NEZ-864 fix: 修复alert message列表 lables展示问题

This commit is contained in:
@changcode
2021-07-23 16:16:01 +08:00
parent 48cc2ae1fe
commit aae5b4cb8e
4 changed files with 7 additions and 11 deletions

View File

@@ -182,7 +182,7 @@ export default {
},
methods: {
labelsSort (obj) {
const buildIn = ['asset', 'endpoint', 'module', 'project', 'datacenter']
const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']
const labels = JSON.parse(JSON.stringify(obj))
const result = []
for (const key of buildIn) {

View File

@@ -87,7 +87,7 @@
</nz-alert-tag>
</span>
<alertLabel
v-if="(item.label === 'asset' ||item.label === 'module' || item.label === 'project'||item.label === 'endpoint') && scope.row[item.label] && scope.row[item.label].loading"
v-if="(item.label === 'asset' ||item.label === 'module' || item.label === 'project'||item.label === 'endpoint' ||item.label === 'cpu' ||item.label === 'user' ||item.label === 'parent_asset') && scope.row[item.label] && scope.row[item.label].loading"
:id="scope.row[item.label].id"
:that="scope.row[item.label]"
:type="item.label"
@@ -222,12 +222,8 @@ export default {
},
computed: {
tagType () {
return (key) => {
if (key == 'asset' || key == 'module' || key == 'project' || key == 'datacenter' || key == 'endpoint') {
return 'normal'
} else {
return 'info'
}
return () => {
return 'normal'
}
},
tagValue () {
@@ -265,7 +261,7 @@ export default {
})
},
labelsSort (obj) {
const buildIn = ['asset', 'endpoint', 'module', 'project', 'datacenter']
const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']
if (typeof obj === 'string') obj = JSON.parse(obj)
const labels = JSON.parse(JSON.stringify(obj))
const result = []

View File

@@ -228,7 +228,7 @@ export default {
},
methods: {
labelsSort (obj) {
const buildIn = ['asset', 'endpoint', 'module', 'project', 'datacenter']
const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']
const labels = JSON.parse(JSON.stringify(obj))
const result = []
for (const key of buildIn) {

View File

@@ -1,6 +1,6 @@
<template>
<span class="nz-alert-tag" :class="['nz-alert-tag_' + type]" :style="{cursor: cursorPoint ? 'pointer' : 'default'}" @click="$emit('click')">
<span class="nz-alert-tag__label"> {{label}}</span>
<span class="nz-alert-tag__label"> {{label}}</span>
<span class="nz-alert-tag__content"><span v-if="!!regex"> ~ </span> <slot></slot></span>
</span>
</template>