From 71acbc61883fb9cf5ea141f374692074818f1368 Mon Sep 17 00:00:00 2001 From: Ming <739803697@qq.com> Date: Wed, 7 Jun 2023 15:13:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=84=E4=BB=B6=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=AF=B9=E5=85=AC=E5=85=B1api=E6=94=AF=E6=8C=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChartEventInteraction/index.vue | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteraction/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteraction/index.vue index b5a74bd4..614b3d15 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteraction/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteraction/index.vue @@ -58,7 +58,7 @@ - 不支持「静态组件」 + 不支持「静态组件」支持「组件」「公共APi」 - 关联目标组件请求参数 + 关联目标请求参数 { // 绑定组件数据 request const fnGetRequest = (id: string | undefined, key: RequestParamsTypeEnum) => { if (!id) return {} + const globalConfigPindApr = chartEditStore.requestGlobalConfig.requestDataPond.find(item => { + return item.dataPondId === id + })?.dataPondRequestConfig.requestParams + + if (globalConfigPindApr) return globalConfigPindApr[key] return chartEditStore.componentList[chartEditStore.fetchTargetIndex(id)]?.request.requestParams[key] } @@ -178,12 +183,10 @@ const fnEventsOptions = (): Array => { iter: Array, val: CreateComponentType | CreateComponentGroupType ) => { - if (val.groupList && val.groupList.length > 0) { - iter.push(val) - } else { + if (!val.groupList && val.request.requestDataType === RequestDataTypeEnum.AJAX && val.request.requestUrl) { iter.push(val) } - return val.groupList ? [...iter, ...fnFlattern(val.groupList)] : iter + return val.groupList && val.groupList.length > 0 ? [...iter, ...fnFlattern(val.groupList)] : iter }, [] ) @@ -203,18 +206,26 @@ const fnEventsOptions = (): Array => { const mapOptionList = filterOptionList.map(item => ({ id: item.id, title: item.chartConfig.title, - disabled: false + disabled: false, + type: 'componentList' })) + const requestDataPond = chartEditStore.requestGlobalConfig.requestDataPond.map(item => ({ + id: item.dataPondId, + title: item.dataPondName, + disabled: false, + type: 'requestDataPond' + })) + const tarArr = requestDataPond.concat(mapOptionList) targetData.value.events.interactEvents?.forEach(iaItem => { - mapOptionList.forEach(optionItem => { + tarArr.forEach(optionItem => { if (optionItem.id === iaItem.interactComponentId) { optionItem.disabled = true } }) }) - return mapOptionList + return tarArr } // 新增模块