2歳以上日誌出力用 preprare
This commit is contained in:
22
src/utils.js
22
src/utils.js
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user