From 940e812ce6b1ee4ff22ad92d73690cfa81fca522 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 9 Dec 2025 10:41:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):?= =?UTF-8?q?=20=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=EF=BC=8C=E5=9B=BE=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E8=AF=B7=E6=B1=82=E6=AF=94=E6=9F=A5=E8=AF=A2=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=90=8E=E5=AE=8C=E6=88=90=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/config/axios/service.ts | 15 ++++++++++++--- .../src/views/chart/components/views/index.vue | 9 ++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/config/axios/service.ts b/core/core-frontend/src/config/axios/service.ts index 7f2a86f964..6e5be8971c 100644 --- a/core/core-frontend/src/config/axios/service.ts +++ b/core/core-frontend/src/config/axios/service.ts @@ -138,9 +138,18 @@ service.interceptors.request.use( config.params = {} config.url = url } - config.cancelToken = new CancelToken(function executor(c) { - cancelMap[config.url] = c - }) + + if (config.url.endsWith('chartData/getData')) { + const chartKey = `chartData/getData/${(config.data as any).id}` + config.cancelToken = new CancelToken(function executor(c) { + cancelMap[chartKey] = c + }) + } else { + config.cancelToken = new CancelToken(function executor(c) { + cancelMap[config.url] = c + }) + } + config.loading && tryShowLoading(permissionStore.getCurrentPath) return config }, 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 d9fac142cf..c1c35bba58 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -2,6 +2,7 @@ import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' import icon_linkRecord_outlined from '@/assets/svg/icon_link-record_outlined.svg' import icon_viewinchat_outlined from '@/assets/svg/icon_viewinchat_outlined.svg' +import { cancelRequestBatch } from '@/config/axios/service' import icon_drilling_outlined from '@/assets/svg/icon_drilling_outlined.svg' import { useI18n } from '@/hooks/web/useI18n' import ChartComponentG2Plot from './components/ChartComponentG2Plot.vue' @@ -571,6 +572,12 @@ const jumpClick = param => { } } +const queryDataFromSelect = (firstLoad = false) => { + cancelRequestBatch(`chartData/getData/${view.value.id}`) + loading.value = false + queryData(firstLoad) +} + const queryData = debounce((firstLoad = false) => { if (loading.value) { return @@ -619,7 +626,7 @@ onBeforeMount(() => { nextTick(() => { useEmitt({ name: `query-data-${view.value.id}`, - callback: queryData + callback: queryDataFromSelect }) }) }