feat(ai): 移除 Excel 导入预检链路
- 删除 preflight_import 工具、预检卡、resolve 接口与 ui.import_preflight 事件 - 删除 imports.preflight 解析器与 PreflightReport 类型 - SYSTEM_PROMPT 改为上传 Excel 后直接确认列映射/策略并调用 start_import_wizard - 前端同步移除预检类型/组件/测试,保留导入向导
This commit is contained in:
@@ -6,7 +6,7 @@ import { App } from 'antd';
|
||||
import type { UploadFile, UploadProps } from 'antd';
|
||||
import { message } from '../../ui/app-message';
|
||||
import { useSettingsStore } from '../../store/settings/settingsStore';
|
||||
import { aiChatApi, resolveImportPreflight, type ResolveImportPreflightInput } from './api';
|
||||
import { aiChatApi } from './api';
|
||||
import { AiMessageContent } from './AiMessageContent';
|
||||
import { mapHistoryMessage } from './message-mappers';
|
||||
import { GongxueAiChatProvider } from './provider';
|
||||
@@ -25,7 +25,6 @@ import type {
|
||||
AiChatMessage,
|
||||
AiChatMessageStatus,
|
||||
AiFormSchema,
|
||||
AiImportPreflight,
|
||||
AiReviewSchema,
|
||||
AiReviewSection,
|
||||
AiReviewSectionType,
|
||||
@@ -416,31 +415,6 @@ export function useAiChatMessageActions({
|
||||
[provider, setMessage],
|
||||
);
|
||||
|
||||
const resolvePreflight = useCallback(
|
||||
async (
|
||||
messageId: number | undefined,
|
||||
_preflight: AiImportPreflight,
|
||||
input: ResolveImportPreflightInput,
|
||||
): Promise<void> => {
|
||||
if (typeof messageId !== 'number') {
|
||||
throw new Error('消息尚未完成生成,请稍后再试');
|
||||
}
|
||||
await resolveImportPreflight(messageId, input, (update) => {
|
||||
setMessage(messageId, (info) => ({
|
||||
message: {
|
||||
...info.message,
|
||||
metadata: {
|
||||
...info.message.metadata,
|
||||
...(update.preflight ? { a2uiImportPreflight: update.preflight } : {}),
|
||||
...(update.wizard ? { a2uiImportWizard: update.wizard } : {}),
|
||||
},
|
||||
},
|
||||
}));
|
||||
});
|
||||
},
|
||||
[setMessage],
|
||||
);
|
||||
|
||||
const customUpload = useCallback<NonNullable<UploadProps['customRequest']>>(async (options) => {
|
||||
const file = options.file as File;
|
||||
if (attachmentsRef.current.length >= 5) {
|
||||
@@ -556,7 +530,6 @@ export function useAiChatMessageActions({
|
||||
onConfirmReviewStep={confirmReviewStep}
|
||||
onConfirmReviewGroup={confirmReviewGroup}
|
||||
onOpenImportWizard={setImportWizardRunId}
|
||||
onResolveImportPreflight={resolvePreflight}
|
||||
/>
|
||||
),
|
||||
})),
|
||||
@@ -570,7 +543,6 @@ export function useAiChatMessageActions({
|
||||
isRequesting,
|
||||
messages,
|
||||
reloadMessage,
|
||||
resolvePreflight,
|
||||
setImportWizardRunId,
|
||||
submitForm,
|
||||
submitReview,
|
||||
|
||||
Reference in New Issue
Block a user