From 4473625fccee385d7f6a2bd02807209d3e58ba18 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 29 Oct 2024 10:57:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../copilot/manage/CopilotManage.java | 6 +-- .../main/resources/i18n/core_zh_CN.properties | 2 + .../src/layout/components/Copilot.vue | 10 ++-- core/core-frontend/src/locales/zh-CN.ts | 48 +++++++++++++++++++ .../src/views/copilot/DialogueChart.vue | 26 +++++----- .../core-frontend/src/views/copilot/index.vue | 16 ++++--- de-xpack | 2 +- 7 files changed, 83 insertions(+), 27 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java index 958547586f..45e103287e 100644 --- a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java +++ b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java @@ -104,7 +104,7 @@ public class CopilotManage { Map dsMap = (Map) sqlMap.get("dsMap"); boolean crossDs = Utils.isCrossDs(dsMap); if (crossDs) { - DEException.throwException("跨源数据集不支持该功能"); + DEException.throwException(Translator.get("i18n_copilot_cross_ds_error")); } // 调用copilot service 获取SQL和chart struct,将返回SQL中表名替换成数据集SQL @@ -302,7 +302,7 @@ public class CopilotManage { if (StringUtils.equalsIgnoreCase(receiveDTO.getChart().getType(), "pie")) { AxisFieldDTO column = receiveDTO.getChart().getColumn(); if (fields.size() != 2 || column == null) { - DEException.throwException("当前字段不足以构建饼图: " + JsonUtil.toJSONString(receiveDTO)); + DEException.throwException("build pie error: " + JsonUtil.toJSONString(receiveDTO)); } AxisDTO axisDTO = new AxisDTO(); AxisFieldDTO x = new AxisFieldDTO(); @@ -318,7 +318,7 @@ public class CopilotManage { y.setName(column.getName()); y.setValue(column.getValue()); } else { - DEException.throwException("当前字段不足以构建饼图: " + JsonUtil.toJSONString(receiveDTO)); + DEException.throwException("build pie error: " + JsonUtil.toJSONString(receiveDTO)); } axisDTO.setX(x); axisDTO.setY(y); diff --git a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties index ddecfc35af..5df1501282 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties @@ -83,3 +83,5 @@ i18n_minute=\u5206\u949F i18n_second=\u79D2 i18n_no_datasource_permission_to_create_column=\u65E0\u6570\u636E\u6E90\u8BBF\u95EE\u6743\u9650\uFF0C\u65E0\u6CD5\u521B\u5EFA\u8868\u5B57\u6BB5 + +i18n_copilot_cross_ds_error=\u8de8\u6e90\u6570\u636e\u96c6\u4e0d\u652f\u6301\u8be5\u529f\u80fd diff --git a/core/core-frontend/src/layout/components/Copilot.vue b/core/core-frontend/src/layout/components/Copilot.vue index 613243b2c5..05a52d7fd6 100644 --- a/core/core-frontend/src/layout/components/Copilot.vue +++ b/core/core-frontend/src/layout/components/Copilot.vue @@ -1,6 +1,8 @@