|
@@ -89,7 +89,7 @@ export default class ExcelUtil {
|
|
let type = ''
|
|
let type = ''
|
|
let isUniq = false // 重复的行
|
|
let isUniq = false // 重复的行
|
|
let isArray = false // 是否是数组
|
|
let isArray = false // 是否是数组
|
|
- let canZeroStr = false // 是否允许为0的字符串
|
|
|
|
|
|
+ let canZeroStr = false // 是否允许字符串数据为'0'
|
|
if (ls != -1 && le != -1 && le > ls + 1) {
|
|
if (ls != -1 && le != -1 && le > ls + 1) {
|
|
let s = name.substring(ls + 1, le)
|
|
let s = name.substring(ls + 1, le)
|
|
name = name.substring(0, ls)
|
|
name = name.substring(0, ls)
|
|
@@ -183,8 +183,9 @@ export default class ExcelUtil {
|
|
if (MathUtil.isNumber(oneUnit) && isNumber) {
|
|
if (MathUtil.isNumber(oneUnit) && isNumber) {
|
|
ret += oneUnit
|
|
ret += oneUnit
|
|
} else {
|
|
} else {
|
|
- if (!canZeroStr && oneUnit.toString() == '0') oneUnit = ''
|
|
|
|
- ret += `'${oneUnit}'` // 支持字符串数组
|
|
|
|
|
|
+ if ((canZeroStr && oneUnit.toString() == '0') || oneUnit.toString() != '0') {
|
|
|
|
+ ret += `'${oneUnit}'` // 支持字符串数组
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (oneIndex != oneArr.length - 1) {
|
|
if (oneIndex != oneArr.length - 1) {
|
|
ret += ', '
|
|
ret += ', '
|
|
@@ -237,6 +238,8 @@ export default class ExcelUtil {
|
|
if (isArray[i]) {
|
|
if (isArray[i]) {
|
|
headInfo.keys[i].type = 'string[]'
|
|
headInfo.keys[i].type = 'string[]'
|
|
temp = this.tryGetArray(temp, isMultArr[i], false, headInfo.keys[i].canZeroStr)
|
|
temp = this.tryGetArray(temp, isMultArr[i], false, headInfo.keys[i].canZeroStr)
|
|
|
|
+ } else {
|
|
|
|
+ if (!headInfo.keys[i].canZeroStr && temp == '0') temp = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cobj[headInfo.keys[i].name] = temp
|
|
cobj[headInfo.keys[i].name] = temp
|