Browse Source

修复当单元格内有换行获取不到值的问题

master
janeluo 4 years ago
parent
commit
13af5c01de
  1. 10
      src/global/api.js

10
src/global/api.js

@ -64,6 +64,8 @@ export function getCellValue(row, column, options = {}) {
let cellData = targetSheetData[row][column];
let return_v;
debugger
if(getObjType(cellData) == "object"){
return_v = cellData[type];
@ -76,6 +78,14 @@ export function getCellValue(row, column, options = {}) {
else if(cellData && cellData.ct && cellData.ct.fa == 'yyyy-MM-dd') {
return_v = cellData.m;
}
// 修复当单元格内有换行获取不到值的问题
else if (cellData && cellData.ct.t === 'inlineStr') {
let inlineStrValueArr = cellData.ct.s;
if (inlineStrValueArr) {
return_v = inlineStrValueArr.map(i => i.v).join()
}
}
}
if(return_v == undefined ){

Loading…
Cancel
Save