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
24 lines
666 B
TypeScript
24 lines
666 B
TypeScript
import XLSX from 'xlsx';
|
|
|
|
const filePath = 'D:\\MyCursor\\AIclinicalresearch\\docs\\03-业务模块\\ASL-AI智能文献\\05-测试文档\\03-测试数据\\screening\\Test Cases.xlsx';
|
|
|
|
const workbook = XLSX.readFile(filePath);
|
|
const sheetName = workbook.SheetNames[0];
|
|
const worksheet = workbook.Sheets[sheetName];
|
|
const data = XLSX.utils.sheet_to_json(worksheet);
|
|
|
|
console.log(`总行数: ${data.length}`);
|
|
console.log('\n前3行数据:');
|
|
data.slice(0, 3).forEach((row: any, i) => {
|
|
console.log(`\n第${i+1}行:`);
|
|
console.log(JSON.stringify(row, null, 2));
|
|
});
|
|
|
|
console.log('\n所有列名:');
|
|
if (data.length > 0) {
|
|
console.log(Object.keys(data[0]));
|
|
}
|
|
|
|
|
|
|