From 63fa79a665e369060d569ff299e410f742e6f670 Mon Sep 17 00:00:00 2001 From: ulleo Date: Thu, 31 Oct 2024 16:34:52 +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 --- .../template/manage/TemplateCenterManage.java | 11 ++-- .../main/resources/i18n/core_en_US.properties | 7 +++ .../main/resources/i18n/core_zh_CN.properties | 3 + .../main/resources/i18n/core_zh_TW.properties | 7 +++ .../data-visualization/DvToolbar.vue | 2 +- .../visualization/CanvasCacheDialog.vue | 3 +- .../components/visualization/LinkJumpSet.vue | 4 +- .../components/visualization/LinkageSet.vue | 2 +- .../visualization/OuterParamsSet.vue | 2 +- .../visualization/common/DragInfo.vue | 4 +- .../v-query/ConditionDefaultConfiguration.vue | 2 +- .../v-query/RangeFilterTime.vue | 2 +- core/core-frontend/src/locales/en.ts | 17 +++++- core/core-frontend/src/locales/tw.ts | 18 +++++- core/core-frontend/src/locales/zh-CN.ts | 18 +++++- .../editor/dataset-select/DatasetSelect.vue | 2 +- .../components/editor/filter/TimeDialog.vue | 2 +- .../src/views/common/DeAppApply.vue | 11 +++- .../src/views/common/DeResourceGroupOpt.vue | 9 ++- .../src/views/common/DeResourceTree.vue | 7 ++- .../src/views/common/DvDetailInfo.vue | 10 +++- .../views/data-visualization/PreviewHead.vue | 16 ++--- .../views/data-visualization/PreviewShow.vue | 2 +- .../src/views/mobile/directory/index.vue | 6 +- .../src/views/mobile/home/index.vue | 2 +- core/core-frontend/src/views/mobile/index.vue | 5 +- .../component/CategoryTemplateV2.vue | 6 +- .../component/MarketPreview.vue | 24 ++++---- .../component/MarketPreviewV2.vue | 59 ++++++++++++------- .../src/views/template-market/index.vue | 46 ++++++++------- de-xpack | 2 +- .../api/template/dto/TemplateMarketDTO.java | 16 +++-- 32 files changed, 224 insertions(+), 103 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java b/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java index c8bf7328fc..f116cdf500 100644 --- a/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java +++ b/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java @@ -11,6 +11,7 @@ import io.dataease.api.template.vo.MarketLatestReleaseVO; import io.dataease.api.template.vo.MarketMetaDataVO; import io.dataease.constant.CommonConstants; import io.dataease.exception.DEException; +import io.dataease.i18n.Translator; import io.dataease.operation.manage.CoreOptRecentManage; import io.dataease.system.manage.SysParameterManage; import io.dataease.template.dao.auto.entity.VisualizationTemplateCategoryMap; @@ -166,11 +167,11 @@ public class TemplateCenterManage { public MarketPreviewBaseResponse searchTemplatePreview() { try { MarketBaseResponse baseContentRsp = searchTemplate(); - List categories = baseContentRsp.getCategories().stream().filter(category -> !"最近使用".equals(category.getLabel())).collect(Collectors.toList()); + List categories = baseContentRsp.getCategories().stream().filter(category -> !Translator.get("i18n_template_recent").equals(category.getLabel())).toList(); List contents = baseContentRsp.getContents(); List previewContents = new ArrayList<>(); categories.forEach(category -> { - if ("推荐".equals(category.getLabel())) { + if (Translator.get("i18n_template_recommend").equals(category.getLabel())) { previewContents.add(new TemplateMarketPreviewInfoDTO(category, contents.stream().filter(template -> "Y".equals(template.getSuggest())).collect(Collectors.toList()))); } else { previewContents.add(new TemplateMarketPreviewInfoDTO(category, contents.stream().filter(template -> checkCategoryMatch(template, category.getLabel())).collect(Collectors.toList()))); @@ -235,7 +236,7 @@ public class TemplateCenterManage { List categoryVO = getCategoriesObject().stream().filter(node -> !"全部".equalsIgnoreCase(node.getLabel())).collect(Collectors.toList()); Map categoriesMap = categoryVO.stream() .collect(Collectors.toMap(MarketMetaDataVO::getValue, MarketMetaDataVO::getLabel)); - List activeCategoriesName = new ArrayList<>(Arrays.asList("最近使用", "推荐")); + List activeCategoriesName = new ArrayList<>(Arrays.asList(Translator.get("i18n_template_recent"), Translator.get("i18n_template_recommend"))); contents.stream().forEach(templateMarketDTO -> { Long recentUseTime = useTime.get(templateMarketDTO.getId()); templateMarketDTO.setRecentUseTime(recentUseTime == null ? 0 : recentUseTime); @@ -264,7 +265,7 @@ public class TemplateCenterManage { public List getCategoriesObject() { List result = getCategoriesV2(); - result.add(0, new MarketMetaDataVO("recent", "最近使用", CommonConstants.TEMPLATE_SOURCE.PUBLIC)); + result.add(0, new MarketMetaDataVO("recent", Translator.get("i18n_template_recent"), CommonConstants.TEMPLATE_SOURCE.PUBLIC)); return result; } @@ -285,7 +286,7 @@ public class TemplateCenterManage { String resultStr = marketGet(templateParams.get("template.url") + TEMPLATE_META_DATA_URL, null); MarketMetaDataBaseResponse metaData = JsonUtil.parseObject(resultStr, MarketMetaDataBaseResponse.class); allCategories.addAll(metaData.getLabels()); - allCategories.add(0, new MarketMetaDataVO("suggest", "推荐", CommonConstants.TEMPLATE_SOURCE.PUBLIC)); + allCategories.add(0, new MarketMetaDataVO("suggest", Translator.get("i18n_template_recommend"), CommonConstants.TEMPLATE_SOURCE.PUBLIC)); } catch (Exception e) { LogUtil.error("模板市场分类获取错误", e); } diff --git a/core/core-backend/src/main/resources/i18n/core_en_US.properties b/core/core-backend/src/main/resources/i18n/core_en_US.properties index 2480b8638e..088c0e13d7 100644 --- a/core/core-backend/src/main/resources/i18n/core_en_US.properties +++ b/core/core-backend/src/main/resources/i18n/core_en_US.properties @@ -104,3 +104,10 @@ i18n_df_multiple_value_split=use ';' to split multiple value i18n_df_email_type=email type i18n_df_phone_type=phone type + + +i18n_copilot_cross_ds_error=This feature is not supported for cross-source datasets. + +i18n_template_recommend=Recommend +i18n_template_recent=Recently Used + 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 ae5e257be2..050cf7519f 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 @@ -126,3 +126,6 @@ i18n_df_phone_type=\u624B\u673A\u53F7\u683C\u5F0F i18n_copilot_cross_ds_error=\u8DE8\u6E90\u6570\u636E\u96C6\u4E0D\u652F\u6301\u8BE5\u529F\u80FD + +i18n_template_recommend=\u63A8\u8350 +i18n_template_recent=\u6700\u8FD1\u4F7F\u7528 diff --git a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties index b68b352476..5616d1175b 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties @@ -124,3 +124,10 @@ i18n_df_email_type=\u90F5\u7BB1\u683C\u5F0F i18n_df_phone_type=\u624B\u6A5F\u865F\u683C\u5F0F + +i18n_copilot_cross_ds_error=\u8DE8\u6E90\u6578\u64DA\u96C6\u4E0D\u652F\u6301\u8A72\u529F\u80FD + +i18n_template_recommend=\u63A8\u85A6 +i18n_template_recent=\u6700\u8FD1\u4F7F\u7528 + + diff --git a/core/core-frontend/src/components/data-visualization/DvToolbar.vue b/core/core-frontend/src/components/data-visualization/DvToolbar.vue index 27ea637cc2..d6388eb32a 100644 --- a/core/core-frontend/src/components/data-visualization/DvToolbar.vue +++ b/core/core-frontend/src/components/data-visualization/DvToolbar.vue @@ -395,7 +395,7 @@ const fullScreenPreview = () => { 编辑 - 预览 + {{ t('template_manage.preview') }} { - const canvasTypeName = initInfo.canvasType === 'dataV' ? '数据大屏' : '仪表板' + const canvasTypeName = + initInfo.canvasType === 'dataV' ? t('work_branch.big_data_screen') : t('work_branch.dashboard') dialogInfo.resourceId = initInfo.resourceId dialogInfo.title = '存在未保存的' + canvasTypeName dialogInfo.tips = canvasTypeName + '存在未保存的修改,立即恢复?' diff --git a/core/core-frontend/src/components/visualization/LinkJumpSet.vue b/core/core-frontend/src/components/visualization/LinkJumpSet.vue index ec65063709..53ababdb87 100644 --- a/core/core-frontend/src/components/visualization/LinkJumpSet.vue +++ b/core/core-frontend/src/components/visualization/LinkJumpSet.vue @@ -465,7 +465,9 @@ const { t } = useI18n() const dialogShow = ref(false) const snapshotStore = snapshotStoreWithOut() -const resourceType = computed(() => (dvInfo.value.type === 'dashboard' ? '仪表板' : '数据大屏')) +const resourceType = computed(() => + dvInfo.value.type === 'dashboard' ? t('work_branch.dashboard') : t('work_branch.big_data_screen') +) const state = reactive({ loading: false, diff --git a/core/core-frontend/src/components/visualization/LinkageSet.vue b/core/core-frontend/src/components/visualization/LinkageSet.vue index 88ba0f0c59..0e1e68a017 100644 --- a/core/core-frontend/src/components/visualization/LinkageSet.vue +++ b/core/core-frontend/src/components/visualization/LinkageSet.vue @@ -205,7 +205,7 @@