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) => {