【update】标签管理、数据字典样式的修改

This commit is contained in:
fengchenchen
2023-11-09 15:05:11 +08:00
parent 4931caa58f
commit 86f0f6b3d9
9 changed files with 236 additions and 145 deletions
+12
View File
@@ -258,6 +258,18 @@ export const SimpleListMixin = {
this.$refs.modalForm.edit(record) this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '详情' this.$refs.modalForm.title = '详情'
this.$refs.modalForm.disableSubmit = true 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)
}
} }
} }
+26 -20
View File
@@ -35,41 +35,42 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="7" :sm="24"> <a-col :md="7" :sm="24">
<span style="float: left;" class="table-page-search-submitButtons"> <span style="float: right;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">{{ $t('query') }}</a-button> <a-button icon="search" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchReset" style="margin-left: 8px">{{ $t('reset') }}</a-button> <a-button icon="reload" type="primary" ghost @click="searchReset" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :md="2" :sm="24"> <a-col :md="2" :sm="24">
<a-button style="margin-bottom: 10px" type="primary" @click="handleAdd" v-if="model.isReadOnly === IsReadOnlyEnums.configurable.value || model.isReadOnly === IsReadOnlyEnums.subConfigurable.value">{{ $t('newlyAdded') }}</a-button> <a-button style="margin-bottom: 10px" icon="plus" type="primary" @click="handleAdd" v-if="model.isReadOnly === IsReadOnlyEnums.configurable.value || model.isReadOnly === IsReadOnlyEnums.subConfigurable.value">{{ $t('newlyAdded') }}</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<div> <div>
<a-table <j-table
ref="table" ref="table"
rowKey="id" can-drag
:class="{'tree-table': attributeType === TagsAttributeTypeEnums.TREE.value}"
:bordered="true"
size="middle" size="middle"
rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange" @change="handleTableChange"
:rowClassName="getRowClassname" :rowClassName="getRowClassname"
> >
<div slot="action" class="table-action" slot-scope="{text, record}">
<span slot="action" slot-scope="text, record"> <a class="action-edit" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
<a @click="handleEdit(record)" v-if="record.isReadOnly === IsReadOnlyEnums.subConfigurable.value || record.isReadOnly === IsReadOnlyEnums.configurable.value">{{ $t('edit') }}</a> <a-divider type="vertical" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'"/>
<a-divider type="vertical"/> <a class="table-del" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
<a-popconfirm :title="$t('areYouSure')" @confirm="() => handleDelete(record.id)" v-if="record.isReadOnly === IsReadOnlyEnums.subConfigurable.value || record.isReadOnly === IsReadOnlyEnums.configurable.value"> </div>
<a>{{ $t('delete') }}</a> </j-table>
</a-popconfirm>
</span>
</a-table>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
@@ -83,15 +84,17 @@ import { filterObj } from '@/utils/util'
import DictItemModal from './modules/DictItemModal' import DictItemModal from './modules/DictItemModal'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import JInput from '@/components/jero/JInput' 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 { export default {
name: 'DictItemList', name: 'DictItemList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { DictItemModal, JInput }, components: { DictItemModal, JInput, JTable },
data () { data () {
return { return {
IsReadOnlyEnums, IsReadOnlyEnums,
TagsAttributeTypeEnums,
columns: [ columns: [
{ {
title: this.$t('name'), title: this.$t('name'),
@@ -129,7 +132,7 @@ export default {
isReadOnly: IsReadOnlyEnums.configurable.value, isReadOnly: IsReadOnlyEnums.configurable.value,
title: this.$t('operation'), title: this.$t('operation'),
visible: false, visible: false,
screenWidth: 1000, screenWidth: 1200,
model: {}, model: {},
dictId: '', dictId: '',
status: 1, status: 1,
@@ -150,7 +153,9 @@ export default {
list: '/sys/dictItem/page', list: '/sys/dictItem/page',
delete: '/sys/dictItem/delete', delete: '/sys/dictItem/delete',
deleteBatch: '/sys/dictItem/deleteBatch' deleteBatch: '/sys/dictItem/deleteBatch'
} },
// 标签类型
attributeType: undefined
} }
}, },
created () { created () {
@@ -170,6 +175,7 @@ export default {
this.queryParam = {} this.queryParam = {}
this.form.resetFields() this.form.resetFields()
this.model = Object.assign({}, record) this.model = Object.assign({}, record)
this.attributeType = Number(this.model.attributeType) // 标签类型,用于辨别是下拉框还是树形结构
this.model.dictId = this.dictId this.model.dictId = this.dictId
this.model.status = this.status this.model.status = this.status
this.visible = true this.visible = true
+71 -37
View File
@@ -4,52 +4,60 @@
<!-- 左侧面板 --> <!-- 左侧面板 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="12"> <a-row :gutter="24">
<a-col :md="6" :sm="12"> <a-col :md="7" :sm="8">
<a-form-item :label="$t('dict.dictionaryName')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item :label="$t('dict.dictionaryName')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<j-input :placeholder="$t('pleaseEnter')+$t('dict.dictionaryName')" v-model="queryParam.dictName"></j-input> <j-input :placeholder="$t('pleaseEnter')+$t('dict.dictionaryName')"
v-model="queryParam.dictName"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="7" :sm="8">
<a-form-item :label="$t('dict.dictionaryNumber')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item :label="$t('dict.dictionaryNumber')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<j-input :placeholder="$t('pleaseEnter')+$t('dict.dictionaryNumber')" v-model="queryParam.dictCode"></j-input> <j-input :placeholder="$t('pleaseEnter')+$t('dict.dictionaryNumber')"
v-model="queryParam.dictCode"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{ $t('query') }}</a-button> <a-col :md="7" :sm="8">
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button> <a-button type="primary" @click="searchQuery" icon="search">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchReset" ghost icon="reload" style="margin-left: 8px">{{ $t('reset')
}}
</a-button>
</a-col>
</div> </div>
</a-row> </a-row>
</a-form> </a-form>
<div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">{{ $t('add') }}</a-button>
<a-button type="primary" icon="download" @click="handleExportXls($t('dict.dictInfo'))">{{ $t('export') }}</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">{{ $t('import') }}</a-button>
</a-upload>
<a-button type="primary" icon="sync" @click="refleshCache()">{{ $t('dict.refreshCache') }}</a-button>
<a-button type="primary" icon="hdd" @click="openDeleteList">{{ $t('recycleBin') }}</a-button>
</div>
<j-table
rowKey="id"
can-drag
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
>
<div slot="action" class="table-action" slot-scope="{text, record}">
<a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
<a class="action-edit" v-if="canOpeFlag || record.isReadOnly === 0" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
<a class="action-delete" v-if="canOpeFlag || record.isReadOnly === 0" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
</div>
</j-table>
</div> </div>
<div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:dict:operation'">{{ $t('add') }}</a-button>
<a-button type="primary" icon="download" ghost @click="handleExportXls($t('dict.dictInfo'))"
v-has="'sys:dict:operation'">{{ $t('export') }}
</a-button>
<a-upload v-has="'sys:dict:operation'" name="file" :showUploadList="false" :multiple="false"
:headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import" ghost>{{ $t('import') }}</a-button>
</a-upload>
<a-button type="primary" icon="sync" ghost v-has="'sys:dict:operation'" @click="refleshCache()">
{{ $t('dict.refreshCache') }}
</a-button>
<a-button type="primary" icon="hdd" ghost @click="openDeleteList">{{ $t('recycleBin') }}</a-button>
</div>
<j-table
rowKey="id"
can-drag
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:operation-list="operationList"
@change="handleTableChange"
@operationClick="operationClick"
>
</j-table>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 --> <dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list v-show="false" ref="dictItemList"></dict-item-list> <dict-item-list v-show="false" ref="dictItemList"></dict-item-list>
<dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list> <dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list>
@@ -67,6 +75,7 @@ import { getAction } from '@/api/manage'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types' import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
import JTable from '../../components/jero/JTable' import JTable from '../../components/jero/JTable'
import { IsReadOnlyEnums } from '../../enums/commonEnums'
export default { export default {
name: 'DictList', name: 'DictList',
@@ -146,7 +155,32 @@ export default {
importExcelUrl: 'sys/dict/importExcel', importExcelUrl: 'sys/dict/importExcel',
refleshCache: 'sys/dict/refleshCache', refleshCache: 'sys/dict/refleshCache',
queryAllDictItems: 'sys/dict/queryAllDictItems' 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: { computed: {
+2 -2
View File
@@ -128,13 +128,13 @@ export default {
const formData = Object.assign({}, this.model) const formData = Object.assign({}, this.model)
if (!this.model.id) { if (!this.model.id) {
obj = addDict obj = addDict
// 设置为非固定字段--默认可以编辑
formData.isReadOnly = 0
} else { } else {
obj = editDict obj = editDict
} }
// 重要,设置为数据字典内容 // 重要,设置为数据字典内容
formData.isTagDict = 0 formData.isTagDict = 0
// 设置为非固定字段--默认可以编辑
formData.isReadOnly = 0
obj(formData).then((res) => { obj(formData).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
+22 -15
View File
@@ -14,14 +14,10 @@
@cancel="handleCancel"> @cancel="handleCancel">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleAdd" v-has="'area:add'"> <!--新增-->
<a-icon type="plus" /> <a-button icon="plus" type="primary" @click="handleAdd" v-has="'area:add'">{{ $t('add') }}</a-button>
{{$t('add')}} <!--批量删除-->
</div> <a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'area:delete'">{{ $t('batchDelete') }}</a-button>
<div class="operator-text" @click="batchDel">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div> </div>
<j-table <j-table
@@ -36,13 +32,10 @@
:loading="loading" :loading="loading"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> :operation-list="operationList"
<div slot="action" class="table-action" slot-scope="{text, record}"> @change="handleTableChange"
<a class="action-edit" @click="handleEdit(record)" v-has="'area:edit'" @operationClick="operationClick"
>{{ $t('edit') }}</a> >
<a class="table-del" @click="handleDelete(record.id)" v-has="'area:delete'"
>{{ $t('delete') }}</a>
</div>
</j-table> </j-table>
</a-spin> </a-spin>
<!--新增表单--> <!--新增表单-->
@@ -129,6 +122,20 @@ export default {
column: 'sort', column: 'sort',
order: 'ascend' order: 'ascend'
}, },
operationList: [
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'area:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'area:delete'
}
],
disableMixinCreated: true // 默认不加载数据 disableMixinCreated: true // 默认不加载数据
} }
}, },
@@ -22,23 +22,17 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button class="box-button" @click="searchReset">{{ $t('reset') }}</a-button> <a-button icon="search" class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery"> <a-button icon="reload" class="box-button" @click="searchReset">{{ $t('reset') }}</a-button>
{{ $t('query') }}
</a-button>
</div> </div>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleAdd" v-has="'sys:dict:operation'"> <!--新增-->
<a-icon type="plus" /> <a-button icon="plus" type="primary" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleAdd" v-has="'sys:dict:operation'">{{ $t('newlyAdded') }}</a-button>
{{ $t('newlyAdded') }} <!--批量删除-->
</div> <a-button type="primary" icon="delete" ghost v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="batchDel" v-has="'sys:dict:operation'">{{ $t('batchDelete') }}</a-button>
<div class="operator-text" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="batchDel" v-has="'sys:dict:operation'">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div> </div>
<j-table <j-table
@@ -54,9 +48,11 @@
:loading="loading" :loading="loading"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange"
>
<div slot="action" class="table-action" slot-scope="{text, record}"> <div slot="action" class="table-action" slot-scope="{text, record}">
<a class="action-edit" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a> <a class="action-edit" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
<a-divider type="vertical" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'"/>
<a class="table-del" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a> <a class="table-del" v-if="record.isReadOnly === IsReadOnlyEnums.configurable.value || record.isReadOnly === IsReadOnlyEnums.subConfigurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
@@ -19,14 +19,10 @@
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleAdd" v-has="'tag:add'"> <!--新增-->
<a-icon type="plus" /> <a-button icon="plus" type="primary" @click="handleAdd" v-has="'tag:add'">{{ $t('newlyAdded') }}</a-button>
{{ $t('newlyAdded') }} <!--批量删除-->
</div> <a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'tag:logicDeleteBatch'">{{ $t('batchDelete') }}</a-button>
<div class="operator-text" @click="batchDel" v-has="'tag:logicDeleteBatch'">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div> </div>
<j-table <j-table
@@ -41,13 +37,10 @@
:loading="loading" :loading="loading"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> :operation-list="operationList"
<div slot="action" class="table-action" slot-scope="{text, record}"> @change="handleTableChange"
<a class="action-edit" @click="handleEdit(record)" v-if="canOpeFlag || record.isReadOnly===0" v-has="'tag:edit'" @operationClick="operationClick"
>{{ $t('edit') }}</a> >
<a class="table-del" @click="handleDelete(record.id)" v-has="'tag:logicDelete'" v-if="canOpeFlag || (record.isReadOnly===2 || record.isReadOnly===0)"
>{{ $t('delete') }}</a>
</div>
</j-table> </j-table>
<clause-splitting-drawer ref="modalForm" v-bind="$props" @ok="modalFormOk"></clause-splitting-drawer> <clause-splitting-drawer ref="modalForm" v-bind="$props" @ok="modalFormOk"></clause-splitting-drawer>
</div> </div>
@@ -59,6 +52,7 @@ import '@assets/less/common.less'
import ClauseSplittingDrawer from '../modules/ClauseSplittingDrawer' import ClauseSplittingDrawer from '../modules/ClauseSplittingDrawer'
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin' import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
import JTable from '../../../../components/jero/JTable' import JTable from '../../../../components/jero/JTable'
import { IsReadOnlyEnums } from '../../../../enums/commonEnums'
export default { export default {
name: 'ClauseSplittingList', name: 'ClauseSplittingList',
@@ -133,7 +127,27 @@ export default {
width: 170 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)
}
}
]
} }
} }
} }
+30 -21
View File
@@ -15,7 +15,7 @@
<a-form-item :label="$t('system.tag.showArea')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> <a-form-item :label="$t('system.tag.showArea')" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-select class="box-input" v-model="queryParam.showArea" <a-select class="box-input" v-model="queryParam.showArea"
:placeholder="$t('pleaseSelect') + $t('system.tag.showArea')"> :placeholder="$t('pleaseSelect') + $t('system.tag.showArea')">
<a-select-option :value="item.id" v-for="item in areasArr" :key="item">{{ item.showArea }} <a-select-option :value="item.id" v-for="item in areasArr" :key="item.id">{{ item.showArea }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@@ -30,19 +30,12 @@
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="handleAdd" v-has="'tag:add'"> <!--新增-->
<a-icon type="plus" /> <a-button icon="plus" type="primary" @click="handleAdd" v-has="'tag:add'">{{ $t('newlyAdded') }}</a-button>
{{ $t('newlyAdded') }}
</div>
<!--展示区域管理--> <!--展示区域管理-->
<div class="operator-text" @click="handleShow" v-has="'tag:area:list'"> <a-button icon="unordered-list" type="primary" ghost @click="handleShow" v-has="'tag:area:list'">{{ $t('system.tag.exhibitionAreaManagement') }}</a-button>
<a-icon type="unordered-list" /> <!--批量删除-->
{{ $t('system.tag.exhibitionAreaManagement') }} <a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'tag:logicDeleteBatch'">{{ $t('batchDelete') }}</a-button>
</div>
<div class="operator-text" @click="batchDel" v-has="'tag:logicDeleteBatch'">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div> </div>
<div> <div>
@@ -55,15 +48,10 @@
:pagination="ipagination" :pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:operation-list="operationList"
@change="handleTableChange" @change="handleTableChange"
@operationClick="operationClick"
> >
<!--todo 需要查看下是否有这个字段并且看一下判断是否必然-->
<div slot="action" class="table-action" slot-scope="{text, record}">
<a class="action-edit" @click="handleEdit(record)" v-if="canOpeFlag || record.isReadOnly===0" v-has="'tag:edit'"
>{{ $t('edit') }}</a>
<a class="table-del" v-if="canOpeFlag || (record.isReadOnly===2 || record.isReadOnly===0)" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
>{{ $t('delete') }}</a>
</div>
</j-table> </j-table>
</div> </div>
<!--新增字段--> <!--新增字段-->
@@ -81,6 +69,7 @@ import StandardDrawer from '../modules/StandardDrawer'
import AreaModal from '../modules/AreaModal' import AreaModal from '../modules/AreaModal'
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin' import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
import JTable from '../../../../components/jero/JTable' import JTable from '../../../../components/jero/JTable'
import { IsReadOnlyEnums } from '../../../../enums/commonEnums'
export default { export default {
name: 'StandardList', name: 'StandardList',
@@ -119,6 +108,7 @@ export default {
column: 'orderNum', column: 'orderNum',
order: 'asc' order: 'asc'
}, },
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
columns: [ columns: [
{ {
title: this.$t('system.tag.attributeName'), title: this.$t('system.tag.attributeName'),
@@ -164,7 +154,26 @@ export default {
width: 150 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: { methods: {
+34 -21
View File
@@ -25,21 +25,12 @@
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<!--v-has="'dict:add'"--> <!--新增-->
<div class="operator-text" @click="handleAdd" v-has="'sys:dict:operation'"> <a-button icon="plus" type="primary" @click="handleAdd" v-has="'sys:dict:operation'">{{ $t('newlyAdded') }}</a-button>
<a-icon type="plus" />
{{ $t('newlyAdded') }}
</div>
<!--刷新缓存--> <!--刷新缓存-->
<div class="operator-text" @click="refreshCache" v-has="'sys:dict:operation'"> <a-button icon="sync" type="primary" ghost @click="refreshCache" v-has="'sys:dict:operation'">{{ $t('dict.refreshCache') }}</a-button>
<a-icon type="sync" /> <!--批量删除-->
{{ $t('dict.refreshCache') }} <a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'sys:dict:operation'">{{ $t('batchDelete') }}</a-button>
</div>
<!--v-has="'dict:logicDeleteBatch'"-->
<div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'">
<a-icon type="delete" />
{{ $t('batchDelete') }}
</div>
</div> </div>
<j-table <j-table
@@ -52,13 +43,10 @@
:columns="columns" :columns="columns"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:operation-list="operationList"
@change="handleTableChange" @change="handleTableChange"
@operationClick="operationClick"
> >
<div slot="action" class="table-action" slot-scope="{text, record}">
<a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
<a class="action-edit" v-if="canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
<a class="action-delete" v-if="canOpeFlag || record.isReadOnly === IsReadOnlyEnums.configurable.value" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
</div>
</j-table> </j-table>
<!-- 新增编辑 --> <!-- 新增编辑 -->
@@ -129,7 +117,7 @@ export default {
title: this.$t('operation'), title: this.$t('operation'),
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
align: 'center', align: 'center',
width: 170 width: 100
} }
], ],
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以 canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
@@ -149,7 +137,32 @@ export default {
// 增加其他的查询条件 // 增加其他的查询条件
filters: { filters: {
isTagDict: 1 // 是否为标签内容(1是 0否) 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: { methods: {