fix(仓库交错视图): 调整单元格宽度计算逻辑

优化单元格宽度计算,当列数超过10列时固定宽度为160px,并移除最小宽度限制以避免溢出
This commit is contained in:
砂糖
2026-01-07 10:44:23 +08:00
parent 96c08b78c4
commit 47c6579363

View File

@@ -190,11 +190,13 @@ export default {
},
cellWidth() {
// 2. 优化cellWidth计算最小宽度从120调整为80避免列数过多时宽度过大导致溢出
if (!this.containerWidth || this.sortedColumnKeys.length === 0) return 120;
if (!this.containerWidth || this.sortedColumnKeys.length === 0) return 160;
// 如果列数超过10列则宽度固定为160px
if (this.sortedColumnKeys.length > 10) return 160;
const availableWidth = Math.max(0, this.containerWidth - 30); // 30是行标尺宽度
const calcWidth = availableWidth / this.sortedColumnKeys.length;
// 最小宽度80px最大不限制交给滚动容器处理
return Math.max(120, calcWidth);
return calcWidth;
},
halfCellWidth() {
return this.cellWidth / 2;