From 35893bd9c1f5cbd658ca9187b0b3fc05f67cbc4a Mon Sep 17 00:00:00 2001 From: 2450357564 <46582006+2450357564@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=BC=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=80=8F=E8=A7=86=E5=9B=BE=E5=90=8E=EF=BC=8C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=85=8D=E7=BD=AE=E8=A1=8C=E5=88=97=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=88=87=E6=8D=A2=E5=85=B6=E4=BB=96Sheet=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/sheetmanage.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index ba874d4a..0132643d 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -1487,26 +1487,29 @@ const sheetmanage = { let data = d; let addr = 0, addc = 0; - let rlen = ret.length, - clen = ret[0].length; + let rlen = ret.length; + let clen = 0; + if (rlen > 0) { + clen = ret[0].length; + } - addr = rlen - d.length; - addc = clen - d[0].length; + addr = rlen - d.length; + addc = clen - d[0].length; - data = datagridgrowth(d, addr + 20, addc + 10, true); + data = datagridgrowth(d, addr + 20, addc + 10, true); - for (let r = 0; r < rlen; r++) { - // let x = [].concat(data[r]); - for (let c = 0; c < clen; c++) { - let value = ""; - if (ret[r] != null && ret[r][c] != null) { - value = getcellvalue(r, c, ret); - setcellvalue(r,c,data,value) - } - // x[c] = value; + for (let r = 0; r < rlen; r++) { + // let x = [].concat(data[r]); + for (let c = 0; c < clen; c++) { + let value = ""; + if (ret[r] != null && ret[r][c] != null) { + value = getcellvalue(r, c, ret); + setcellvalue(r,c,data,value) } - // data[r] = x; + // x[c] = value; } + // data[r] = x; + } file.data = data; }, checkLoadSheetIndexToDataIndex: {},