From 3f3f54f3b78e329d10d01e5bb2448e8b09153bf6 Mon Sep 17 00:00:00 2001 From: limingz <739803697@qq.com> Date: Fri, 10 Mar 2023 13:46:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A7=E4=BB=B6=E5=8A=A0=E5=85=A5Hea?= =?UTF-8?q?der=20=E5=8F=82=E6=95=B0=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/events.hook.ts | 9 +++++++-- .../components/ChartEvebtInteraction/index.vue | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/hooks/events.hook.ts b/src/hooks/events.hook.ts index 669f5668..e99480c6 100644 --- a/src/hooks/events.hook.ts +++ b/src/hooks/events.hook.ts @@ -15,9 +15,14 @@ export const eventsCreate = (chartConfig: CreateComponentType, useChartEditStore if (fnOnEvevnt.length === 0) return fnOnEvevnt.forEach((item) => { const index = chartEditStore.fetchTargetIndex(item.components) - const { Params } = toRefs(chartEditStore.componentList[index].request.requestParams) + const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams) Object.keys(item.fn).forEach((key) => { - Params.value[key] = param[item.fn[key]] + if (Params.value[key]) { + Params.value[key] = param[item.fn[key]] + } + if (Header.value[key]) { + Header.value[key] = param[item.fn[key]] + } }) }) } \ No newline at end of file diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEvebtInteraction/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEvebtInteraction/index.vue index 0526f50d..f6980427 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEvebtInteraction/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEvebtInteraction/index.vue @@ -37,7 +37,16 @@ + + + + + @@ -70,9 +79,9 @@ const option = computed(() => { return chartEditStore.componentList[chartEditStore.fetchTargetIndex()].option }) // 绑定组件数据request -const fnGetRequest = (id: string | undefined) => { +const fnGetRequest = (id: string | undefined, key: 'Params' | 'Header') => { if (!id) return {} - return chartEditStore.componentList[chartEditStore.fetchTargetIndex(id)]?.request.requestParams.Params + return chartEditStore.componentList[chartEditStore.fetchTargetIndex(id)]?.request.requestParams[key] } const fnDimensionsAndSource = (on: any) => {