fix: dragging to adjust td width boundary error #569

This commit is contained in:
zhaopeng
2024-05-15 21:08:11 +08:00
committed by GitHub
parent 6ada65e768
commit 2738d3ae4c
@@ -285,7 +285,8 @@ export class TableTool {
dx = nextColWidth - this.MIN_TD_WIDTH dx = nextColWidth - this.MIN_TD_WIDTH
} }
const moveColWidth = curColWidth + dx const moveColWidth = curColWidth + dx
// 开始移动 // 开始移动,只有表格的最后一列线才会改变表格的宽度,其他场景不用计算表格超出
if (index === colgroup.length - 1) {
let moveTableWidth = 0 let moveTableWidth = 0
for (let c = 0; c < colgroup.length; c++) { for (let c = 0; c < colgroup.length; c++) {
const group = colgroup[c] const group = colgroup[c]
@@ -305,6 +306,7 @@ export class TableTool {
const tableWidth = element.width! const tableWidth = element.width!
dx = innerWidth - tableWidth dx = innerWidth - tableWidth
} }
}
if (dx) { if (dx) {
// 当前列增加,后列减少 // 当前列增加,后列减少
if (colgroup.length - 1 !== index) { if (colgroup.length - 1 !== index) {