【update】标签管理交互的修改
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
prop="dictEnglishName"
|
||||
prop="enName"
|
||||
:label="$t('dict.dictionaryEnglishName')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('dict.dictionaryEnglishName')" v-model="model.dictEnglishName"/>
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('dict.dictionaryEnglishName')" v-model="model.enName"/>
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item
|
||||
|
||||
@@ -174,7 +174,7 @@ export default {
|
||||
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
|
||||
that.ipagination.current -= 1
|
||||
}
|
||||
this.$emit('refresh')
|
||||
that.$emit('refresh')
|
||||
that.loadData()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
|
||||
@@ -402,7 +402,7 @@ export default {
|
||||
},
|
||||
// 获取展示区域下拉框数据
|
||||
getShowAreaData () {
|
||||
getShowAreaData({ type: this.type }).then(res => {
|
||||
getShowAreaData({ isModel: this.type }).then(res => {
|
||||
if (res.success) {
|
||||
this.areaOptions = res.result || []
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
},
|
||||
getAllTree () {
|
||||
// TODO 获取所有的树形结构
|
||||
getAction(`sys/category/childList`, {
|
||||
getAction(`sys/dictItem/treeList`, {
|
||||
sysDictId: this.dictId,
|
||||
isTagDict: 1
|
||||
}).then(res => {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
:class="{'tree-table': attributeType === TagsAttributeTypeEnums.TREE.value}"
|
||||
:bordered="true"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
@@ -87,20 +88,12 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
TagsAttributeTypeEnums,
|
||||
visible: false,
|
||||
title: this.$t('system.tag.dictionaryConfiguration'),
|
||||
width: 800,
|
||||
confirmLoading: false,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.tag.name'),
|
||||
dataIndex: 'itemText',
|
||||
key: 'itemText',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
commonColumns: [
|
||||
{
|
||||
// 英文名称
|
||||
title: this.$t('system.tag.attributeNameEnglish'),
|
||||
@@ -110,13 +103,6 @@ export default {
|
||||
dataIndex: 'enName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
// {
|
||||
// title: this.$t('statisticalNodes'),
|
||||
// align: 'left',
|
||||
// dataIndex: 'statNode',
|
||||
// ellipsis: true,
|
||||
// width: 100
|
||||
// },
|
||||
{
|
||||
// 数据值
|
||||
title: this.$t('system.tag.dataValue'),
|
||||
@@ -142,9 +128,31 @@ export default {
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
treeColumn: [
|
||||
{
|
||||
title: this.$t('system.tag.name'),
|
||||
dataIndex: 'itemText',
|
||||
key: 'itemText',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 150
|
||||
}
|
||||
],
|
||||
listColumn: [
|
||||
{
|
||||
title: this.$t('system.tag.name'),
|
||||
dataIndex: 'itemText',
|
||||
key: 'itemText',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
}
|
||||
],
|
||||
columns: [],
|
||||
// 树形结构对应的接口
|
||||
treeUrl: {
|
||||
list: 'sys/category/queryPageList',
|
||||
list: 'sys/dictItem/treeList',
|
||||
delete: 'sys/category/delete',
|
||||
deleteBatch: 'sys/category/deleteBatch'
|
||||
},
|
||||
@@ -183,8 +191,10 @@ export default {
|
||||
// 不同的标签类型 调用不同的接口
|
||||
if (this.attributeType === TagsAttributeTypeEnums.SELECT.value) {
|
||||
this.url = { ...this.dictUrl }
|
||||
this.columns = [...this.listColumn, ...this.commonColumns]
|
||||
} else {
|
||||
this.url = { ...this.treeUrl }
|
||||
this.columns = [...this.treeColumn, ...this.commonColumns]
|
||||
}
|
||||
this.filters.dictId = record.id
|
||||
// todo 需要判断当前标签的类型,来决定列表页是否是树形的
|
||||
@@ -229,4 +239,18 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tree-table {
|
||||
.tree-table-content {
|
||||
.tree-table-con {
|
||||
.action-edit {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.action-delete {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
:placeholder="$t('pleaseSelect') + $t('system.tag.labelType')"/>
|
||||
</a-form-model-item>
|
||||
<!--展示顺序-->
|
||||
{{model.orderNum}}
|
||||
<a-form-model-item :label="$t('system.tag.displayOrder')" prop="orderNum" class="tag-item">
|
||||
<a-input-number v-model="model.orderNum" :placeholder="$t('pleaseEnter') + $t('system.tag.displayOrder')" style="width: 100%"
|
||||
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
|
||||
|
||||
Reference in New Issue
Block a user