From 76a4a2368952e153d008bbf799d01764933c6908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Sun, 3 Dec 2023 23:37:09 +0800 Subject: [PATCH] style: UI (#6974) * refactor: UI * refactor: UI * refactor: UI --- ...oryTemplate.vue => CategoryTemplateV2.vue} | 18 ++- .../src/views/template-market/index.vue | 141 +++++++----------- .../api/template/dto/TemplateMarketDTO.java | 14 +- 3 files changed, 82 insertions(+), 91 deletions(-) rename core/core-frontend/src/views/template-market/component/{CategoryTemplate.vue => CategoryTemplateV2.vue} (80%) diff --git a/core/core-frontend/src/views/template-market/component/CategoryTemplate.vue b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue similarity index 80% rename from core/core-frontend/src/views/template-market/component/CategoryTemplate.vue rename to core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue index fbdbf3d1a2..30797a68eb 100644 --- a/core/core-frontend/src/views/template-market/component/CategoryTemplate.vue +++ b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue @@ -3,13 +3,11 @@
{{ label }} {{ label }} - 的搜索结果是{{ fullTemplateShowList.length }}个 + 的搜索结果是{{ searchResult }}个 import TemplateMarketV2Item from '@/views/template-market/component/TemplateMarketV2Item.vue' +import { computed } from 'vue' const emits = defineEmits(['templateApply', 'templatePreview']) const templateApply = params => { @@ -38,6 +37,17 @@ const templatePreview = params => { emits('templatePreview', params) } +const searchResult = computed( + () => props.fullTemplateShowList.filter(item => showFlagCheck(item)).length +) + +const showFlagCheck = template => { + if (!template.categoryNames) { + console.log('===templateTest' + JSON.stringify(template)) + } + return template.showFlag && template.categoryNames?.includes(props.label) +} + const props = defineProps({ searchText: { type: String diff --git a/core/core-frontend/src/views/template-market/index.vue b/core/core-frontend/src/views/template-market/index.vue index 53082db7a4..87f9e14cfb 100644 --- a/core/core-frontend/src/views/template-market/index.vue +++ b/core/core-frontend/src/views/template-market/index.vue @@ -102,8 +102,8 @@ id="template-show-area" class="template-right" > - - + + > - - +
@@ -154,18 +152,17 @@