NEZ-2099 fix: 新建System图表时设置显示为Legend,预览时内容为空

This commit is contained in:
zhangyu
2022-08-04 09:59:56 +08:00
parent 50759f5e9e
commit 8ae84248aa
2 changed files with 15 additions and 10 deletions

View File

@@ -333,7 +333,9 @@ export default {
deep: true, deep: true,
handler (n) { handler (n) {
if (n) { if (n) {
this.$nextTick(() => {
this.initChart && this.initChart(this.chartOption) this.initChart && this.initChart(this.chartOption)
})
} }
} }
} }

View File

@@ -120,6 +120,8 @@
:modal-append-to-body="false" :modal-append-to-body="false"
> >
<panel-chart <panel-chart
v-if="prevChart"
style="height: 100%;width: 100%"
:ref="'chart-fullscreen-previewShow'" :ref="'chart-fullscreen-previewShow'"
:chart-info="prevChart" :chart-info="prevChart"
:from="from" :from="from"
@@ -197,7 +199,7 @@ export default {
name: '' name: ''
}, },
timeRange: [], timeRange: [],
prevChart: {}, prevChart: '',
filterPanel: '', filterPanel: '',
groupArr: [], groupArr: [],
varTypeArr: [ varTypeArr: [
@@ -497,19 +499,20 @@ export default {
} }
}, },
preview (show) { preview (show) {
this.previewShow = show
if (show) { if (show) {
this.$nextTick(() => { this.prevChart = ''
setTimeout(()=>{
const start = new Date().setHours(new Date().getHours() - 1) const start = new Date().setHours(new Date().getHours() - 1)
const end = new Date() const end = new Date()
this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)] this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)]
setTimeout(() => { this.prevChart = {
this.prevChart = lodash.cloneDeep(this.editChart) ...lodash.cloneDeep(this.editChart),
this.prevChart.loaded = true loaded: true
this.prevChart.param.showHeader = true
})
})
} }
this.prevChart.param.showHeader = true
}, 200)
}
this.previewShow = show
} }
}, },
created () { created () {