система инит
This commit is contained in:
@@ -97,6 +97,18 @@ const DualSpreadsheet: FC<DualSpreadsheetProps> = ({ templateData = {} }) => {
|
||||
})
|
||||
)
|
||||
}));
|
||||
|
||||
// Загружаем данные в движок
|
||||
Object.entries(templateData.Report).forEach(([cellName, value]) => {
|
||||
const match = cellName.match(/^([A-Z]+)(\d+)$/);
|
||||
if (match) {
|
||||
const col = match[1].charCodeAt(0) - 65;
|
||||
const row = parseInt(match[2]) - 1;
|
||||
if (row >= 0 && row < 20 && col >= 0 && col < 10) {
|
||||
multiSheetEngine.setCellValue('Report', row, col, String(value));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [templateData]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user