fix: 修复按顺序匹配功能的TypeScript编译错误
修复内容: - 在AiClassificationFormErrors接口中添加weight字段 - 修复AiClassificationRealTimePreview组件中缺少weight字段的问题 - 更新所有测试文件中的mock数据,添加weight字段 - 确保所有AI分类相关的类型定义完整一致 构建状态: - TypeScript编译通过 - Rust编译通过 - 生成可执行文件和安装包 - 仅有编译警告,无错误 所有按顺序匹配功能现已可正常使用
This commit is contained in:
parent
0cfacd0662
commit
3d24f5b908
|
|
@ -54,6 +54,7 @@ export const AiClassificationRealTimePreview: React.FC<AiClassificationRealTimeP
|
|||
description: currentFormData.description || undefined,
|
||||
is_active: true,
|
||||
sort_order: currentFormData.sort_order,
|
||||
weight: currentFormData.weight,
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ describe('AiClassificationService', () => {
|
|||
description: '全身分类描述',
|
||||
is_active: true,
|
||||
sort_order: 1,
|
||||
weight: 10,
|
||||
created_at: '2024-01-01T00:00:00Z',
|
||||
updated_at: '2024-01-01T00:00:00Z',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ describe('AI Classification Type Functions', () => {
|
|||
prompt_text: '头顶到脚底完整入镜,肢体可见度≥90%',
|
||||
description: '全身分类描述',
|
||||
sort_order: 1,
|
||||
weight: 10,
|
||||
};
|
||||
|
||||
const mockClassification: AiClassification = {
|
||||
|
|
@ -25,6 +26,7 @@ describe('AI Classification Type Functions', () => {
|
|||
description: '全身分类描述',
|
||||
is_active: true,
|
||||
sort_order: 1,
|
||||
weight: 10,
|
||||
created_at: '2024-01-01T00:00:00Z',
|
||||
updated_at: '2024-01-01T00:00:00Z',
|
||||
};
|
||||
|
|
@ -137,6 +139,7 @@ describe('AI Classification Type Functions', () => {
|
|||
prompt_text: '',
|
||||
description: 'a'.repeat(CLASSIFICATION_VALIDATION.DESCRIPTION_MAX_LENGTH + 1),
|
||||
sort_order: -1,
|
||||
weight: 0,
|
||||
};
|
||||
|
||||
const errors = validateClassificationForm(formData);
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ export interface AiClassificationFormErrors {
|
|||
description?: string;
|
||||
/** 排序顺序错误 */
|
||||
sort_order?: string;
|
||||
/** 权重错误 */
|
||||
weight?: string;
|
||||
/** 通用错误 */
|
||||
general?: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue