feat(web): AI 工作台文件预览/附件关联任务与草稿分支

- 新增 WorkbenchAiFilePreviewDialog 附件预览对话框及 useWorkbenchAiFilePreview,附件支持点击预览
- 新增 attachmentAssociationJobs/linkedReimbursementDraftJobs 前端服务与对应 composable,接入后台任务轮询与状态展示
- 新增 travelReimbursementDraftBranchModel 草稿分支模型,报销关联门控支持跳过/选择草稿
- PersonalWorkbenchAiMode 及各 composable(expense/document/steward/application-preview/attachment-association)重构适配,WorkbenchAiComposer/FileStrip 样式与交互完善
- DocumentsCenter/ReceiptFolder/TravelReimbursementCreate 等视图及 scripts 重构,风险/差旅规划/审批等工具适配
- 新增/更新前端测试:application-result-card、reimbursement-list-preview-fetch、guided-flow、composer-components 等
This commit is contained in:
caoxiaozhu
2026-06-24 10:42:50 +08:00
parent 0264a4b5b4
commit ee730aa31c
73 changed files with 2528 additions and 379 deletions

View File

@@ -18,6 +18,7 @@ import {
isApplicationPreviewValueProvided,
isTravelApplicationType,
normalizeAmountFromOntology,
normalizeApplicationLocationBoundary,
normalizeApplicationTypeLabel,
normalizeTypedOntologyAmount,
parseApplicationDaysValue,
@@ -61,6 +62,15 @@ export function buildApplicationPolicyEstimateRequest(preview = {}, currentUser
const applicationType = String(fields.applicationType || '').trim()
const transportMode = String(fields.transportMode || '').trim()
const shouldEstimate = /差旅|住宿|交通/.test(applicationType) || Boolean(transportMode)
const blockingLocationIssue = (normalized.validationIssues || []).find((issue) => issue?.field === 'location')
if (blockingLocationIssue) {
return {
canCalculate: false,
reason: blockingLocationIssue.message || '地点需修正',
payload: null
}
}
if (!shouldEstimate || !days || !location) {
return {
@@ -334,7 +344,9 @@ export function buildModelRefinedApplicationPreview(localPreview = {}, ontology
currentFields.applicationType
),
time: resolveProvidedValue(ontologyFields.timeRange, currentFields.time),
location: resolveProvidedValue(ontologyFields.location, currentFields.location),
location: normalizeApplicationLocationBoundary(
resolveProvidedValue(ontologyFields.location, currentFields.location)
),
reason: resolveProvidedValue(ontologyFields.reason, currentFields.reason),
days: resolveProvidedValue(ontologyFields.days, currentFields.days),
transportMode: resolveModelRefinedTransportMode(ontologyFields, rawText, currentFields),
@@ -480,7 +492,7 @@ export function buildLocalApplicationPreviewMessage(preview) {
: modelReviewStatus === 'failed'
? '模型复核暂时失败,我先保留一份临时核对表,方便您核查和补充信息。点击对应行即可直接编辑。'
: modelReviewStatus === 'template'
? '我已为准备好费用申请模板。本步骤不调用大模型,也不会保存草稿;请点击对应行直接填写。'
? '我已为准备好费用申请模板。本步骤不调用大模型,也不会保存草稿;请点击对应行直接填写。'
: '我先整理出下方表格,请核查识别结果。点击对应行即可直接编辑。'
].join('\n')
}