更新前端src/views/(template-market,toolbox,watermark,wizard,workbranch)目录文件

This commit is contained in:
limengnan 2025-06-24 11:44:02 +08:00
parent 8dada43656
commit 13e7d15784
4 changed files with 101 additions and 32 deletions

View File

@ -135,7 +135,7 @@
</div> </div>
</el-row> </el-row>
<el-row v-if="state.curTemplate" class="img-main"> <el-row v-if="state.curTemplate" class="img-main">
<img style="height: 100%" :src="imgUrlTrans(state.templatePreviewUrl)" alt="" /> <img :src="imgUrlTrans(state.templatePreviewUrl)" alt="" />
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@ -151,7 +151,7 @@ import { searchMarketPreview } from '@/api/templateMarket'
import { onMounted, reactive, watch, ref } from 'vue' import { onMounted, reactive, watch, ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import TemplateMarketPreviewItem from '@/views/template-market/component/TemplateMarketPreviewItem.vue' 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' import { imgUrlTrans } from '@/utils/imgUtils'
const { t } = useI18n() const { t } = useI18n()
@ -269,6 +269,11 @@ const initMarketTemplate = () => {
state.marketTemplatePreviewShowList = rsp.data.contents state.marketTemplatePreviewShowList = rsp.data.contents
state.hasResult = true state.hasResult = true
state.categories = rsp.data.categories 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) activeCategories.value = deepCopy(state.categories)
if (props.previewId) { if (props.previewId) {
state.marketTemplatePreviewShowList.forEach(categoryTemplates => { state.marketTemplatePreviewShowList.forEach(categoryTemplates => {
@ -377,9 +382,10 @@ onMounted(() => {
} }
} }
.aside-list { .aside-list {
padding: 0px 12px 12px 12px; padding: 0 12px 12px 12px;
width: 100%; width: 100%;
height: calc(100vh - 200px); height: calc(100vh - 200px);
overflow-x: hidden;
//overflow-y: auto; //overflow-y: auto;
:deep(.ed-collapse) { :deep(.ed-collapse) {
--ed-collapse-header-font-size: 14px !important; --ed-collapse-header-font-size: 14px !important;
@ -506,6 +512,7 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
color: var(--TextPrimary, #1f2329); color: var(--TextPrimary, #1f2329);
background: rgba(255, 255, 255, 1);
-webkit-appearance: none; -webkit-appearance: none;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
@ -611,6 +618,13 @@ onMounted(() => {
width: 100%; width: 100%;
height: calc(100% - 76px) !important; height: calc(100% - 76px) !important;
} }
.img-main img {
width: 100%;
height: 100%;
object-fit: contain; /* 保持图片比例,不裁剪 */
}
.open-button { .open-button {
cursor: pointer; cursor: pointer;
font-size: 30px; font-size: 30px;
@ -658,8 +672,8 @@ onMounted(() => {
cursor: pointer; cursor: pointer;
font-weight: 400; font-weight: 400;
color: #646a73; color: #646a73;
min-width: 64px;
height: 22px; height: 22px;
line-height: 22px;
display: flex; display: flex;
align-items: center; align-items: center;
white-space: nowrap; white-space: nowrap;
@ -675,7 +689,7 @@ onMounted(() => {
height: 100%; height: 100%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
display: none; display: none;
border-radius: 4px 0 0 0; border-radius: 4px;
} }
&:hover { &:hover {
@ -700,6 +714,7 @@ onMounted(() => {
font-weight: 400; font-weight: 400;
color: #1f2329; color: #1f2329;
cursor: default; cursor: default;
margin-left: 4px;
} }
.mp-divider { .mp-divider {
border-color: #1f232926; border-color: #1f232926;

View File

@ -119,6 +119,7 @@
v-show="state.networkStatus && state.hasResult" v-show="state.networkStatus && state.hasResult"
id="template-show-area" id="template-show-area"
class="template-right" class="template-right"
style="padding-top: 16px"
> >
<el-row v-if="state.marketActiveTab === null" <el-row v-if="state.marketActiveTab === null"
><TemplateSkeleton :width="state.templateCurWidth" ><TemplateSkeleton :width="state.templateCurWidth"
@ -141,6 +142,9 @@
<el-row v-show="state.marketActiveTab === t('work_branch.recommend')"> <el-row v-show="state.marketActiveTab === t('work_branch.recommend')">
<el-row <el-row
style="display: inline; width: 100%; margin-bottom: 32px" style="display: inline; width: 100%; margin-bottom: 32px"
:style="{
marginBottom: categoryItem.label !== t('work_branch.recent') ? '32px' : 0
}"
v-for="(categoryItem, index) in categoriesComputed" v-for="(categoryItem, index) in categoriesComputed"
:key="index" :key="index"
> >
@ -171,7 +175,7 @@
</div> </div>
</el-row> </el-row>
<el-row v-show="!state.networkStatus" class="template-empty"> <el-row v-show="!state.networkStatus" class="template-empty">
{{ t('visualization.market_network_tips') }} 111 {{ t('visualization.market_network_tips', [state.baseUrl]) }}
</el-row> </el-row>
</el-row> </el-row>
</el-row> </el-row>
@ -197,6 +201,7 @@ import { interactiveStoreWithOut } from '@/store/modules/interactive'
import { XpackComponent } from '@/components/plugin' import { XpackComponent } from '@/components/plugin'
import { useEmitt } from '@/hooks/web/useEmitt' import { useEmitt } from '@/hooks/web/useEmitt'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { getActiveCategories } from '@/utils/utils'
const { t } = useI18n() const { t } = useI18n()
const { wsCache } = useCache() const { wsCache } = useCache()
const embeddedStore = useEmbedded() const embeddedStore = useEmbedded()
@ -415,12 +420,16 @@ const initMarketTemplate = async () => {
.then(rsp => { .then(rsp => {
state.baseUrl = rsp.data.baseUrl state.baseUrl = rsp.data.baseUrl
state.currentMarketTemplateShowList = rsp.data.contents state.currentMarketTemplateShowList = rsp.data.contents
state.marketTabs = rsp.data.categories
state.marketActiveTab = state.marketTabs[1].label
initStyle() initStyle()
initTemplateShow() 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 state.networkStatus = false
}) })
} }
@ -466,7 +475,7 @@ const templateApply = template => {
apply(template) apply(template)
} }
const apply = template => { const apply = () => {
if (state.dvCreateForm.newFrom === 'new_market_template' && !state.dvCreateForm.templateUrl) { if (state.dvCreateForm.newFrom === 'new_market_template' && !state.dvCreateForm.templateUrl) {
ElMessage.warning(t('template_manage.get_download_link_hint')) ElMessage.warning(t('template_manage.get_download_link_hint'))
return false return false

View File

@ -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 icon_operationAnalysis_outlined from '@/assets/svg/icon_operation-analysis_outlined.svg'
import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg' import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg'
import icon_pc_outlined from '@/assets/svg/icon_pc_outlined.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 { useI18n } from '@/hooks/web/useI18n'
import { ref, reactive, onMounted, computed, watch } from 'vue' import { ref, reactive, onMounted, computed, watch } from 'vue'
import type { TabsPaneContext } from 'element-plus-secondary' import type { TabsPaneContext } from 'element-plus-secondary'
@ -61,6 +61,7 @@ const iconMap = {
panelMobile: dvDashboardSpineMobile, panelMobile: dvDashboardSpineMobile,
dashboard: icon_dashboard_outlined, dashboard: icon_dashboard_outlined,
dashboardMobile: dvDashboardSpineMobile, dashboardMobile: dvDashboardSpineMobile,
dashboardMobileDisabled: dvDashboardSpineMobileDisabled,
screen: icon_operationAnalysis_outlined, screen: icon_operationAnalysis_outlined,
dataV: icon_operationAnalysis_outlined, dataV: icon_operationAnalysis_outlined,
dataset: icon_app_outlined, dataset: icon_app_outlined,
@ -99,13 +100,15 @@ const triggerFilterPanel = () => {
loadTableData() loadTableData()
} }
const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank' const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank'
const preview = id => { const preview = (id, disabled = false) => {
if (!disabled) {
const routeUrl = resolve({ const routeUrl = resolve({
path: '/preview', path: '/preview',
query: { dvId: id } query: { dvId: id }
}) })
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
} }
}
const openDataset = id => { const openDataset = id => {
const routeUrl = resolve({ const routeUrl = resolve({
@ -198,7 +201,7 @@ const sortChange = param => {
} }
const handleCellClick = row => { const handleCellClick = row => {
if (row) { if (row && !checkDisabled(row)) {
const sourceId = activeName.value === 'recent' ? row.id : row.resourceId const sourceId = activeName.value === 'recent' ? row.id : row.resourceId
if (['dashboard', 'panel'].includes(row.type)) { if (['dashboard', 'panel'].includes(row.type)) {
window.open('#/panel/index?dvId=' + sourceId, '_self') window.open('#/panel/index?dvId=' + sourceId, '_self')
@ -238,7 +241,12 @@ const executeStore = rowInfo => {
}) })
} }
const checkDisabled = row => {
return activeName.value === 'store' && !row.extFlag1
}
const executeCancelStore = rowInfo => { const executeCancelStore = rowInfo => {
if (!checkDisabled(rowInfo)) {
const param = { const param = {
id: rowInfo.resourceId, id: rowInfo.resourceId,
type: rowInfo.type === 'dataV' ? 'screen' : 'panel' type: rowInfo.type === 'dataV' ? 'screen' : 'panel'
@ -247,6 +255,7 @@ const executeCancelStore = rowInfo => {
loadTableData() loadTableData()
}) })
} }
}
const imgType = ref() const imgType = ref()
const emptyDesc = ref('') const emptyDesc = ref('')
@ -352,18 +361,32 @@ const getEmptyDesc = (): string => {
<Icon <Icon
><component ><component
class="svg-icon" class="svg-icon"
:is="iconMap[scope.row.type + 'Mobile']" :is="
iconMap[
scope.row.type + 'Mobile' + (checkDisabled(scope.row) ? 'Disabled' : '')
]
"
></component ></component
></Icon> ></Icon>
</el-icon> </el-icon>
<el-icon v-else :class="`main-color color-${scope.row.type}`"> <el-icon
v-else
:class="`main-color color-${scope.row.type} custom-color${
checkDisabled(scope.row) ? '-disabled' : ''
}`"
>
<Icon <Icon
><component class="svg-icon" :is="iconMap[scope.row.type]"></component ><component class="svg-icon" :is="iconMap[scope.row.type]"></component
></Icon> ></Icon>
</el-icon> </el-icon>
<el-tooltip placement="top"> <el-tooltip placement="top">
<template #content>{{ scope.row.name }}</template> <template #content>{{ scope.row.name }}</template>
<span class="ellipsis" style="max-width: 250px">{{ scope.row.name }}</span> <span
class="ellipsis"
:class="{ 'color-disabled': checkDisabled(scope.row) }"
style="max-width: 250px"
>{{ scope.row.name }}</span
>
</el-tooltip> </el-tooltip>
<el-icon <el-icon
v-if="activeName === 'recent' && ['screen', 'panel'].includes(scope.row.type)" v-if="activeName === 'recent' && ['screen', 'panel'].includes(scope.row.type)"
@ -406,17 +429,24 @@ const getEmptyDesc = (): string => {
<el-table-column width="100" fixed="right" key="_operation" :label="$t('common.operate')"> <el-table-column width="100" fixed="right" key="_operation" :label="$t('common.operate')">
<template #default="scope"> <template #default="scope">
<div style="display: flex; flex-direction: row; align-items: center"> <div
style="display: flex; flex-direction: row; align-items: center"
:class="{ 'opt-disabled': checkDisabled(scope.row) }"
>
<template v-if="['dashboard', 'dataV', 'panel', 'screen'].includes(scope.row.type)"> <template v-if="['dashboard', 'dataV', 'panel', 'screen'].includes(scope.row.type)">
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="t('work_branch.new_page_preview')" :content="t('work_branch.new_page_preview')"
:disabled="checkDisabled(scope.row)"
placement="top" placement="top"
> >
<el-icon <el-icon
class="hover-icon hover-icon-in-table" class="hover-icon hover-icon-in-table"
@click.stop=" @click.stop="
preview(activeName === 'recent' ? scope.row.id : scope.row.resourceId) preview(
activeName === 'recent' ? scope.row.id : scope.row.resourceId,
checkDisabled(scope.row)
)
" "
> >
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon> <Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
@ -425,6 +455,7 @@ const getEmptyDesc = (): string => {
<ShareHandler <ShareHandler
v-if="!shareDisable" v-if="!shareDisable"
:in-grid="true" :in-grid="true"
:disabled="checkDisabled(scope.row)"
:weight="scope.row.weight" :weight="scope.row.weight"
:resource-id="activeName === 'recent' ? scope.row.id : scope.row.resourceId" :resource-id="activeName === 'recent' ? scope.row.id : scope.row.resourceId"
:resource-type="scope.row.type" :resource-type="scope.row.type"
@ -432,6 +463,7 @@ const getEmptyDesc = (): string => {
<el-tooltip <el-tooltip
v-if="activeName === 'store'" v-if="activeName === 'store'"
effect="dark" effect="dark"
:disabled="checkDisabled(scope.row)"
:content="t('work_branch.cancel_favorites')" :content="t('work_branch.cancel_favorites')"
placement="top" placement="top"
> >
@ -439,7 +471,7 @@ const getEmptyDesc = (): string => {
class="hover-icon hover-icon-in-table" class="hover-icon hover-icon-in-table"
@click.stop="executeCancelStore(scope.row)" @click.stop="executeCancelStore(scope.row)"
> >
<Icon name="icon_cancel_store"><icon_cancel_store class="svg-icon" /></Icon> <Icon name="icon_cancel_store"><visualStar class="svg-icon" /></Icon>
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
</template> </template>
@ -568,6 +600,19 @@ const getEmptyDesc = (): string => {
.jump-active { .jump-active {
cursor: pointer; cursor: pointer;
} }
.color-disabled {
color: #bbbfc4;
}
.opt-disabled {
opacity: 0.2;
cursor: not-allowed;
}
.custom-color-disabled {
background: #bbbfc4 !important;
}
</style> </style>
<style lang="less"> <style lang="less">
.menu-panel-select_popper { .menu-panel-select_popper {

View File

@ -345,7 +345,7 @@ loadShareBase()
v-if="!ele['menuAuth'] || !ele['anyManage']" v-if="!ele['menuAuth'] || !ele['anyManage']"
class="box-item" class="box-item"
effect="dark" effect="dark"
:content="t('work_branch.template_market_official')" :content="t('work_branch.permission_to_create')"
placement="top" placement="top"
> >
<div class="empty-tooltip-container" /> <div class="empty-tooltip-container" />
@ -430,7 +430,7 @@ loadShareBase()
</div> </div>
</el-row> </el-row>
<el-row v-show="!state.networkStatus" class="template-empty"> <el-row v-show="!state.networkStatus" class="template-empty">
{{ t('visualization.market_network_tips') }} {{ t('visualization.market_network_tips', [state.baseUrl]) }}
</el-row> </el-row>
</template> </template>
</div> </div>