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.tableTimer = setTimeout(() => {
this.columns = this.chartInfo.param.columns 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]) { if (this.valueMapping[item.column]) {
this.valueMapping[item.column].push(item) this.valueMapping[item.column].push(item)
} else { } else {

View File

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

View File

@@ -445,7 +445,15 @@ export default {
deep: true, deep: true,
immediate: true, immediate: true,
handler (n) { 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) { if (this.editChart.groupId === -1) {
this.editChart.groupId = '' this.editChart.groupId = ''
} }

View File

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