feat(web): AI 工作台多 task 串行推进与会话适配
- useWorkbenchAiApplicationPreviewFlow/useWorkbenchAiActionRouter/useWorkbenchAiCommandIntents 支持 task1 完成后自动推进 task2,确认按钮直接拉起申请预览,草稿/提交成功后继续推进下一 task - workbenchAiIntentPlannerModel/workbenchAiMessageModel/workbenchAiCommandIntentModel 适配多 task 意图规划与消息结构 - aiApplicationPreviewActions/aiApplicationPrecheckModel/aiExpenseDraftModel/aiWorkbenchConversationStore 草稿与会话存储适配 - PersonalWorkbenchAiMode 与样式适配,更新 preview-actions/expense-draft/conversation-store/fast-preview/action-router/command-intent/intent-planner 测试
This commit is contained in:
@@ -362,6 +362,40 @@ test('travel application submit can continue with conversational planning recomm
|
||||
assert.match(recommendation, /AP-202606030001-ABCDE123/)
|
||||
})
|
||||
|
||||
test('application edit preview only allows reason time location and transport changes', () => {
|
||||
const preview = normalizeApplicationPreview({
|
||||
sourceText: '修改申请',
|
||||
applicationEditMode: true,
|
||||
editableFields: ['reason', 'time', 'location', 'transportMode'],
|
||||
fields: {
|
||||
applicationType: '差旅费用申请',
|
||||
applicant: '李文静',
|
||||
grade: 'P5',
|
||||
department: '财务部',
|
||||
position: '财务分析师',
|
||||
managerName: '王强',
|
||||
time: '2026-05-25 至 2026-05-28',
|
||||
location: '上海',
|
||||
reason: '客户现场项目支持',
|
||||
days: '4天',
|
||||
transportMode: '火车',
|
||||
lodgingDailyCap: '450元/天',
|
||||
subsidyDailyCap: '100元/天',
|
||||
transportPolicy: '按规则测算',
|
||||
policyEstimate: '交通 300元 + 住宿 1800元 + 补贴 400元 = 2500元',
|
||||
amount: '2500元'
|
||||
}
|
||||
})
|
||||
|
||||
const rows = buildApplicationPreviewRows(preview)
|
||||
const editableKeys = rows.filter((row) => row.editable).map((row) => row.key)
|
||||
assert.deepEqual(editableKeys, ['time', 'time_return', 'location', 'reason', 'transportMode'])
|
||||
assert.equal(rows.find((row) => row.key === 'applicationType')?.editable, false)
|
||||
assert.equal(rows.find((row) => row.key === 'days')?.editable, false)
|
||||
assert.equal(rows.find((row) => row.key === 'amount')?.editable, false)
|
||||
assert.match(buildLocalApplicationPreviewMessage(preview), /只修改事由、时间、地点和出行方式/)
|
||||
})
|
||||
|
||||
test('application preview renders ordered editable rows and submit text uses edited values', () => {
|
||||
const preview = buildLocalApplicationPreview('申请 2026-05-25 至 2026-05-28 去新疆,伊犁出差,服务美团业务部署,火车,预计费用1800元', {
|
||||
name: '李文静',
|
||||
|
||||
Reference in New Issue
Block a user