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

This commit is contained in:
zhenglingpeng
2024-07-19 09:33:18 +08:00
parent f33b61abd9
commit 911bf14e58
2 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -1413,9 +1413,7 @@ export class Draw {
}
}
}
for (let i = tr.tdList.length - 1; i >= item.col; i--) {
tr.tdList[i + 1] = tr.tdList[i]
}
tr.tdList.splice(item.col, 0, tr.tdList[tr.tdList.length - 1])
const tempRow = item.row - item.count
tr.tdList[mdColIndex] = {
...cell,
@@ -1424,7 +1422,7 @@ export class Draw {
height: height - initHeight,
realHeight: height - initRealHeight,
realMinHeight: height - initRealMinHeight,
tempFlag: true,
temporaryFlag: true,
parentTr: `${mdColIndex}-${mdRowIndex}`,
value: cell.value.map(item => ({ ...item, value: '' }))
}
@@ -1438,9 +1436,10 @@ export class Draw {
deleteStart = r + 1
deleteCount = trList.length - deleteStart
preTrHeight += trHeight
// 重新记录临时的td
for (let i = 0; i < trList.length; i++) {
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]
if (tempTd.parentTr) {
const mdRowIndex = parseInt(
+2 -2
View File
@@ -29,6 +29,6 @@ export interface ITd {
mainHeight?: number // 内容 + 内边距高度
realHeight?: number // 真实高度(包含跨列)
realMinHeight?: number // 真实最小高度(包含跨列)
tempFlag?: boolean,
parentTr?: string
temporaryFlag?: boolean, // 临时单元格标识
parentTr?: string // 记录临时单元格的父级tr,用于合并单元格
}