From d3cdef4269a0a3d935a76d1b00ca7083201fb877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 3 Dec 2021 15:42:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=8D=95=E5=85=83=E6=A0=BC=E5=8F=AA=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E5=88=97=E5=AE=BD=E6=97=B6,=E5=9C=A8=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E5=86=85=E5=90=91=E5=8F=B3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=97=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83=E6=A0=BC=E5=8A=A0=E5=AE=BD?= =?UTF-8?q?=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/extend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/global/extend.js b/src/global/extend.js index f8829f9..163c04a 100644 --- a/src/global/extend.js +++ b/src/global/extend.js @@ -96,7 +96,12 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { } else if(index == c + cs - 1){ if(direction == "lefttop"){ - merge_new[r + "_" + c] = { "r": r, "c": c, "rs": rs, "cs": cs + value }; + // *这是要判断一下这个合并单元格的列宽是否=1,如果cs等于1的情况下,向左插入列,这个合并单元格会右移 + if(cs == 1){ + merge_new[r + "_" + (c + value)] = { "r": r, "c": c + value, "rs": rs, "cs": cs }; + } else { + merge_new[r + "_" + c] = { "r": r, "c": c, "rs": rs, "cs": cs + value }; + } } else{ merge_new[r + "_" + c] = { "r": r, "c": c, "rs": rs, "cs": cs };