fix: the problem of unable to page across columns in the same row Hufe921#41

pr675
zhenglingpeng 2 years ago
parent f33b61abd9
commit 911bf14e58

@ -1413,9 +1413,7 @@ export class Draw {
} }
} }
} }
for (let i = tr.tdList.length - 1; i >= item.col; i--) { tr.tdList.splice(item.col, 0, tr.tdList[tr.tdList.length - 1])
tr.tdList[i + 1] = tr.tdList[i]
}
const tempRow = item.row - item.count const tempRow = item.row - item.count
tr.tdList[mdColIndex] = { tr.tdList[mdColIndex] = {
...cell, ...cell,
@ -1424,7 +1422,7 @@ export class Draw {
height: height - initHeight, height: height - initHeight,
realHeight: height - initRealHeight, realHeight: height - initRealHeight,
realMinHeight: height - initRealMinHeight, realMinHeight: height - initRealMinHeight,
tempFlag: true, temporaryFlag: true,
parentTr: `${mdColIndex}-${mdRowIndex}`, parentTr: `${mdColIndex}-${mdRowIndex}`,
value: cell.value.map(item => ({ ...item, value: '' })) value: cell.value.map(item => ({ ...item, value: '' }))
} }
@ -1438,9 +1436,10 @@ export class Draw {
deleteStart = r + 1 deleteStart = r + 1
deleteCount = trList.length - deleteStart deleteCount = trList.length - deleteStart
preTrHeight += trHeight preTrHeight += trHeight
// 重新记录临时的td
for (let i = 0; i < trList.length; i++) { for (let i = 0; i < trList.length; i++) {
for (let j = trList[i]?.tdList.length - 1; j >= 0; j--) { for (let j = trList[i]?.tdList.length - 1; j >= 0; j--) {
if (trList[i]?.tdList[j]?.tempFlag) { if (trList[i]?.tdList[j]?.temporaryFlag) {
const tempTd = trList[i].tdList[j] const tempTd = trList[i].tdList[j]
if (tempTd.parentTr) { if (tempTd.parentTr) {
const mdRowIndex = parseInt( const mdRowIndex = parseInt(

@ -29,6 +29,6 @@ export interface ITd {
mainHeight?: number // 内容 + 内边距高度 mainHeight?: number // 内容 + 内边距高度
realHeight?: number // 真实高度(包含跨列) realHeight?: number // 真实高度(包含跨列)
realMinHeight?: number // 真实最小高度(包含跨列) realMinHeight?: number // 真实最小高度(包含跨列)
tempFlag?: boolean, temporaryFlag?: boolean, // 临时单元格标识
parentTr?: string parentTr?: string // 记录临时单元格的父级tr用于合并单元格
} }

Loading…
Cancel
Save