fix:修改panel页面导入之后不显示的问题

This commit is contained in:
zhangyu
2022-03-08 10:01:10 +08:00
parent 306fcce990
commit 19b89fe2bd
4 changed files with 16 additions and 4 deletions

View File

@@ -67,7 +67,7 @@ export default {
}
this.tableTimer = setTimeout(() => {
this.columns = this.chartInfo.param.columns
this.chartInfo.param.valueMapping.forEach((item) => {
this.chartInfo.param.valueMapping && this.chartInfo.param.valueMapping.forEach((item) => {
if (this.valueMapping[item.column]) {
this.valueMapping[item.column].push(item)
} else {

View File

@@ -163,7 +163,7 @@ export default {
},
selectMapping (value, valueMapping, show) {
let mapping = ''
if (show) {
if (show && valueMapping) {
valueMapping.forEach(item => {
if (item.type === 'value') {
if (value == item.value) {

View File

@@ -445,7 +445,15 @@ export default {
deep: true,
immediate: true,
handler (n) {
this.editChart = JSON.parse(JSON.stringify(n))
const obj = JSON.parse(JSON.stringify(n))
console.log(obj)
if (obj.param && !obj.param.valueMapping) {
obj.param.valueMapping = []
}
if (obj.param && !obj.param.thresholds) {
obj.param.thresholds = []
}
this.editChart = obj
if (this.editChart.groupId === -1) {
this.editChart.groupId = ''
}

View File

@@ -60,7 +60,7 @@
export-file-name="chart"
export-url="/visual/panel/export"
import-url="/visual/panel/import"
@afterImport="dateChange"
@afterImport="afterImport"
>
<template v-slot:before>
<el-dropdown-item>
@@ -812,6 +812,10 @@ export default {
if (type === 'duplicate') {
this.editChart(chartInfo, true)
}
},
afterImport () {
this.dateChange()
this.panelReloadOnlyPanel()
}
},
created () {