From 8041f316d3dd8b4501986d89ee7faa5fef8fb4f0 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 24 Oct 2023 18:00:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=98=8E=E7=BB=86=E8=A1=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E5=85=B6=E4=BB=96=E5=9B=BE=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=B8=85=E7=A9=BA=E6=95=B0=E6=8D=AE=E5=88=97=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #6279 --- .../src/views/chart/view/ChartEdit.vue | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/core/frontend/src/views/chart/view/ChartEdit.vue b/core/frontend/src/views/chart/view/ChartEdit.vue index 3a01e3f495..2ea98a2432 100644 --- a/core/frontend/src/views/chart/view/ChartEdit.vue +++ b/core/frontend/src/views/chart/view/ChartEdit.vue @@ -2003,7 +2003,8 @@ export default { watchChartTypeChangeObj() { const { type, render } = this.view const isPlugin = this.isPlugin - return { type, render, isPlugin } + const id = this.chart.id + return { type, render, isPlugin, id } }, ...mapState([ 'curComponent', @@ -2042,6 +2043,18 @@ export default { }, watchChartTypeChangeObj(newVal, oldVal) { this.view.isPlugin = newVal.isPlugin + if (newVal.id === oldVal.id && newVal.type !== oldVal.type && oldVal.type === 'table-info' && this.view.xaxis.length > 0) { + // 针对明细表切换为其他图表 + this.$message({ + showClose: true, + message: this.$t('chart.table_info_switch'), + type: 'warning' + }) + this.view.xaxis = [] + } + if (newVal.id === oldVal.id && newVal.type !== oldVal.type) { + this.view.senior.threshold = {} + } if (newVal.type === oldVal.type && newVal.render === oldVal.render && newVal.isPlugin === oldVal.isPlugin) { return } @@ -2254,17 +2267,7 @@ export default { parseInt(this.view.resultCount) < 1) { this.view.resultCount = '1000' } - if (switchType) { - this.view.senior.threshold = {} - } - if (switchType && (this.view.type === 'table-info' || this.chart.type === 'table-info') && this.view.xaxis.length > 0) { - this.$message({ - showClose: true, - message: this.$t('chart.table_info_switch'), - type: 'warning' - }) - this.view.xaxis = [] - } + const view = JSON.parse(JSON.stringify(this.view)) view.id = this.view.id view.sceneId = this.view.sceneId