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 4c7e6b0f7c..e9cb0e0dca 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) {