|
@@ -4,14 +4,25 @@
|
|
<div class="left-filter">
|
|
<div class="left-filter">
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
- @click="$router.push({path:'/knowledgeEdit',query: { source: ResourceType }})"
|
|
|
|
- v-if="checkBtnAuth('add')"
|
|
|
|
|
|
+ @click="$router.push({path:'/knowledgeAdd',query: { source: ResourceType }})"
|
|
|
|
+ v-if="checkBtnAuth('add') && ResourceType != 2"
|
|
>添加{{ titlePath }}</el-button>
|
|
>添加{{ titlePath }}</el-button>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="isImportExcelDia=true"
|
|
|
|
+ v-if="checkBtnAuth('import') && ResourceType == 4"
|
|
|
|
+ >Excel导入</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleImport"
|
|
|
|
+ v-if="checkBtnAuth('import') && ResourceType == 2"
|
|
|
|
+ >文件上传</el-button>
|
|
<el-dropdown
|
|
<el-dropdown
|
|
split-button
|
|
split-button
|
|
type="primary"
|
|
type="primary"
|
|
@click="isImportExcelDia=true"
|
|
@click="isImportExcelDia=true"
|
|
- v-if="checkBtnAuth('import')"
|
|
|
|
|
|
+ v-if="checkBtnAuth('import') && [0,1,3].includes(ResourceType)"
|
|
@command="handleImport"
|
|
@command="handleImport"
|
|
>
|
|
>
|
|
Excel导入
|
|
Excel导入
|
|
@@ -121,6 +132,24 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="ResourceType == 4 && standpointActiveType=='my'" class="select-item">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="filterForm.states"
|
|
|
|
+ placeholder="请选择状态"
|
|
|
|
+ size="medium"
|
|
|
|
+ clearable
|
|
|
|
+ style="width:100%;"
|
|
|
|
+ multiple
|
|
|
|
+ @change="filterChange"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in stateOptions"
|
|
|
|
+ :key="item.state"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.state"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="select-btn" slot="reference">
|
|
<div class="select-btn" slot="reference">
|
|
<img src="~@/assets/icons/filter.svg">
|
|
<img src="~@/assets/icons/filter.svg">
|
|
@@ -141,10 +170,23 @@
|
|
</header>
|
|
</header>
|
|
|
|
|
|
<div class="main">
|
|
<div class="main">
|
|
|
|
+ <el-radio-group
|
|
|
|
+ v-if="ResourceType == 4 && standpointTypes.length > 0"
|
|
|
|
+ v-model="standpointActiveType"
|
|
|
|
+ style="margin:30px 0 0 0;"
|
|
|
|
+ @change="tabChange">
|
|
|
|
+ <el-radio-button
|
|
|
|
+ v-for="item in standpointTypes"
|
|
|
|
+ :key="item.type"
|
|
|
|
+ :label="item.type">{{ item.label }}</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+
|
|
<el-table
|
|
<el-table
|
|
:data="tableData"
|
|
:data="tableData"
|
|
style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);margin-top: 20px"
|
|
style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);margin-top: 20px"
|
|
border
|
|
border
|
|
|
|
+ v-loading="dataLoading"
|
|
|
|
+ @sort-change="sortChange"
|
|
ref="table"
|
|
ref="table"
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -153,10 +195,12 @@
|
|
:label="item.label"
|
|
:label="item.label"
|
|
:width="item.widthsty"
|
|
:width="item.widthsty"
|
|
:min-width="item.minwidthsty"
|
|
:min-width="item.minwidthsty"
|
|
|
|
+ :sortable="item.sortable"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
<span v-if="item.key==='Title'" class="editsty" @click="lookDetailHandle(row,'look')">{{row[item.key]}}</span>
|
|
<span v-if="item.key==='Title'" class="editsty" @click="lookDetailHandle(row,'look')">{{row[item.key]}}</span>
|
|
|
|
+ <span v-else-if="item.key==='State'">{{stateTypes[row[item.key]]}}</span>
|
|
<span v-else>{{row[item.key]}}</span>
|
|
<span v-else>{{row[item.key]}}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -166,10 +210,15 @@
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <div>
|
|
|
|
- <span class="editsty" @click="lookDetailHandle(row,'edit')" v-if="checkBtnAuth('edit')">{{$t('Table.edit_btn')}}</span>
|
|
|
|
-
|
|
|
|
- <span class="deletesty" @click="handleDelItem(row)" v-if="checkBtnAuth('del')">{{$t('Table.delete_btn')}}</span>
|
|
|
|
|
|
+ <div v-if="!(ResourceType == 4 && standpointActiveType == 'my' && row.OutSource == 1)">
|
|
|
|
+ <span
|
|
|
|
+ v-if="ResourceType == 4 && standpointActiveType == 'my' && checkBtnAuth('my_setpublic') && (row.State == 0 || row.State == 3)"
|
|
|
|
+ class="editsty" @click="setPublic(row)">设置公共</span>
|
|
|
|
+ <span class="editsty" @click="lookDetailHandle(row,'edit')" v-if="isShowEdit(row)">{{$t('Table.edit_btn')}}</span>
|
|
|
|
+ <span
|
|
|
|
+ v-if="ResourceType == 4 && standpointActiveType == 'my' && checkBtnAuth('my_back') && (row.State == 2 || row.State == 4)"
|
|
|
|
+ class="editsty" @click="handleApproveBack(row)">撤销</span>
|
|
|
|
+ <span class="deletesty" @click="handleDelItem(row)" v-if="isShowDelete(row)">{{$t('Table.delete_btn')}}</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -228,6 +277,12 @@ import importExcelDia from './components/importExcelDia.vue';
|
|
import importFileDia from './components/importFileDia.vue';
|
|
import importFileDia from './components/importFileDia.vue';
|
|
import importMoreFileDia from './components/importMoreFileDia.vue';
|
|
import importMoreFileDia from './components/importMoreFileDia.vue';
|
|
import mPage from '@/components/mPage.vue'
|
|
import mPage from '@/components/mPage.vue'
|
|
|
|
+const stateOptions = [
|
|
|
|
+ {state:0,label:'待提交'},
|
|
|
|
+ {state:2,label:'待审核'},
|
|
|
|
+ {state:3,label:'已驳回'},
|
|
|
|
+ {state:4,label:'已通过'}
|
|
|
|
+]
|
|
export default {
|
|
export default {
|
|
components: { mPage,classifyDia,importExcelDia,importFileDia,importMoreFileDia },
|
|
components: { mPage,classifyDia,importExcelDia,importFileDia,importMoreFileDia },
|
|
computed: {
|
|
computed: {
|
|
@@ -237,6 +292,7 @@ export default {
|
|
'/knowledge_policy': 1,
|
|
'/knowledge_policy': 1,
|
|
'/knowledge_viewpoint': 2,
|
|
'/knowledge_viewpoint': 2,
|
|
'/knowledge_know': 3,
|
|
'/knowledge_know': 3,
|
|
|
|
+ '/knowledge_standpoint':4,
|
|
}
|
|
}
|
|
|
|
|
|
return apiMap[this.$route.path] && apiMap[this.$route.path]
|
|
return apiMap[this.$route.path] && apiMap[this.$route.path]
|
|
@@ -245,21 +301,32 @@ export default {
|
|
const titleMap = {
|
|
const titleMap = {
|
|
'/knowledge_event': '事件',
|
|
'/knowledge_event': '事件',
|
|
'/knowledge_policy': '政策',
|
|
'/knowledge_policy': '政策',
|
|
- '/knowledge_viewpoint': '观点',
|
|
|
|
|
|
+ '/knowledge_viewpoint': '报告',
|
|
'/knowledge_know': '知识',
|
|
'/knowledge_know': '知识',
|
|
|
|
+ '/knowledge_standpoint':'观点',
|
|
}
|
|
}
|
|
|
|
|
|
return titleMap[this.$route.path] && titleMap[this.$route.path]
|
|
return titleMap[this.$route.path] && titleMap[this.$route.path]
|
|
},
|
|
},
|
|
tableColums() {
|
|
tableColums() {
|
|
return [
|
|
return [
|
|
- { label: [2,3].includes(this.ResourceType)?'时间':'开始时间',key: 'StartTime' },
|
|
|
|
|
|
+ { label: [2,3,4].includes(this.ResourceType)?'发布时间':'开始时间',key: 'StartTime',sortable:'custom' },
|
|
{ label: '标题',key: 'Title',minwidthsty:'150px' },
|
|
{ label: '标题',key: 'Title',minwidthsty:'150px' },
|
|
{ label: '来源',key: 'SourceFrom' },
|
|
{ label: '来源',key: 'SourceFrom' },
|
|
{ label: '分类',key: 'ClassifyFullName' },
|
|
{ label: '分类',key: 'ClassifyFullName' },
|
|
{ label: '标签',key: 'TagName' },
|
|
{ label: '标签',key: 'TagName' },
|
|
- { label: '添加人',key: 'AdminRealName' },
|
|
|
|
- ]
|
|
|
|
|
|
+ { label: this.ResourceType == 4 && this.standpointActiveType == 'my' ? '状态' :'添加人',
|
|
|
|
+ key: this.ResourceType == 4 && this.standpointActiveType == 'my' ? 'State' :'AdminRealName' },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ stateTypes() {
|
|
|
|
+ return {
|
|
|
|
+ 0:'待提交',
|
|
|
|
+ 1:'',
|
|
|
|
+ 2:'待审核',
|
|
|
|
+ 3:'已驳回',
|
|
|
|
+ 4:'已通过'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
selectNum() {
|
|
selectNum() {
|
|
@@ -269,6 +336,7 @@ export default {
|
|
this.filterForm.sources.length && num++;
|
|
this.filterForm.sources.length && num++;
|
|
this.filterForm.tags.length && num++;
|
|
this.filterForm.tags.length && num++;
|
|
this.filterForm.users.length && num++;
|
|
this.filterForm.users.length && num++;
|
|
|
|
+ if(this.ResourceType == 4 && this.standpointActiveType=='my') this.filterForm.states.length && num++;
|
|
|
|
|
|
return num
|
|
return num
|
|
}
|
|
}
|
|
@@ -283,6 +351,8 @@ export default {
|
|
tags: [],
|
|
tags: [],
|
|
users: [],
|
|
users: [],
|
|
keyWord:"",
|
|
keyWord:"",
|
|
|
|
+ states:[],
|
|
|
|
+ publishSort:'',
|
|
},
|
|
},
|
|
classifyOptions:[],
|
|
classifyOptions:[],
|
|
sourcesOptions:[],
|
|
sourcesOptions:[],
|
|
@@ -311,11 +381,15 @@ export default {
|
|
fileList:[],
|
|
fileList:[],
|
|
|
|
|
|
// 解决再次上传相同文件无响应
|
|
// 解决再次上传相同文件无响应
|
|
- useMore:true
|
|
|
|
|
|
+ useMore:true,
|
|
|
|
+ standpointTypes:[],
|
|
|
|
+ standpointActiveType:'my', //my public
|
|
|
|
+ dataLoading:false,
|
|
|
|
+ stateOptions,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
- if(!this.checkBtnAuth('view'))
|
|
|
|
|
|
+ if(!this.handleViewAuth())
|
|
return this.$message.warning('您当前暂无查看数据权限,如需查看,请联系管理员');
|
|
return this.$message.warning('您当前暂无查看数据权限,如需查看,请联系管理员');
|
|
this.getClassifyOptions();
|
|
this.getClassifyOptions();
|
|
this.getSourceOptions();
|
|
this.getSourceOptions();
|
|
@@ -324,6 +398,52 @@ export default {
|
|
this.getTableData()
|
|
this.getTableData()
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ handleViewAuth(){
|
|
|
|
+ let valid = true;
|
|
|
|
+ if(this.ResourceType == 4){
|
|
|
|
+ let myValid = this.checkBtnAuth('my_view');
|
|
|
|
+ let publicValid = this.checkBtnAuth('public_view');
|
|
|
|
+ if(!myValid && !publicValid) return valid = false;
|
|
|
|
+ if(myValid) this.standpointTypes.push({label:'我的观点',type:'my'});
|
|
|
|
+ if(publicValid) this.standpointTypes.push({label:'公共观点',type:'public'});
|
|
|
|
+ this.standpointActiveType = this.standpointTypes[0].type;
|
|
|
|
+ } else {
|
|
|
|
+ valid = this.checkBtnAuth('view');
|
|
|
|
+ }
|
|
|
|
+ return valid
|
|
|
|
+ },
|
|
|
|
+ setPublic(row){
|
|
|
|
+ eventInterface.setPublic({
|
|
|
|
+ KnowledgeResourceId:row.KnowledgeResourceId
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.Ret != 200) return;
|
|
|
|
+ this.$message.success('设置成功')
|
|
|
|
+ this.getTableData()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleApproveBack(row){
|
|
|
|
+ eventInterface.setCancel({
|
|
|
|
+ KnowledgeResourceId:row.KnowledgeResourceId
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.Ret != 200) return;
|
|
|
|
+ this.$message.success('撤销成功')
|
|
|
|
+ this.getTableData()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ tabChange(){
|
|
|
|
+ this.filterForm.states = [];
|
|
|
|
+ this.filterChange();
|
|
|
|
+ },
|
|
|
|
+ isShowEdit(row){
|
|
|
|
+ return (this.ResourceType != 4 && this.checkBtnAuth('edit'))
|
|
|
|
+ || (this.ResourceType == 4 && this.standpointActiveType == 'my' && this.checkBtnAuth('my_edit') && (row.State == 0 || row.State == 3))
|
|
|
|
+ || (this.ResourceType == 4 && this.standpointActiveType == 'public' && this.checkBtnAuth('public_edit'));
|
|
|
|
+ },
|
|
|
|
+ isShowDelete(row){
|
|
|
|
+ return (this.ResourceType != 4 && this.checkBtnAuth('del'))
|
|
|
|
+ || (this.ResourceType == 4 && this.standpointActiveType == 'my' && this.checkBtnAuth('my_del') && (row.State == 0 || row.State == 3))
|
|
|
|
+ || (this.ResourceType == 4 && this.standpointActiveType == 'public' && this.checkBtnAuth('public_del'));
|
|
|
|
+ },
|
|
async getClassifyOptions() {
|
|
async getClassifyOptions() {
|
|
const res = await eventInterface.getClassify({
|
|
const res = await eventInterface.getClassify({
|
|
ResourceType: this.ResourceType
|
|
ResourceType: this.ResourceType
|
|
@@ -355,9 +475,22 @@ export default {
|
|
this.usersOptions=res.Data.List || []
|
|
this.usersOptions=res.Data.List || []
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ sortChange({order}){
|
|
|
|
+ if(!order) {
|
|
|
|
+ this.filterForm.publishSort = ''
|
|
|
|
+ this.getTableData();
|
|
|
|
+ return;
|
|
|
|
+ };
|
|
|
|
+ this.filterForm.publishSort = order == "ascending" ? 'asc' : 'desc';
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
|
|
async getTableData() {
|
|
async getTableData() {
|
|
- if(!this.checkBtnAuth('view')) //权限拦截
|
|
|
|
|
|
+ const auths = {
|
|
|
|
+ my:'my_view',
|
|
|
|
+ public:'public_view'
|
|
|
|
+ }
|
|
|
|
+ if(!this.checkBtnAuth(this.ResourceType == 4 ? auths[this.standpointActiveType] : 'view')) //权限拦截
|
|
return this.$message.warning('您当前暂无查看数据权限,如需查看,请联系管理员');
|
|
return this.$message.warning('您当前暂无查看数据权限,如需查看,请联系管理员');
|
|
const { pageNo,
|
|
const { pageNo,
|
|
pageSize,
|
|
pageSize,
|
|
@@ -365,7 +498,9 @@ export default {
|
|
sources,
|
|
sources,
|
|
tags,
|
|
tags,
|
|
users,
|
|
users,
|
|
- keyWord } = this.filterForm;
|
|
|
|
|
|
+ keyWord,
|
|
|
|
+ states,
|
|
|
|
+ publishSort } = this.filterForm;
|
|
let params = {
|
|
let params = {
|
|
PageSize:pageSize,
|
|
PageSize:pageSize,
|
|
CurrentIndex:pageNo,
|
|
CurrentIndex:pageNo,
|
|
@@ -374,12 +509,24 @@ export default {
|
|
TagIds:tags.join(','),
|
|
TagIds:tags.join(','),
|
|
Keyword:keyWord,
|
|
Keyword:keyWord,
|
|
SourceFrom: sources.join(','),
|
|
SourceFrom: sources.join(','),
|
|
- ResourceType: this.ResourceType
|
|
|
|
|
|
+ ResourceType: this.ResourceType,
|
|
|
|
+ IsShowMe:this.ResourceType == 4 && this.standpointActiveType == 'my' ? true : false,
|
|
|
|
+ IsShowPublic:this.ResourceType == 4 && this.standpointActiveType == 'public' ? true : false,
|
|
|
|
+ PublishSort:publishSort,
|
|
}
|
|
}
|
|
- const res = await eventInterface.getEventList(params)
|
|
|
|
|
|
+ if(this.ResourceType == 4 && this.standpointActiveType == 'my') params['State'] = states.join(',');
|
|
|
|
|
|
|
|
+ this.dataLoading = true;
|
|
|
|
+ const res = await eventInterface.getEventList(params)
|
|
|
|
+ this.dataLoading = false;
|
|
if(res.Ret !==200 ) return
|
|
if(res.Ret !==200 ) return
|
|
|
|
|
|
|
|
+ if(pageNo > res.Data.Paging.Pages && res.Data.Paging.Pages > 0){
|
|
|
|
+ this.filterForm.pageNo = res.Data.Paging.Pages || 1;
|
|
|
|
+ this.getTableData()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
this.tableData = res.Data.List||[]
|
|
this.tableData = res.Data.List||[]
|
|
this.total = res.Data.Paging.Totals
|
|
this.total = res.Data.Paging.Totals
|
|
},
|
|
},
|
|
@@ -399,6 +546,7 @@ export default {
|
|
this.filterForm.sources = []
|
|
this.filterForm.sources = []
|
|
this.filterForm.tags = []
|
|
this.filterForm.tags = []
|
|
this.filterForm.users = []
|
|
this.filterForm.users = []
|
|
|
|
+ this.filterForm.states = []
|
|
this.filterChange()
|
|
this.filterChange()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -407,7 +555,8 @@ export default {
|
|
path: type==='look'?'/knowledgeDetail':'/knowledgeEdit',
|
|
path: type==='look'?'/knowledgeDetail':'/knowledgeEdit',
|
|
query: {
|
|
query: {
|
|
id: item.KnowledgeResourceId,
|
|
id: item.KnowledgeResourceId,
|
|
- source: this.ResourceType
|
|
|
|
|
|
+ source: this.ResourceType,
|
|
|
|
+ pointType: this.ResourceType == 4 ? this.standpointActiveType : ''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -452,7 +601,6 @@ export default {
|
|
//选择多个文件上传
|
|
//选择多个文件上传
|
|
async moreFileSelectedImport(){
|
|
async moreFileSelectedImport(){
|
|
let file = document.getElementById('moreFile').files;
|
|
let file = document.getElementById('moreFile').files;
|
|
- console.log(file)
|
|
|
|
if(file.length>30){
|
|
if(file.length>30){
|
|
return this.$message.warning('最多上传30个文件');
|
|
return this.$message.warning('最多上传30个文件');
|
|
}
|
|
}
|
|
@@ -524,6 +672,7 @@ export default {
|
|
'/knowledge_policy': 'policy',
|
|
'/knowledge_policy': 'policy',
|
|
'/knowledge_viewpoint': 'viewpoint',
|
|
'/knowledge_viewpoint': 'viewpoint',
|
|
'/knowledge_know': 'know',
|
|
'/knowledge_know': 'know',
|
|
|
|
+ '/knowledge_standpoint':'standpoint'
|
|
}
|
|
}
|
|
|
|
|
|
let permission_prefix = authMap[this.$route.path]&&authMap[this.$route.path]
|
|
let permission_prefix = authMap[this.$route.path]&&authMap[this.$route.path]
|