2歳以上日誌出力用 preprare

This commit is contained in:
2025-02-16 09:15:13 +08:00
parent 4bcad33a61
commit 6b8c172bac
5 changed files with 119 additions and 8 deletions

View File

@@ -443,4 +443,26 @@ function createCopyFromTemplate(worksheet, { startPage,
newPageRow += rowCount;
callback(p, rowCount);
}
}
function updateCell(worksheet, { base, left = 0, right = 0, up = 0, down = 0 }, data) {
const row = base.row + ( down - up );
const col = base.col + ( right - left );
worksheet.getCell(row, col).value = data;
worksheet.getCell(row, col).alignment = { wrapText: true };;
}
function getMergedInfo(worksheet, { row, col }) {
const key = columnToLetter(col) + row;
return worksheet._merges[key];
}
function columnToLetter(columnIndex) {
let letter = '';
while (columnIndex > 0) {
let remainder = (columnIndex - 1) % 26;
letter = String.fromCharCode(65 + remainder) + letter;
columnIndex = Math.floor((columnIndex - 1) / 26);
}
return letter;
}