feat(ai): 移除 Excel 导入预检链路

- 删除 preflight_import 工具、预检卡、resolve 接口与 ui.import_preflight 事件
- 删除 imports.preflight 解析器与 PreflightReport 类型
- SYSTEM_PROMPT 改为上传 Excel 后直接确认列映射/策略并调用 start_import_wizard
- 前端同步移除预检类型/组件/测试,保留导入向导
This commit is contained in:
2026-08-06 15:50:38 +08:00
parent 14db28afc6
commit 9048816abc
29 changed files with 14 additions and 2914 deletions

View File

@@ -16,17 +16,14 @@ import { useUserStore } from '../../store/user/userStore';
import { DynamicChart } from './DynamicChart';
import { DynamicForm } from './DynamicForm';
import { DynamicReview } from './DynamicReview';
import { ImportPreflightCard } from './ImportPreflightCard';
import { LiteCodeHighlighter } from './LiteCodeHighlighter';
import { LiteMermaid } from './LiteMermaid';
import type { ResolveImportPreflightInput } from './api';
import type {
AiAttachment,
AiChatMessage,
AiChatMessageStatus,
AiChartSchema,
AiFormSchema,
AiImportPreflight,
AiImportWizard,
AiReviewSection,
AiReviewSchema,
@@ -46,7 +43,6 @@ const toolLabels: Record<string, string> = {
render_form: '生成表单',
render_review: '生成导入预览',
render_chart: '生成图表',
preflight_import: '导入预检',
start_import_wizard: '生成导入向导',
create_student: '创建学生',
search_exams: '查询考试',
@@ -193,11 +189,6 @@ export interface AiMessageContentProps {
type: AiReviewSectionType,
) => AiReviewSchema | Promise<AiReviewSchema> | void;
onOpenImportWizard?: (runId: string) => void;
onResolveImportPreflight?: (
messageId: number | undefined,
preflight: AiImportPreflight,
input: ResolveImportPreflightInput,
) => Promise<void> | void;
}
export const AiMessageContent: React.FC<AiMessageContentProps> = ({
@@ -211,7 +202,6 @@ export const AiMessageContent: React.FC<AiMessageContentProps> = ({
onConfirmReviewStep,
onConfirmReviewGroup,
onOpenImportWizard,
onResolveImportPreflight,
}) => {
const streaming = status === 'loading' || status === 'updating';
const formSubmission = message.metadata?.a2uiSubmit;
@@ -324,26 +314,6 @@ export const AiMessageContent: React.FC<AiMessageContentProps> = ({
{attachmentCards}
</Flex>
)}
{(() => {
const preflight = message.metadata?.a2uiImportPreflight;
if (!preflight || typeof preflight !== 'object' || Array.isArray(preflight)) return null;
const typedPreflight = preflight as AiImportPreflight;
return (
<ImportPreflightCard
preflight={typedPreflight}
onResolve={
onResolveImportPreflight
? (input) =>
onResolveImportPreflight(
typeof message.id === 'number' ? message.id : undefined,
typedPreflight,
input,
)
: undefined
}
/>
);
})()}
{(() => {
const wizard = message.metadata?.a2uiImportWizard as AiImportWizard | undefined;
if (!wizard || !onOpenImportWizard) return null;