CN-1273 fix: 调整内置tag字典
This commit is contained in:
@@ -187,7 +187,7 @@ import relatedServer from '@/mixins/relatedServer'
|
||||
import Loading from '@/components/common/Loading'
|
||||
import axios from 'axios'
|
||||
import { api } from '@/utils/api'
|
||||
import { entityDefaultColor, entityDetailTags, psiphon3IpType } from '@/utils/constants'
|
||||
import { entityDefaultColor, entityDetailTags, tagValueLabelMapping } from '@/utils/constants'
|
||||
import _ from 'lodash'
|
||||
import { getTagColor } from '@/utils/tools'
|
||||
|
||||
@@ -292,7 +292,7 @@ export default {
|
||||
Object.keys(res.data[k]).forEach(k2 => {
|
||||
const find = entityDetailTags[this.entity.entityType].find(t => t.name === k2)
|
||||
if (find) {
|
||||
this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(k, k2, res.data[k][k2]), type: find.type })
|
||||
this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(res.data[k][k2]), type: find.type })
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -304,16 +304,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
tagValueHandler (k, k2, value) {
|
||||
if (k === 'psiphon3Ip') {
|
||||
if (k2 === 'type') {
|
||||
const find = psiphon3IpType.find(t => t.value === value)
|
||||
if (find) {
|
||||
return find.name
|
||||
}
|
||||
}
|
||||
}
|
||||
return value
|
||||
tagValueHandler (value) {
|
||||
const find = tagValueLabelMapping.find(t => t.value === value)
|
||||
return find ? find.name : value
|
||||
},
|
||||
/* 切换折叠状态 */
|
||||
switchCollapse () {
|
||||
|
||||
Reference in New Issue
Block a user