From 6e19ed2dce32d048c3f59966dd7f767964239c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Mon, 19 Sep 2022 20:39:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E9=85=8D=E7=BD=AE=E4=BC=9A=E8=B0=83=E7=94=A8=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=E6=8E=A5=E5=8F=A3=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ChartDataAjax/index.vue | 37 ++++++++----------- .../components/ChartDataRequest/index.vue | 4 +- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue index 2419024f..2c03df5b 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue @@ -96,7 +96,6 @@ import { SelectHttpType } from '../../index.d' import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow' import { useTargetData } from '../../../hooks/useTargetData.hook' import { isDev, newFunctionHandle } from '@/utils' -import debounce from 'lodash/debounce' const { HelpOutlineIcon, FlashIcon, PulseIcon } = icon.ionicons5 const { targetData, chartEditStore } = useTargetData() @@ -122,27 +121,23 @@ const requestModelHandle = () => { } // 发送请求 -const sendHandle = debounce( - async () => { - if (!targetData.value?.request) return - loading.value = true - try { - const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.requestGlobalConfig)) - loading.value = false - if (res && res.data) { - targetData.value.option.dataset = newFunctionHandle(res.data, targetData.value.filter) - showMatching.value = true - return - } - window['$message'].warning('数据异常,请检查参数!') - } catch (error) { - loading.value = false - window['$message'].warning('数据异常,请检查参数!') +const sendHandle = async () => { + if (!targetData.value?.request) return + loading.value = true + try { + const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.requestGlobalConfig)) + loading.value = false + if (res && res.data) { + targetData.value.option.dataset = newFunctionHandle(res.data, targetData.value.filter) + showMatching.value = true + return } - }, - 2000, - { leading: true } -) + window['$message'].warning('数据异常,请检查参数!') + } catch (error) { + loading.value = false + window['$message'].warning('数据异常,请检查参数!') + } +} // 颜色 const themeColor = computed(() => { diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/index.vue index 258577ad..21511961 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/index.vue @@ -1,5 +1,5 @@ From 369a8ade425cd0fb3765f5c805a3928168644bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Mon, 19 Sep 2022 20:46:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=85=8D=E7=BD=AE=E4=BC=9A=E4=BA=92=E7=9B=B8?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/public/publicConfig.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index ddcc2056..2c59131e 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -10,6 +10,7 @@ import { RequestBodyEnum } from '@/enums/httpEnum' import { chartInitConfig } from '@/settings/designSetting' +import cloneDeep from 'lodash/cloneDeep' // 请求基础属性 const requestConfig: RequestConfigType = { @@ -69,7 +70,7 @@ export class PublicConfigClass implements PublicConfigType { animations: [] } // 请求 - public request = { ...requestConfig } + public request = cloneDeep(requestConfig) // 数据过滤 public filter = undefined