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 { computed, ref } from 'vue'
|
|
|
|
|
import { icons } from '../data/icons.js'
|
|
|
|
|
|
|
|
|
|
export const navItems = [
|
2026-04-29 23:35:56 +08:00
|
|
|
{
|
|
|
|
|
id: 'overview',
|
|
|
|
|
label: '总览',
|
|
|
|
|
navHint: '运营指标与趋势',
|
|
|
|
|
icon: icons.dashboard,
|
|
|
|
|
title: '企业报销智能运营台',
|
|
|
|
|
desc: '面向财务共享中心的审批、风控、SLA与自动化运营看板'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'requests',
|
2026-04-30 17:11:24 +08:00
|
|
|
label: '差旅申请/报销',
|
|
|
|
|
navHint: '差旅单据与发起申请',
|
2026-04-29 23:35:56 +08:00
|
|
|
icon: icons.list,
|
2026-04-30 17:11:24 +08:00
|
|
|
title: '差旅申请/报销',
|
|
|
|
|
desc: '查看员工差旅报销单据、跟踪进度、发起新申请'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'chat',
|
|
|
|
|
label: 'AI助手',
|
|
|
|
|
navHint: '指标、趋势与行动建议',
|
|
|
|
|
icon: icons.message,
|
|
|
|
|
title: 'AI 财务助手',
|
|
|
|
|
desc: '问指标、看趋势、拿建议,辅助你处理当前报销运营工作'
|
2026-04-29 23:35:56 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'policies',
|
|
|
|
|
label: '政策规则',
|
|
|
|
|
navHint: '制度与校验规则',
|
|
|
|
|
icon: icons.file,
|
|
|
|
|
title: '政策规则中心',
|
|
|
|
|
desc: '维护差旅、招待、采购和发票校验规则。'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'audit',
|
|
|
|
|
label: '审计追踪',
|
|
|
|
|
navHint: '关键动作与日志',
|
|
|
|
|
icon: icons.audit,
|
|
|
|
|
title: '审计追踪',
|
|
|
|
|
desc: '查看关键审批动作、AI 建议和制度命中记录。'
|
|
|
|
|
}
|
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() {
|
|
|
|
|
const activeView = ref('overview')
|
|
|
|
|
|
|
|
|
|
const currentView = computed(
|
|
|
|
|
() => navItems.find((item) => item.id === activeView.value) ?? navItems[0]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function setView(view) {
|
|
|
|
|
activeView.value = view
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return { activeView, currentView, setView, navItems }
|
|
|
|
|
}
|