侧边栏修正

This commit is contained in:
2025-12-13 16:46:04 +08:00
parent b57a002de8
commit a9b2c729e3
14 changed files with 114 additions and 56 deletions

View File

@@ -108,14 +108,7 @@ import {
Loading
} from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
interface MenuItem {
key: string
label: string
icon: string
url?: string
type: 'route' | 'iframe'
}
import type { MenuItem } from 'shared/types'
const router = useRouter()
const route = useRoute()
@@ -227,7 +220,7 @@ const handleMenuClick = (item: MenuItem) => {
// 所有菜单都通过路由跳转
if (item.url) {
router.push(item.url)
if (item.type === 'iframe') {
if (item.viewType === 'iframe') {
iframeLoading.value = true
}
}

View File

@@ -95,15 +95,28 @@ declare module 'shared/types' {
parentId?: string
url?: string
component?: string
service?: string
iframeUrl?: string
icon?: string
type?: number
viewType?: string
service?: string
layout?: string
orderNum?: number
description?: string
children?: TbSysViewDTO[]
}
// 菜单项类型(扩展 TbSysViewDTO
export interface MenuItem extends TbSysViewDTO {
key: string
label: string
expanded?: boolean
children?: MenuItem[]
}
// 菜单工具函数
export function toMenuItem(view: TbSysViewDTO, expanded?: boolean): MenuItem
export function toMenuItems(views: TbSysViewDTO[], defaultExpanded?: boolean): MenuItem[]
}
declare module 'shared/utils/route' {