From 13af5c01dedb641025ac41f2ed9cdf800cbf7063 Mon Sep 17 00:00:00 2001 From: janeluo Date: Tue, 18 Jan 2022 11:04:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E5=86=85=E6=9C=89=E6=8D=A2=E8=A1=8C=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global/api.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/global/api.js b/src/global/api.js index 49580e6..5cd1963 100644 --- a/src/global/api.js +++ b/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,9 +78,17 @@ 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){ + if(return_v == undefined ){ return_v = null; } @@ -636,7 +646,7 @@ export function frozenFirstRow(order) { top ]; } - + luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, null, null); if (luckysheetFreezen.freezenverticaldata != null) { From fdd2b074f4b551bcdee048faa48678318e4a1b15 Mon Sep 17 00:00:00 2001 From: janeluo Date: Tue, 18 Jan 2022 11:06:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E5=86=85=E6=9C=89=E6=8D=A2=E8=A1=8C=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global/api.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/global/api.js b/src/global/api.js index 5cd1963..a932022 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -64,8 +64,6 @@ export function getCellValue(row, column, options = {}) { let cellData = targetSheetData[row][column]; let return_v; - debugger - if(getObjType(cellData) == "object"){ return_v = cellData[type]; From fd9e97adfb63e03ffc082ddb5b62010655de067d Mon Sep 17 00:00:00 2001 From: janeluo Date: Tue, 18 Jan 2022 11:21:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E5=86=85=E6=9C=89=E6=8D=A2=E8=A1=8C=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global/api.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/global/api.js b/src/global/api.js index a932022..a8691ee 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -73,14 +73,16 @@ 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') { - 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() + 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("") + } } }