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