提交
This commit is contained in:
1 parent
7c838cfb2d
commit
8e70047f4c
161 files changed
+16659
-10436
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<!-- 系统logo -->
|
||||
<template>
|
||||
<div class="flex-cc">
|
||||
<img :style="logoStyle" src="/logo.gif" alt="山峡化工" class="block object-contain" />
|
||||
<img :style="logoStyle" :src="src" alt="山峡化工" class="block object-contain" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
interface Props {
|
||||
/** logo 大小 */
|
||||
size?: number | string
|
||||
/** logo 图片路径 */
|
||||
src?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
size: 36
|
||||
size: 36,
|
||||
src: '/logo.gif'
|
||||
})
|
||||
|
||||
const logoStyle = computed(() => {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<!-- 列表序号列:有分页时连续编号,无分页时从 1 递增 -->
|
||||
<script setup lang="ts">
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}>(),
|
||||
{
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
)
|
||||
|
||||
function resolveIndex(index: number) {
|
||||
return (props.page - 1) * props.pageSize + index + 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="resolveIndex"
|
||||
/>
|
||||
</template>
|
||||
@@ -111,14 +111,21 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user-avatar-wrapper {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 5px;
|
||||
background-color: #fff;
|
||||
line-height: 0;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
padding: 2px;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
:deep(.el-avatar) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
:item="item"
|
||||
:isMobile="false"
|
||||
:level="0"
|
||||
:show-icon="showIcon"
|
||||
/>
|
||||
</ElMenu>
|
||||
</div>
|
||||
@@ -37,12 +38,15 @@
|
||||
interface Props {
|
||||
/** 菜单列表数据 */
|
||||
list: AppRouteRecord[]
|
||||
/** 是否展示菜单图标 */
|
||||
showIcon?: boolean
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
list: () => []
|
||||
list: () => [],
|
||||
showIcon: true
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
+12
-1
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<ElSubMenu v-if="hasChildren" :index="item.path || item.meta.title" class="!p-0">
|
||||
<template #title>
|
||||
<ArtSvgIcon :icon="item.meta.icon" :color="theme?.iconColor" class="mr-1 text-lg" />
|
||||
<ArtSvgIcon
|
||||
v-if="showIcon"
|
||||
:icon="item.meta.icon"
|
||||
:color="theme?.iconColor"
|
||||
class="mr-1 text-lg"
|
||||
/>
|
||||
<span class="text-md">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge art-badge-horizontal" />
|
||||
<div v-if="item.meta.showTextBadge" class="art-text-badge">
|
||||
@@ -17,6 +22,7 @@
|
||||
:theme="theme"
|
||||
:is-mobile="isMobile"
|
||||
:level="level + 1"
|
||||
:show-icon="showIcon"
|
||||
@close="closeMenu"
|
||||
/>
|
||||
</ElSubMenu>
|
||||
@@ -27,6 +33,7 @@
|
||||
@click="goPage(item)"
|
||||
>
|
||||
<ArtSvgIcon
|
||||
v-if="showIcon"
|
||||
:icon="item.meta.icon"
|
||||
:color="theme?.iconColor"
|
||||
class="mr-1 text-lg"
|
||||
@@ -63,6 +70,10 @@
|
||||
level: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
overflow: hidden;
|
||||
line-height: normal;
|
||||
cursor: pointer;
|
||||
background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
|
||||
background: linear-gradient(135deg, #1ca851 0%, #49be78 100%);
|
||||
border-bottom: none !important;
|
||||
|
||||
.header-brand {
|
||||
|
||||
@@ -215,7 +215,7 @@ $popup-menu-radius: 6px;
|
||||
.el-menu--collapse {
|
||||
.el-sub-menu.is-active {
|
||||
.el-sub-menu__title {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
|
||||
.menu-icon {
|
||||
.art-svg-icon {
|
||||
@@ -226,7 +226,7 @@ $popup-menu-radius: 6px;
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
color: #fff !important;
|
||||
|
||||
span,
|
||||
@@ -240,7 +240,7 @@ $popup-menu-radius: 6px;
|
||||
// ---------------------- Design theme menu ----------------------
|
||||
.el-menu-design {
|
||||
@include theme-menu-base;
|
||||
@include menu-active(#fff, var(--primary, #10b981), #fff);
|
||||
@include menu-active(#fff, var(--primary, #1ca851), #fff);
|
||||
@include menu-hover($hover-bg-color);
|
||||
|
||||
.el-menu-item,
|
||||
@@ -274,7 +274,7 @@ $popup-menu-radius: 6px;
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
color: #fff !important;
|
||||
font-weight: 600;
|
||||
|
||||
@@ -322,7 +322,7 @@ $popup-menu-radius: 6px;
|
||||
.el-menu--popup {
|
||||
.el-menu-item.is-active {
|
||||
color: #fff !important;
|
||||
background-color: var(--primary, #10b981) !important;
|
||||
background-color: var(--primary, #1ca851) !important;
|
||||
|
||||
span,
|
||||
.menu-name,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<RouterView v-if="isRefresh" v-slot="{ Component, route }" :style="contentStyle">
|
||||
<!-- 缓存路由动画 -->
|
||||
<Transition :name="showTransitionMask ? '' : actualTransition" mode="out-in" appear>
|
||||
<KeepAlive :max="10" :exclude="keepAliveExclude">
|
||||
<KeepAlive :max="keepAliveMax" :exclude="keepAliveExclude">
|
||||
<component
|
||||
class="art-page-view"
|
||||
:is="Component"
|
||||
@@ -59,9 +59,11 @@
|
||||
|
||||
const route = useRoute()
|
||||
const { containerMinHeight } = useAutoLayoutHeight()
|
||||
const { pageTransition, containerWidth, refresh } = storeToRefs(useSettingStore())
|
||||
const { pageTransition, containerWidth, refresh, showWorkTab } = storeToRefs(useSettingStore())
|
||||
const { keepAliveExclude } = storeToRefs(useWorktabStore())
|
||||
|
||||
const keepAliveMax = computed(() => (showWorkTab.value ? 10 : 1))
|
||||
|
||||
const isRefresh = shallowRef(true)
|
||||
const isOpenRouteInfo = import.meta.env.VITE_OPEN_ROUTE_INFO
|
||||
const showTransitionMask = ref(false)
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
<template>
|
||||
<header class="portal-header">
|
||||
<div class="portal-header-brand" @click="toHome">
|
||||
<ArtLogo class="portal-header-logo" />
|
||||
<ArtLogo class="portal-header-logo" src="/logo-sx.svg" :size="38" />
|
||||
<p class="portal-header-title">{{ AppConfig.systemInfo.name }}</p>
|
||||
</div>
|
||||
|
||||
<ArtPortalTopNav class="portal-header-nav" />
|
||||
<div class="portal-header-nav">
|
||||
<ArtPortalModuleSelect />
|
||||
<ArtPortalSubNav class="portal-header-sub-nav" />
|
||||
</div>
|
||||
|
||||
<div class="portal-header-actions">
|
||||
<ArtPortalMobileMenu />
|
||||
<ArtIconButton
|
||||
v-if="shouldShowFullscreen"
|
||||
icon="fullscreen"
|
||||
:class="[!isFullscreen ? 'full-screen-btn' : 'exit-full-screen-btn']"
|
||||
:class="[
|
||||
'portal-header-icon-btn',
|
||||
!isFullscreen ? 'full-screen-btn' : 'exit-full-screen-btn'
|
||||
]"
|
||||
class="max-md:!hidden"
|
||||
@click="toggleFullScreen"
|
||||
/>
|
||||
@@ -55,8 +62,8 @@
|
||||
height: 56px;
|
||||
padding: 0 var(--mint-content-padding, 24px);
|
||||
user-select: none;
|
||||
background: var(--mint-surface, #fff);
|
||||
border-bottom: 1px solid var(--mint-border, #d9e8e2);
|
||||
background: var(--mint-primary, #1ca851);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.portal-header-brand {
|
||||
@@ -64,10 +71,10 @@
|
||||
flex-shrink: 0;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
margin-right: 12px;
|
||||
margin-right: 4px;
|
||||
padding-right: 16px;
|
||||
cursor: pointer;
|
||||
border-right: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
.portal-header-logo {
|
||||
@@ -75,19 +82,26 @@
|
||||
}
|
||||
|
||||
.portal-header-title {
|
||||
max-width: 180px;
|
||||
max-width: 240px;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
color: var(--mint-text, #1e293b);
|
||||
white-space: normal;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.portal-header-nav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.portal-header-sub-nav {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.portal-header-actions {
|
||||
@@ -96,6 +110,90 @@
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.portal-module-select-trigger) {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.28);
|
||||
|
||||
.portal-module-select-trigger__icon,
|
||||
.portal-module-select-trigger__label,
|
||||
.portal-module-select-trigger__arrow {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:hover:not(.is-disabled) {
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
border-color: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__icon),
|
||||
:deep(.portal-sub-nav-card__label) {
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__icon-arrow) {
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-sub-menu__title) {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-sub-menu__icon-more),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-icon) {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow:hover .el-sub-menu__title) {
|
||||
background: rgba(255, 255, 255, 0.14) !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover .portal-sub-nav-card) {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .portal-sub-nav-card) {
|
||||
background: #fff;
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: var(--mint-primary, #1ca851);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-mobile-menu-trigger) {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.28);
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
border-color: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-header-icon-btn) {
|
||||
color: #fff !important;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.14) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (width <= 800px) {
|
||||
.portal-header-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.portal-header-sub-nav {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<!-- 门户窄屏菜单抽屉(≤800px) -->
|
||||
<template>
|
||||
<div class="portal-mobile-menu">
|
||||
<ElButton class="portal-mobile-menu-trigger" @click="drawerVisible = true">
|
||||
<ElIcon><Menu /></ElIcon>
|
||||
<span>菜单</span>
|
||||
</ElButton>
|
||||
|
||||
<ElDrawer
|
||||
v-model="drawerVisible"
|
||||
title="功能菜单"
|
||||
direction="ltr"
|
||||
size="280px"
|
||||
:modal-class="'portal-mobile-menu-mask'"
|
||||
class="portal-mobile-menu-drawer"
|
||||
append-to-body
|
||||
>
|
||||
<ElScrollbar v-if="subMenuList.length">
|
||||
<ElMenu
|
||||
:default-active="routerPath"
|
||||
class="portal-mobile-menu-tree"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<SidebarSubmenu
|
||||
:list="subMenuList"
|
||||
:is-mobile="true"
|
||||
:level="1"
|
||||
@close="drawerVisible = false"
|
||||
/>
|
||||
</ElMenu>
|
||||
</ElScrollbar>
|
||||
<p v-else class="portal-mobile-menu-empty">当前模块暂无可用菜单</p>
|
||||
</ElDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { Menu } from '@element-plus/icons-vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { filterSidebarRoutes } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolvePortalSubMenus } from '@/utils/router/portal-menu'
|
||||
import SidebarSubmenu from '../art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalMobileMenu' })
|
||||
|
||||
const route = useRoute()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const drawerVisible = ref(false)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
const routerPath = computed(() => currentRoutePath.value)
|
||||
|
||||
const subMenuList = computed<AppRouteRecord[]>(() => {
|
||||
const raw = resolvePortalSubMenus(menuList.value, currentRoutePath.value)
|
||||
return filterSidebarRoutes(raw)
|
||||
})
|
||||
|
||||
const handleMenuSelect = (): void => {
|
||||
drawerVisible.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-mobile-menu {
|
||||
display: none;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.portal-mobile-menu-trigger {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
font-size: 14px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.portal-mobile-menu-empty {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
:deep(.portal-mobile-menu-tree) {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
@media only screen and (width <= 800px) {
|
||||
.portal-mobile-menu {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-mobile-menu-mask {
|
||||
backdrop-filter: none !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,185 @@
|
||||
<!-- 门户顶栏一级模块下拉 -->
|
||||
<template>
|
||||
<div class="portal-module-select">
|
||||
<ElDropdown
|
||||
v-if="moduleList.length"
|
||||
trigger="click"
|
||||
popper-class="portal-module-select-popper"
|
||||
@command="handleModuleSelect"
|
||||
>
|
||||
<button type="button" class="portal-module-select-trigger">
|
||||
<ArtSvgIcon
|
||||
v-if="activeModule?.meta?.icon"
|
||||
:icon="activeModule.meta.icon"
|
||||
class="portal-module-select-trigger__icon"
|
||||
/>
|
||||
<span class="portal-module-select-trigger__label">{{ triggerLabel }}</span>
|
||||
<ElIcon class="portal-module-select-trigger__arrow"><ArrowDown /></ElIcon>
|
||||
</button>
|
||||
<template #dropdown>
|
||||
<ElDropdownMenu>
|
||||
<ElDropdownItem
|
||||
v-for="item in moduleList"
|
||||
:key="item.path"
|
||||
:command="item.path"
|
||||
:class="{ 'is-active': item.isActive }"
|
||||
>
|
||||
<ArtSvgIcon
|
||||
v-if="item.meta.icon"
|
||||
:icon="item.meta.icon"
|
||||
class="portal-module-select-item__icon"
|
||||
/>
|
||||
<span>{{ item.formattedTitle }}</span>
|
||||
</ElDropdownItem>
|
||||
</ElDropdownMenu>
|
||||
</template>
|
||||
</ElDropdown>
|
||||
<button v-else type="button" class="portal-module-select-trigger is-disabled" disabled>
|
||||
<span class="portal-module-select-trigger__label">暂无可用模块</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { ArrowDown } from '@element-plus/icons-vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import {
|
||||
filterPortalTopModules,
|
||||
getFirstAccessiblePath,
|
||||
isPortalModuleActive,
|
||||
PORTAL_DEFAULT_MODULE_PATH,
|
||||
resolveActivePortalModule
|
||||
} from '@/utils/router/portal-menu'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalModuleSelect' })
|
||||
|
||||
interface PortalModuleItem extends AppRouteRecord {
|
||||
isActive: boolean
|
||||
formattedTitle: string
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
|
||||
const moduleList = computed<PortalModuleItem[]>(() => {
|
||||
return filterPortalTopModules(menuList.value).map((item) => ({
|
||||
...item,
|
||||
isActive: isPortalModuleActive(item, currentRoutePath.value),
|
||||
formattedTitle: formatMenuTitle(item.meta.title)
|
||||
}))
|
||||
})
|
||||
|
||||
const activeModule = computed(() => {
|
||||
const matched = resolveActivePortalModule(menuList.value, currentRoutePath.value)
|
||||
if (matched) {
|
||||
return matched
|
||||
}
|
||||
return moduleList.value.find((item) => item.path === PORTAL_DEFAULT_MODULE_PATH) || moduleList.value[0]
|
||||
})
|
||||
|
||||
const triggerLabel = computed(() => {
|
||||
if (activeModule.value) {
|
||||
return formatMenuTitle(activeModule.value.meta.title)
|
||||
}
|
||||
return moduleList.value[0]?.formattedTitle || '选择模块'
|
||||
})
|
||||
|
||||
const handleModuleSelect = (modulePath: string): void => {
|
||||
const module = moduleList.value.find((item) => item.path === modulePath)
|
||||
if (!module || module.isActive) {
|
||||
return
|
||||
}
|
||||
|
||||
const target = getFirstAccessiblePath(module)
|
||||
if (target && target !== route.path) {
|
||||
router.push(target)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-module-select {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.portal-module-select-trigger {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
max-width: 180px;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 8px;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
border-color 0.2s ease;
|
||||
|
||||
&__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 18px;
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&__label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: var(--mint-text, #1e293b);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
&:hover:not(.is-disabled) {
|
||||
border-color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
cursor: not-allowed;
|
||||
background: var(--mint-bg-page, #f8fafc);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-module-select-popper.el-popper {
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
.portal-module-select-popper {
|
||||
.el-dropdown-menu__item {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
font-size: 15px;
|
||||
|
||||
&.is-active {
|
||||
color: var(--primary, #1ca851);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
}
|
||||
|
||||
.portal-module-select-item__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,225 @@
|
||||
<!-- 门户顶栏二三级水平菜单(上图标、下标题) -->
|
||||
<template>
|
||||
<div v-show="subMenuList.length" class="portal-sub-nav">
|
||||
<ElMenu
|
||||
mode="horizontal"
|
||||
:ellipsis="true"
|
||||
:default-active="routerPath"
|
||||
background-color="transparent"
|
||||
:show-timeout="50"
|
||||
:hide-timeout="50"
|
||||
popper-class="portal-sub-nav-popper"
|
||||
class="portal-sub-nav-menu"
|
||||
>
|
||||
<PortalSubmenu
|
||||
v-for="(item, index) in subMenuList"
|
||||
:key="`${item.path || item.meta.title}-${index}`"
|
||||
:item="item"
|
||||
:level="2"
|
||||
/>
|
||||
</ElMenu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { filterSidebarRoutes } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolvePortalSubMenus } from '@/utils/router/portal-menu'
|
||||
import PortalSubmenu from './widget/PortalSubmenu.vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalSubNav' })
|
||||
|
||||
const route = useRoute()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
const routerPath = computed(() => currentRoutePath.value)
|
||||
|
||||
const subMenuList = computed<AppRouteRecord[]>(() => {
|
||||
const raw = resolvePortalSubMenus(menuList.value, currentRoutePath.value)
|
||||
return filterSidebarRoutes(raw)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-sub-nav {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.portal-sub-nav-menu {
|
||||
width: 100%;
|
||||
height: 56px;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu.el-menu--horizontal) {
|
||||
height: 56px;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title) {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 56px !important;
|
||||
padding: 0 6px !important;
|
||||
margin: 0 2px;
|
||||
line-height: normal !important;
|
||||
background-color: transparent !important;
|
||||
border-bottom: none !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover > .el-sub-menu__title),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title:hover) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title) {
|
||||
padding-right: 22px !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__icon-arrow) {
|
||||
right: 4px;
|
||||
margin-top: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card) {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 56px;
|
||||
min-height: 48px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 8px;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
color 0.2s ease;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__icon) {
|
||||
flex-shrink: 0;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__label) {
|
||||
font-size: 14px;
|
||||
line-height: 1.3;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover .portal-sub-nav-card) {
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active .portal-sub-nav-card) {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .portal-sub-nav-card) {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .el-sub-menu__title) {
|
||||
background: transparent !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-sub-nav-popper.el-popper {
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
.portal-sub-nav-popper {
|
||||
.el-menu-item,
|
||||
.el-sub-menu__title {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.el-menu-item:hover,
|
||||
.el-sub-menu__title:hover {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: auto !important;
|
||||
min-height: 56px;
|
||||
padding: 4px 8px !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.portal-sub-nav-card {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 56px;
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.portal-sub-nav-card__icon {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.portal-sub-nav-card__label {
|
||||
font-size: 14px;
|
||||
line-height: 1.3;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.el-menu-item:hover .portal-sub-nav-card {
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
.el-menu-item.is-active .portal-sub-nav-card {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<ElSubMenu
|
||||
v-if="hasChildren"
|
||||
:index="item.path || item.meta.title"
|
||||
popper-class="portal-sub-nav-popper"
|
||||
class="portal-sub-nav-submenu"
|
||||
>
|
||||
<template #title>
|
||||
<div class="portal-sub-nav-card">
|
||||
<ArtSvgIcon
|
||||
:icon="menuIcon"
|
||||
class="portal-sub-nav-card__icon"
|
||||
/>
|
||||
<span class="portal-sub-nav-card__label">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<PortalSubmenu
|
||||
v-for="(child, index) in filteredChildren"
|
||||
:key="getUniqueKey(child, index)"
|
||||
:item="child"
|
||||
:level="level + 1"
|
||||
/>
|
||||
</ElSubMenu>
|
||||
|
||||
<ElMenuItem
|
||||
v-else-if="isNavigableRoute"
|
||||
:index="item.path || item.meta.title"
|
||||
class="portal-sub-nav-menuitem"
|
||||
@click="goPage(item)"
|
||||
>
|
||||
<div class="portal-sub-nav-card">
|
||||
<ArtSvgIcon
|
||||
:icon="menuIcon"
|
||||
class="portal-sub-nav-card__icon"
|
||||
/>
|
||||
<span class="portal-sub-nav-card__label">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge" />
|
||||
<div v-if="item.meta.showTextBadge" class="art-text-badge">
|
||||
{{ item.meta.showTextBadge }}
|
||||
</div>
|
||||
</div>
|
||||
</ElMenuItem>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { filterSidebarRoutes, isSidebarNavigableRoute } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolveSidebarMenuIcon } from '@/utils/router/menu-icon'
|
||||
import { handleMenuJump } from '@/utils/navigation'
|
||||
|
||||
defineOptions({ name: 'PortalSubmenu' })
|
||||
|
||||
interface Props {
|
||||
item: AppRouteRecord
|
||||
level?: number
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
level: 2
|
||||
})
|
||||
|
||||
const filteredChildren = computed(() => filterSidebarRoutes(props.item.children || []))
|
||||
|
||||
const hasChildren = computed(() => filteredChildren.value.length > 0)
|
||||
|
||||
const isNavigableRoute = computed(() => isSidebarNavigableRoute(props.item))
|
||||
|
||||
const menuIcon = computed(() =>
|
||||
resolveSidebarMenuIcon(props.item, hasChildren.value)
|
||||
)
|
||||
|
||||
const goPage = (item: AppRouteRecord): void => {
|
||||
handleMenuJump(item)
|
||||
}
|
||||
|
||||
const getUniqueKey = (item: AppRouteRecord, index: number): string => {
|
||||
return `${item.path || item.meta.title || 'menu'}-${props.level}-${index}`
|
||||
}
|
||||
</script>
|
||||
@@ -139,11 +139,11 @@
|
||||
}
|
||||
|
||||
&:hover:not(.is-active) {
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-top-nav-card__icon,
|
||||
.portal-top-nav-card__label {
|
||||
|
||||
+11
-1
@@ -1,14 +1,16 @@
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ContainerWidthEnum } from '@/enums/appEnum'
|
||||
import { ContainerWidthEnum, MenuTypeEnum } from '@/enums/appEnum'
|
||||
import AppConfig from '@/config'
|
||||
import { headerBarConfig } from '@/config/modules/headerBar'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
|
||||
/**
|
||||
* 设置项配置选项管理
|
||||
*/
|
||||
export function useSettingsConfig() {
|
||||
const { t } = useI18n()
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
// 标签页风格选项
|
||||
const tabStyleOptions = computed(() => [
|
||||
@@ -219,6 +221,14 @@ export function useSettingsConfig() {
|
||||
return (
|
||||
allSettings
|
||||
.filter((setting) => {
|
||||
// 门户严格单页:隐藏多标签与标签样式配置
|
||||
if (
|
||||
settingStore.menuType === MenuTypeEnum.PORTAL &&
|
||||
(setting.key === 'showWorkTab' || setting.key === 'tabStyle')
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 如果设置项不依赖headerBar配置,则始终显示
|
||||
if (setting.headerBarKey === null) {
|
||||
return true
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
import { useWorktabStore } from '@/store/modules/worktab'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getFirstSecondLevelMenuPath, isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { getPortalDefaultHomePath, getPortalDefaultPathForRoute } from '@/utils/router/portal-menu'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
import { MenuItemType } from '../../others/art-menu-right/index.vue'
|
||||
@@ -344,9 +345,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
/** 标签全部关闭后,导航到侧栏第一个二级菜单 */
|
||||
/** 标签全部关闭后,导航到当前模块第一个二级菜单 */
|
||||
const navigateToDefaultMenuWhenEmpty = () => {
|
||||
const fromMenu = getFirstSecondLevelMenuPath(menuStore.menuList as AppRouteRecord[])
|
||||
const currentPath = String(route.meta.activePath || route.path)
|
||||
const fromModule = getPortalDefaultPathForRoute(
|
||||
menuStore.menuList as AppRouteRecord[],
|
||||
currentPath
|
||||
)
|
||||
const fromMenu =
|
||||
fromModule || getPortalDefaultHomePath(menuStore.menuList as AppRouteRecord[])
|
||||
const home = useCommon().homePath.value
|
||||
const fallbackPath = fromMenu || (home && !isWorkbenchRoute(home) ? home : '')
|
||||
if (fallbackPath && route.path !== fallbackPath) {
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
right: -80px;
|
||||
width: 360px;
|
||||
height: 360px;
|
||||
background: rgba(16, 185, 129, 0.18);
|
||||
background: rgba(28, 168, 81, 0.18);
|
||||
}
|
||||
|
||||
.exception-page__blob--2 {
|
||||
|
||||
Reference in new issue
Block a user