fix:修改 asset chart相关bug
This commit is contained in:
@@ -48,12 +48,12 @@
|
||||
<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;">
|
||||
<template v-if="value && value.length > 0">
|
||||
<nz-alert-tag :label="tagItem.tag" type="normal" style="margin: 5px 5px 0 0; vertical-align: middle;"
|
||||
<nz-alert-tag :label="tagItem.name" type="normal" style="margin: 5px 5px 0 0; vertical-align: middle;"
|
||||
:cursor-point="false"
|
||||
:key="tagItem.id"
|
||||
v-for="(tagItem, tagIndex) in value">
|
||||
<div :id="`tag-${index}-${tagIndex}`" class="tag-value">
|
||||
<span class="content-text">{{tagItem.value}}</span>
|
||||
<span class="content-text">{{tagItem.value.join(',')}}</span>
|
||||
</div>
|
||||
</nz-alert-tag>
|
||||
</template>
|
||||
@@ -328,9 +328,9 @@ export default {
|
||||
model: this.$t('asset.model'),
|
||||
vendor: this.$t('asset.vendor'),
|
||||
purchaseDate: this.$t('asset.procurementDate'),
|
||||
principal: this.$t('asset.principal'),
|
||||
tel: this.$t('asset.principalTel'),
|
||||
pingStatus: this.$t('asset.assetPing'),
|
||||
// principal: this.$t('asset.principal'),
|
||||
// tel: this.$t('asset.principalTel'),
|
||||
// pingStatus: this.$t('asset.assetPing'),
|
||||
pingLastReply: this.$t('asset.lastReply'),
|
||||
endpoint: this.$t('asset.modules'),
|
||||
alert: this.$t('asset.alerts'),
|
||||
@@ -473,6 +473,7 @@ export default {
|
||||
this.panelIdInner = panelId
|
||||
this.data = chartItem
|
||||
this.detail = detail
|
||||
console.log(detail);
|
||||
if (this.detail[0] && this.detail[0].type && this.detail[0].type == 'endpointInfo') { // endpointInfo的小图表
|
||||
this.$nextTick(() => {
|
||||
this.initChart(this.detail[0].data.stateSeries)
|
||||
|
||||
@@ -1495,26 +1495,26 @@ export default {
|
||||
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,
|
||||
host: basic.pingInfo ? basic.pingInfo.host : '-',
|
||||
assetType: basic.type ? basic.type.name : '-',
|
||||
state: basic.state ? basic.state.name : '-',
|
||||
cabinet: basic.cabinet ? basic.cabinet.name : '-'
|
||||
pingRtt: basic.pingInfo ? basic.pingInfo.rtt : '',
|
||||
dataCenter: basic.dc ? basic.dc.name : '-',
|
||||
cabinet: basic.cabinet ? basic.cabinet.name : '-',
|
||||
alert: basic.alertNum,
|
||||
endpoint: basic.endpointNum,
|
||||
purchaseDate: basic.purchaseDate,
|
||||
vendor: basic.brand ? basic.brand.name : '-',
|
||||
model: basic.model ? basic.model.name : '-',
|
||||
sn: basic.sn,
|
||||
tags: basic.fields,
|
||||
pingStatus: basic.pingInfo ? basic.pingInfo.status : '-',
|
||||
cabinetStart: basic.cabinetStart,
|
||||
cabinetEnd: basic.cabinetEnd,
|
||||
pingLastReply: basic.pingInfo ? basic.pingInfo.lastUpdate : ''
|
||||
// principal: basic.dc ? basic.dc.principal : '-',
|
||||
// tel: basic.tel,
|
||||
}
|
||||
console.log(obj)
|
||||
basic && detail.push({
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
export-url="visual/panel/export"
|
||||
import-url="visual/panel/import"
|
||||
@afterImport="getTableData"
|
||||
:showLock="from === fromRoute.asset"
|
||||
@panelLockChange="panelLockChange"
|
||||
>
|
||||
</top-tool-more-options>
|
||||
</template>
|
||||
@@ -276,7 +278,7 @@ export default {
|
||||
} else {
|
||||
if (this.from == this.$CONSTANTS.fromRoute.chartTemp) {
|
||||
if (this.obj.type === 'group') {
|
||||
this.$get('/visual/panel/chart', { ids: this.obj.id,groupId:0}).then(res => {
|
||||
this.$get('/visual/panel/chart', { ids: this.obj.id, groupId: 0 }).then(res => {
|
||||
this.panelDataList = res.data.list
|
||||
if (this.panelDataList.length > 0) {
|
||||
this.showPanel.id = this.filter.panelId = 0
|
||||
@@ -428,6 +430,9 @@ export default {
|
||||
},
|
||||
tableListLeave () {
|
||||
this.tableHover = false
|
||||
},
|
||||
panelLockChange (boolean) {
|
||||
this.panelLock = boolean
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -106,6 +106,7 @@ const cn = {
|
||||
moreOption: '更多选项',
|
||||
copy: '复制',
|
||||
silence: '静默',
|
||||
labels: '标签',
|
||||
},
|
||||
setup: {
|
||||
step0: '欢迎',
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<i class="nz-icon nz-icon-arrow-down" style="font-size: 12px;"></i>
|
||||
</button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<!-- <el-dropdown-item>
|
||||
<el-dropdown-item v-if="showLock">
|
||||
<div @click="panelLock=!panelLock" id="panel-lock"><i :class="{'nz-icon nz-icon-lock':panelLock,'nz-icon nz-icon-unlock':!panelLock}"></i>{{panelLock ? 'Locked' : 'Unlocked'}}</div>
|
||||
</el-dropdown-item>-->
|
||||
</el-dropdown-item>
|
||||
<slot name="before"></slot>
|
||||
<el-dropdown-item v-if="importUrl">
|
||||
<div id="chart-import" @click="showImportBox(1)"><i class="nz-icon nz-icon-upload"></i>{{$t('overall.importExcel')}}</div>
|
||||
@@ -125,6 +125,9 @@ export default {
|
||||
triggerButtonClass: { // 触发下拉事件的按钮的class
|
||||
type: String,
|
||||
default: 'top-tool-btn'
|
||||
},
|
||||
showLock: {
|
||||
type: Boolean, default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -134,7 +137,8 @@ export default {
|
||||
importFileList: [],
|
||||
importResult: null,
|
||||
exportShow: false,
|
||||
paramsType: ''
|
||||
paramsType: '',
|
||||
panelLock: true
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -348,6 +352,14 @@ export default {
|
||||
default: this.paramsType = ''; break
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
panelLock: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
this.$emit('panelLockChange', n)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -480,7 +480,7 @@ export default {
|
||||
blankLabelValue (label) {
|
||||
if (label.type.toUpperCase() === this.assetConstants.labelTypeData.CHECKBOX) {
|
||||
return []
|
||||
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.MULTITEXT) {
|
||||
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.MULTITEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXTAREA) {
|
||||
return ['']
|
||||
} else {
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user