【update】标签管理对应bug的修改2
This commit is contained in:
@@ -50,7 +50,8 @@ module.exports = {
|
||||
dataValue: '数据值',
|
||||
parentName: '父级名称',
|
||||
select: '下拉选择',
|
||||
tree: '树形结构'
|
||||
tree: '树形结构',
|
||||
pleaseEnterYourEnglishName: '请输入英文字段名称'
|
||||
},
|
||||
// 内部工作组
|
||||
internalWorkGroup: {
|
||||
|
||||
@@ -51,7 +51,8 @@ module.exports = {
|
||||
dataValue: '数据值',
|
||||
parentName: '父级名称',
|
||||
select: '下拉选择',
|
||||
tree: '树形结构'
|
||||
tree: '树形结构',
|
||||
pleaseEnterYourEnglishName: '请输入英文字段名称'
|
||||
},
|
||||
// 内部工作组
|
||||
internalWorkGroup: {
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
>
|
||||
<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" @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-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>
|
||||
@@ -131,6 +131,7 @@ export default {
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0', // 是否可以操作编辑和删除,开发环境可以
|
||||
dict: '',
|
||||
labelCol: {
|
||||
xs: { span: 8 },
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
: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') }}
|
||||
</a-form-model-item>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
prop="dictName"
|
||||
required
|
||||
: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
|
||||
@@ -26,7 +26,7 @@
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="dictEnglishName"
|
||||
: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
|
||||
@@ -35,14 +35,19 @@
|
||||
prop="dictCode"
|
||||
required
|
||||
: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
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
: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>
|
||||
@@ -128,6 +133,8 @@ export default {
|
||||
}
|
||||
// 重要,设置为数据字典内容
|
||||
formData.isTagDict = 0
|
||||
// 设置为非固定字段--默认可以编辑
|
||||
formData.isReadOnly = 0
|
||||
obj(formData).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<!--展示区域-->
|
||||
<a-form-model-item :label="$t('system.tag.showArea')" prop="showArea">
|
||||
<a-input
|
||||
v-model="model.showArea"
|
||||
v-model.trim="model.showArea"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.showArea')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="50"
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="enName">
|
||||
<a-input
|
||||
v-model="model.enName"
|
||||
v-model.trim="model.enName"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="50"
|
||||
@@ -41,7 +41,7 @@
|
||||
</a-form-model-item>
|
||||
<!--排序值-->
|
||||
<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')}}
|
||||
</a-form-model-item>
|
||||
<!--<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum">-->
|
||||
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
methods: {
|
||||
show () {
|
||||
this.visible = true
|
||||
this.loadData()
|
||||
this.loadData(1)
|
||||
},
|
||||
handleOk () {},
|
||||
// 关闭
|
||||
|
||||
@@ -34,25 +34,25 @@
|
||||
<!-- 属性名称-->
|
||||
<a-form-model-item :label="$t('system.tag.attributeName')" prop="dbFieldTxt">
|
||||
<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()"
|
||||
:maxLength="120"
|
||||
:maxLength="50"
|
||||
></a-input>
|
||||
</a-form-model-item>
|
||||
<!-- 英文名称-->
|
||||
<a-form-model-item :label="$t('system.tag.attributeNameEnglish')" prop="dbFieldEnName">
|
||||
<a-input
|
||||
v-model="form.dbFieldEnName"
|
||||
v-model.trim="form.dbFieldEnName"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.attributeNameEnglish')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="120"
|
||||
:maxLength="50"
|
||||
></a-input>
|
||||
</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-input
|
||||
v-model="form.dbFieldName"
|
||||
v-model.trim="form.dbFieldName"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.fieldName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="120"
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
<!--字段长度 key 值必须加,解决验证错位的问题-->
|
||||
<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')"
|
||||
style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-model-item>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
// 获取选项内容
|
||||
|
||||
@@ -73,8 +73,9 @@
|
||||
dictCode="field_show_type"
|
||||
:placeholder="$t('pleaseSelect') + $t('system.tag.attributeType')"
|
||||
:disabled="disabledEdit"
|
||||
@change="form.dictId = undefined"
|
||||
@change="fieldShowTypeChange"
|
||||
/>
|
||||
<!-- @change="form.dictId = undefined"-->
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
@@ -93,7 +94,7 @@
|
||||
<!--字段长度 key 值必须加,解决验证错位的问题-->
|
||||
<a-col :span="24" v-if="isLength">
|
||||
<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')"
|
||||
style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-model-item>
|
||||
@@ -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]
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<a-form-model-item :label="$t('system.tag.labelItemName')" prop="dictName" class="tag-item">
|
||||
<a-input
|
||||
:maxLength="50"
|
||||
v-model="model.dictName"
|
||||
v-model.trim="model.dictName"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.labelItemName')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<a-input
|
||||
:maxLength="50"
|
||||
:placeholder="$t('pleaseEnter') + $t('dict.dictionaryNumber')"
|
||||
v-model="model.dictCode"
|
||||
v-model.trim="model.dictCode"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
@@ -42,11 +42,10 @@
|
||||
</a-form-model-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"
|
||||
:maxLength="500"
|
||||
:placeholder="$t('pleaseEnter') + $t('system.tag.describe')"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<j-table
|
||||
ref="table"
|
||||
:bordered="true"
|
||||
:bordered="false"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
can-drag
|
||||
@@ -43,9 +43,9 @@
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
</j-table>
|
||||
@@ -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' }
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<div>
|
||||
<j-table
|
||||
rowKey="id"
|
||||
:bordered="false"
|
||||
can-drag
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
@@ -181,6 +182,7 @@ export default {
|
||||
},
|
||||
refreshAreaData () {
|
||||
this.getShowAreaData()
|
||||
this.loadData()
|
||||
this.queryParam.showArea = undefined
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
<a-icon type="plus" />
|
||||
{{ $t('newlyAdded') }}
|
||||
</div>
|
||||
<!--刷新缓存-->
|
||||
<div class="operator-text" @click="refreshCache" v-has="'sys:dict:operation'">
|
||||
<a-icon type="sync" />
|
||||
{{ $t('dict.refreshCache') }}
|
||||
</div>
|
||||
<!--v-has="'dict:logicDeleteBatch'"-->
|
||||
<div class="operator-text" @click="batchDel" v-has="'sys:dict:operation'">
|
||||
<a-icon type="delete" />
|
||||
@@ -45,14 +50,14 @@
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:scroll="{x: true}"
|
||||
:scroll="{x: '100%'}"
|
||||
:row-selection="{ 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" @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-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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user