This commit is contained in:
zlwu committed 2026-05-20 09:28:36 +08:00
1 parent e6072457fd
commit be4fab78e1
578 files changed
+174415 -214

No files matched your search

@@ -52,14 +52,14 @@
.art-svg-icon {
display: block;
margin: 0 auto;
font-size: 20px;
font-size: 16px;
}
.dual-menu-icon-placeholder {
display: block;
flex-shrink: 0;
width: 20px;
height: 20px;
width: 16px;
height: 16px;
margin: 0 auto;
}
@@ -2,7 +2,7 @@
// 菜单样式变量
$menu-height: 40px;
$menu-icon-size: 20px;
$menu-icon-size: 16px;
$menu-font-size: 13px;
$hover-bg-color: var(--mint-row-alt, #f8fafc);
$popup-menu-height: 40px;
@@ -17,7 +17,7 @@ $popup-menu-radius: 6px;
border-radius: 8px;
.menu-icon {
margin-left: -7px;
margin-left: -5px;
}
}
@@ -121,6 +121,12 @@ $popup-menu-radius: 6px;
height: $menu-icon-size;
margin-right: 8px;
font-size: $menu-icon-size;
.art-svg-icon {
width: $menu-icon-size;
height: $menu-icon-size;
font-size: $menu-icon-size;
}
}
.menu-icon__virtual {
@@ -62,12 +62,15 @@
import { storeToRefs } from 'pinia'
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 { formatMenuTitle } from '@/utils/router'
import { useSettingStore } from '@/store/modules/setting'
import { MenuItemType } from '../../others/art-menu-right/index.vue'
import { useCommon } from '@/hooks/core/useCommon'
import { WorkTab } from '@/types'
import type { AppRouteRecord } from '@/types/router'
defineOptions({ name: 'ArtWorkTab' })
@@ -87,6 +90,7 @@
// 基础设置
const { t } = useI18n()
const store = useWorktabStore()
const menuStore = useMenuStore()
const userStore = useUserStore()
const route = useRoute()
const router = useRouter()
@@ -340,6 +344,16 @@
}
}
/** 标签全部关闭后,导航到侧栏第一个二级菜单 */
const navigateToDefaultMenuWhenEmpty = () => {
const fromMenu = getFirstSecondLevelMenuPath(menuStore.menuList as AppRouteRecord[])
const home = useCommon().homePath.value
const fallbackPath = fromMenu || (home && !isWorkbenchRoute(home) ? home : '')
if (fallbackPath && route.path !== fallbackPath) {
router.push(fallbackPath)
}
}
// 标签页操作逻辑
const useTabOperations = (adjustPositionAfterClose: () => void) => {
const clickTab = (item: WorkTab) => {
@@ -363,6 +377,9 @@
closeActions[type]?.()
setTimeout(() => {
if (store.opened.length === 0) {
navigateToDefaultMenuWhenEmpty()
}
adjustPositionAfterClose()
}, 100)
}