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:
2026-08-05 21:12:50 +08:00
parent b70f45fb04
commit ab4765cee5
44 changed files with 2449 additions and 166 deletions

View File

@@ -16,7 +16,6 @@ import { OfficeCliService } from './office-cli.service';
import { AiAttachment } from './entities';
const MAX_FILE_BYTES = 10 * 1024 * 1024;
const MAX_EXTRACTED_CHARS = 48 * 1024;
const MAX_MODEL_IMAGE_BYTES = 20 * 1024 * 1024;
const ACCEPTED_MIME_TYPES = new Set([
'image/jpeg',
@@ -165,7 +164,7 @@ export class AiAttachmentService {
} else {
parts.push({
attachment,
text: attachment.extractedText?.slice(0, MAX_EXTRACTED_CHARS) || '',
text: attachment.extractedText || '',
});
}
}
@@ -290,7 +289,7 @@ export class AiAttachmentService {
}
private normalizeExtractedText(value: string): string {
return value.split('\u0000').join('').replace(/\r\n/g, '\n').trim().slice(0, MAX_EXTRACTED_CHARS);
return value.split('\u0000').join('').replace(/\r\n/g, '\n').trim();
}
private assertDeclaredType(declared: string, detected: string): void {