From bb33b4c2919bc57c30b149688a6739c132078e63 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 10 Oct 2024 18:29:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BC=96=E8=BE=91=E5=8C=BA=E5=9F=9F=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=88=87=E6=8D=A2=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E6=97=B6=E9=83=A8=E5=88=86=E5=9B=BE=E8=A1=A8=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0=E5=A4=9A=E6=AC=A1=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PictureGroupDatasetSelect.vue | 18 ++++++++++++++++-- .../views/chart/components/editor/index.vue | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/custom-component/picture-group/PictureGroupDatasetSelect.vue b/core/core-frontend/src/custom-component/picture-group/PictureGroupDatasetSelect.vue index e062f2d8d4..3c3e5fb7a7 100644 --- a/core/core-frontend/src/custom-component/picture-group/PictureGroupDatasetSelect.vue +++ b/core/core-frontend/src/custom-component/picture-group/PictureGroupDatasetSelect.vue @@ -4,6 +4,7 @@ import { BASE_VIEW_CONFIG } from '@/views/chart/components/editor/util/chart' import DatasetSelect from '@/views/chart/components/editor/dataset-select/DatasetSelect.vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { useEmitt } from '@/hooks/web/useEmitt' +import { getFieldByDQ } from '@/api/chart' const snapshotStore = snapshotStoreWithOut() const props = defineProps({ @@ -23,8 +24,21 @@ const { view } = toRefs(props) const state = reactive({}) const onDatasetUpdate = () => { - useEmitt().emitter.emit('calcData-' + view.value.id, view) - snapshotStore.recordSnapshotCache('calc', view.value.id) + if (view.value.tableId && view.value.id) { + getFieldByDQ(view.value.tableId, view.value.id, { type: 'table-info' }) + .then(res => { + view.value.xAxis = [] + view.value.xAxis.push(...res.dimensionList, ...res.quotaList) + const viewTarget = view.value + useEmitt().emitter.emit('calcData-' + viewTarget.id, viewTarget) + snapshotStore.recordSnapshotCache('calc', view.value.id) + }) + .catch(() => { + // something do error + }) + } else { + view.value.xAxis = [] + } } 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 21380ad271..aaad22fba0 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -222,6 +222,9 @@ provide('quota', () => state.quota) watch( [() => view.value['tableId']], () => { + if ('picture-group' === props.view.type) { + return + } getFields(props.view.tableId, props.view.id, props.view.type) const nodeId = view.value['tableId'] if (!!nodeId) {