修正上一次提交导致数组导出错误
添加调试配置
This commit is contained in:
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
@@ -9,8 +9,13 @@
|
|||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
"<node_internals>/**"
|
"<node_internals>/**"
|
||||||
],
|
],
|
||||||
// "cwd": "D:/work/repositories/zombie/config/新配表",
|
"sourceMapPathOverrides": {
|
||||||
"cwd": "${workspaceFolder}",
|
"webpack:///./~/*": "${workspaceRoot}/node_modules/*",
|
||||||
|
"webpack:///./*": "${workspaceRoot}/*",
|
||||||
|
"webpack:///*": "*"
|
||||||
|
},
|
||||||
|
"cwd": "D:/work/repositories/zombie/config/新配表",
|
||||||
|
// "cwd": "${workspaceFolder}",
|
||||||
"program": "${workspaceFolder}/dist/binary.js",
|
"program": "${workspaceFolder}/dist/binary.js",
|
||||||
"args": [
|
"args": [
|
||||||
"./excel-exporter.yaml"
|
"./excel-exporter.yaml"
|
||||||
|
|||||||
@@ -87,11 +87,12 @@ export class TableParser {
|
|||||||
let row: RawTableCell[] = [];
|
let row: RawTableCell[] = [];
|
||||||
for (let c = range.s.c; c <= range.e.c; c++) {
|
for (let c = range.s.c; c <= range.e.c; c++) {
|
||||||
let C = xlsl.utils.encode_col(c);
|
let C = xlsl.utils.encode_col(c);
|
||||||
let cell: RawTableCell = {
|
let origin_cell = sheet[`${C}${R}`] as xlsl.CellObject;
|
||||||
...(sheet[`${C}${R}`] as xlsl.CellObject),
|
let cell: RawTableCell = origin_cell ? {
|
||||||
|
...origin_cell,
|
||||||
column: c,
|
column: c,
|
||||||
row: r,
|
row: r,
|
||||||
};
|
} : null;
|
||||||
row.push(cell);
|
row.push(cell);
|
||||||
}
|
}
|
||||||
rows.push(row);
|
rows.push(row);
|
||||||
@@ -132,7 +133,6 @@ export class TableParser {
|
|||||||
var t = this.get_data_type(cell);
|
var t = this.get_data_type(cell);
|
||||||
if (type_order.indexOf(t) < type_order.indexOf(type)) {
|
if (type_order.indexOf(t) < type_order.indexOf(type)) {
|
||||||
if (type != DataType.null) {
|
if (type != DataType.null) {
|
||||||
// console.log(colors.yellow(`\t\t${first.v} 的数据类型被提升为 ${t}\n\t\t ${this.dump_row_values(rows[start_raw + i])}`));
|
|
||||||
console.log(colors.yellow(`\t\t${first.v}(${this.format_cell_position(first).replace(/\d+/, '')}列) 的数据类型被提升为 ${t} 因为 ${this.format_cell_position(cell)} 的值为 ${cell.w}`));
|
console.log(colors.yellow(`\t\t${first.v}(${this.format_cell_position(first).replace(/\d+/, '')}列) 的数据类型被提升为 ${t} 因为 ${this.format_cell_position(cell)} 的值为 ${cell.w}`));
|
||||||
}
|
}
|
||||||
type = t;
|
type = t;
|
||||||
@@ -269,7 +269,7 @@ export class TableParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get_cell_value(cell: xlsl.CellObject, type: DataType) {
|
protected get_cell_value(cell: RawTableCell, type: DataType) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DataType.bool:
|
case DataType.bool:
|
||||||
return cell && cell.v as boolean == true;
|
return cell && cell.v as boolean == true;
|
||||||
|
|||||||
Reference in New Issue
Block a user