feat(web): 工作台 AI 模式与差旅/风险建议交互优化
- 新增 PersonalWorkbenchAiMode 组件、AI 侧边栏与 orb 机器人视觉资源 - 新增 aiApplicationDraftModel / aiExpenseDraftModel / aiWorkbenchConversationStore 及业务准入 aiSidebarBusinessAccess,支撑 AI 模式下的申请与报销草稿 - 顶栏、侧边栏、工作台样式重构,适配 AI 模式切换与响应式布局 - 同步 steward plan/off_topic、差旅报销引导流、风险建议卡片等测试
This commit is contained in:
@@ -2,9 +2,44 @@ import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import {
|
||||
buildStewardPlanMessageText,
|
||||
buildStewardSuggestedActions
|
||||
} from '../src/views/scripts/stewardPlanModel.js'
|
||||
|
||||
test('steward pending flow confirmation renders extracted fields as table', () => {
|
||||
const message = buildStewardPlanMessageText({
|
||||
plan_id: 'steward-plan-pending-flow',
|
||||
plan_status: 'needs_flow_confirmation',
|
||||
next_action: 'confirm_flow',
|
||||
pending_flow_confirmation: {
|
||||
status: 'pending',
|
||||
reason: '已先查询可关联申请单,当前仍需确认下一步。',
|
||||
candidate_flows: [
|
||||
{
|
||||
flow_id: 'travel_application',
|
||||
label: '先发起出差申请',
|
||||
confidence: 0.82,
|
||||
ontology_fields: {
|
||||
time_range: '2026-02-20',
|
||||
location: '上海',
|
||||
expense_type: 'travel',
|
||||
reason: '辅助国网仿生产服务器部署'
|
||||
},
|
||||
missing_fields: ['transport_mode']
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
assert.match(message, /\| 字段 \| 内容 \|/)
|
||||
assert.match(message, /\| 费用类型 \| 差旅 \|/)
|
||||
assert.match(message, /\| 发生时间 \| 2026-02-20 \|/)
|
||||
assert.match(message, /\| 地点 \| 上海 \|/)
|
||||
assert.match(message, /\| 事由 \| 辅助国网仿生产服务器部署 \|/)
|
||||
assert.doesNotMatch(message, /已提取到:\*\*/)
|
||||
assert.match(message, /请先点击下方/)
|
||||
})
|
||||
|
||||
test('steward pending flow confirmation builds candidate actions', () => {
|
||||
const actions = buildStewardSuggestedActions({
|
||||
plan_id: 'steward-plan-pending-flow',
|
||||
|
||||
Reference in New Issue
Block a user