Browse Source

Merge pull request #930 from yangyining/fix-getcellvalue

修复当单元格内有换行获取不到值的问题
master
mengshukeji 4 years ago
committed by GitHub
parent
commit
7024b58e86
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/global/api.js

14
src/global/api.js

@ -73,12 +73,22 @@ export function getCellValue(row, column, options = {}) {
else if(type == "f") {
return_v = cellData["v"];
}
else if(cellData && cellData.ct && cellData.ct.fa == 'yyyy-MM-dd') {
else if(cellData && cellData.ct ) {
if (cellData.ct.fa == 'yyyy-MM-dd') {
return_v = cellData.m;
}
// 修复当单元格内有换行获取不到值的问题
else if (cellData.ct.hasOwnProperty("t") && cellData.ct.t === 'inlineStr') {
let inlineStrValueArr = cellData.ct.s;
if (inlineStrValueArr) {
return_v = inlineStrValueArr.map(i => i.v).join("")
}
}
}
}
if(return_v == undefined){
if(return_v == undefined ){
return_v = null;
}

Loading…
Cancel
Save