feat(asl): Week 2 Day 2 - Excel import with template download and intelligent dedup
Features: - feat: Excel template generation and download (with examples) - feat: Excel file parsing in memory (cloud-native, no disk write) - feat: Field validation (title + abstract required) - feat: Smart deduplication (DOI priority + Title fallback) - feat: Literature preview table with statistics - feat: Complete submission flow (create project + import literatures) Components: - feat: Create excelUtils.ts with full Excel processing toolkit - feat: Enhance TitleScreeningSettings page with upload/preview/submit - feat: Update API interface signatures and export unified aslApi object Dependencies: - chore: Add xlsx library for Excel file processing Ref: Week 2 Frontend Development - Day 2 Scope: ASL Module MVP - Title Abstract Screening Cloud-Native: Memory parsing, no file persistence
This commit is contained in:
@@ -101,15 +101,13 @@ export async function deleteProject(
|
||||
/**
|
||||
* 批量导入文献(JSON格式)
|
||||
*/
|
||||
export async function importLiteratures(
|
||||
projectId: string,
|
||||
data: ImportLiteraturesRequest
|
||||
): Promise<ApiResponse<{
|
||||
imported: number;
|
||||
duplicates: number;
|
||||
failed: number;
|
||||
export async function importLiteratures(data: {
|
||||
projectId: string;
|
||||
literatures: Array<Omit<Literature, 'id' | 'projectId' | 'createdAt'>>;
|
||||
}): Promise<ApiResponse<{
|
||||
importedCount: number;
|
||||
}>> {
|
||||
return request(`/projects/${projectId}/literatures/import-json`, {
|
||||
return request('/literatures/import', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
@@ -265,3 +263,39 @@ export async function healthCheck(): Promise<ApiResponse<{
|
||||
return request('/health');
|
||||
}
|
||||
|
||||
// ==================== 统一导出API对象 ====================
|
||||
|
||||
/**
|
||||
* ASL API统一导出对象
|
||||
*/
|
||||
export const aslApi = {
|
||||
// 项目管理
|
||||
createProject,
|
||||
listProjects,
|
||||
getProject,
|
||||
updateProject,
|
||||
deleteProject,
|
||||
|
||||
// 文献管理
|
||||
importLiteratures,
|
||||
listLiteratures,
|
||||
deleteLiterature,
|
||||
|
||||
// 筛选任务
|
||||
startScreening,
|
||||
getTaskProgress,
|
||||
|
||||
// 筛选结果
|
||||
getScreeningResults,
|
||||
updateScreeningResult,
|
||||
batchUpdateScreeningResults,
|
||||
|
||||
// 导出
|
||||
exportScreeningResults,
|
||||
|
||||
// 统计
|
||||
getProjectStatistics,
|
||||
|
||||
// 健康检查
|
||||
healthCheck,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user