From 50b83c75f55293cfa58fd2fa1e15c83142b60353 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 25 Oct 2023 10:32:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=A6=96=E6=AC=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9B=BE=E8=A1=A8=E7=9A=84=E5=9B=BE=E6=A0=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=97=B6=E6=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/custom-component/component-list.ts | 1 + .../src/views/chart/components/editor/index.vue | 7 ++++++- .../src/views/chart/components/views/index.vue | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index 330e3bd9f1..78f0ed76ae 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -211,6 +211,7 @@ for (let i = 0, len = list.length; i < len; i++) { const item = list[i] item.style = { ...commonStyle, ...item.style } item['commonBackground'] = deepCopy(COMMON_COMPONENT_BACKGROUND_BASE) + item['state'] = 'prepare' list[i] = { ...commonAttr, ...item } } diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index 2dbecc1930..c17ae8a7c8 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -525,6 +525,11 @@ const calcData = (view, resetDrill = false, updateQuery = '') => { } } +const updateChartData = view => { + curComponent.value['state'] = 'ready' + calcData(view, true, 'updateQuery') +} + const renderChart = view => { useEmitt().emitter.emit('renderChart-' + view.id, view) snapshotStore.recordSnapshotCache('renderChart', view.id) @@ -1637,7 +1642,7 @@ const onRefreshChange = val => { {{ t('chart.update_chart_data') }} diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index ca58eec789..510b2eb7e0 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -490,7 +490,7 @@ const loadingFlag = computed(() => { const chartAreaShow = computed(() => { return ( - view.value.tableId || + (view.value.tableId && element.value['state'] === 'ready') || view.value.type === 'rich-text' || (view.value.type === 'map' && view.value.customAttr.map.id) )