mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-11 19:41:55 +00:00
perf: 优化资产、网关列表页面显示 labels 信息不全的问题
This commit is contained in:
parent
c4ad25bfe3
commit
1fdcf9ff75
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-for="tag of cellValue"
|
v-for="tag of iTags"
|
||||||
:key="tag"
|
:key="tag"
|
||||||
:type="getTagType(tag)"
|
:type="getTagType(tag)"
|
||||||
class="tag-formatter"
|
class="tag-formatter"
|
||||||
@ -24,6 +24,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
getTagType(tag) {
|
getTagType(tag) {
|
||||||
return 'primary'
|
return 'primary'
|
||||||
|
},
|
||||||
|
getTags(cellValue) {
|
||||||
|
return cellValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,6 +37,11 @@ export default {
|
|||||||
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
|
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
iTags() {
|
||||||
|
return this.formatterArgs.getTags(this.cellValue)
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTagType(tag) {
|
getTagType(tag) {
|
||||||
return this.formatterArgs.getTagType(tag)
|
return this.formatterArgs.getTagType(tag)
|
||||||
|
@ -164,8 +164,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
connectivity: connectivityMeta,
|
connectivity: connectivityMeta,
|
||||||
labels_display: {
|
labels: {
|
||||||
formatter: TagsFormatter
|
formatter: TagsFormatter,
|
||||||
|
formatterArgs: {
|
||||||
|
getTags(cellValue) {
|
||||||
|
return cellValue.map(item => `${item.name}:${item.value}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
formatter: ActionsFormatter,
|
formatter: ActionsFormatter,
|
||||||
|
@ -78,8 +78,13 @@ export default {
|
|||||||
nodes_display: {
|
nodes_display: {
|
||||||
formatter: ArrayFormatter
|
formatter: ArrayFormatter
|
||||||
},
|
},
|
||||||
labels_display: {
|
labels: {
|
||||||
formatter: TagsFormatter
|
formatter: TagsFormatter,
|
||||||
|
formatterArgs: {
|
||||||
|
getTags(cellValue) {
|
||||||
|
return cellValue.map(item => `${item.name}:${item.value}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
connectivity: connectivityMeta,
|
connectivity: connectivityMeta,
|
||||||
actions: {
|
actions: {
|
||||||
|
Loading…
Reference in New Issue
Block a user