2026-05-06 22:23:42 +08:00
|
|
|
import { computed } from 'vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
import { icons } from '../data/icons.js'
|
|
|
|
|
|
2026-05-07 15:55:23 +08:00
|
|
|
export const appViews = ['overview', 'workbench', 'requests', 'approval', 'chat', 'policies', 'audit', 'employees', 'settings']
|
2026-05-06 22:23:42 +08:00
|
|
|
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
export const navItems = [
|
2026-04-29 23:35:56 +08:00
|
|
|
{
|
|
|
|
|
id: 'overview',
|
|
|
|
|
label: '总览',
|
2026-05-06 22:23:42 +08:00
|
|
|
navHint: '查看系统总览与关键指标',
|
2026-04-29 23:35:56 +08:00
|
|
|
icon: icons.dashboard,
|
2026-05-06 22:23:42 +08:00
|
|
|
title: '财务运营总览',
|
|
|
|
|
desc: '聚合差旅申请、审批效率、风险信号与 SLA 表现。'
|
2026-04-29 23:35:56 +08:00
|
|
|
},
|
2026-05-05 18:22:47 +08:00
|
|
|
{
|
|
|
|
|
id: 'workbench',
|
|
|
|
|
label: '个人工作台',
|
2026-05-06 22:23:42 +08:00
|
|
|
navHint: '集中处理个人待办',
|
2026-05-05 18:22:47 +08:00
|
|
|
icon: icons.workspace,
|
|
|
|
|
title: '个人工作台',
|
2026-05-06 22:23:42 +08:00
|
|
|
desc: '聚焦当前待办、快捷操作与助手入口。'
|
2026-05-05 18:22:47 +08:00
|
|
|
},
|
2026-04-29 23:35:56 +08:00
|
|
|
{
|
|
|
|
|
id: 'requests',
|
2026-05-06 22:23:42 +08:00
|
|
|
label: '申请单',
|
|
|
|
|
navHint: '查看和管理申请单',
|
2026-04-29 23:35:56 +08:00
|
|
|
icon: icons.list,
|
2026-05-06 22:23:42 +08:00
|
|
|
title: '差旅申请与单据',
|
|
|
|
|
desc: '集中查看申请单状态、处理进度和风险提示。'
|
2026-04-30 17:11:24 +08:00
|
|
|
},
|
2026-05-01 00:39:24 +08:00
|
|
|
{
|
|
|
|
|
id: 'approval',
|
|
|
|
|
label: '审批中心',
|
2026-05-06 22:23:42 +08:00
|
|
|
navHint: '处理审批任务',
|
2026-05-01 00:39:24 +08:00
|
|
|
icon: icons.approval,
|
|
|
|
|
title: '审批中心',
|
2026-05-06 22:23:42 +08:00
|
|
|
desc: '按优先级处理待审批事项,控制时效与风险。'
|
2026-05-01 00:39:24 +08:00
|
|
|
},
|
2026-04-30 17:11:24 +08:00
|
|
|
{
|
|
|
|
|
id: 'chat',
|
2026-05-06 22:23:42 +08:00
|
|
|
label: 'AI 助手',
|
|
|
|
|
navHint: '进入智能问答',
|
2026-04-30 17:11:24 +08:00
|
|
|
icon: icons.message,
|
2026-05-06 22:23:42 +08:00
|
|
|
title: 'AI 财务助手',
|
|
|
|
|
desc: '围绕制度、票据、审批和差旅场景进行快速问答。'
|
2026-04-29 23:35:56 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'policies',
|
2026-05-06 22:23:42 +08:00
|
|
|
label: '制度知识',
|
|
|
|
|
navHint: '查看制度与知识库',
|
2026-04-29 23:35:56 +08:00
|
|
|
icon: icons.file,
|
2026-05-06 22:23:42 +08:00
|
|
|
title: '制度与知识库',
|
|
|
|
|
desc: '统一管理制度文档、知识问答和搜索入口。'
|
2026-04-29 23:35:56 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'audit',
|
2026-05-11 01:53:30 +00:00
|
|
|
label: '任务规则中心',
|
|
|
|
|
navHint: '查看和管理任务规则配置',
|
2026-05-05 22:35:38 +08:00
|
|
|
icon: icons.skill,
|
2026-05-11 01:53:30 +00:00
|
|
|
title: '任务规则中心',
|
|
|
|
|
desc: '集中管理规则文件、外部 MCP 服务与定时任务调度。'
|
2026-05-06 11:00:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'employees',
|
|
|
|
|
label: '员工管理',
|
2026-05-06 22:23:42 +08:00
|
|
|
navHint: '维护员工与组织信息',
|
2026-05-06 11:00:38 +08:00
|
|
|
icon: icons.users,
|
2026-05-06 22:23:42 +08:00
|
|
|
title: '员工与组织管理',
|
|
|
|
|
desc: '维护员工账号、组织结构与角色权限。'
|
2026-05-07 15:55:23 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'settings',
|
|
|
|
|
label: '系统设置',
|
|
|
|
|
navHint: '维护企业品牌、管理员安全与系统配置',
|
|
|
|
|
icon: icons.settings,
|
|
|
|
|
title: '系统设置中心',
|
|
|
|
|
desc: '集中配置公司名称、管理员账号安全、模型接入、日志策略与邮箱通知。'
|
2026-04-29 23:35:56 +08:00
|
|
|
}
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
]
|
|
|
|
|
|
2026-05-06 22:23:42 +08:00
|
|
|
const viewRouteNames = {
|
|
|
|
|
overview: 'app-overview',
|
|
|
|
|
workbench: 'app-workbench',
|
|
|
|
|
requests: 'app-requests',
|
|
|
|
|
approval: 'app-approval',
|
|
|
|
|
chat: 'app-chat',
|
|
|
|
|
policies: 'app-policies',
|
|
|
|
|
audit: 'app-audit',
|
2026-05-07 15:55:23 +08:00
|
|
|
employees: 'app-employees',
|
|
|
|
|
settings: 'app-settings'
|
2026-05-06 22:23:42 +08:00
|
|
|
}
|
|
|
|
|
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
export function useNavigation() {
|
2026-05-06 22:23:42 +08:00
|
|
|
const route = useRoute()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
|
|
const activeView = computed({
|
|
|
|
|
get() {
|
|
|
|
|
return route.meta.appView || 'overview'
|
|
|
|
|
},
|
|
|
|
|
set(view) {
|
|
|
|
|
setView(view)
|
|
|
|
|
}
|
|
|
|
|
})
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
|
|
|
|
|
const currentView = computed(
|
|
|
|
|
() => navItems.find((item) => item.id === activeView.value) ?? navItems[0]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function setView(view) {
|
2026-05-06 22:23:42 +08:00
|
|
|
const targetName = viewRouteNames[view] || viewRouteNames.overview
|
|
|
|
|
|
|
|
|
|
if (route.name === targetName) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
router.push({ name: targetName })
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return { activeView, currentView, setView, navItems }
|
|
|
|
|
}
|