feat(dc): Complete Phase 1 - Portal workbench page development

Summary:
- Implement DC module Portal page with 3 tool cards
- Create ToolCard component with decorative background and hover animations
- Implement TaskList component with table layout and progress bars
- Implement AssetLibrary component with tab switching and file cards
- Complete database verification (4 tables confirmed)
- Complete backend API verification (6 endpoints ready)
- Optimize UI to match prototype design (V2.html)

Frontend Components (~715 lines):
- components/ToolCard.tsx - Tool cards with animations
- components/TaskList.tsx - Recent tasks table view
- components/AssetLibrary.tsx - Data asset library with tabs
- hooks/useRecentTasks.ts - Task state management
- hooks/useAssets.ts - Asset state management
- pages/Portal.tsx - Main portal page
- types/portal.ts - TypeScript type definitions

Backend Verification:
- Backend API: 1495 lines code verified
- Database: dc_schema with 4 tables verified
- API endpoints: 6 endpoints tested (templates API works)

Documentation:
- Database verification report
- Backend API test report
- Phase 1 completion summary
- UI optimization report
- Development task checklist
- Development plan for Tool B

Status: Phase 1 completed (100%), ready for browser testing
Next: Phase 2 - Tool B Step 1 and 2 development
This commit is contained in:
2025-12-02 21:53:24 +08:00
parent f240aa9236
commit d4d33528c7
83 changed files with 21863 additions and 1601 deletions

View File

@@ -335,6 +335,90 @@ export async function healthCheck(): Promise<ApiResponse<{
return request('/health');
}
// ==================== 全文复筛API (Day 5-8 新增) ====================
/**
* 创建全文复筛任务
*/
export async function createFulltextTask(data: {
projectId: string;
literatureIds: string[];
modelA?: string;
modelB?: string;
}): Promise<ApiResponse<{
taskId: string;
projectId: string;
status: string;
totalCount: number;
}>> {
return request('/fulltext-screening/tasks', {
method: 'POST',
body: JSON.stringify(data),
});
}
/**
* 获取全文复筛任务进度
*/
export async function getFulltextTaskProgress(
taskId: string
): Promise<ApiResponse<any>> {
return request(`/fulltext-screening/tasks/${taskId}`);
}
/**
* 获取全文复筛任务结果
*/
export async function getFulltextTaskResults(
taskId: string,
params?: {
filter?: 'all' | 'conflict' | 'pending' | 'reviewed';
page?: number;
pageSize?: number;
sortBy?: 'priority' | 'createdAt';
sortOrder?: 'asc' | 'desc';
}
): Promise<ApiResponse<any>> {
const queryString = new URLSearchParams(
params as Record<string, string>
).toString();
return request(`/fulltext-screening/tasks/${taskId}/results?${queryString}`);
}
/**
* 更新全文复筛人工决策
*/
export async function updateFulltextDecision(
resultId: string,
data: {
finalDecision: 'include' | 'exclude';
exclusionReason?: string;
reviewNotes?: string;
}
): Promise<ApiResponse<any>> {
return request(`/fulltext-screening/results/${resultId}/decision`, {
method: 'PUT',
body: JSON.stringify(data),
});
}
/**
* 导出全文复筛结果Excel
*/
export async function exportFulltextResults(
taskId: string
): Promise<Blob> {
const response = await fetch(
`${API_BASE_URL}/fulltext-screening/tasks/${taskId}/export`
);
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return response.blob();
}
// ==================== 统一导出API对象 ====================
/**
@@ -372,6 +456,13 @@ export const aslApi = {
// 统计
getProjectStatistics,
// 全文复筛 (Day 5-8 新增)
createFulltextTask,
getFulltextTaskProgress,
getFulltextTaskResults,
updateFulltextDecision,
exportFulltextResults,
// 健康检查
healthCheck,
};