Browse Source

修改配置

lanyunfei 7 months ago
parent
commit
e24cef5fa3
2 changed files with 2 additions and 2 deletions
  1. 1 1
      dist/ExcelUtil.js
  2. 1 1
      src/ExcelUtil.ts

+ 1 - 1
dist/ExcelUtil.js

@@ -70,7 +70,7 @@ var ExcelUtil = /** @class */ (function () {
             if ((name_1 == undefined || name_1 == null) && row == 1) {
                 Config_1.Config.checkState(Config_1.RetCode.EXCEL_DATA_ERROR, "".concat(StringUtil_1.default.getCheckString(address, ret), " \n\u7F3A\u5931\u8868\u5934\u540D\u5B57!,\u662F\u4E0D\u662F\u63D2\u5165\u4E86\u7A7A\u5217\uFF1F"));
             }
-            if (ret.cols.findIndex(function (v) { return v == col; }) == -1 && worksheet[col + '1']) {
+            if (ret.cols.findIndex(function (v) { return v == col; }) == -1 && worksheet[col + '1'] && worksheet[col + '1'].v) {
                 ret.cols.push(col);
             }
             if (ret.cols.length > 0 && ret.maxRow < row && name_1 != undefined) {

+ 1 - 1
src/ExcelUtil.ts

@@ -74,7 +74,7 @@ export default class ExcelUtil {
             if ((name == undefined || name == null) && row == 1) {
                 Config.checkState(RetCode.EXCEL_DATA_ERROR, `${StringUtil.getCheckString(address, ret)} \n缺失表头名字!,是不是插入了空列?`)
             }
-            if (ret.cols.findIndex((v) => v == col) == -1 && worksheet[col + '1']) {
+            if (ret.cols.findIndex((v) => v == col) == -1 && worksheet[col + '1'] && worksheet[col + '1'].v) {
                 ret.cols.push(col);
             }
             if (ret.cols.length > 0 && ret.maxRow < row && name != undefined) {