From a94bac0dd5c4597d3060f5bc88b348c4e8b7e646 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 5 Dec 2023 10:42:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E4=BD=BF=E7=94=A8=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mybatis/ExtVisualizationTemplateMapper.xml | 5 ++++- core/core-frontend/src/views/template-market/index.vue | 1 + .../java/io/dataease/api/template/dto/TemplateMarketDTO.java | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml b/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml index 1971a6d26b..1746fdfea4 100644 --- a/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml +++ b/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml @@ -20,6 +20,7 @@ + @@ -50,10 +51,12 @@ vt.create_time, vt.template_type, vt.SNAPSHOT, - vtcm.category_id + vtcm.category_id, + cor.time as 'recent_use_time' FROM visualization_template vt LEFT JOIN visualization_template_category_map vtcm ON vt.id = vtcm.template_id + left JOIN core_opt_recent cor on cor.resource_type=6 and vt.id= cor.resource_name ORDER BY vt.create_time DESC diff --git a/core/core-frontend/src/views/template-market/index.vue b/core/core-frontend/src/views/template-market/index.vue index 6655b71054..6fcd01358c 100644 --- a/core/core-frontend/src/views/template-market/index.vue +++ b/core/core-frontend/src/views/template-market/index.vue @@ -405,6 +405,7 @@ const apply = () => { decompression(state.dvCreateForm) .then(response => { state.curApplyTemplate.recentUseTime = Date.now() + state.curApplyTemplate.categoryNames.push('最近使用') state.loading = false const templateData = response.data // do create diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/template/dto/TemplateMarketDTO.java b/sdk/api/api-base/src/main/java/io/dataease/api/template/dto/TemplateMarketDTO.java index 5e52f7bd71..33e36dd84d 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/template/dto/TemplateMarketDTO.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/template/dto/TemplateMarketDTO.java @@ -46,11 +46,13 @@ public class TemplateMarketDTO implements Comparable { this.categories = manageDTO.getCategoryNames().stream().map(category->new MarketCategoryVO(category)).collect(Collectors.toList()); this.categoryNames = manageDTO.getCategoryNames(); this.metas = new MarketMetasVO(manageDTO.getSnapshot()); - this.templateType = "dataV".equalsIgnoreCase(manageDTO.getTemplateType()) ? "SCREEN" : "PANEL"; + this.templateType = "dataV".equalsIgnoreCase(manageDTO.getDvType()) ? "SCREEN" : "PANEL"; this.thumbnail = manageDTO.getSnapshot(); this.source = "manage"; if (manageDTO.getRecentUseTime() != null) { this.recentUseTime = manageDTO.getRecentUseTime(); + this.categories.add(new MarketCategoryVO("最近使用")); + this.categoryNames.add("最近使用"); } }