diff --git a/src/common/lang/system/en.js b/src/common/lang/system/en.js index e18be931..e13abcf2 100644 --- a/src/common/lang/system/en.js +++ b/src/common/lang/system/en.js @@ -50,7 +50,8 @@ module.exports = { dataValue: '数据值', parentName: '父级名称', select: '下拉选择', - tree: '树形结构' + tree: '树形结构', + pleaseEnterYourEnglishName: '请输入英文字段名称' }, // 内部工作组 internalWorkGroup: { diff --git a/src/common/lang/system/zh.js b/src/common/lang/system/zh.js index 80de5e32..d76e887b 100644 --- a/src/common/lang/system/zh.js +++ b/src/common/lang/system/zh.js @@ -51,7 +51,8 @@ module.exports = { dataValue: '数据值', parentName: '父级名称', select: '下拉选择', - tree: '树形结构' + tree: '树形结构', + pleaseEnterYourEnglishName: '请输入英文字段名称' }, // 内部工作组 internalWorkGroup: { diff --git a/src/views/system/DictList.vue b/src/views/system/DictList.vue index 97d350d6..d32e3cca 100644 --- a/src/views/system/DictList.vue +++ b/src/views/system/DictList.vue @@ -47,8 +47,8 @@ >
{{ $t('system.tag.dictionaryConfiguration') }} - {{ $t('edit') }} - {{ $t('delete') }} + {{ $t('edit') }} + {{ $t('delete') }}
@@ -131,6 +131,7 @@ export default { scopedSlots: { customRender: 'action' } } ], + canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以 dict: '', labelCol: { xs: { span: 8 }, diff --git a/src/views/system/modules/DictItemModal.vue b/src/views/system/modules/DictItemModal.vue index 129fda6a..1b1089b1 100644 --- a/src/views/system/modules/DictItemModal.vue +++ b/src/views/system/modules/DictItemModal.vue @@ -53,7 +53,7 @@ :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('dict.rankingValue')"> - + {{ $t('dict.valueSmallerIsHigher') }} diff --git a/src/views/system/modules/DictModal.vue b/src/views/system/modules/DictModal.vue index 6dd5765d..77687d66 100644 --- a/src/views/system/modules/DictModal.vue +++ b/src/views/system/modules/DictModal.vue @@ -18,7 +18,7 @@ prop="dictName" required :label="$t('dict.dictionaryName')"> - + - + - + - + @@ -128,6 +133,8 @@ export default { } // 重要,设置为数据字典内容 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/AreaFormModal.vue b/src/views/system/tags/modules/AreaFormModal.vue index b59e646e..e767a8d7 100644 --- a/src/views/system/tags/modules/AreaFormModal.vue +++ b/src/views/system/tags/modules/AreaFormModal.vue @@ -23,7 +23,7 @@ - + {{ $t('dict.valueSmallerIsHigher')}} diff --git a/src/views/system/tags/modules/AreaModal.vue b/src/views/system/tags/modules/AreaModal.vue index 3241d172..59797564 100644 --- a/src/views/system/tags/modules/AreaModal.vue +++ b/src/views/system/tags/modules/AreaModal.vue @@ -135,7 +135,7 @@ export default { methods: { show () { this.visible = true - this.loadData() + this.loadData(1) }, handleOk () {}, // 关闭 diff --git a/src/views/system/tags/modules/ClauseSplittingDrawer.vue b/src/views/system/tags/modules/ClauseSplittingDrawer.vue index f843ed7e..1864e8f2 100644 --- a/src/views/system/tags/modules/ClauseSplittingDrawer.vue +++ b/src/views/system/tags/modules/ClauseSplittingDrawer.vue @@ -34,25 +34,25 @@ - - + + - @@ -170,6 +170,7 @@ export default { }, data () { return { + canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否存在字段名称,开发环境存在 visible: false, title: '', width: 800, @@ -198,7 +199,7 @@ export default { ], // 字段名称 dbFieldName: [ - { required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' }, + { required: false, message: this.$t('system.tag.pleaseEnterYourEnglishName'), trigger: 'blur' }, // { min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' }, { validator: this.test } ], @@ -296,6 +297,10 @@ export default { if (valid) { this.confirmLoading = true const formData = Object.assign({}, this.form) + // 多行文字 默认500的长度 + if (formData.fieldShowType === FieldType.TEXTAREA.value) { + formData.dbLength = formData.dbLength || 500 + } let Func = addTag if (this.isEdit) { Func = editTag @@ -364,6 +369,7 @@ export default { this.isLength = true } else { this.isLength = false + // this.isLength = true } }, // 获取选项内容 diff --git a/src/views/system/tags/modules/StandardDrawer.vue b/src/views/system/tags/modules/StandardDrawer.vue index f4ad936b..fcf7ee72 100644 --- a/src/views/system/tags/modules/StandardDrawer.vue +++ b/src/views/system/tags/modules/StandardDrawer.vue @@ -73,8 +73,9 @@ dictCode="field_show_type" :placeholder="$t('pleaseSelect') + $t('system.tag.attributeType')" :disabled="disabledEdit" - @change="form.dictId = undefined" + @change="fieldShowTypeChange" /> + @@ -93,7 +94,7 @@ - @@ -241,7 +242,7 @@ export default { ], dbFieldName: [ - { required: false, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' }, + { required: false, message: this.$t('system.tag.pleaseEnterYourEnglishName'), trigger: 'blur' }, { min: 1, max: 60, message: this.$t('cantExeed') + '60' + this.$t('characters'), trigger: 'blur' }, { validator: this.test } ], @@ -357,12 +358,24 @@ export default { onClose () { this.visible = false }, + fieldShowTypeChange(e) { + console.log(e, '----------') + // this.form.dictId = undefined + // this.$refs.editForm.resetFields({ + // dictId: undefined + // }) + // this.$forceUpdate() + }, handleOk () { this.$refs.editForm.validate((valid) => { console.log('---err-----', valid) if (valid) { this.confirmLoading = true const formData = Object.assign({}, this.form) + // 多行文字 默认500的长度 + if (formData.fieldShowType === FieldType.TEXTAREA.value) { + formData.dbLength = formData.dbLength || 500 + } let Func = addTag if (this.isEdit) { Func = editTag @@ -435,15 +448,20 @@ export default { this.isSearch = true } // 输入框(字符串) 文本框 人员选择 标准选择 输入框(链接) + // 文本框 || 单选用户弹框 || 多选标准弹框 if (val === FieldType.TEXT_BOX.value || val === FieldType.USER_SINGLE.value || val === FieldType.STANDARD_MORE.value || val === 'sel_user') { this.isLength = true } else { this.isLength = false + // this.isLength = true } }, // 获取选项内容 loadContent () { - const params = {} + const params = { + column: 'orderNum', + order: 'ascend' + } queryDictName(params).then((res) => { if (res.success) { const data = [...res.result] diff --git a/src/views/system/tags/modules/TagContentDictListDrawer.vue b/src/views/system/tags/modules/TagContentDictListDrawer.vue index 7daf9a03..139d5b93 100644 --- a/src/views/system/tags/modules/TagContentDictListDrawer.vue +++ b/src/views/system/tags/modules/TagContentDictListDrawer.vue @@ -90,7 +90,7 @@ export default { { // 英文名称 title: this.$t('system.tag.attributeNameEnglish'), - align: 'left', + align: 'center', width: 100, ellipsis: true, dataIndex: 'enName', @@ -99,7 +99,7 @@ export default { { // 数据值 title: this.$t('system.tag.dataValue'), - align: 'left', + align: 'center', width: 100, ellipsis: true, dataIndex: 'itemValue', @@ -107,7 +107,7 @@ export default { }, { title: this.$t('system.tag.describe'), - align: 'left', + align: 'center', width: 100, ellipsis: true, dataIndex: 'description', diff --git a/src/views/system/tags/modules/TagContentModal.vue b/src/views/system/tags/modules/TagContentModal.vue index a7ed353d..c21b390b 100644 --- a/src/views/system/tags/modules/TagContentModal.vue +++ b/src/views/system/tags/modules/TagContentModal.vue @@ -16,7 +16,7 @@ @@ -31,7 +31,7 @@ @@ -42,11 +42,10 @@ - @@ -131,8 +130,8 @@ export default { const formData = Object.assign({}, this.model) // 重要,设置为标签内容 formData.isTagDict = 1 - // 设置为非固定字段,为啥不清楚 - // formData.isReadOnly = 0 + // 设置为非固定字段--默认可以编辑 + formData.isReadOnly = 0 Func(formData).then(res => { if (res.success) { this.$message.success(res.message) diff --git a/src/views/system/tags/pages/ClauseSplittingList.vue b/src/views/system/tags/pages/ClauseSplittingList.vue index ce57bd10..dc85e8d6 100644 --- a/src/views/system/tags/pages/ClauseSplittingList.vue +++ b/src/views/system/tags/pages/ClauseSplittingList.vue @@ -31,7 +31,7 @@ @@ -92,35 +92,35 @@ export default { columns: [ { title: this.$t('system.tag.attributeName'), - align: 'left', + align: 'center', width: 200, dataIndex: 'dbFieldTxt', scopedSlots: { customRender: 'text' } }, { title: this.$t('system.tag.attributeNameEnglish'), - align: 'left', + align: 'center', width: 100, dataIndex: 'dbFieldEnName', scopedSlots: { customRender: 'text' } }, { title: this.$t('system.tag.attributeType'), - align: 'left', + align: 'center', width: 100, dataIndex: 'fieldShowType_dictText', scopedSlots: { customRender: 'text' } }, { title: this.$t('system.tag.fieldLength'), - align: 'left', + align: 'center', width: 80, dataIndex: 'dbLength', scopedSlots: { customRender: 'text' } }, { title: this.$t('system.tag.displayOrder'), - align: 'left', + align: 'center', width: 80, dataIndex: 'orderNum', scopedSlots: { customRender: 'text' } diff --git a/src/views/system/tags/pages/StandardList.vue b/src/views/system/tags/pages/StandardList.vue index a9f8bf28..0bf4174d 100644 --- a/src/views/system/tags/pages/StandardList.vue +++ b/src/views/system/tags/pages/StandardList.vue @@ -48,6 +48,7 @@
{{ $t('newlyAdded') }}
+ +
+ + {{ $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)