|
@ -100,41 +100,39 @@ const selection = { |
|
|
|
|
|
|
|
|
Store.luckysheet_selection_range = []; |
|
|
Store.luckysheet_selection_range = []; |
|
|
//copy范围
|
|
|
//copy范围
|
|
|
let minR = Store.luckysheet_select_save[0].row[0], |
|
|
let rowIndexArr = [], colIndexArr = []; |
|
|
maxR = Store.luckysheet_select_save[0].row[1]; |
|
|
|
|
|
let minC = Store.luckysheet_select_save[0].column[0], |
|
|
|
|
|
maxC = Store.luckysheet_select_save[0].column[1]; |
|
|
|
|
|
|
|
|
|
|
|
let copyRange = [], RowlChange = false, HasMC = false; |
|
|
let copyRange = [], RowlChange = false, HasMC = false; |
|
|
|
|
|
|
|
|
for(let s = 0; s < Store.luckysheet_select_save.length; s++){ |
|
|
for(let s = 0; s < Store.luckysheet_select_save.length; s++){ |
|
|
let range = Store.luckysheet_select_save[s]; |
|
|
let range = Store.luckysheet_select_save[s]; |
|
|
|
|
|
|
|
|
if(range.row[0] < minR){ |
|
|
let r1 = range.row[0], |
|
|
minR = range.row[0]; |
|
|
r2 = range.row[1]; |
|
|
} |
|
|
let c1 = range.column[0], |
|
|
|
|
|
c2 = range.column[1]; |
|
|
|
|
|
|
|
|
if(range.row[1] > maxR){ |
|
|
for(let copyR = r1; copyR <= r2; copyR++){ |
|
|
maxR = range.row[1]; |
|
|
if (Store.config["rowhidden"] != null && Store.config["rowhidden"][copyR] != null) { |
|
|
|
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(range.column[0] < minC){ |
|
|
if(!rowIndexArr.includes(copyR)){ |
|
|
minC = range.column[0]; |
|
|
rowIndexArr.push(copyR); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(range.column[1] > maxC){ |
|
|
if (Store.config["rowlen"] != null && (copyR in Store.config["rowlen"])){ |
|
|
maxC = range.column[1]; |
|
|
RowlChange = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for(let copyR = range.row[0]; copyR <= range.row[1]; copyR++){ |
|
|
for(let copyC = c1; copyC <= c2; copyC++){ |
|
|
if (Store.config["rowhidden"] != null && Store.config["rowhidden"][copyR] != null) { |
|
|
if (Store.config["colhidden"] != null && Store.config["colhidden"][copyC] != null) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (Store.config["rowlen"] != null && (copyR in Store.config["rowlen"])){ |
|
|
if(!colIndexArr.includes(copyC)){ |
|
|
RowlChange = true; |
|
|
colIndexArr.push(copyC); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for(let copyC = range.column[0]; copyC <= range.column[1]; copyC++){ |
|
|
|
|
|
let cell = Store.flowdata[copyR][copyC]; |
|
|
let cell = Store.flowdata[copyR][copyC]; |
|
|
|
|
|
|
|
|
if(getObjType(cell) == "object" && ("mc" in cell) && cell.mc.rs != null){ |
|
|
if(getObjType(cell) == "object" && ("mc" in cell) && cell.mc.rs != null){ |
|
@ -169,20 +167,31 @@ const selection = { |
|
|
d = editor.deepCopyFlowData(Store.flowdata); |
|
|
d = editor.deepCopyFlowData(Store.flowdata); |
|
|
let colgroup = ""; |
|
|
let colgroup = ""; |
|
|
|
|
|
|
|
|
for (let r = minR; r <= maxR; r++) { |
|
|
rowIndexArr = rowIndexArr.sort(); |
|
|
|
|
|
colIndexArr = colIndexArr.sort(); |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < rowIndexArr.length; i++) { |
|
|
|
|
|
let r = rowIndexArr[i]; |
|
|
|
|
|
|
|
|
if (Store.config["rowhidden"] != null && Store.config["rowhidden"][r] != null) { |
|
|
if (Store.config["rowhidden"] != null && Store.config["rowhidden"][r] != null) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cpdata += '<tr>'; |
|
|
cpdata += '<tr>'; |
|
|
|
|
|
|
|
|
for (let c = minC; c <= maxC; c++) { |
|
|
for (let j = 0; j < colIndexArr.length; j++) { |
|
|
|
|
|
let c = colIndexArr[j]; |
|
|
|
|
|
|
|
|
|
|
|
if (Store.config["colhidden"] != null && Store.config["colhidden"][c] != null) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let column = '<td ${span} style="${style}">'; |
|
|
let column = '<td ${span} style="${style}">'; |
|
|
|
|
|
|
|
|
if (d[r] != null && d[r][c] != null) { |
|
|
if (d[r] != null && d[r][c] != null) { |
|
|
let style = "", span = ""; |
|
|
let style = "", span = ""; |
|
|
|
|
|
|
|
|
if(r == minR){ |
|
|
if(r == rowIndexArr[0]){ |
|
|
if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ |
|
|
if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ |
|
|
colgroup += '<colgroup width="72px"></colgroup>'; |
|
|
colgroup += '<colgroup width="72px"></colgroup>'; |
|
|
} |
|
|
} |
|
@ -191,7 +200,7 @@ const selection = { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(c == minC){ |
|
|
if(c == colIndexArr[0]){ |
|
|
if(Store.config == null || Store.config["rowlen"] == null || Store.config["rowlen"][r.toString()] == null){ |
|
|
if(Store.config == null || Store.config["rowlen"] == null || Store.config["rowlen"][r.toString()] == null){ |
|
|
style += 'height:19px;'; |
|
|
style += 'height:19px;'; |
|
|
} |
|
|
} |
|
@ -470,7 +479,7 @@ const selection = { |
|
|
|
|
|
|
|
|
column += ""; |
|
|
column += ""; |
|
|
|
|
|
|
|
|
if(r == minR){ |
|
|
if(r == rowIndexArr[0]){ |
|
|
if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ |
|
|
if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ |
|
|
colgroup += '<colgroup width="72px"></colgroup>'; |
|
|
colgroup += '<colgroup width="72px"></colgroup>'; |
|
|
} |
|
|
} |
|
@ -479,7 +488,7 @@ const selection = { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(c == minC){ |
|
|
if(c == colIndexArr[0]){ |
|
|
if(Store.config == null || Store.config["rowlen"] == null || Store.config["rowlen"][r.toString()] == null){ |
|
|
if(Store.config == null || Store.config["rowlen"] == null || Store.config["rowlen"][r.toString()] == null){ |
|
|
style += 'height:19px;'; |
|
|
style += 'height:19px;'; |
|
|
} |
|
|
} |
|
|