diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index 459a17b4c5..f1d94e7a7b 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -53,7 +53,7 @@ const props = defineProps({ const { element, view, scale } = toRefs(props) const { t } = useI18n() const dvMainStore = dvMainStoreWithOut() -const { curComponent, canvasViewInfo, mobileInPc } = storeToRefs(dvMainStore) +const { curComponent, canvasViewInfo, mobileInPc, firstLoadMap } = storeToRefs(dvMainStore) const canEdit = ref(false) const queryConfig = ref() const defaultStyle = { @@ -299,7 +299,7 @@ const queryData = () => { return } if (!emitterList.length) return - + dvMainStore.setFirstLoadMap([...new Set([...emitterList, ...firstLoadMap.value])]) emitterList.forEach(ele => { emitter.emit(`query-data-${ele}`) }) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index 9294ddfeac..401f9a4c1c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -30,6 +30,7 @@ export const dvMainStore = defineStore('dataVisualization', { }, editMode: 'edit', // 编辑器模式 edit preview mobileInPc: false, + firstLoadMap: [], canvasStyleData: { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null }, // 当前展示画布缓存数据 componentDataCache: null, @@ -170,6 +171,9 @@ export const dvMainStore = defineStore('dataVisualization', { setPublicLinkStatus(value) { this.publicLinkStatus = value }, + setFirstLoadMap(value) { + this.firstLoadMap = value + }, setDataPrepareState(value) { this.dataPrepareState = value }, 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 b815568c9a..724a6b67b4 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -383,7 +383,8 @@ const queryData = (firstLoad = false) => { if (loading.value) { return } - const queryFilter = filter(firstLoad) + const searched = dvMainStore.firstLoadMap.includes(element.value.id) + const queryFilter = filter(searched ? false : firstLoad) let params = cloneDeep(view.value) params['chartExtRequest'] = queryFilter chartExtRequest.value = queryFilter