fix:修改 asset chartInfo的显示
This commit is contained in:
@@ -43,9 +43,7 @@
|
||||
|
||||
<div class="content-item-value item-tip" :id="`value-${index}-${i}`">
|
||||
<span v-if="key == 'state'">
|
||||
<span v-if="value==1">{{ $t('asset.inStock')}}</span>
|
||||
<span v-if="value==2">{{ $t('asset.notInStock')}}</span>
|
||||
<span v-if="value==3">{{ $t('asset.suspended')}}</span>
|
||||
{{value}}
|
||||
</span>
|
||||
<span v-else-if="key == 'alert'" class="as-button" :class="{'success': value <= 0, 'danger': value > 0}">{{value + ' ' + $t('overall.active')}}</span>
|
||||
<div v-else-if="key == 'tags'" class="no-overflow" style="padding-bottom: 5px;">
|
||||
@@ -67,7 +65,7 @@
|
||||
<span v-else></span>
|
||||
</template>
|
||||
<template v-else-if="key == 'pingRtt'">
|
||||
<div class="active-icon" :class="{'green': item.data.pingStatus == 1, 'red': item.data.pingStatus == 1 != 1}"></div>
|
||||
<div class="active-icon" :class="{'green-bg': item.data.pingStatus == 1, 'red-bg': item.data.pingStatus == 1 != 1}"></div>
|
||||
<span>{{value ? value + 'ms' : ''}}</span>
|
||||
</template>
|
||||
<template v-else-if="assetKey[key]">
|
||||
|
||||
@@ -1491,7 +1491,44 @@ export default {
|
||||
// })
|
||||
Promise.all(arr).then(res => {
|
||||
console.log(res)
|
||||
// this.$refs['editChart' + chartInfo.id][0].setData(chartInfo, detail, this.filter.panelId, this.filter)
|
||||
if (res) {
|
||||
const basic = res[0].data
|
||||
// basic.cabinet = basic.cabinet ? basic.cabinet.name : '-'
|
||||
const obj = {
|
||||
purchaseDate: basic.purchaseDate,
|
||||
pingRtt: basic.pingInfo ? basic.pingInfo.rtt : '-',
|
||||
dataCenter: basic.dc ? basic.dc.name : '-',
|
||||
pingStatus: basic.pingInfo ? basic.pingInfo.status : '-',
|
||||
assetType: basic.type ? basic.type.name : '-',
|
||||
tags: basic.fields,
|
||||
cabinetStart: basic.cabinetStart,
|
||||
principal: basic.dc ? basic.dc.principal : '-',
|
||||
endpoint: basic.endpointNum,
|
||||
cabinetEnd: basic.cabinetEnd,
|
||||
alert: basic.alertNum,
|
||||
vendor: basic.brand ? basic.brand.name : '-',
|
||||
pingLastReply: basic.pingInfo ? basic.pingInfo.lastUpdate : '-',
|
||||
host: basic.pingInfo ? basic.pingInfo.host : '-',
|
||||
tel: basic.tel,
|
||||
model: basic.model ? basic.model.name : '-',
|
||||
id: basic.id,
|
||||
sn: basic.sn,
|
||||
state: basic.state ? basic.state.name : '-',
|
||||
cabinet: basic.cabinet ? basic.cabinet.name : '-'
|
||||
}
|
||||
console.log(obj)
|
||||
basic && detail.push({
|
||||
title: vm.$t('project.chart.basicTitle'),
|
||||
type: 'basic',
|
||||
data: obj
|
||||
})
|
||||
res[1] && detail.push({
|
||||
title: vm.$t('asset.featureTitle'),
|
||||
type: 'attribute',
|
||||
data: res[1].data
|
||||
})
|
||||
}
|
||||
this.$refs['editChart' + chartInfo.id][0].setData(chartInfo, detail, this.filter.panelId, this.filter)
|
||||
})
|
||||
} else {
|
||||
detail.push({
|
||||
|
||||
Reference in New Issue
Block a user