forked from wangziqi/gongxue-base
feat: Excel 导入预检与动态问答,AI 聊天/文件解析体验修复
- imports: 新增 preflight_import 预检报告(判定/分阶段统计/阻断归因/问题/下一步/错误示例),导入任务 settings 落库(映射/校区/更新/重复/未匹配策略),预览应用策略,向导提交写操作日志 - ai-chat: 新增 excel_analyze(ExcelJS)工具,移除附件/上下文截断,start_import_wizard 支持确认参数,ui.import_preflight SSE,预览确认写操作日志 - admin: ImportPreflightCard 渲染与持久化,聊天抽屉布局/侧边栏修复,考勤页 CSS 引入,费用/学生页接口 schema 校验修复
This commit is contained in:
@@ -139,4 +139,26 @@ describe('AI chat history mapper', () => {
|
||||
expect(mapped.message.charts).toHaveLength(1);
|
||||
expect(mapped.message.charts?.[0]).toMatchObject({ id: 'chart-9', chartType: 'bar' });
|
||||
});
|
||||
|
||||
it('keeps import preflight metadata on history messages', () => {
|
||||
const preflight = {
|
||||
verdict: 'needs_input',
|
||||
stages: [],
|
||||
blocks: [],
|
||||
questions: [{ key: 'update', type: 'update', label: '文件中有 1 行已匹配现有记录' }],
|
||||
nextSteps: [],
|
||||
};
|
||||
const mapped = mapHistoryMessage({
|
||||
id: 8,
|
||||
role: 'assistant',
|
||||
content: '预检完成',
|
||||
reasoningContent: null,
|
||||
status: 'completed',
|
||||
errorCode: null,
|
||||
createdAt: '2026-07-23T00:00:00.000Z',
|
||||
metadata: { a2uiImportPreflight: preflight },
|
||||
});
|
||||
|
||||
expect(mapped.message.metadata?.a2uiImportPreflight).toEqual(preflight);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user