【update】数据字典表格的替换

This commit is contained in:
fengchenchen
2023-09-19 09:15:29 +08:00
parent 180c3f94de
commit bc95bd338b
2 changed files with 31 additions and 39 deletions
+30 -38
View File
@@ -35,40 +35,22 @@
<a-button type="primary" icon="hdd" @click="openDeleteList">{{ $t('recycleBin') }}</a-button> <a-button type="primary" icon="hdd" @click="openDeleteList">{{ $t('recycleBin') }}</a-button>
</div> </div>
<a-table <j-table
ref="table"
rowKey="id" rowKey="id"
size="middle" can-drag
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :scroll="{x: '100%'}"
@change="handleTableChange"> :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
<span slot="action" slot-scope="text, record"> @change="handleTableChange"
<a @click="handleEdit(record)"> >
<a-icon type="edit"/> <div slot="action" class="table-action" slot-scope="{text, record}">
{{ $t('edit') }} <a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
</a> <a class="action-edit" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</a>
<a-divider type="vertical"/> <a class="action-delete" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
<a-dropdown> </div>
<a class="ant-dropdown-link"> </j-table>
{{ $t('more') }} <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<!-- <a-icon type="setting"/>-->
<a @click="editDictItem(record)">{{ $t('dict.dictConfiguration') }}</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm :title="$t('areYouSure')" @confirm="() =>handleDelete(record.id)">
<a>{{ $t('delete') }}</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div> </div>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 --> <dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list ref="dictItemList"></dict-item-list> <dict-item-list ref="dictItemList"></dict-item-list>
@@ -86,11 +68,12 @@ import JInput from '@/components/jero/JInput'
import { getAction } from '@/api/manage' 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'
export default { export default {
name: 'DictList', name: 'DictList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { DictModal, DictItemList, DictDeleteList, JInput }, components: { DictModal, DictItemList, DictDeleteList, JInput, JTable },
data () { data () {
return { return {
description: '这是数据字典页面', description: '这是数据字典页面',
@@ -106,7 +89,7 @@ export default {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key: 'rowIndex', key: 'rowIndex',
width: 120, width: 60,
align: 'center', align: 'center',
customRender: function (t, r, index) { customRender: function (t, r, index) {
return parseInt(index) + 1 return parseInt(index) + 1
@@ -115,27 +98,36 @@ export default {
{ {
title: this.$t('dict.dictionaryName'), title: this.$t('dict.dictionaryName'),
align: 'left', align: 'left',
dataIndex: 'dictName' width: 100,
dataIndex: 'dictName',
scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('dict.dictionaryEnglishName'), title: this.$t('dict.dictionaryEnglishName'),
align: 'left', align: 'left',
dataIndex: 'dictEnglishName' width: 100,
dataIndex: 'dictEnglishName',
scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('dict.dictionaryNumber'), title: this.$t('dict.dictionaryNumber'),
align: 'left', align: 'left',
dataIndex: 'dictCode' width: 100,
dataIndex: 'dictCode',
scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('description'), title: this.$t('description'),
align: 'left', align: 'left',
dataIndex: 'description' dataIndex: 'description',
width: 200,
scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
dataIndex: 'action', // dataIndex: 'action',
align: 'center', align: 'left',
width: 170,
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
], ],
+1 -1
View File
@@ -132,7 +132,7 @@ export default {
}, },
columns: [ columns: [
{ {
title: this.$t('message.my.MessageContent'), title: this.$t('message.my.messageContent'),
align: 'left', align: 'left',
dataIndex: 'msgContent', dataIndex: 'msgContent',
ellipsis: true, ellipsis: true,