feat: 新增数字员工管理页面与工作台首页重构

后端优化 agent 资产种子初始化和常量配置,前端新增数字员工
视图和调度对话框组件,重构个人工作台首页布局和洞察面板,
完善审计页面数字员工详情和运行时模型,优化侧边栏导航和图
标配置,新增工作台摘要和工作台数据模块,补充单元测试。
This commit is contained in:
caoxiaozhu
2026-05-28 09:30:34 +08:00
parent d4d5d40569
commit 04cd6d0f81
38 changed files with 3413 additions and 1301 deletions

View File

@@ -12,6 +12,7 @@ export const icons = {
book: iconPath('<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>'),
library: iconPath('<path d="m16 6 4 14"/><path d="M12 6v14"/><path d="M8 8v12"/><path d="M4 4v16"/><path d="M2 20h20"/>'),
skill: iconPath('<path d="M12 3 9.5 8.5 3 11l6.5 2.5L12 19l2.5-5.5L21 11l-6.5-2.5z"/><path d="M19 19l.9 2 .9-2 2-.9-2-.9-.9-2-.9 2-2 .9z"/><path d="M5 5l.6 1.4L7 7l-1.4.6L5 9l-.6-1.4L3 7l1.4-.6z"/>'),
digitalEmployee: iconPath('<text x="12" y="12.2" text-anchor="middle" dominant-baseline="middle" font-size="16" font-weight="800" fill="currentColor" stroke="none" font-family="system-ui, -apple-system, Segoe UI, Arial, sans-serif" letter-spacing="-0.45">AI</text>'),
users: iconPath('<path d="M16 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2"/><circle cx="9.5" cy="7" r="4"/><path d="M20 8v6"/><path d="M23 11h-6"/>'),
audit: iconPath('<path d="M12 8v4l3 3"/><path d="M3.05 11a9 9 0 1 1 .5 4"/><path d="M3 4v7h7"/>'),
logs: iconPath('<path d="M4 5h16"/><path d="M4 12h16"/><path d="M4 19h10"/><path d="M18 17v4"/><path d="M16 19h4"/>'),

View File

@@ -0,0 +1,260 @@
export const quickPromptItems = [
'如何申请差旅费用?',
'报销标准是多少?',
'预算有哪些科目余额?',
'发票丢失了如何处理?'
]
export const assistantCapabilities = [
{
title: '费用申请助手',
primary: '智能识别规划',
secondary: '快速创建申请',
icon: 'mdi mdi-file-document-plus-outline',
tone: 'green',
prompt: '帮我新建一笔费用申请,并检查需要补充哪些信息。'
},
{
title: '报销助手',
primary: '票据 OCR 归票',
secondary: '自动价格分摊',
icon: 'mdi mdi-wallet-outline',
tone: 'blue',
prompt: '帮我整理票据并生成一笔可提交的报销单。'
},
{
title: '预算控制助手',
primary: '预算查询分析',
secondary: '超标预警提醒',
icon: 'mdi mdi-chart-pie',
tone: 'emerald',
prompt: '帮我查询本月预算使用情况,并提醒可能超标的费用。'
},
{
title: '审批问答助手',
primary: '审批凭证说明',
secondary: '进度实时查询',
icon: 'mdi mdi-clipboard-check-outline',
tone: 'violet',
prompt: '帮我查询报销审批进度,并说明当前卡在哪个节点。'
},
{
title: '差旅助手',
primary: '行程预订建议',
secondary: '标准合规校验',
icon: 'mdi mdi-airplane',
tone: 'cyan',
prompt: '帮我检查差旅安排是否符合公司差旅标准。'
},
{
title: '制度知识助手',
primary: '制度检索解读',
secondary: '政策实时更新',
icon: 'mdi mdi-book-open-page-variant-outline',
tone: 'amber',
prompt: '帮我解释最新报销制度,并列出需要注意的条款。'
}
]
export const todoItems = [
{
title: '待补材料',
description: '差旅报销-北京市市场调研差旅费',
status: '待补材料',
statusTone: 'warning',
due: '今天 18:00 截止',
iconKey: 'receipts',
color: 'var(--warning)',
accent: 'var(--warning-soft)'
},
{
title: '待提交申请',
description: '费用申请-5月市场活动费用申请',
status: '待提交',
statusTone: 'success',
due: '明天 10:00 截止',
iconKey: 'travelDraft',
color: 'var(--theme-primary)',
accent: 'var(--theme-primary-soft)'
},
{
title: '退回修改',
description: '办公用品采购报销单',
status: '退回修改',
statusTone: 'danger',
due: '2026-05-03',
iconKey: 'procurement',
color: 'var(--danger)',
accent: 'var(--danger-soft)'
},
{
title: '待确认票据',
description: '招待费报销单',
status: '待确认',
statusTone: 'info',
due: '2026-05-04',
iconKey: 'hospitality',
color: 'var(--chart-blue)',
accent: 'color-mix(in srgb, var(--chart-blue) 10%, #ffffff)'
},
{
title: '待审批',
description: '培训费报销单',
status: '待审批',
statusTone: 'orange',
due: '2026-05-05',
iconKey: 'transport',
color: 'var(--chart-amber)',
accent: 'color-mix(in srgb, var(--chart-amber) 12%, #ffffff)'
}
]
export const progressSteps = ['草稿中', '审批中', '待付款', '已完成']
export const progressItems = [
{
id: 'BX-202605-0031',
title: '北京市市场调研差旅费',
amount: '¥3,280.00',
status: '审批中',
statusTone: 'success',
activeStep: 1
},
{
id: 'BX-202605-0028',
title: '5月市场活动费用申请',
amount: '¥8,750.00',
status: '审批中',
statusTone: 'success',
activeStep: 1
},
{
id: 'BX-202605-0022',
title: '办公用品采购报销单',
amount: '¥1,126.00',
status: '待付款',
statusTone: 'warning',
activeStep: 2
},
{
id: 'BX-202604-0049',
title: '上海出差差旅费',
amount: '¥2,458.00',
status: '已完成',
statusTone: 'muted',
activeStep: 3
},
{
id: 'BX-202604-0033',
title: '客户招待费',
amount: '¥945.00',
status: '已完成',
statusTone: 'muted',
activeStep: 3
}
]
export function buildExpenseStatItems(summary = {}) {
return [
{
key: 'monthly-count',
label: '本月报销笔数',
value: summary.monthlyCount ?? 0,
unit: '笔',
tone: 'primary'
},
{
key: 'monthly-amount',
label: '本月报销金额',
value: summary.monthlyAmountLabel || '¥0',
unit: '',
tone: 'amount'
},
{
key: 'total-count',
label: '累计报销笔数',
value: summary.totalCount ?? 0,
unit: '笔',
tone: 'muted'
},
{
key: 'total-amount',
label: '累计报销金额',
value: summary.totalAmountLabel || '¥0',
unit: '',
tone: 'amount'
},
{
key: 'in-review',
label: '审批中单据',
value: summary.inReviewCount ?? 0,
unit: '笔',
tone: 'warning'
},
{
key: 'pending-payment',
label: '待付款单据',
value: summary.pendingPaymentCount ?? 0,
unit: '笔',
tone: 'info'
}
]
}
/** 费用画像:待后端接入后替换为真实用户行为统计 */
export const usageProfileMetrics = [
{
key: 'stay-duration',
label: '系统停留时长',
value: '128.5',
unit: '小时',
hint: '近 30 天累计',
icon: 'mdi mdi-clock-outline',
tone: 'primary'
},
{
key: 'ai-usage',
label: 'AI 使用次数',
value: '86',
unit: '次',
hint: '含报销助手与制度问答',
icon: 'mdi mdi-robot-outline',
tone: 'violet'
},
{
key: 'token-usage',
label: 'Token 消耗',
value: '1.42',
unit: '万',
hint: '本月模型调用累计',
icon: 'mdi mdi-lightning-bolt-outline',
tone: 'amber'
},
{
key: 'audit-duration',
label: '平均审核时长',
value: '18.6',
unit: '小时',
hint: '本月已办结单据',
icon: 'mdi mdi-timer-sand',
tone: 'success'
},
{
key: 'submit-efficiency',
label: '平均提单耗时',
value: '12',
unit: '分钟',
hint: '从打开助手到提交',
icon: 'mdi mdi-speedometer',
tone: 'cyan'
},
{
key: 'auto-pass-rate',
label: '智能预审通过率',
value: '92',
unit: '%',
hint: 'AI 预审后无需补材',
icon: 'mdi mdi-shield-check-outline',
tone: 'emerald'
}
]