From f9eca82ed762e8f8c0dbd39d3fcee43a1ea46b95 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 31 Aug 2022 11:15:37 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=8A=A5=E5=91=8A):=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=B8=A6=E6=A8=A1=E7=89=88=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/service/chart/ViewExportExcel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/service/chart/ViewExportExcel.java b/backend/src/main/java/io/dataease/service/chart/ViewExportExcel.java index 2cd29212e7..e8fd9a9224 100644 --- a/backend/src/main/java/io/dataease/service/chart/ViewExportExcel.java +++ b/backend/src/main/java/io/dataease/service/chart/ViewExportExcel.java @@ -38,6 +38,9 @@ public class ViewExportExcel { private Type tokenType = new TypeToken>>() { }.getType(); + private Type fieldTokenType = new TypeToken>() { + }.getType(); + @DePermissionProxy(paramIndex = 2) public List export(String panelId, List viewIds, PermissionProxy proxy) throws Exception { if (CollectionUtils.isEmpty(viewIds)) { @@ -91,7 +94,7 @@ public class ViewExportExcel { Map chart = chartViewDTO.getData(); Object objectFields = chart.get("fields"); - List fields = (List) objectFields; + List fields = gson.fromJson(gson.toJson(objectFields), fieldTokenType); List heads = new ArrayList<>(); List headKeys = new ArrayList<>(); fields.forEach(field -> {