fix
This commit is contained in:
@@ -70,25 +70,28 @@
|
||||
|
||||
const pageSize = 10;
|
||||
const totalPages = Math.ceil(records.length / pageSize);
|
||||
|
||||
// make new copy
|
||||
if (totalPages > 2) {
|
||||
const lastPage = 2;
|
||||
const copyPageRowStart = baseCells['月'][lastPage - 1].row - 1;
|
||||
const copyPageRowEnd = baseCells['児童名'][lastPage - 1].row + pageSize;
|
||||
const rowCount = copyPageRowEnd - copyPageRowStart + 1;
|
||||
let newPageRow = copyPageRowEnd + 1;
|
||||
|
||||
for (let p = 3; p <= totalPages; p++) {
|
||||
const copyRow = pvc.lib.exceljsUtil.copyRows(worksheet, copyPageRowStart, copyPageRowEnd);
|
||||
pvc.lib.exceljsUtil.insertRows(worksheet, newPageRow, copyRow);
|
||||
newPageRow += rowCount;
|
||||
['月', '児童名'].forEach((label) => {
|
||||
const last = baseCells[label][p - 2];
|
||||
baseCells[label].push({
|
||||
...last,
|
||||
row: last.row + rowCount
|
||||
});
|
||||
})
|
||||
}
|
||||
createCopyFromTemplate(worksheet, {
|
||||
startPage: lastPage + 1,
|
||||
totalPages,
|
||||
copyPageRowStart,
|
||||
copyPageRowEnd,
|
||||
callback: (newPage, rowCount) => {
|
||||
['月', '児童名'].forEach((label) => {
|
||||
const last = baseCells[label][newPage - lastPage];
|
||||
baseCells[label].push({
|
||||
col: last.col,
|
||||
row: last.row + rowCount
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cols = getLabelColsMapping(worksheet, baseCells['児童名'][0].row, ['児童名', '子どもの姿', '保育者援助_配慮_環境構成']);
|
||||
|
||||
Reference in New Issue
Block a user