From b7736aa46cf1ccf015220732a76bd80fab024264 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 6 Dec 2023 13:26:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=A8=A1=E7=89=88=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/svg/icon_template_colorful.svg | 2 +- .../component/CategoryTemplateV2.vue | 10 +++++ .../component/MarketPreviewV2.vue | 14 +++++- .../component/TemplateMarketV2Item.vue | 19 +++++++- .../src/views/template-market/index.vue | 14 ++++++ .../views/workbranch/TemplateBranchItem.vue | 21 +++++++-- .../src/views/workbranch/index.vue | 45 ++++++++++++++++++- 7 files changed, 116 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/assets/svg/icon_template_colorful.svg b/core/core-frontend/src/assets/svg/icon_template_colorful.svg index a19c0b2869..789b3a02d8 100644 --- a/core/core-frontend/src/assets/svg/icon_template_colorful.svg +++ b/core/core-frontend/src/assets/svg/icon_template_colorful.svg @@ -1,4 +1,4 @@ - + diff --git a/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue index f32c06b02a..108991348e 100644 --- a/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue +++ b/core/core-frontend/src/views/template-market/component/CategoryTemplateV2.vue @@ -18,6 +18,7 @@ :base-url="baseUrl" :width="templateCurWidth" :cur-position="curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" /> @@ -67,6 +68,15 @@ const props = defineProps({ fullTemplateShowList: { type: Array, default: () => [] + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) diff --git a/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue b/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue index 95dbd14d6a..8f34a0c3c8 100644 --- a/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue +++ b/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue @@ -101,12 +101,13 @@ class="main-area" :class="state.asideActive ? 'main-area-active' : ''" > - - {{ state.curTemplate.title }} + + {{ state.curTemplate.title }}
{{ t('visualization.apply_this_template') }} @@ -138,6 +139,15 @@ const props = defineProps({ templateShowList: { type: Array, default: () => [] + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) diff --git a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue index e0d32eeff3..5492535413 100644 --- a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue +++ b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue @@ -4,7 +4,11 @@ {{ template.title }} @@ -44,6 +48,15 @@ const props = defineProps({ }, width: { type: Number + }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } } }) @@ -139,4 +152,8 @@ const templateInnerPreview = e => { .create-area { bottom: -38px !important; } + +.fix-bottom { + bottom: -38px !important; +} diff --git a/core/core-frontend/src/views/template-market/index.vue b/core/core-frontend/src/views/template-market/index.vue index 6fcd01358c..168fbdcb1f 100644 --- a/core/core-frontend/src/views/template-market/index.vue +++ b/core/core-frontend/src/views/template-market/index.vue @@ -8,6 +8,7 @@ @@ -111,6 +112,7 @@ :base-url="state.baseUrl" :template-cur-width="state.templateCurWidth" :cur-position="state.curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -130,6 +132,7 @@ :base-url="state.baseUrl" :template-cur-width="state.templateCurWidth" :cur-position="state.curPosition" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -163,9 +166,12 @@ import MarketPreviewV2 from '@/views/template-market/component/MarketPreviewV2.v import { imgUrlTrans } from '@/utils/imgUtils' import { deepCopy } from '@/utils/utils' import CategoryTemplateV2 from '@/views/template-market/component/CategoryTemplateV2.vue' +import { interactiveStoreWithOut } from '@/store/modules/interactive' const { t } = useI18n() const { wsCache } = useCache() +const interactiveStore = interactiveStoreWithOut() + // full 正常展示 marketPreview 模板中心预览 createPreview 创建界面预览 const previewModel = ref('full') const emits = defineEmits(['close']) @@ -264,6 +270,14 @@ const state = reactive({ } }) +const createAuth = computed(() => { + const authMap = interactiveStore.getData + return { + PANEL: authMap['0'].menuAuth && authMap['0'].anyManage, + SCREEN: authMap['1'].menuAuth && authMap['1'].anyManage + } +}) + const categoriesComputed = computed(() => { let result if (state.templateSourceType === 'all') { diff --git a/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue b/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue index 897b2690c4..61f1bb498f 100644 --- a/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue +++ b/core/core-frontend/src/views/workbranch/TemplateBranchItem.vue @@ -3,8 +3,10 @@
-
- {{ template.title }} +
+ + {{ template.title }} + {{ t('dataset.preview') }} @@ -30,6 +32,15 @@ const props = defineProps({ return {} } }, + createAuth: { + type: Object, + default() { + return { + PANEL: false, + SCREEN: false + } + } + }, baseUrl: { type: String } @@ -69,7 +80,7 @@ const templateInnerPreview = e => { border-radius: 4px; display: flex; flex-wrap: wrap; - width: 181px; + min-width: 181px; height: 141px; margin-left: 16px; position: relative; @@ -136,4 +147,8 @@ const templateInnerPreview = e => { } } } + +.fix-height { + height: 39px !important; +} diff --git a/core/core-frontend/src/views/workbranch/index.vue b/core/core-frontend/src/views/workbranch/index.vue index 29e4d22a45..d6e840e4f2 100644 --- a/core/core-frontend/src/views/workbranch/index.vue +++ b/core/core-frontend/src/views/workbranch/index.vue @@ -58,6 +58,21 @@ const showTemplate = computed(() => { return state.networkStatus && state.hasResult }) +const createAuth = computed(() => { + return { + PANEL: havePanelAuth.value, + SCREEN: haveScreenAuth.value + } +}) + +const havePanelAuth = computed(() => { + return quickCreationList.value[0]['menuAuth'] && quickCreationList.value[0]['anyManage'] +}) + +const haveScreenAuth = computed(() => { + return quickCreationList.value[1]['menuAuth'] && quickCreationList.value[1]['anyManage'] +}) + const activeTabChange = value => { activeTabBtn.value = value } @@ -289,8 +304,23 @@ initMarketTemplate() {{ t(`auth.${ele.name}`) }}
-
- +
+ +
+ + 使用模板新建 @@ -329,6 +359,7 @@ initMarketTemplate() :key="index" :template="template" :base-url="state.baseUrl" + :create-auth="createAuth" @templateApply="templateApply" @templatePreview="templatePreview" > @@ -536,6 +567,15 @@ initMarketTemplate() height: 52px; margin-left: -16px; } + .empty-tooltip-container-template { + width: 300px; + position: absolute; + height: 52px; + margin-left: -16px; + } + .template-create { + opacity: 0.3; + } } } } @@ -620,6 +660,7 @@ initMarketTemplate() .template-list { display: flex; margin-left: -16px; + overflow-x: auto; } } }