style(diskMonitor): 统一磁盘监控页面样式规范
- 添加页面边距、表格样式和按钮样式约定到 AGENTS.md 文档 - 为任务详情抽屉组件添加卡片样式和表格结构优化 - 重构任务表格组件,增加搜索功能和列设置选项 - 移除独立的策略表单组件,整合到汇总页面 - 优化监控摘要组件的网格布局和样式 - 重新设计目标对话框的表单分组和禁用状态处理 - 统一所有组件使用 card、table-main 等标准类名 - 添加文件编码规范要求确保 UTF-8 编码一致性
This commit is contained in:
@@ -26,12 +26,16 @@
|
||||
import Sortable from 'sortablejs'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { TabPaneName, TabsPaneContext } from 'element-plus'
|
||||
import type { TabPaneName, TabsPaneContext } from 'element-plus'
|
||||
import { HOME_URL } from '@/config'
|
||||
import { useGlobalStore } from '@/stores/modules/global'
|
||||
import { useTabsStore } from '@/stores/modules/tabs'
|
||||
import MoreButton from './components/MoreButton.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'LayoutTabs'
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const tabStore = useTabsStore()
|
||||
@@ -41,17 +45,41 @@ const tabsMenuValue = ref(route.fullPath)
|
||||
const tabsMenuList = computed(() => tabStore.tabsMenuList)
|
||||
const tabsIcon = computed(() => globalStore.tabsIcon)
|
||||
|
||||
const resolveCurrentTabPath = () => {
|
||||
const parentPath = route.meta.parentPath as string | undefined
|
||||
return route.meta.hideTab ? parentPath || route.fullPath : route.fullPath
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tabsDrop()
|
||||
initTabs()
|
||||
})
|
||||
|
||||
const ensureParentTab = () => {
|
||||
const parentPath = resolveCurrentTabPath()
|
||||
if (!parentPath || tabStore.tabsMenuList.some(item => item.path === parentPath)) return
|
||||
|
||||
const parentRoute = router.getRoutes().find(item => item.path === parentPath && item.name)
|
||||
if (!parentRoute) return
|
||||
|
||||
// 直接打开隐藏子页时补齐父级主标签
|
||||
tabStore.addTabs({
|
||||
icon: parentRoute.meta.icon as string,
|
||||
title: parentRoute.meta.title as string,
|
||||
path: parentRoute.path,
|
||||
name: parentRoute.name as string,
|
||||
close: !parentRoute.meta.isAffix,
|
||||
isKeepAlive: parentRoute.meta.isKeepAlive as boolean
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => route.fullPath,
|
||||
() => {
|
||||
if (route.meta.isFull) return
|
||||
if (route.meta.hideTab) {
|
||||
tabsMenuValue.value = route.meta.parentPath as string
|
||||
ensureParentTab()
|
||||
tabsMenuValue.value = resolveCurrentTabPath()
|
||||
} else {
|
||||
tabsMenuValue.value = route.fullPath
|
||||
const tabsParams = {
|
||||
@@ -112,7 +140,7 @@ const tabClick = (tabItem: TabsPaneContext) => {
|
||||
}
|
||||
|
||||
const tabRemove = (fullPath: TabPaneName) => {
|
||||
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath)
|
||||
tabStore.removeTabs(fullPath as string, fullPath === tabsMenuValue.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user