bug 78390

This commit is contained in:
赵霄
2023-12-05 09:29:35 +08:00
parent a856960218
commit f33f8384eb
2 changed files with 20 additions and 3 deletions
@@ -94,6 +94,7 @@ import { JeroListMixin } from '@/mixins/JeroListMixin'
import { getFormDictTreeList } from '@api/api'
import CustomComparisonDrawer from './modules/CustomComparisonDrawer'
import JTable from '../../../components/jero/JTable'
import { mapGetters } from 'vuex'
export default {
name: 'CustomComparisonList',
@@ -157,12 +158,18 @@ export default {
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'customComparison:edit'
has: 'customComparison:edit',
show: (record) => {
return this.isAdmin || this.userInfo.id === record.authorId
}
},
{ // 删除
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'customComparison:delete'
has: 'customComparison:delete',
show: (record) => {
return this.isAdmin || this.userInfo.id === record.authorId
}
}
],
url: {
@@ -171,6 +178,15 @@ export default {
}
}
},
computed: {
...mapGetters(['userInfo']),
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
methods: {
initDictConfig () {
// 涉及国家
@@ -193,7 +209,7 @@ export default {
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
}
}
</script>
@@ -608,6 +608,7 @@ export default {
this.modal.id = res.result
this.getFormData()
this.reloadTableData()
this.$emit('ok')
} else {
this.$message.warning(res.message)
}