From 3a1701051f16b293ebbac792cdec536e060bf6a6 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:45:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20S2=E6=8A=A5=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/store/index.js | 2 +- frontend/src/views/chart/chart/table/table-info.js | 14 -------------- .../views/chart/components/ChartComponentS2.vue | 9 --------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 2540e3bff7..c7fded233e 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -263,7 +263,7 @@ const data = { } else { state.componentData.push(component) } - this.commit('setCurComponent', { component: component, index: index ? index : state.componentData.length - 1 }) + this.commit('setCurComponent', { component: component, index: index || state.componentData.length - 1 }) }, removeViewFilter(state, componentId) { state.componentData = state.componentData.map(item => { diff --git a/frontend/src/views/chart/chart/table/table-info.js b/frontend/src/views/chart/chart/table/table-info.js index 2324b6b0fd..1225886c54 100644 --- a/frontend/src/views/chart/chart/table/table-info.js +++ b/frontend/src/views/chart/chart/table/table-info.js @@ -3,7 +3,6 @@ import { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart' import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' import { hexColorToRGBA } from '@/views/chart/chart/util' -import Vue from 'vue' export function baseTableInfo(s2, container, chart, action, tableData) { const containerDom = document.getElementById(container) @@ -12,7 +11,6 @@ export function baseTableInfo(s2, container, chart, action, tableData) { if (!fields || fields.length === 0) { if (s2) { s2.destroy() - destroyS2() } return } @@ -140,7 +138,6 @@ export function baseTableInfo(s2, container, chart, action, tableData) { // 开始渲染 if (s2) { s2.destroy() - destroyS2 } s2 = new TableSheet(containerDom, s2DataConfig, s2Options) @@ -163,7 +160,6 @@ export function baseTableNormal(s2, container, chart, action, tableData) { if (!fields || fields.length === 0) { if (s2) { s2.destroy() - destroyS2 } return } @@ -278,7 +274,6 @@ export function baseTableNormal(s2, container, chart, action, tableData) { // 开始渲染 if (s2) { s2.destroy() - destroyS2() } s2 = new TableSheet(containerDom, s2DataConfig, s2Options) @@ -315,7 +310,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) { if (!fields || fields.length === 0) { if (s2) { s2.destroy() - destroyS2() } return } @@ -437,7 +431,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) { // 开始渲染 if (s2) { s2.destroy() - destroyS2() } s2 = new PivotSheet(containerDom, s2DataConfig, s2Options) @@ -451,13 +444,6 @@ export function baseTablePivot(s2, container, chart, action, tableData) { return s2 } -function destroyS2(s2) { - for (const i in s2) { - Vue.$delete(s2, i) - } - s2 = null -} - function getCurrentField(valueFieldList, field) { let list = [] let res = null diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue index 8c55c3a9ce..9a37f67555 100644 --- a/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/frontend/src/views/chart/components/ChartComponentS2.vue @@ -225,7 +225,6 @@ export default { }, beforeDestroy() { clearInterval(this.scrollTimer) - this.destroyS2() }, methods: { initData() { @@ -268,13 +267,6 @@ export default { }) } }, - destroyS2() { - if (!this.myChart) return - for (const i in this.myChart) { - this.$delete(this.myChart, i) - } - this.myChart = null - }, drawView() { const chart = this.chart // type @@ -300,7 +292,6 @@ export default { if (this.myChart) { this.antVRenderStatus = false this.myChart.destroy() - this.destroyS2() } }