feat(ai): 移除 Excel 导入预检链路
- 删除 preflight_import 工具、预检卡、resolve 接口与 ui.import_preflight 事件 - 删除 imports.preflight 解析器与 PreflightReport 类型 - SYSTEM_PROMPT 改为上传 Excel 后直接确认列映射/策略并调用 start_import_wizard - 前端同步移除预检类型/组件/测试,保留导入向导
This commit is contained in:
@@ -189,46 +189,6 @@ describe('AI chat SSE message reducer', () => {
|
||||
expect(message.reviews?.[0]).toMatchObject({ id: 'review-1', status: 'expired' });
|
||||
});
|
||||
|
||||
it('stores ui.import_preflight in message metadata and restores it from completed message', () => {
|
||||
const preflight = {
|
||||
verdict: 'needs_input',
|
||||
stages: [
|
||||
{
|
||||
stepKey: 'students',
|
||||
label: '学生档案',
|
||||
sheetNames: ['学生'],
|
||||
total: 2,
|
||||
create: 1,
|
||||
update: 1,
|
||||
error: 0,
|
||||
skip: 0,
|
||||
mapping: { name: '姓名' },
|
||||
missingRequired: [],
|
||||
},
|
||||
],
|
||||
blocks: [],
|
||||
questions: [{ key: 'update', type: 'update', label: '文件中有 1 行已匹配现有记录' }],
|
||||
nextSteps: [{ key: 'students-next', label: '分班 / 排课 / 入住', description: '建议', after: ['students'] }],
|
||||
};
|
||||
let message = reduceAiSseMessage(undefined, {
|
||||
event: 'ui.import_preflight',
|
||||
data: JSON.stringify({ messageId: 8, preflight }),
|
||||
});
|
||||
expect(message.metadata?.a2uiImportPreflight).toEqual(preflight);
|
||||
|
||||
message = reduceAiSseMessage(message, {
|
||||
event: 'message.completed',
|
||||
data: JSON.stringify({
|
||||
message: {
|
||||
id: 8,
|
||||
content: '预检完成',
|
||||
status: 'completed',
|
||||
metadata: { a2uiImportPreflight: preflight },
|
||||
},
|
||||
}),
|
||||
});
|
||||
expect(message.metadata?.a2uiImportPreflight).toEqual(preflight);
|
||||
});
|
||||
|
||||
it('restores a persisted form from message.completed metadata', () => {
|
||||
const message = reduceAiSseMessage(undefined, {
|
||||
|
||||
Reference in New Issue
Block a user