feat(web): AI 工作台会话与文档卡片渲染增强

- aiConversationHtmlRenderer 识别单据记录类表格并渲染为卡片列表,新增删除申请单详情的禁用占位链接
- aiWorkbenchConversationStore 增加草稿删除后会话链接失效处理,避免点击已删除单据跳转
- aiApplicationPreviewActions 调整提交/草稿调用路径,PersonalWorkbenchAiMode 接入新的会话存储与渲染
- ConfirmDialog/TravelRequestDeleteDialog/useAppShell/AppShellRouteView 配套适配,同步更新相关前端测试
This commit is contained in:
caoxiaozhu
2026-06-20 21:44:16 +08:00
parent 81e990ab72
commit 0cda750ff0
19 changed files with 734 additions and 92 deletions

View File

@@ -56,15 +56,27 @@ async function testSubmitActionUsesFastPreviewEndpoint() {
assert.equal(body.context_json.application_preview.fields.transportMode, '火车')
}
async function testSaveDraftActionKeepsOrchestratorPath() {
async function testSaveDraftActionUsesFastPreviewEndpoint() {
let capturedUrl = ''
let capturedOptions = null
global.fetch = async (url) => {
global.fetch = async (url, options) => {
capturedUrl = String(url)
capturedOptions = options
return {
ok: true,
async json() {
return { status: 'succeeded', result: {} }
return {
status: 'succeeded',
result: {
draft_payload: {
claim_id: 'claim-fast-draft',
claim_no: 'AP-20260620-DRAFT',
status: 'draft',
approval_stage: '待提交'
}
}
}
}
}
}
@@ -75,12 +87,17 @@ async function testSaveDraftActionKeepsOrchestratorPath() {
currentUser: { username: 'zhangsan@example.com', name: '张三' }
})
assert.equal(capturedUrl, '/api/v1/orchestrator/run')
assert.equal(capturedUrl, '/api/v1/reimbursements/application-preview-action')
assert.equal(capturedOptions.method, 'POST')
const body = JSON.parse(capturedOptions.body)
assert.equal(body.context_json.application_action, 'save_draft')
assert.equal(body.context_json.application_save_mode, true)
assert.equal(body.context_json.application_stage, 'expense_application')
}
async function run() {
await testSubmitActionUsesFastPreviewEndpoint()
await testSaveDraftActionKeepsOrchestratorPath()
await testSaveDraftActionUsesFastPreviewEndpoint()
console.log('ai-application-preview-actions tests passed')
}