From 5557f01c1fcfb54c7ad5fb2c9f30a1449df2a4dc Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 19 Jul 2024 17:24:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=AF=BC=E5=87=BA=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=E5=B5=8C=E5=85=A5=E5=BC=8F=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/chart/server/ChartDataServer.java | 2 +- core/core-frontend/src/views/chart/components/js/util.ts | 3 +++ .../views/visualized/data/datasource/form/ApiKeyValue.vue | 7 ++++++- .../io/dataease/api/chart/request/ChartExcelRequest.java | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java b/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java index f19a8cec63..9952a6ed1b 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java +++ b/core/core-backend/src/main/java/io/dataease/chart/server/ChartDataServer.java @@ -89,7 +89,7 @@ public class ChartDataServer implements ChartDataApi { public void innerExportDetails(ChartExcelRequest request, HttpServletResponse response) throws Exception { HttpServletRequest httpServletRequest = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String linkToken = httpServletRequest.getHeader(AuthConstant.LINK_TOKEN_KEY); - if (StringUtils.isEmpty(linkToken)) { + if (StringUtils.isEmpty(linkToken) || !request.isDataEaseBi()) { exportCenterManage.addTask(request.getViewId(), "chart", request); return; } diff --git a/core/core-frontend/src/views/chart/components/js/util.ts b/core/core-frontend/src/views/chart/components/js/util.ts index a5b0418d7e..b10bba90fb 100644 --- a/core/core-frontend/src/views/chart/components/js/util.ts +++ b/core/core-frontend/src/views/chart/components/js/util.ts @@ -513,6 +513,9 @@ export const exportExcelDownload = (chart, callBack?) => { const linkStore = useLinkStoreWithOut() + if (isDataEaseBi.value || appStore.getIsIframe) { + request.isDataEaseBi = true + } innerExportDetails(request) .then(res => { if (linkStore.getLinkToken || isDataEaseBi.value || appStore.getIsIframe) { diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/ApiKeyValue.vue b/core/core-frontend/src/views/visualized/data/datasource/form/ApiKeyValue.vue index f5463ab4cc..641590cf85 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/ApiKeyValue.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/ApiKeyValue.vue @@ -46,6 +46,11 @@ onBeforeMount(() => { if (!items.value.length || items.value[items.value.length - 1].name) { items.value.push(new KeyValue({ enable: true, name: '', value: '' })) } + for (let i = 0; i < items.value.length; i++) { + if (!items.value[i].hasOwnProperty('nameType')) { + items.value[i].nameType = 'fixed' + } + } }) const activeName = inject('api-active-name') @@ -56,7 +61,7 @@ const remove = (index: number) => { items.value.splice(index, 1) } const change = () => { - items.value.push(new KeyValue({ enable: true })) + items.value.push(new KeyValue({ enable: true, nameType: 'fixed' })) } const isDisable = () => { return items.value.length === 1 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/chart/request/ChartExcelRequest.java b/sdk/api/api-base/src/main/java/io/dataease/api/chart/request/ChartExcelRequest.java index ca1c785b54..3092bcd2b2 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/chart/request/ChartExcelRequest.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/chart/request/ChartExcelRequest.java @@ -22,4 +22,6 @@ public class ChartExcelRequest extends ChartExcelRequestInner { private List multiInfo; + private boolean isDataEaseBi = false; + }