perf: 优化资产、网关列表页面显示 labels 信息不全的问题

This commit is contained in:
Bai 2023-05-15 19:01:23 +08:00 committed by Jiangjie.Bai
parent c4ad25bfe3
commit 1fdcf9ff75
3 changed files with 23 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<template>
<div>
<el-tag
v-for="tag of cellValue"
v-for="tag of iTags"
:key="tag"
:type="getTagType(tag)"
class="tag-formatter"
@ -24,6 +24,9 @@ export default {
return {
getTagType(tag) {
return 'primary'
},
getTags(cellValue) {
return cellValue
}
}
}
@ -34,6 +37,11 @@ export default {
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
}
},
computed: {
iTags() {
return this.formatterArgs.getTags(this.cellValue)
}
},
methods: {
getTagType(tag) {
return this.formatterArgs.getTagType(tag)

View File

@ -164,8 +164,13 @@ export default {
}
},
connectivity: connectivityMeta,
labels_display: {
formatter: TagsFormatter
labels: {
formatter: TagsFormatter,
formatterArgs: {
getTags(cellValue) {
return cellValue.map(item => `${item.name}:${item.value}`)
}
}
},
actions: {
formatter: ActionsFormatter,

View File

@ -78,8 +78,13 @@ export default {
nodes_display: {
formatter: ArrayFormatter
},
labels_display: {
formatter: TagsFormatter
labels: {
formatter: TagsFormatter,
formatterArgs: {
getTags(cellValue) {
return cellValue.map(item => `${item.name}:${item.value}`)
}
}
},
connectivity: connectivityMeta,
actions: {