【update】标签管理对应bug的修改2

This commit is contained in:
fengchenchen
2023-10-30 17:34:46 +08:00
parent 40cdef674c
commit 19de3005ab
14 changed files with 120 additions and 52 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ module.exports = {
dataValue: '数据值', dataValue: '数据值',
parentName: '父级名称', parentName: '父级名称',
select: '下拉选择', select: '下拉选择',
tree: '树形结构' tree: '树形结构',
pleaseEnterYourEnglishName: '请输入英文字段名称'
}, },
// 内部工作组 // 内部工作组
internalWorkGroup: { internalWorkGroup: {
+2 -1
View File
@@ -51,7 +51,8 @@ module.exports = {
dataValue: '数据值', dataValue: '数据值',
parentName: '父级名称', parentName: '父级名称',
select: '下拉选择', select: '下拉选择',
tree: '树形结构' tree: '树形结构',
pleaseEnterYourEnglishName: '请输入英文字段名称'
}, },
// 内部工作组 // 内部工作组
internalWorkGroup: { internalWorkGroup: {
+3 -2
View File
@@ -47,8 +47,8 @@
> >
<div slot="action" class="table-action" slot-scope="{text, record}"> <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-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
<a class="action-edit" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</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" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a> <a class="action-delete" v-if="canOpeFlag || record.isReadOnly === 0" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
</div> </div>
@@ -131,6 +131,7 @@ export default {
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
], ],
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
dict: '', dict: '',
labelCol: { labelCol: {
xs: { span: 8 }, xs: { span: 8 },
+1 -1
View File
@@ -53,7 +53,7 @@
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('dict.rankingValue')"> :label="$t('dict.rankingValue')">
<a-input-number :min="1" v-model="model.sortOrder" /> <a-input-number :min="1" :max="99999" v-model="model.sortOrder" />
{{ $t('dict.valueSmallerIsHigher') }} {{ $t('dict.valueSmallerIsHigher') }}
</a-form-model-item> </a-form-model-item>
+11 -4
View File
@@ -18,7 +18,7 @@
prop="dictName" prop="dictName"
required required
:label="$t('dict.dictionaryName')"> :label="$t('dict.dictionaryName')">
<a-input :placeholder="$t('pleaseEnter') + $t('dict.dictionaryName')" v-model="model.dictName"/> <a-input :maxLength="50" :placeholder="$t('pleaseEnter') + $t('dict.dictionaryName')" v-model.trim="model.dictName" @change="event => event.target.value = event.target.value.trim()"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
@@ -26,7 +26,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
prop="dictEnglishName" prop="dictEnglishName"
:label="$t('dict.dictionaryEnglishName')"> :label="$t('dict.dictionaryEnglishName')">
<a-input :placeholder="$t('pleaseEnter') + $t('dict.dictionaryEnglishName')" v-model="model.dictEnglishName"/> <a-input :maxLength="50" :placeholder="$t('pleaseEnter') + $t('dict.dictionaryEnglishName')" v-model.trim="model.dictEnglishName" @change="event => event.target.value = event.target.value.trim()"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
@@ -35,14 +35,19 @@
prop="dictCode" prop="dictCode"
required required
:label="$t('dict.dictionaryNumber')"> :label="$t('dict.dictionaryNumber')">
<a-input :placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')" v-model="model.dictCode"/> <a-input
:maxLength="50"
:placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')"
v-model.trim="model.dictCode"
@change="event => event.target.value = event.target.value.trim()"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item <a-form-model-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('description')"> :label="$t('description')">
<a-input v-model="model.description"/> <a-textarea :maxLength="500" v-model="model.description" :placeholder="$t('pleaseEnter') + $t('system.tag.describe')"/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
@@ -128,6 +133,8 @@ export default {
} }
// 重要,设置为数据字典内容 // 重要,设置为数据字典内容
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)
@@ -23,7 +23,7 @@
<!--展示区域--> <!--展示区域-->
<a-form-model-item :label="$t('system.tag.showArea')" prop="showArea"> <a-form-model-item :label="$t('system.tag.showArea')" prop="showArea">
<a-input <a-input
v-model="model.showArea" v-model.trim="model.showArea"
:placeholder="$t('pleaseEnter') + $t('system.tag.showArea')" :placeholder="$t('pleaseEnter') + $t('system.tag.showArea')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="50" :maxLength="50"
@@ -33,7 +33,7 @@
<a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="enName"> <a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="enName">
<a-input <a-input
v-model="model.enName" v-model.trim="model.enName"
:placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="50" :maxLength="50"
@@ -41,7 +41,7 @@
</a-form-model-item> </a-form-model-item>
<!--排序值--> <!--排序值-->
<a-form-model-item :label="$t('dict.rankingValue')" prop="sort"> <a-form-model-item :label="$t('dict.rankingValue')" prop="sort">
<a-input-number :min="1" v-model="model.sort" /> <a-input-number :min="1" :max="99999" v-model="model.sort" />
{{ $t('dict.valueSmallerIsHigher')}} {{ $t('dict.valueSmallerIsHigher')}}
</a-form-model-item> </a-form-model-item>
<!--<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum">--> <!--<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum">-->
+1 -1
View File
@@ -135,7 +135,7 @@ export default {
methods: { methods: {
show () { show () {
this.visible = true this.visible = true
this.loadData() this.loadData(1)
}, },
handleOk () {}, handleOk () {},
// 关闭 // 关闭
@@ -34,25 +34,25 @@
<!-- 属性名称--> <!-- 属性名称-->
<a-form-model-item :label="$t('system.tag.attributeName')" prop="dbFieldTxt"> <a-form-model-item :label="$t('system.tag.attributeName')" prop="dbFieldTxt">
<a-input <a-input
v-model="form.dbFieldTxt" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')" v-model.trim="form.dbFieldTxt" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeName')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="120" :maxLength="50"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
<!-- 英文名称--> <!-- 英文名称-->
<a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="dbFieldEnName"> <a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="dbFieldEnName">
<a-input <a-input
v-model="form.dbFieldEnName" v-model.trim="form.dbFieldEnName"
:placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')" :placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="120" :maxLength="50"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
<!-- 字段名称--> <!-- 字段名称 正式环境 需要注释掉,开发环境可以先留着,方便使用-->
<a-col :span="24"> <a-col :span="24" v-if="canOpeFlag">
<a-form-model-item :label="$t('system.tag.fieldName')" prop="dbFieldName"> <a-form-model-item :label="$t('system.tag.fieldName')" prop="dbFieldName">
<a-input <a-input
v-model="form.dbFieldName" v-model.trim="form.dbFieldName"
:placeholder="$t('pleaseEnter') + $t('system.tag.fieldName')" :placeholder="$t('pleaseEnter') + $t('system.tag.fieldName')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="120" :maxLength="120"
@@ -84,7 +84,7 @@
<!--字段长度 key 值必须加,解决验证错位的问题--> <!--字段长度 key 值必须加,解决验证错位的问题-->
<a-form-model-item v-if="isLength" :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength"> <a-form-model-item v-if="isLength" :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength">
<a-input-number v-model="form.dbLength" :min="1" :max="200" <a-input-number v-model="form.dbLength" :min="1" :max="9999"
:placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')" :placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')"
style="width: 100%" :formatter="limitNumber" :parser="limitNumber" /> style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
</a-form-model-item> </a-form-model-item>
@@ -170,6 +170,7 @@ export default {
}, },
data () { data () {
return { return {
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否存在字段名称,开发环境存在
visible: false, visible: false,
title: '', title: '',
width: 800, width: 800,
@@ -198,7 +199,7 @@ export default {
], ],
// 字段名称 // 字段名称
dbFieldName: [ 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' }, // { min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test } { validator: this.test }
], ],
@@ -296,6 +297,10 @@ export default {
if (valid) { if (valid) {
this.confirmLoading = true this.confirmLoading = true
const formData = Object.assign({}, this.form) const formData = Object.assign({}, this.form)
// 多行文字 默认500的长度
if (formData.fieldShowType === FieldType.TEXTAREA.value) {
formData.dbLength = formData.dbLength || 500
}
let Func = addTag let Func = addTag
if (this.isEdit) { if (this.isEdit) {
Func = editTag Func = editTag
@@ -364,6 +369,7 @@ export default {
this.isLength = true this.isLength = true
} else { } else {
this.isLength = false this.isLength = false
// this.isLength = true
} }
}, },
// 获取选项内容 // 获取选项内容
@@ -73,8 +73,9 @@
dictCode="field_show_type" dictCode="field_show_type"
:placeholder="$t('pleaseSelect') + $t('system.tag.attributeType')" :placeholder="$t('pleaseSelect') + $t('system.tag.attributeType')"
:disabled="disabledEdit" :disabled="disabledEdit"
@change="form.dictId = undefined" @change="fieldShowTypeChange"
/> />
<!-- @change="form.dictId = undefined"-->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@@ -93,7 +94,7 @@
<!--字段长度 key 值必须加,解决验证错位的问题--> <!--字段长度 key 值必须加,解决验证错位的问题-->
<a-col :span="24" v-if="isLength"> <a-col :span="24" v-if="isLength">
<a-form-model-item :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength"> <a-form-model-item :label="$t('system.tag.fieldLength')" prop="dbLength" key="dbLength">
<a-input-number v-model="form.dbLength" :min="1" :max="200" <a-input-number v-model="form.dbLength" :min="1" :max="9999"
:placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')" :placeholder="$t('pleaseEnter') + $t('system.tag.fieldLength')"
style="width: 100%" :formatter="limitNumber" :parser="limitNumber" /> style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
</a-form-model-item> </a-form-model-item>
@@ -241,7 +242,7 @@ export default {
], ],
dbFieldName: [ 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' }, { min: 1, max: 60, message: this.$t('cantExeed') + '60' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test } { validator: this.test }
], ],
@@ -357,12 +358,24 @@ export default {
onClose () { onClose () {
this.visible = false this.visible = false
}, },
fieldShowTypeChange(e) {
console.log(e, '----------')
// this.form.dictId = undefined
// this.$refs.editForm.resetFields({
// dictId: undefined
// })
// this.$forceUpdate()
},
handleOk () { handleOk () {
this.$refs.editForm.validate((valid) => { this.$refs.editForm.validate((valid) => {
console.log('---err-----', valid) console.log('---err-----', valid)
if (valid) { if (valid) {
this.confirmLoading = true this.confirmLoading = true
const formData = Object.assign({}, this.form) const formData = Object.assign({}, this.form)
// 多行文字 默认500的长度
if (formData.fieldShowType === FieldType.TEXTAREA.value) {
formData.dbLength = formData.dbLength || 500
}
let Func = addTag let Func = addTag
if (this.isEdit) { if (this.isEdit) {
Func = editTag Func = editTag
@@ -435,15 +448,20 @@ export default {
this.isSearch = true this.isSearch = true
} }
// 输入框(字符串) 文本框 人员选择 标准选择 输入框(链接) // 输入框(字符串) 文本框 人员选择 标准选择 输入框(链接)
// 文本框 || 单选用户弹框 || 多选标准弹框
if (val === FieldType.TEXT_BOX.value || val === FieldType.USER_SINGLE.value || val === FieldType.STANDARD_MORE.value || val === 'sel_user') { if (val === FieldType.TEXT_BOX.value || val === FieldType.USER_SINGLE.value || val === FieldType.STANDARD_MORE.value || val === 'sel_user') {
this.isLength = true this.isLength = true
} else { } else {
this.isLength = false this.isLength = false
// this.isLength = true
} }
}, },
// 获取选项内容 // 获取选项内容
loadContent () { loadContent () {
const params = {} const params = {
column: 'orderNum',
order: 'ascend'
}
queryDictName(params).then((res) => { queryDictName(params).then((res) => {
if (res.success) { if (res.success) {
const data = [...res.result] const data = [...res.result]
@@ -90,7 +90,7 @@ export default {
{ {
// 英文名称 // 英文名称
title: this.$t('system.tag.attributeNameEnglish'), title: this.$t('system.tag.attributeNameEnglish'),
align: 'left', align: 'center',
width: 100, width: 100,
ellipsis: true, ellipsis: true,
dataIndex: 'enName', dataIndex: 'enName',
@@ -99,7 +99,7 @@ export default {
{ {
// 数据值 // 数据值
title: this.$t('system.tag.dataValue'), title: this.$t('system.tag.dataValue'),
align: 'left', align: 'center',
width: 100, width: 100,
ellipsis: true, ellipsis: true,
dataIndex: 'itemValue', dataIndex: 'itemValue',
@@ -107,7 +107,7 @@ export default {
}, },
{ {
title: this.$t('system.tag.describe'), title: this.$t('system.tag.describe'),
align: 'left', align: 'center',
width: 100, width: 100,
ellipsis: true, ellipsis: true,
dataIndex: 'description', dataIndex: 'description',
@@ -16,7 +16,7 @@
<a-form-model-item :label="$t('system.tag.labelItemName')" prop="dictName" class="tag-item"> <a-form-model-item :label="$t('system.tag.labelItemName')" prop="dictName" class="tag-item">
<a-input <a-input
:maxLength="50" :maxLength="50"
v-model="model.dictName" v-model.trim="model.dictName"
:placeholder="$t('pleaseEnter') + $t('system.tag.labelItemName')" :placeholder="$t('pleaseEnter') + $t('system.tag.labelItemName')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
/> />
@@ -31,7 +31,7 @@
<a-input <a-input
:maxLength="50" :maxLength="50"
:placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')" :placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')"
v-model="model.dictCode" v-model.trim="model.dictCode"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
/> />
</a-form-model-item> </a-form-model-item>
@@ -42,11 +42,10 @@
</a-form-model-item> </a-form-model-item>
<!--描述--> <!--描述-->
<a-form-model-item ref="describe" :label="$t('system.tag.describe')" prop="description" class="tag-item"> <a-form-model-item ref="describe" :label="$t('system.tag.describe')" prop="description" class="tag-item">
<a-input <a-textarea
v-model="model.description" v-model="model.description"
:maxLength="500" :maxLength="500"
:placeholder="$t('pleaseEnter') + $t('system.tag.describe')" :placeholder="$t('pleaseEnter') + $t('system.tag.describe')"
@change="event => event.target.value = event.target.value.trim()"
/> />
</a-form-model-item> </a-form-model-item>
@@ -131,8 +130,8 @@ export default {
const formData = Object.assign({}, this.model) const formData = Object.assign({}, this.model)
// 重要,设置为标签内容 // 重要,设置为标签内容
formData.isTagDict = 1 formData.isTagDict = 1
// 设置为非固定字段,为啥不清楚 // 设置为非固定字段--默认可以编辑
// formData.isReadOnly = 0 formData.isReadOnly = 0
Func(formData).then(res => { Func(formData).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -31,7 +31,7 @@
<j-table <j-table
ref="table" ref="table"
:bordered="true" :bordered="false"
size="middle" size="middle"
rowKey="id" rowKey="id"
can-drag can-drag
@@ -43,9 +43,9 @@
: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" @click="handleEdit(record)" v-if="canOpeFlag && record.isReadOnly===0" v-has="'tag:edit'" <a class="action-edit" @click="handleEdit(record)" v-if="canOpeFlag || record.isReadOnly===0" v-has="'tag:edit'"
>{{ $t('edit') }}</a> >{{ $t('edit') }}</a>
<a class="table-del" @click="handleDelete(record.id)" v-has="'tag:logicDelete'" v-if="canOpeFlag && (record.isReadOnly===2 || record.isReadOnly===0)" <a class="table-del" @click="handleDelete(record.id)" v-has="'tag:logicDelete'" v-if="canOpeFlag || (record.isReadOnly===2 || record.isReadOnly===0)"
>{{ $t('delete') }}</a> >{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
@@ -92,35 +92,35 @@ export default {
columns: [ columns: [
{ {
title: this.$t('system.tag.attributeName'), title: this.$t('system.tag.attributeName'),
align: 'left', align: 'center',
width: 200, width: 200,
dataIndex: 'dbFieldTxt', dataIndex: 'dbFieldTxt',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.attributeNameEnglish'), title: this.$t('system.tag.attributeNameEnglish'),
align: 'left', align: 'center',
width: 100, width: 100,
dataIndex: 'dbFieldEnName', dataIndex: 'dbFieldEnName',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.attributeType'), title: this.$t('system.tag.attributeType'),
align: 'left', align: 'center',
width: 100, width: 100,
dataIndex: 'fieldShowType_dictText', dataIndex: 'fieldShowType_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.fieldLength'), title: this.$t('system.tag.fieldLength'),
align: 'left', align: 'center',
width: 80, width: 80,
dataIndex: 'dbLength', dataIndex: 'dbLength',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.displayOrder'), title: this.$t('system.tag.displayOrder'),
align: 'left', align: 'center',
width: 80, width: 80,
dataIndex: 'orderNum', dataIndex: 'orderNum',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
@@ -48,6 +48,7 @@
<div> <div>
<j-table <j-table
rowKey="id" rowKey="id"
:bordered="false"
can-drag can-drag
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
@@ -181,6 +182,7 @@ export default {
}, },
refreshAreaData () { refreshAreaData () {
this.getShowAreaData() this.getShowAreaData()
this.loadData()
this.queryParam.showArea = undefined this.queryParam.showArea = undefined
} }
}, },
+42 -9
View File
@@ -30,6 +30,11 @@
<a-icon type="plus" /> <a-icon type="plus" />
{{ $t('newlyAdded') }} {{ $t('newlyAdded') }}
</div> </div>
<!--刷新缓存-->
<div class="operator-text" @click="refreshCache" v-has="'sys:dict:operation'">
<a-icon type="sync" />
{{ $t('dict.refreshCache') }}
</div>
<!--v-has="'dict:logicDeleteBatch'"--> <!--v-has="'dict:logicDeleteBatch'"-->
<div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'"> <div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'">
<a-icon type="delete" /> <a-icon type="delete" />
@@ -45,14 +50,14 @@
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:columns="columns" :columns="columns"
:scroll="{x: true}" :scroll="{x: '100%'}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ 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-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a> <a class="action-dict" @click="editDictItem(record)">{{ $t('system.tag.dictionaryConfiguration') }}</a>
<a class="action-edit" @click="handleEdit(record)" v-has="'sys:dict:operation'">{{ $t('edit') }}</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" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a> <a class="action-delete" v-if="canOpeFlag || record.isReadOnly === 0" @click="handleDelete(record.id)" v-has="'sys:dict:operation'">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
@@ -71,6 +76,9 @@ import TagContentDictListDrawer from '../modules/TagContentDictListDrawer'
import JDictSelectTag from '../../../../components/dict/JDictSelectTag' import JDictSelectTag from '../../../../components/dict/JDictSelectTag'
import { SimpleListMixin } from '../../../../mixins/SimpleListMixin' import { SimpleListMixin } from '../../../../mixins/SimpleListMixin'
import JTable from '../../../../components/jero/JTable' 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 { export default {
name: 'TagContent', name: 'TagContent',
@@ -88,21 +96,21 @@ export default {
title: this.$t('system.tag.labelName'), title: this.$t('system.tag.labelName'),
dataIndex: 'dictName', dataIndex: 'dictName',
key: 'dictName', key: 'dictName',
// align: 'left', align: 'center',
// ellipsis: true, // ellipsis: true,
width: 100, width: 100,
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.labelType'), title: this.$t('system.tag.labelType'),
align: 'left', align: 'center',
width: 100, width: 100,
dataIndex: 'attributeType_dictText', dataIndex: 'attributeType_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('system.tag.describe'), title: this.$t('system.tag.describe'),
align: 'left', align: 'center',
dataIndex: 'description', dataIndex: 'description',
ellipsis: true, ellipsis: true,
width: 200, width: 200,
@@ -110,7 +118,7 @@ export default {
}, },
{ {
title: this.$t('system.tag.displayOrder'), title: this.$t('system.tag.displayOrder'),
align: 'left', align: 'center',
width: 100, width: 100,
dataIndex: 'orderNum', dataIndex: 'orderNum',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
@@ -118,15 +126,23 @@ export default {
{ {
title: this.$t('operation'), title: this.$t('operation'),
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
align: 'left', align: 'center',
width: 170 width: 170
} }
], ],
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
// dataSource: [], // dataSource: [],
url: { url: {
list: 'sys/dict/tagDictPage', list: 'sys/dict/tagDictPage',
delete: 'sys/dict/delete', 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: { filters: {
@@ -135,6 +151,23 @@ export default {
} }
}, },
methods: { 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) { editDictItem (record) {
this.$refs.tagContentDictListDrawer.show(record) this.$refs.tagContentDictListDrawer.show(record)