From 13e7d15784bbdd46d8131888e1f54c82f8728068 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 24 Jun 2025 11:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AFsrc/views/?= =?UTF-8?q?=EF=BC=88template-market=EF=BC=8Ctoolbox=EF=BC=8Cwatermark?= =?UTF-8?q?=EF=BC=8Cwizard=EF=BC=8Cworkbranch=EF=BC=89=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/MarketPreviewV2.vue | 25 ++++-- .../src/views/template-market/index.vue | 19 +++-- .../src/views/workbranch/ShortcutTable.vue | 85 ++++++++++++++----- .../src/views/workbranch/index.vue | 4 +- 4 files changed, 101 insertions(+), 32 deletions(-) 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 70178b7..3cf40b0 100644 --- a/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue +++ b/core/core-frontend/src/views/template-market/component/MarketPreviewV2.vue @@ -135,7 +135,7 @@ - + @@ -151,7 +151,7 @@ import { searchMarketPreview } from '@/api/templateMarket' import { onMounted, reactive, watch, ref } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import TemplateMarketPreviewItem from '@/views/template-market/component/TemplateMarketPreviewItem.vue' -import { deepCopy } from '@/utils/utils' +import { deepCopy, getActiveCategories } from '@/utils/utils' import { imgUrlTrans } from '@/utils/imgUtils' const { t } = useI18n() @@ -269,6 +269,11 @@ const initMarketTemplate = () => { state.marketTemplatePreviewShowList = rsp.data.contents state.hasResult = true state.categories = rsp.data.categories + initTemplateShow() + const activeCategoriesShow = getActiveCategories(state.currentMarketTemplateShowList) + state.categories = rsp.data.categories.filter(category => + activeCategoriesShow.has(category.label) + ) activeCategories.value = deepCopy(state.categories) if (props.previewId) { state.marketTemplatePreviewShowList.forEach(categoryTemplates => { @@ -377,9 +382,10 @@ onMounted(() => { } } .aside-list { - padding: 0px 12px 12px 12px; + padding: 0 12px 12px 12px; width: 100%; height: calc(100vh - 200px); + overflow-x: hidden; //overflow-y: auto; :deep(.ed-collapse) { --ed-collapse-header-font-size: 14px !important; @@ -506,6 +512,7 @@ onMounted(() => { white-space: nowrap; cursor: pointer; color: var(--TextPrimary, #1f2329); + background: rgba(255, 255, 255, 1); -webkit-appearance: none; text-align: center; box-sizing: border-box; @@ -611,6 +618,13 @@ onMounted(() => { width: 100%; height: calc(100% - 76px) !important; } + +.img-main img { + width: 100%; + height: 100%; + object-fit: contain; /* 保持图片比例,不裁剪 */ +} + .open-button { cursor: pointer; font-size: 30px; @@ -658,8 +672,8 @@ onMounted(() => { cursor: pointer; font-weight: 400; color: #646a73; - min-width: 64px; height: 22px; + line-height: 22px; display: flex; align-items: center; white-space: nowrap; @@ -675,7 +689,7 @@ onMounted(() => { height: 100%; transform: translate(-50%, -50%); display: none; - border-radius: 4px 0 0 0; + border-radius: 4px; } &:hover { @@ -700,6 +714,7 @@ onMounted(() => { font-weight: 400; color: #1f2329; cursor: default; + margin-left: 4px; } .mp-divider { border-color: #1f232926; diff --git a/core/core-frontend/src/views/template-market/index.vue b/core/core-frontend/src/views/template-market/index.vue index cf8e9fe..3105426 100644 --- a/core/core-frontend/src/views/template-market/index.vue +++ b/core/core-frontend/src/views/template-market/index.vue @@ -119,6 +119,7 @@ v-show="state.networkStatus && state.hasResult" id="template-show-area" class="template-right" + style="padding-top: 16px" > @@ -171,7 +175,7 @@ - {{ t('visualization.market_network_tips') }} + 111 {{ t('visualization.market_network_tips', [state.baseUrl]) }} @@ -197,6 +201,7 @@ import { interactiveStoreWithOut } from '@/store/modules/interactive' import { XpackComponent } from '@/components/plugin' import { useEmitt } from '@/hooks/web/useEmitt' import { Base64 } from 'js-base64' +import { getActiveCategories } from '@/utils/utils' const { t } = useI18n() const { wsCache } = useCache() const embeddedStore = useEmbedded() @@ -415,12 +420,16 @@ const initMarketTemplate = async () => { .then(rsp => { state.baseUrl = rsp.data.baseUrl state.currentMarketTemplateShowList = rsp.data.contents - state.marketTabs = rsp.data.categories - state.marketActiveTab = state.marketTabs[1].label initStyle() initTemplateShow() + const activeCategories = getActiveCategories(state.currentMarketTemplateShowList) + state.marketTabs = rsp.data.categories.filter(category => + activeCategories.has(category.label) + ) + state.marketActiveTab = state.marketTabs[1].label }) - .catch(() => { + .catch(err => { + console.error('searchMarket:', err) state.networkStatus = false }) } @@ -466,7 +475,7 @@ const templateApply = template => { apply(template) } -const apply = template => { +const apply = () => { if (state.dvCreateForm.newFrom === 'new_market_template' && !state.dvCreateForm.templateUrl) { ElMessage.warning(t('template_manage.get_download_link_hint')) return false diff --git a/core/core-frontend/src/views/workbranch/ShortcutTable.vue b/core/core-frontend/src/views/workbranch/ShortcutTable.vue index 7beef08..8195ba9 100644 --- a/core/core-frontend/src/views/workbranch/ShortcutTable.vue +++ b/core/core-frontend/src/views/workbranch/ShortcutTable.vue @@ -8,7 +8,7 @@ import icon_database_outlined from '@/assets/svg/icon_database_outlined.svg' import icon_operationAnalysis_outlined from '@/assets/svg/icon_operation-analysis_outlined.svg' import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg' import icon_pc_outlined from '@/assets/svg/icon_pc_outlined.svg' -import icon_cancel_store from '@/assets/svg/icon_cancel_store.svg' +import dvDashboardSpineMobileDisabled from '@/assets/svg/dv-dashboard-spine-mobile-disabled.svg' import { useI18n } from '@/hooks/web/useI18n' import { ref, reactive, onMounted, computed, watch } from 'vue' import type { TabsPaneContext } from 'element-plus-secondary' @@ -61,6 +61,7 @@ const iconMap = { panelMobile: dvDashboardSpineMobile, dashboard: icon_dashboard_outlined, dashboardMobile: dvDashboardSpineMobile, + dashboardMobileDisabled: dvDashboardSpineMobileDisabled, screen: icon_operationAnalysis_outlined, dataV: icon_operationAnalysis_outlined, dataset: icon_app_outlined, @@ -99,12 +100,14 @@ const triggerFilterPanel = () => { loadTableData() } const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank' -const preview = id => { - const routeUrl = resolve({ - path: '/preview', - query: { dvId: id } - }) - window.open(routeUrl.href, '_blank') +const preview = (id, disabled = false) => { + if (!disabled) { + const routeUrl = resolve({ + path: '/preview', + query: { dvId: id } + }) + window.open(routeUrl.href, '_blank') + } } const openDataset = id => { @@ -198,7 +201,7 @@ const sortChange = param => { } const handleCellClick = row => { - if (row) { + if (row && !checkDisabled(row)) { const sourceId = activeName.value === 'recent' ? row.id : row.resourceId if (['dashboard', 'panel'].includes(row.type)) { window.open('#/panel/index?dvId=' + sourceId, '_self') @@ -238,14 +241,20 @@ const executeStore = rowInfo => { }) } +const checkDisabled = row => { + return activeName.value === 'store' && !row.extFlag1 +} + const executeCancelStore = rowInfo => { - const param = { - id: rowInfo.resourceId, - type: rowInfo.type === 'dataV' ? 'screen' : 'panel' + if (!checkDisabled(rowInfo)) { + const param = { + id: rowInfo.resourceId, + type: rowInfo.type === 'dataV' ? 'screen' : 'panel' + } + storeApi(param).then(() => { + loadTableData() + }) } - storeApi(param).then(() => { - loadTableData() - }) } const imgType = ref() @@ -352,18 +361,32 @@ const getEmptyDesc = (): string => { - + - {{ scope.row.name }} + {{ scope.row.name }} {