mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 21:12:33 +08:00
fix( 查询组件): 查询组件绑定图表,图表查询的请求比查询组件后完成,导致数据不能正常加载。
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
@@ -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
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user