From 82aa669977a7ceba9df7ede011c65d16e4add951 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 10:12:00 +0800 Subject: [PATCH 01/11] =?UTF-8?q?perf(X-Pack):=20OAuth2=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/logout.ts | 7 ------- de-xpack | 2 +- .../io/dataease/api/xpack/settings/XpackOauth2Api.java | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/core/core-frontend/src/utils/logout.ts b/core/core-frontend/src/utils/logout.ts index d69b27833f..4dce91b431 100644 --- a/core/core-frontend/src/utils/logout.ts +++ b/core/core-frontend/src/utils/logout.ts @@ -3,7 +3,6 @@ import router from '@/router' import { usePermissionStoreWithOut } from '@/store/modules/permission' import { interactiveStoreWithOut } from '@/store/modules/interactive' import { useCache } from '@/hooks/web/useCache' -import request from '@/config/axios' const { wsCache } = useCache() const permissionStore = usePermissionStoreWithOut() @@ -11,12 +10,6 @@ const userStore = useUserStoreWithOut() const interactiveStore = interactiveStoreWithOut() export const logoutHandler = (justClean?: boolean) => { - const idToken = wsCache.get('oauth2-id-token') - if (idToken) { - request.get({ url: `/oauth2/logout/${idToken}` }).finally(() => { - wsCache.delete('oauth2-id-token') - }) - } userStore.clear() userStore.$reset() permissionStore.clear() diff --git a/de-xpack b/de-xpack index d883d74073..4b1d708155 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit d883d74073867950a4347dc50b417c3093298e60 +Subproject commit 4b1d7081554441fd75b18bef9b02779389076b16 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/settings/XpackOauth2Api.java b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/settings/XpackOauth2Api.java index 94e6da6cb2..353298f858 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/settings/XpackOauth2Api.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/settings/XpackOauth2Api.java @@ -6,7 +6,6 @@ import io.dataease.api.xpack.settings.vo.XpackOauthAuthVO; import io.dataease.api.xpack.settings.vo.XpackOauthTokenVO; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -20,6 +19,4 @@ public interface XpackOauth2Api { @PostMapping("/token") XpackOauthTokenVO oauth2Token(@RequestBody XpackOauth2TokenRequest request); - @GetMapping("/logout/{idToken}") - void logout(@PathVariable("idToken") String idToken); } From e77d7063a23b0ac653a260da554d42e52b73d270 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 10:32:29 +0800 Subject: [PATCH 02/11] =?UTF-8?q?perf(X-Pack):=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=AD=90=E6=A8=A1=E5=9D=97=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index d883d74073..4b1d708155 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit d883d74073867950a4347dc50b417c3093298e60 +Subproject commit 4b1d7081554441fd75b18bef9b02779389076b16 From ed053ed762adfda29ad8774999519f0fac52b474 Mon Sep 17 00:00:00 2001 From: ulleo Date: Sat, 14 Sep 2024 10:55:17 +0800 Subject: [PATCH 03/11] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=9F=B1=E7=BA=BF=E7=BB=84=E5=90=88=E5=9B=BE=E5=AD=90?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E5=A2=9E=E5=8A=A0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #11863 --- .../charts/impl/mix/DualLineMixHandler.java | 21 +++++++++++++++ .../chart/charts/impl/mix/MixHandler.java | 23 ++++++++-------- .../dataease/chart/utils/ChartDataBuild.java | 26 ++++++++++++++----- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/DualLineMixHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/DualLineMixHandler.java index 8561590988..491d6c9dae 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/DualLineMixHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/DualLineMixHandler.java @@ -1,11 +1,32 @@ package io.dataease.chart.charts.impl.mix; +import io.dataease.chart.utils.ChartDataBuild; +import io.dataease.extensions.view.dto.AxisFormatResult; +import io.dataease.extensions.view.dto.ChartAxis; +import io.dataease.extensions.view.dto.ChartViewDTO; +import io.dataease.extensions.view.dto.CustomFilterResult; import lombok.Getter; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; + @Component public class DualLineMixHandler extends GroupMixHandler { @Getter private final String type = "chart-mix-dual-line"; + @Override + public Map buildNormalResult(ChartViewDTO view, AxisFormatResult formatResult, CustomFilterResult filterResult, List data) { + boolean isDrill = filterResult + .getFilterList() + .stream() + .anyMatch(ele -> ele.getFilterType() == 1); + var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis); + var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt); + var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis); + var xAxisBase = xAxis.subList(0, xAxis.size() - xAxisExt.size()); + return ChartDataBuild.transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill, true); + } + } diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java index 7989cb3a1a..962bd853b7 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java @@ -55,11 +55,19 @@ public class MixHandler extends YoyChartHandler { .getFilterList() .stream() .anyMatch(ele -> ele.getFilterType() == 1); + if (StringUtils.equals((String) formatResult.getContext().get("isRight"), "isRight")) { + var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis); + var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt); + var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis); + var xAxisBase = xAxis.subList(0, xAxis.size() - xAxisExt.size()); + return ChartDataBuild.transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill, true); + } + var xAxisBase = (List) formatResult.getContext().get("xAxisBase"); var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis); var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis); var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt); - var result = ChartDataBuild.transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill); + var result = ChartDataBuild.transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill, false); return result; } @@ -97,11 +105,6 @@ public class MixHandler extends YoyChartHandler { AxisFormatResult formatResult2 = new AxisFormatResult(); var axisMap = new HashMap>(); - axisMap.put(ChartAxis.xAxis, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.xAxis))); - axisMap.put(ChartAxis.extStack, new ArrayList<>()); - axisMap.put(ChartAxis.xAxisExt, new ArrayList<>()); - axisMap.put(ChartAxis.extBubble, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extBubble))); - axisMap.put(ChartAxis.yAxisExt, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.yAxisExt))); axisMap.put(ChartAxis.extLabel, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extLabel))); axisMap.put(ChartAxis.extTooltip, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extTooltip))); axisMap.put(ChartAxis.drill, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.drill))); @@ -110,18 +113,16 @@ public class MixHandler extends YoyChartHandler { // 计算右轴,包含 xAxis,xAxisExt,yAxisExt,需要去掉 group 和 stack var xAxis = new ArrayList<>(view.getXAxis()); - var extStack = formatResult2.getAxisMap().get(ChartAxis.extStack); - var xAxisExt = formatResult2.getAxisMap().get(ChartAxis.xAxisExt); - //xAxis = xAxis.subList(0, xAxis.size() - extStack.size() - xAxisExt.size()); - var extBubble = formatResult2.getAxisMap().get(ChartAxis.extBubble); + var extBubble = new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extBubble)); xAxis.addAll(extBubble); var dillAxis = (ArrayList) formatResult.getContext().get("dillAxis"); xAxis.addAll(dillAxis); formatResult2.getAxisMap().put(ChartAxis.xAxis, xAxis); formatResult2.getAxisMap().put(ChartAxis.xAxisExt, extBubble); - var yAxisExt = formatResult2.getAxisMap().get(ChartAxis.yAxisExt); + var yAxisExt = new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.yAxisExt)); formatResult2.getAxisMap().put(ChartAxis.yAxis, yAxisExt); formatResult2.getContext().remove("yoyFiltered"); + formatResult2.getContext().put("isRight", "isRight"); formatResult.getContext().put("subAxisMap", axisMap); diff --git a/core/core-backend/src/main/java/io/dataease/chart/utils/ChartDataBuild.java b/core/core-backend/src/main/java/io/dataease/chart/utils/ChartDataBuild.java index 7519fbb1b4..32d5404979 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/utils/ChartDataBuild.java +++ b/core/core-backend/src/main/java/io/dataease/chart/utils/ChartDataBuild.java @@ -1,6 +1,7 @@ package io.dataease.chart.utils; -import io.dataease.api.chart.dto.*; +import io.dataease.api.chart.dto.ScatterChartDataDTO; +import io.dataease.api.chart.dto.Series; import io.dataease.extensions.view.dto.*; import io.dataease.i18n.Lang; import io.dataease.i18n.Translator; @@ -423,7 +424,7 @@ public class ChartDataBuild { axisChartDataDTO.setValue(new BigDecimal(0)); } axisChartDataDTO.setCategory(StringUtils.defaultIfBlank(yAxis.get(j).getChartShowName(), yAxis.get(j).getName())); - buildDynamicValue(view, axisChartDataDTO, row, size, ObjectUtils.isNotEmpty(extBubble)?extSize-1:extSize); + buildDynamicValue(view, axisChartDataDTO, row, size, ObjectUtils.isNotEmpty(extBubble) ? extSize - 1 : extSize); // pop if (ObjectUtils.isNotEmpty(extBubble)) { try { @@ -504,6 +505,11 @@ public class ChartDataBuild { // antV组合图形 public static Map transMixChartDataAntV(List xAxisBase, List xAxis, List xAxisExt, List yAxis, ChartViewDTO view, List data, boolean isDrill) { + return transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill, false); + } + + public static Map transMixChartDataAntV(List xAxisBase, List xAxis, List xAxisExt, List yAxis, ChartViewDTO view, List data, boolean isDrill, boolean isLine) { + Map map = new HashMap<>(); List series = new ArrayList<>(); @@ -571,8 +577,16 @@ public class ChartDataBuild { } catch (Exception e) { axisChartDataDTO.setValue(new BigDecimal(0)); } + String category = StringUtils.defaultIfBlank(b.toString(), StringUtils.defaultIfBlank(yAxis.get(j).getChartShowName(), yAxis.get(j).getName())); + + if (isLine) { + if (ObjectUtils.isEmpty(xAxisExt)) { + category = StringUtils.defaultIfBlank(yAxis.get(j).getChartShowName(), yAxis.get(j).getName()); + } + } + axisChartDataDTO.setCategory(category); categories.add(category); @@ -1764,7 +1778,7 @@ public class ChartDataBuild { List> tableRow = (List>) map.get("tableRow"); final int xEndIndex = detailIndex; Map> groupDataList = detailData.stream().collect(Collectors.groupingBy(item -> "(" + StringUtils.join(ArrayUtils.subarray(item, 0, xEndIndex), ")-de-(") + ")")); - String extBubbleDataeaseName = ObjectUtils.isNotEmpty(extBubble)?extBubble.get(0).getDataeaseName():""; + String extBubbleDataeaseName = ObjectUtils.isNotEmpty(extBubble) ? extBubble.get(0).getDataeaseName() : ""; tableRow.forEach(row -> { BigDecimal rowValue = row.get(extBubbleDataeaseName) == null ? BigDecimal.ZERO : new BigDecimal(row.get(extBubbleDataeaseName).toString()); String key = xAxis.stream().map(x -> String.format(format, row.get(x.getDataeaseName()).toString())).collect(Collectors.joining("-de-")); @@ -1773,16 +1787,16 @@ public class ChartDataBuild { Map temp = new HashMap<>(); for (int i = 0; i < realDetailFields.size(); i++) { ChartViewFieldDTO realDetailField = realDetailFields.get(i); - if(StringUtils.equalsIgnoreCase(extBubbleDataeaseName,realDetailField.getDataeaseName())){ + if (StringUtils.equalsIgnoreCase(extBubbleDataeaseName, realDetailField.getDataeaseName())) { temp.put(realDetailField.getDataeaseName(), rowValue); - }else{ + } else { temp.put(realDetailField.getDataeaseName(), detailArr[detailIndex + i]); } } return temp; })).collect(Collectors.toList()); //详情只要一个 - row.put("details", !detailValueMapList.isEmpty() ?Collections.singletonList(detailValueMapList.getFirst()):detailValueMapList); + row.put("details", !detailValueMapList.isEmpty() ? Collections.singletonList(detailValueMapList.getFirst()) : detailValueMapList); }); // 先过滤掉所有记录数字段 List filterCountAxis = fields.stream() From 0450eb5284bea60fd9f561d6d22bf92c357cc419 Mon Sep 17 00:00:00 2001 From: ulleo Date: Sat, 14 Sep 2024 10:57:13 +0800 Subject: [PATCH 04/11] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=8C=E7=BA=BF=E7=BB=84=E5=90=88=E5=9B=BE=E5=B7=A6?= =?UTF-8?q?=E7=BA=B5=E8=BD=B4=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E8=89=B2?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/others/chart-mix.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts index 371c8fe4ce..35cf1d3983 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts @@ -870,9 +870,9 @@ export class DualLineMix extends ColumnLineMix { p[n.id] = n return p }, {}) - const { yAxis, extStack } = chart + const { yAxis, xAxisExt } = chart const { data } = options as unknown as Options - if (extStack?.length) { + if (xAxisExt?.length) { const seriesSet = new Set() data[0]?.forEach(d => d.category !== null && seriesSet.add(d.category)) const tmp = [...seriesSet] @@ -917,8 +917,8 @@ export class DualLineMix extends ColumnLineMix { const result: ChartBasicStyle['seriesColor'] = [] const seriesSet = new Set() const colors = chart.customAttr.basicStyle.colors - const { yAxis, extStack } = chart - if (extStack?.length) { + const { yAxis, xAxisExt } = chart + if (xAxisExt?.length) { data?.forEach(d => { if (d.value === null || d.category === null || seriesSet.has(d.category)) { return From 7ef4c41cc3ab567195ed64127ed348905281aece Mon Sep 17 00:00:00 2001 From: wisonic Date: Sat, 14 Sep 2024 11:02:53 +0800 Subject: [PATCH 05/11] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=9C=AA=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/views/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 243fac0b3c..6d790aca12 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -119,12 +119,13 @@ const props = defineProps({ const dynamicAreaId = ref('') const { view, showPosition, element, active, searchCount, scale } = toRefs(props) -const titleShow = computed( - () => - !['rich-text', 'Picture'].includes('rich-text') && +const titleShow = computed(() => { + return ( + !['rich-text', 'Picture'].includes(element.value.innerType) && state.title_show && showPosition.value !== 'viewDialog' -) + ) +}) const snapshotStore = snapshotStoreWithOut() const state = reactive({ From 3c33ef9c66ea0feec251d6a9972414163a28ce68 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 11:13:56 +0800 Subject: [PATCH 06/11] =?UTF-8?q?perf(X-Pack):=20OAuth2=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 4b1d708155..5d1d24082b 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 4b1d7081554441fd75b18bef9b02779389076b16 +Subproject commit 5d1d24082bbcf80193d0ddd335d7746ced90b180 From 14e9356294e27fb697719b3ad517306a17680398 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 11:35:45 +0800 Subject: [PATCH 07/11] =?UTF-8?q?perf(X-Pack):=20OAuth2=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 5d1d24082b..ed76b914e6 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 5d1d24082bbcf80193d0ddd335d7746ced90b180 +Subproject commit ed76b914e640f091106fce55fe238a11d647622b From 27c385b14246a14f65eec618efb1d2bceb86e78c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 11:40:39 +0800 Subject: [PATCH 08/11] =?UTF-8?q?perf(X-Pack):=20OAuth2=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=96=87=E6=A1=88=E5=8E=BB=E6=8E=89=E7=82=B9=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index ed76b914e6..afebf7200c 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit ed76b914e640f091106fce55fe238a11d647622b +Subproject commit afebf7200c190ec1a7d72dc3eb6d3fb38f2d0393 From a3511e13b0f1db2029ad0bf990c8feff77249f41 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 15:27:31 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix(X-Pack):=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E5=91=8A-=E5=AF=BC=E5=87=BA=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=89=E6=8B=A9=E7=9A=84=E6=98=AF=E5=8F=8C?= =?UTF-8?q?=E8=BD=B4=E5=9B=BE=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/CoreVisualizationExportManage.java | 55 +++++++++++++------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java b/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java index 5933316126..c38092fe28 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java @@ -8,7 +8,6 @@ import io.dataease.constant.CommonConstants; import io.dataease.dataset.server.DatasetFieldServer; import io.dataease.engine.constant.DeTypeConstants; import io.dataease.exception.DEException; -import io.dataease.extensions.datasource.dto.DatasetTableFieldDTO; import io.dataease.extensions.view.dto.ChartExtFilterDTO; import io.dataease.extensions.view.dto.ChartExtRequest; import io.dataease.extensions.view.dto.ChartViewDTO; @@ -73,27 +72,14 @@ public class CoreVisualizationExportManage { } view.getChartExtRequest().setUser(AuthUtils.getUser().getUserId()); view.setTitle((i + 1) + "-" + view.getTitle()); - sheets.add(exportViewData(view)); + sheets.addAll(exportViewData(view)); } return VisualizationExcelUtils.exportExcel(sheets, visualization.getName(), visualization.getId().toString()); } - private ExcelSheetModel exportViewData(ChartViewDTO request) { + private ExcelSheetModel exportSingleData(Map chart, String title) { ExcelSheetModel result = new ExcelSheetModel(); - ChartViewDTO chartViewDTO = null; - if (CommonConstants.VIEW_DATA_FROM.TEMPLATE.equalsIgnoreCase(request.getDataFrom())) { - chartViewDTO = extendDataManage.getChartDataInfo(request.getId(), request); - } else { - try { - chartViewDTO = chartDataManage.calcData(request); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - String title = chartViewDTO.getTitle(); - Map chart = chartViewDTO.getData(); - Object objectFields = chart.get("fields"); List fields = (List) objectFields; List heads = new ArrayList<>(); @@ -116,6 +102,9 @@ public class CoreVisualizationExportManage { }); } Object objectTableRow = chart.get("tableRow"); + if (objectTableRow == null) { + objectTableRow = chart.get("sourceData"); + } List> tableRow = (List>) objectTableRow; List> details = tableRow.stream().map(row -> { @@ -140,6 +129,40 @@ public class CoreVisualizationExportManage { return result; } + private List exportViewData(ChartViewDTO request) { + + ChartViewDTO chartViewDTO = null; + request.setIsExcelExport(true); + if (CommonConstants.VIEW_DATA_FROM.TEMPLATE.equalsIgnoreCase(request.getDataFrom())) { + chartViewDTO = extendDataManage.getChartDataInfo(request.getId(), request); + } else { + try { + chartViewDTO = chartDataManage.calcData(request); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + String title = chartViewDTO.getTitle(); + Map chart = chartViewDTO.getData(); + List resultList = new ArrayList<>(); + boolean leftExist = ObjectUtils.isNotEmpty(chart.get("left")); + boolean rightExist = ObjectUtils.isNotEmpty(chart.get("right")); + if (!leftExist && !rightExist) { + ExcelSheetModel sheetModel = exportSingleData(chart, title); + resultList.add(sheetModel); + return resultList; + } + if (leftExist) { + ExcelSheetModel sheetModel = exportSingleData((Map) chart.get("left"), title + "_left"); + resultList.add(sheetModel); + } + if (rightExist) { + ExcelSheetModel sheetModel = exportSingleData((Map) chart.get("right"), title + "_right"); + resultList.add(sheetModel); + } + return resultList; + } + private String filterInvalidDecimal(String sourceNumberStr) { if (StringUtils.isNotBlank(sourceNumberStr) && StringUtils.contains(sourceNumberStr, ".")) { sourceNumberStr = sourceNumberStr.replaceAll("0+?$", ""); From af9bc7de92fad136a3b193bd3a2e59133398ccb5 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 14 Sep 2024 16:24:11 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix(X-Pack):=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E5=91=8A-pdf=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visualization/manage/CoreVisualizationExportManage.java | 6 ++++++ de-xpack | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java b/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java index c38092fe28..ef860b6d67 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/manage/CoreVisualizationExportManage.java @@ -49,6 +49,12 @@ public class CoreVisualizationExportManage { @Resource private DatasetFieldServer datasetFieldServer; + public String getResourceName(Long dvId, String busiFlag) { + DataVisualizationVO visualization = extDataVisualizationMapper.findDvInfo(dvId, busiFlag); + if (ObjectUtils.isEmpty(visualization)) DEException.throwException("资源不存在或已经被删除..."); + return visualization.getName(); + } + public File exportExcel(Long dvId, String busiFlag, List viewIdList, boolean onlyDisplay) throws Exception { DataVisualizationVO visualization = extDataVisualizationMapper.findDvInfo(dvId, busiFlag); if (ObjectUtils.isEmpty(visualization)) DEException.throwException("资源不存在或已经被删除..."); diff --git a/de-xpack b/de-xpack index afebf7200c..bf9cd45f20 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit afebf7200c190ec1a7d72dc3eb6d3fb38f2d0393 +Subproject commit bf9cd45f206458e3bfa385e451f56e74dea334ee From cf678ee54ae69e57ec606cb7bcee0bc5645a8bbc Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sat, 14 Sep 2024 16:36:57 +0800 Subject: [PATCH 11/11] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/icon-custom/src/Icon.vue | 8 +- .../custom-component/picture-group/Attr.vue | 357 ++++++++++++++++++ .../picture-group/Component.vue | 90 +++++ core/core-frontend/src/utils/components.ts | 6 +- .../chart/components/editor/util/chart.ts | 6 +- .../js/panel/charts/others/Picture.ts | 19 - .../js/panel/charts/others/picture-group.ts | 35 ++ .../chart/components/js/panel/types/index.ts | 2 +- .../views/chart/components/views/index.vue | 14 +- 9 files changed, 507 insertions(+), 30 deletions(-) create mode 100644 core/core-frontend/src/custom-component/picture-group/Attr.vue create mode 100644 core/core-frontend/src/custom-component/picture-group/Component.vue delete mode 100644 core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts create mode 100644 core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts diff --git a/core/core-frontend/src/components/icon-custom/src/Icon.vue b/core/core-frontend/src/components/icon-custom/src/Icon.vue index 606c3df97d..86c91541ad 100644 --- a/core/core-frontend/src/components/icon-custom/src/Icon.vue +++ b/core/core-frontend/src/components/icon-custom/src/Icon.vue @@ -693,6 +693,9 @@ import icon_font from '@/assets/svg/icon_font.svg' import tHeatmap from '@/assets/svg/t-heatmap.svg' import tHeatmapDark from '@/assets/svg/t-heatmap-dark.svg' import tHeatmapOrigin from '@/assets/svg/t-heatmap-origin.svg' +import pictureGroupDark from '@/assets/svg/picture-group-dark.svg' +import pictureGroupOrigin from '@/assets/svg/picture-group-origin.svg' +import pictureGroup from '@/assets/svg/picture-group.svg' const iconMap = { '401': _401, icon_link_calculated_outlined, @@ -1384,7 +1387,10 @@ const iconMap = { clock, 't-heatmap': tHeatmap, 't-heatmap-dark': tHeatmapDark, - 't-heatmap-origin': tHeatmapOrigin + 't-heatmap-origin': tHeatmapOrigin, + 'picture-group': pictureGroup, + 'picture-group-dark': pictureGroupDark, + 'picture-group-origin': pictureGroupOrigin } const props = defineProps({ diff --git a/core/core-frontend/src/custom-component/picture-group/Attr.vue b/core/core-frontend/src/custom-component/picture-group/Attr.vue new file mode 100644 index 0000000000..57855165be --- /dev/null +++ b/core/core-frontend/src/custom-component/picture-group/Attr.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/core/core-frontend/src/custom-component/picture-group/Component.vue b/core/core-frontend/src/custom-component/picture-group/Component.vue new file mode 100644 index 0000000000..2ca938e064 --- /dev/null +++ b/core/core-frontend/src/custom-component/picture-group/Component.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/core/core-frontend/src/utils/components.ts b/core/core-frontend/src/utils/components.ts index 077835fca1..3d35be10a9 100644 --- a/core/core-frontend/src/utils/components.ts +++ b/core/core-frontend/src/utils/components.ts @@ -35,6 +35,8 @@ import ScrollText from '@/custom-component/scroll-text/Component.vue' import ScrollTextAttr from '@/custom-component/scroll-text/Attr.vue' import PopArea from '@/custom-component/pop-area/Component.vue' import PopAreaAttr from '@/custom-component/pop-area/Attr.vue' +import PictureGroup from '@/custom-component/picture-group/Component.vue' +import PictureGroupAttr from '@/custom-component/picture-group/Attr.vue' export const componentsMap = { VText: VText, VQuery, @@ -72,7 +74,9 @@ export const componentsMap = { ScrollText: ScrollText, ScrollTextAttr: ScrollTextAttr, PopArea: PopArea, - PopAreaAttr: PopAreaAttr + PopAreaAttr: PopAreaAttr, + PictureGroup: PictureGroup, + PictureGroupAttr: PictureGroupAttr } export default function findComponent(key) { diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 3fd8b6c68e..4cd09393a7 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -1508,14 +1508,14 @@ export const CHART_TYPE_CONFIGS = [ }, { category: 'other', - title: '图片', + title: '图片组', display: 'hidden', details: [ { render: 'custom', category: 'quota', - value: 'Picture', - title: '图片', + value: 'picture-group', + title: '图片图', icon: 'picture' } ] diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts deleted file mode 100644 index 472638090b..0000000000 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types' -import { useI18n } from '@/hooks/web/useI18n' - -const { t } = useI18n() -/** - * 富文本图表 - */ -export class PictureChartView extends AbstractChartView { - properties: EditorProperty[] = ['background-overall-component', 'border-style'] - propertyInner: EditorPropertyInner = { - 'background-overall-component': ['all'], - 'border-style': ['all'] - } - axis: AxisType[] = ['filter'] - axisConfig: AxisConfig = {} - constructor() { - super(ChartRenderType.CUSTOM, ChartLibraryType.PICTURE, 'Picture') - } -} diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts new file mode 100644 index 0000000000..0679e1e868 --- /dev/null +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts @@ -0,0 +1,35 @@ +import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types' +import { useI18n } from '@/hooks/web/useI18n' + +const { t } = useI18n() +/** + * 图片组图表 + */ +export class PictureGroupView extends AbstractChartView { + properties: EditorProperty[] = [ + 'background-overall-component', + 'border-style', + 'threshold', + 'function-cfg' + ] + propertyInner: EditorPropertyInner = { + 'background-overall-component': ['all'], + 'border-style': ['all'], + threshold: ['tableThreshold'], + 'function-cfg': ['emptyDataStrategy'] + } + axis: AxisType[] = ['xAxis', 'yAxis', 'filter'] + axisConfig: AxisConfig = { + xAxis: { + name: `${t('chart.dimension')}`, + type: 'd' + }, + yAxis: { + name: `${t('chart.quota')}`, + type: 'q' + } + } + constructor() { + super(ChartRenderType.CUSTOM, ChartLibraryType.PICTURE_GROUP, 'picture-group') + } +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts index bb84e11bd6..89b29f4d11 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts @@ -15,7 +15,7 @@ export enum ChartLibraryType { ECHARTS = 'echarts', S2 = 's2', RICH_TEXT = 'rich-text', - PICTURE = 'Picture', + PICTURE_GROUP = 'picture_group', INDICATOR = 'indicator' } export abstract class ChartWrapper { diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 6d790aca12..7e437cb2ae 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -43,7 +43,7 @@ import { storeToRefs } from 'pinia' import { checkAddHttp, setIdValueTrans } from '@/utils/canvasUtils' import { Base64 } from 'js-base64' import DeRichTextView from '@/custom-component/rich-text/DeRichTextView.vue' -import DePictureV2 from '@/custom-component/picture/Component.vue' +import DePictureGroup from '@/custom-component/picture-group/component.vue' import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { viewFieldTimeTrans } from '@/utils/viewUtils' @@ -897,11 +897,15 @@ const loadPluginCategory = data => { @onJumpClick="jumpClick" @resetLoading="() => (loading = false)" /> - + :active="active" + :show-position="showPosition" + > +