+
+ {{ $t('dict.refreshCache') }}
+
@@ -45,14 +50,14 @@
:pagination="ipagination"
:loading="loading"
:columns="columns"
- :scroll="{x: true}"
+ :scroll="{x: '100%'}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
@change="handleTableChange"
>
@@ -71,6 +76,9 @@ import TagContentDictListDrawer from '../modules/TagContentDictListDrawer'
import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
import JTable from '../../../../components/jero/JTable'
+import Vue from 'vue'
+import { getAction } from '../../../../api/manage'
+import { UI_CACHE_DB_DICT_DATA } from '../../../../store/mutation-types'
export default {
name: 'TagContent',
@@ -88,21 +96,21 @@ export default {
title: this.$t('system.tag.labelName'),
dataIndex: 'dictName',
key: 'dictName',
- // align: 'left',
+ align: 'center',
// ellipsis: true,
width: 100,
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.labelType'),
- align: 'left',
+ align: 'center',
width: 100,
dataIndex: 'attributeType_dictText',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.describe'),
- align: 'left',
+ align: 'center',
dataIndex: 'description',
ellipsis: true,
width: 200,
@@ -110,7 +118,7 @@ export default {
},
{
title: this.$t('system.tag.displayOrder'),
- align: 'left',
+ align: 'center',
width: 100,
dataIndex: 'orderNum',
scopedSlots: { customRender: 'text' }
@@ -118,15 +126,23 @@ export default {
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
- align: 'left',
+ align: 'center',
width: 170
}
],
+ canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
// dataSource: [],
url: {
list: 'sys/dict/tagDictPage',
delete: 'sys/dict/delete',
- deleteBatch: 'sys/dict/deleteBatch'
+ deleteBatch: 'sys/dict/deleteBatch',
+ refreshCache: 'sys/dict/refleshCache',
+ queryAllDictItems: 'sys/dict/queryAllDictItems'
+ },
+ /* 排序参数 */
+ isorter: {
+ column: 'orderNum',
+ order: 'ascend'
},
// 增加其他的查询条件
filters: {
@@ -135,6 +151,23 @@ export default {
}
},
methods: {
+ refreshCache () {
+ getAction(this.url.refreshCache).then((res) => {
+ if (res.success) {
+ // 重新加载缓存
+ getAction(this.url.queryAllDictItems).then((res) => {
+ if (res.success) {
+ Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
+ Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
+ }
+ })
+ this.$message.success(this.$t('dict.refreshCache') + this.$t('dict.complete') + '!')
+ }
+ }).catch(e => {
+ this.$message.warn(this.$t('dict.refreshCache') + this.$t('dict.failed') + '!')
+ console.log('刷新失败', e)
+ })
+ },
// 编辑字典数据
editDictItem (record) {
this.$refs.tagContentDictListDrawer.show(record)