diff --git a/src/mixins/SimpleListMixin.js b/src/mixins/SimpleListMixin.js index 995bfad2..09010b1b 100644 --- a/src/mixins/SimpleListMixin.js +++ b/src/mixins/SimpleListMixin.js @@ -258,6 +258,18 @@ export const SimpleListMixin = { this.$refs.modalForm.edit(record) this.$refs.modalForm.title = '详情' this.$refs.modalForm.disableSubmit = true + }, + /** + * 循环操作按钮的操作 + * @param operation + * @param record + */ + operationClick (operation, record) { + if (operation.clickEvent === 'handleDelete') { + this.handleDelete(record.id) + } else { + this[operation.clickEvent](record) + } } } diff --git a/src/views/system/DictItemList.vue b/src/views/system/DictItemList.vue index 8c756ec9..9134a0e0 100644 --- a/src/views/system/DictItemList.vue +++ b/src/views/system/DictItemList.vue @@ -35,41 +35,42 @@ - - {{ $t('query') }} - {{ $t('reset') }} + + {{ $t('query') }} + {{ $t('reset') }} - {{ $t('newlyAdded') }} + {{ $t('newlyAdded') }}
- - - - {{ $t('edit') }} - - - {{ $t('delete') }} - - - - +
+ {{ $t('edit') }} + + {{ $t('delete') }} +
+
@@ -83,15 +84,17 @@ import { filterObj } from '@/utils/util' import DictItemModal from './modules/DictItemModal' import { JeroListMixin } from '@/mixins/JeroListMixin' import JInput from '@/components/jero/JInput' -import { IsReadOnlyEnums } from '../../enums/commonEnums' +import { IsReadOnlyEnums, TagsAttributeTypeEnums } from '../../enums/commonEnums' +import JTable from '../../components/jero/JTable' export default { name: 'DictItemList', mixins: [JeroListMixin], - components: { DictItemModal, JInput }, + components: { DictItemModal, JInput, JTable }, data () { return { IsReadOnlyEnums, + TagsAttributeTypeEnums, columns: [ { title: this.$t('name'), @@ -129,7 +132,7 @@ export default { isReadOnly: IsReadOnlyEnums.configurable.value, title: this.$t('operation'), visible: false, - screenWidth: 1000, + screenWidth: 1200, model: {}, dictId: '', status: 1, @@ -150,7 +153,9 @@ export default { list: '/sys/dictItem/page', delete: '/sys/dictItem/delete', deleteBatch: '/sys/dictItem/deleteBatch' - } + }, + // 标签类型 + attributeType: undefined } }, created () { @@ -170,6 +175,7 @@ export default { this.queryParam = {} this.form.resetFields() this.model = Object.assign({}, record) + this.attributeType = Number(this.model.attributeType) // 标签类型,用于辨别是下拉框还是树形结构 this.model.dictId = this.dictId this.model.status = this.status this.visible = true diff --git a/src/views/system/DictList.vue b/src/views/system/DictList.vue index 6aa3146f..a23ad2c2 100644 --- a/src/views/system/DictList.vue +++ b/src/views/system/DictList.vue @@ -4,52 +4,60 @@
- - + + - + - + - + -
- {{ $t('query') }} - {{ $t('reset') }} +
+ + {{ $t('query') }} + {{ $t('reset') + }} + +
- -
- {{ $t('add') }} - {{ $t('export') }} - - {{ $t('import') }} - - {{ $t('dict.refreshCache') }} - - {{ $t('recycleBin') }} -
- - - -
+
+ {{ $t('add') }} + {{ $t('export') }} + + + {{ $t('import') }} + + + {{ $t('dict.refreshCache') }} + + + {{ $t('recycleBin') }} +
+ + + + @@ -67,6 +75,7 @@ import { getAction } from '@/api/manage' import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types' import Vue from 'vue' import JTable from '../../components/jero/JTable' +import { IsReadOnlyEnums } from '../../enums/commonEnums' export default { name: 'DictList', @@ -146,7 +155,32 @@ export default { importExcelUrl: 'sys/dict/importExcel', refleshCache: 'sys/dict/refleshCache', queryAllDictItems: 'sys/dict/queryAllDictItems' - } + }, + operationList: [ + // 字典配置 + { + text: this.$t('system.tag.dictionaryConfiguration'), + clickEvent: 'editDictItem' + }, + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'sys:dict:operation', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value) + } + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'sys:dict:operation', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value) + } + } + ] } }, computed: { diff --git a/src/views/system/modules/DictModal.vue b/src/views/system/modules/DictModal.vue index 77687d66..2dec369e 100644 --- a/src/views/system/modules/DictModal.vue +++ b/src/views/system/modules/DictModal.vue @@ -128,13 +128,13 @@ export default { const formData = Object.assign({}, this.model) if (!this.model.id) { obj = addDict + // 设置为非固定字段--默认可以编辑 + formData.isReadOnly = 0 } else { obj = editDict } // 重要,设置为数据字典内容 formData.isTagDict = 0 - // 设置为非固定字段--默认可以编辑 - formData.isReadOnly = 0 obj(formData).then((res) => { if (res.success) { that.$message.success(res.message) diff --git a/src/views/system/tags/modules/AreaModal.vue b/src/views/system/tags/modules/AreaModal.vue index 0de41b51..51a75e19 100644 --- a/src/views/system/tags/modules/AreaModal.vue +++ b/src/views/system/tags/modules/AreaModal.vue @@ -14,14 +14,10 @@ @cancel="handleCancel">
-
- - {{$t('add')}} -
-
- - {{ $t('batchDelete') }} -
+ + {{ $t('add') }} + + {{ $t('batchDelete') }}
- + :operation-list="operationList" + @change="handleTableChange" + @operationClick="operationClick" + >
@@ -129,6 +122,20 @@ export default { column: 'sort', order: 'ascend' }, + operationList: [ + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'area:edit' + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'area:delete' + } + ], disableMixinCreated: true // 默认不加载数据 } }, diff --git a/src/views/system/tags/modules/TagContentDictListDrawer.vue b/src/views/system/tags/modules/TagContentDictListDrawer.vue index a6c03e39..5c224959 100644 --- a/src/views/system/tags/modules/TagContentDictListDrawer.vue +++ b/src/views/system/tags/modules/TagContentDictListDrawer.vue @@ -22,23 +22,17 @@
- {{ $t('reset') }} - - {{ $t('query') }} - + {{ $t('query') }} + {{ $t('reset') }}
-
- - {{ $t('newlyAdded') }} -
-
- - {{ $t('batchDelete') }} -
+ + {{ $t('newlyAdded') }} + + {{ $t('batchDelete') }}
+ @change="handleTableChange" + >
{{ $t('edit') }} + {{ $t('delete') }}
diff --git a/src/views/system/tags/pages/ClauseSplittingList.vue b/src/views/system/tags/pages/ClauseSplittingList.vue index 5b4338c9..1e0011c5 100644 --- a/src/views/system/tags/pages/ClauseSplittingList.vue +++ b/src/views/system/tags/pages/ClauseSplittingList.vue @@ -19,14 +19,10 @@
-
- - {{ $t('newlyAdded') }} -
-
- - {{ $t('batchDelete') }} -
+ + {{ $t('newlyAdded') }} + + {{ $t('batchDelete') }}
-
- {{ $t('edit') }} - {{ $t('delete') }} -
+ :operation-list="operationList" + @change="handleTableChange" + @operationClick="operationClick" + >
@@ -59,6 +52,7 @@ import '@assets/less/common.less' import ClauseSplittingDrawer from '../modules/ClauseSplittingDrawer' import { SimpleListMixin } from '../../../../mixins/SimpleListMixin' import JTable from '../../../../components/jero/JTable' +import { IsReadOnlyEnums } from '../../../../enums/commonEnums' export default { name: 'ClauseSplittingList', @@ -133,7 +127,27 @@ export default { width: 170 } ], - canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0' // 是否可以操作编辑和删除,开发环境可以 + canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以 + operationList: [ + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'tag:edit', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value) + } + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'tag:logicDelete', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value) + } + } + ] } } } diff --git a/src/views/system/tags/pages/StandardList.vue b/src/views/system/tags/pages/StandardList.vue index ff370bea..9e485253 100644 --- a/src/views/system/tags/pages/StandardList.vue +++ b/src/views/system/tags/pages/StandardList.vue @@ -15,7 +15,7 @@ - {{ item.showArea }} + {{ item.showArea }} @@ -30,19 +30,12 @@
-
- - {{ $t('newlyAdded') }} -
+ + {{ $t('newlyAdded') }} -
- - {{ $t('system.tag.exhibitionAreaManagement') }} -
-
- - {{ $t('batchDelete') }} -
+ {{ $t('system.tag.exhibitionAreaManagement') }} + + {{ $t('batchDelete') }}
@@ -55,15 +48,10 @@ :pagination="ipagination" :scroll="{x: '100%', y: yScrollHeight}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + :operation-list="operationList" @change="handleTableChange" + @operationClick="operationClick" > - -
- {{ $t('edit') }} - {{ $t('delete') }} -
@@ -81,6 +69,7 @@ import StandardDrawer from '../modules/StandardDrawer' import AreaModal from '../modules/AreaModal' import { SimpleListMixin } from '../../../../mixins/SimpleListMixin' import JTable from '../../../../components/jero/JTable' +import { IsReadOnlyEnums } from '../../../../enums/commonEnums' export default { name: 'StandardList', @@ -119,6 +108,7 @@ export default { column: 'orderNum', order: 'asc' }, + canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以 columns: [ { title: this.$t('system.tag.attributeName'), @@ -164,7 +154,26 @@ export default { width: 150 } ], - canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0' // 是否可以操作编辑和删除,开发环境可以 + operationList: [ + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'tag:edit', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value) + } + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'tag:logicDelete', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value) + } + } + ] } }, methods: { diff --git a/src/views/system/tags/pages/TagContent.vue b/src/views/system/tags/pages/TagContent.vue index 42dd8346..4d560327 100644 --- a/src/views/system/tags/pages/TagContent.vue +++ b/src/views/system/tags/pages/TagContent.vue @@ -25,21 +25,12 @@
- -
- - {{ $t('newlyAdded') }} -
+ + {{ $t('newlyAdded') }} -
- - {{ $t('dict.refreshCache') }} -
- -
- - {{ $t('batchDelete') }} -
+ {{ $t('dict.refreshCache') }} + + {{ $t('batchDelete') }}
-
- {{ $t('system.tag.dictionaryConfiguration') }} - {{ $t('edit') }} - {{ $t('delete') }} -
@@ -129,7 +117,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', - width: 170 + width: 100 } ], canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以 @@ -149,7 +137,32 @@ export default { // 增加其他的查询条件 filters: { isTagDict: 1 // 是否为标签内容(1是 0否) - } + }, + operationList: [ + // 字典配置 + { + text: this.$t('system.tag.dictionaryConfiguration'), + clickEvent: 'editDictItem' + }, + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'sys:dict:operation', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value) + } + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'sys:dict:operation', + show: (record) => { + return (this.canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value) + } + } + ] } }, methods: {