feat(chat): 完善附件预览与订单提取交互
- 优化聊天附件上传、预览及 PDF.js 加载 - 完善订单文档画布与审核预览体验 - 优化订单提取运行状态及发送流程 - 增强会话附件接口与相关测试覆盖 - 更新 Nginx 配置、技术文档及四语言文案
This commit is contained in:
1 parent
104afa3844
commit
9d2fa522fa
29 files changed
+584
-140
No files matched your search
@@ -250,6 +250,31 @@ describe('useChatShippingSendHandler', () => {
|
||||
expect(ctx.msg.warning).toHaveBeenCalledWith('run create failed');
|
||||
});
|
||||
|
||||
it('blocks order extraction when notice attachments exceed chat snapshot limit', async () => {
|
||||
const many = Array.from({ length: 201 }, (_, i) => ({
|
||||
id: `notice-${i}`,
|
||||
kind: 'shipping_notice' as const,
|
||||
type: 'document' as const,
|
||||
uploadStatus: 'uploaded' as const,
|
||||
parseStatus: 'parsed' as const,
|
||||
uploadProgress: 100,
|
||||
originalFilename: `orders-${i}.eml`,
|
||||
fileSize: 100,
|
||||
intakeNo: `SNI-${i}`,
|
||||
}));
|
||||
const startOrderExtractionRun = vi.fn(async () => true);
|
||||
const ctx = createContext({
|
||||
attachments: ref(many),
|
||||
getParsedIntakeNos: () => many.map((item) => item.intakeNo),
|
||||
startOrderExtractionRun,
|
||||
});
|
||||
const { tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers(ctx);
|
||||
const handled = await tryHandleShippingAttachmentAutoFlow(undefined, '', '');
|
||||
expect(handled).toBe(true);
|
||||
expect(startOrderExtractionRun).not.toHaveBeenCalled();
|
||||
expect(ctx.msg.warning).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('warns and consumes send when user tries batch task switching (co8 batch API retired)', async () => {
|
||||
const ctx = createContext({
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user