Browse Source

fix: 修复当合并单元格只有一列宽时,在合并单元格内向右添加列会导致这个合并单元格加宽的问题

master
菜猫子neko 4 years ago
parent
commit
d3cdef4269
  1. 7
      src/global/extend.js

7
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 };

Loading…
Cancel
Save