【update】标签管理优化 + 文档拆分查看代码修改接口

This commit is contained in:
fengchenchen
2023-09-11 17:42:17 +08:00
parent 30f9260fff
commit 9385dbda09
12 changed files with 118 additions and 49 deletions
@@ -24,7 +24,7 @@
<a-divider dashed />
<!--所属模块-->
<a-form-model-item :label="$t('system.tag.module')" prop="isModel">
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.module')" disabled v-model="form.isModel">
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.module')" disabled v-model="form.isModel" show-search :filter-option="filterOption">
<a-select-option v-for="item in moduleArr" :key="item.value" :value="item.value">
{{ translate(item.langKey) }}
</a-select-option>
@@ -69,7 +69,12 @@
<!--选项内容-->
<a-form-model-item v-if="isTagContent" :label="$t('system.tag.optionContent')" prop="dictId" key="dictId">
<template>
<a-select :placeholder="$t('pleaseSelect') + $t('system.tag.optionContent')" v-model="form.dictId">
<a-select
:placeholder="$t('pleaseSelect') + $t('system.tag.optionContent')"
v-model="form.dictId"
show-search
:filter-option="filterOption"
>
<a-select-option v-for="item in contentOption" :key="item.id" :value="item.id">
{{ item.dictName }}
</a-select-option>
@@ -238,12 +243,16 @@ export default {
},
add () {
this.edit({
isModel: this.type
isModel: this.type,
fieldMustInput: 1,
isShowList: 1,
isQuery: 1
})
},
edit (record) {
this.$refs.editForm && this.$refs.editForm.resetFields()
this.form = Object.assign({}, record)
this.form.isModel = 4
this.isEdit = !!this.form.id
this.initData()
this.visible = true
@@ -363,6 +372,10 @@ export default {
}
}
})
},
filterOption (input, option) {
const text = option.componentOptions.children[0].text || option.componentOptions.children[0].data.attrs.title
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}
@@ -40,6 +40,8 @@
v-model="model.parentId"
:placeholder="$t('pleaseSelect')"
allowClear
showSearch
tree-node-filter-prop="title"
>
</a-tree-select>
</a-form-model-item>
@@ -147,7 +147,7 @@ export default {
/* 排序参数--按照排序字段失序 */
isorter: {
column: 'sortOrder',
order: 'ascend'
order: 'asc'
},
// 树形结构对应的接口
treeUrl: {
@@ -44,17 +44,10 @@
:scroll="{x: '100%'}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<div slot="action" class="table-action" slot-scope="text, record">
<a class="action-edit" @click="handleEdit(record)" v-has="'tag:edit'" v-if="record.isReadOnly===0"
<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'"
>{{ $t('edit') }}</a>
<a class="table-del" v-if="record.isReadOnly===2 || record.isReadOnly===0" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
<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>
@@ -93,44 +86,56 @@ export default {
filters: {
isModel: this.type
},
/* 排序参数 */
isorter: {
column: 'orderNum',
order: 'asc'
},
columns: [
{
title: this.$t('system.tag.attributeName'),
align: 'left',
width: 100,
dataIndex: 'dbFieldTxt'
// width: 100,
dataIndex: 'dbFieldTxt',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.attributeNameEnglish'),
align: 'left',
width: 100,
dataIndex: 'dbFieldEnName'
dataIndex: 'dbFieldEnName',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.attributeType'),
align: 'left',
width: 100,
dataIndex: 'fieldShowTypeName'
dataIndex: 'fieldShowType_dictText',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.fieldLength'),
align: 'left',
width: 80,
dataIndex: 'dbLength'
dataIndex: 'dbLength',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('system.tag.displayOrder'),
align: 'left',
width: 80,
dataIndex: 'orderNum'
dataIndex: 'orderNum',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'left',
align: 'center',
fixed: 'right',
width: 170
}
]
],
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0' // 是否可以操作编辑和删除,开发环境可以
}
}
}
+10 -3
View File
@@ -58,9 +58,9 @@
>
<!--todo 需要查看下是否有这个字段,并且看一下判断是否必然-->
<div slot="action" class="table-action" slot-scope="{text, record}">
<a class="action-edit" @click="handleEdit(record)" v-if="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" v-if="record.isReadOnly===2 || record.isReadOnly===0" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
<a class="table-del" v-if="canOpeFlag && (record.isReadOnly===2 || record.isReadOnly===0)" v-has="'tag:logicDelete'" @click="handleDelete(record.id)"
>{{ $t('delete') }}</a>
</div>
</j-table>
@@ -108,6 +108,11 @@ export default {
filters: {
isModel: this.type
},
/* 排序参数 */
isorter: {
column: 'orderNum',
order: 'asc'
},
columns: [
{
title: this.$t('system.tag.attributeName'),
@@ -152,7 +157,8 @@ export default {
fixed: 'right',
width: 150
}
]
],
canOpeFlag: process.env.VUE_APP_TAG_FLAG === '0' // 是否可以操作编辑和删除,开发环境可以
}
},
methods: {
@@ -174,6 +180,7 @@ export default {
}
},
created () {
console.log('-----------process.env.VUE_TAG_FLAG--------', process.env)
this.getShowAreaData()
}
}