feat(web): 票据夹资产缓存接入与 AI 工作台附件流程完善
- ReceiptFolderView 删除票据后提示已关联附件副本保留,接入 useToast;fetchReceiptFolderAsset 加 no-store 避免预览缓存 - PersonalWorkbenchAiMode 附件区/对话气泡适配资产缓存,personal-workbench-ai-mode.css 调整布局 - usePersonalWorkbenchAiMode/useWorkbenchAiApplicationPreviewFlow/useWorkbenchAiAttachmentAssociationFlow/useWorkbenchAiStewardFlow 完善附件草稿选择与关联流程 - travelRequestDetailSmartEntryRecognition 智能识别增强,AppShellRouteView/PersonalWorkbenchView/useApplicationPreviewEditor/useTravelReimbursementSubmitComposer 等配套适配 - 新增 expense-attachment-draft-selection、receipt-folder-asset-cache、travel-request-detail-smart-entry-recognition 测试,更新 attachment-association-confirmation、expense-application-fast-preview、workbench-ai-mode-switch 测试
This commit is contained in:
@@ -263,6 +263,36 @@ test('OCR documents keep full recognized text for backend context', () => {
|
||||
assert.match(documents[0].text, /电子客票号:E1234567890/)
|
||||
})
|
||||
|
||||
test('OCR documents normalize receipt-folder field shapes for AI cards', () => {
|
||||
const documents = normalizeOcrDocuments({
|
||||
documents: [
|
||||
{
|
||||
filename: 'train-ticket.png',
|
||||
document_info: {
|
||||
fields: [
|
||||
{ label: '身份证号', value: '4201061987****1615' },
|
||||
{ key: 'seat_no', label: '座位号', value: '01B' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
filename: 'hotel.png',
|
||||
fields: [
|
||||
{ name: 'amount', label: '金额', value: '450元' }
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert.deepEqual(documents[0].document_fields, [
|
||||
{ key: '身份证号', label: '身份证号', value: '4201061987****1615' },
|
||||
{ key: 'seat_no', label: '座位号', value: '01B' }
|
||||
])
|
||||
assert.deepEqual(documents[1].document_fields, [
|
||||
{ key: 'amount', label: '金额', value: '450元' }
|
||||
])
|
||||
})
|
||||
|
||||
test('receipt files are collected through a single OCR persistence entry before draft association', async () => {
|
||||
const files = [
|
||||
{ name: 'invoice.png' }
|
||||
|
||||
Reference in New Issue
Block a user