[update] 市场法规清单
This commit is contained in:
+24
-5
@@ -124,11 +124,21 @@ import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
|||||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||||
import { ListState } from '../../../enums/commonEnums'
|
import { ListState } from '../../../enums/commonEnums'
|
||||||
import { getFormDictTreeList } from '../../../api/api'
|
import { getFormDictTreeList } from '../../../api/api'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MarketRegulationsList',
|
name: 'MarketRegulationsList',
|
||||||
components: { JTable, JDictSelectTag },
|
components: { JTable, JDictSelectTag },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
// 当前用户是否管理员
|
||||||
|
isAdmin () {
|
||||||
|
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
|
||||||
|
const userRoleList = this.userInfo.roleCode.split(',')
|
||||||
|
return userRoleList.some(tt => adminRoleList.includes(tt))
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
countryOptions: [], // 国家下拉选择
|
countryOptions: [], // 国家下拉选择
|
||||||
@@ -179,7 +189,7 @@ export default {
|
|||||||
title: this.$t('standardRegulationLibrary.marketRegulationsList.author'),
|
title: this.$t('standardRegulationLibrary.marketRegulationsList.author'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'author_dictText',
|
dataIndex: 'createBy_dictText',
|
||||||
scopedSlots: { customRender: 'text' }
|
scopedSlots: { customRender: 'text' }
|
||||||
},
|
},
|
||||||
{ // 清单状态
|
{ // 清单状态
|
||||||
@@ -198,27 +208,36 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
operationList: [
|
operationList: [
|
||||||
|
// 已发布的清单所有人都可以查看,只有作者和管理员能删除,未发布的数据只能作者和管理员查看、编辑、删除
|
||||||
// 发布
|
// 发布
|
||||||
{
|
{
|
||||||
text: this.$t('release'),
|
text: this.$t('release'),
|
||||||
clickEvent: 'handlePublish',
|
clickEvent: 'handlePublish',
|
||||||
has: '',
|
has: '',
|
||||||
// 已发布状态不显示发布按钮??
|
// 已发布状态不显示发布按钮,只有作者和管理员可以发布
|
||||||
show: (record) => {
|
show: (record) => {
|
||||||
return record.manifestStatus !== ListState.RELEASED.value
|
return record.manifestStatus !== ListState.RELEASED.value && (this.isAdmin || this.userInfo.id === record.createBy)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
{
|
{
|
||||||
text: this.$t('edit'),
|
text: this.$t('edit'),
|
||||||
clickEvent: 'handleEdit',
|
clickEvent: 'handleEdit',
|
||||||
has: ''
|
has: '',
|
||||||
|
// 只有作者和管理员可以编辑
|
||||||
|
show: (record) => {
|
||||||
|
return this.isAdmin || this.userInfo.id === record.createBy
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
{
|
{
|
||||||
text: this.$t('delete'),
|
text: this.$t('delete'),
|
||||||
clickEvent: 'handleDelete',
|
clickEvent: 'handleDelete',
|
||||||
has: ''
|
has: '',
|
||||||
|
// 只有作者和管理员可以删除
|
||||||
|
show: (record) => {
|
||||||
|
return this.isAdmin || this.userInfo.id === record.createBy
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
|
|||||||
Reference in New Issue
Block a user