From d744230a22bb28beecda6a9d1e5f6c43e6ecc389 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Jul 2021 10:49:14 +0800 Subject: [PATCH 1/2] update --- src/core/wrapper/layout/adapt/adapt.table.js | 6 +++++- src/core/wrapper/layout/layout.td.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 0539b7f41..a2ddcc77e 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -61,7 +61,11 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { // 2、不能给多个td设置最大宽度,这样只会平分宽度 // 3、多百分比宽度就算了 if (columnSize > 0) { - td.element.css({"max-width": columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit}); + columnSize = columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit; + td.element.css({ + "max-width": columnSize, + "min-width": columnSize + }); } if (i === 0) { td.element.addClass("first-element"); diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index 39ebac7d2..94bdbc5cb 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -132,7 +132,11 @@ BI.TdLayout = BI.inherit(BI.Layout, { // 2、不能给多个td设置最大宽度,这样只会平分宽度 // 3、多百分比宽度就算了 if (columnSize > 0) { - td.element.css({"max-width": columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit}); + columnSize = columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit; + td.element.css({ + "max-width": columnSize, + "min-width": columnSize + }); } td.element.css({ position: "relative", From 8856745406299fca4bee60d9645e94659792203a Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Jul 2021 10:50:26 +0800 Subject: [PATCH 2/2] update --- src/core/wrapper/layout/layout.td.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/wrapper/layout/layout.td.js b/src/core/wrapper/layout/layout.td.js index 94bdbc5cb..e191015b4 100644 --- a/src/core/wrapper/layout/layout.td.js +++ b/src/core/wrapper/layout/layout.td.js @@ -76,13 +76,14 @@ BI.TdLayout = BI.inherit(BI.Layout, { } var height = o.rowSize[idx] === "" ? "" : (o.rowSize[idx] < 1 ? ((o.rowSize[idx] * 100).toFixed(1) + "%") : o.rowSize[idx]); - + var rowHeight = BI.isNumber(o.rowSize[idx]) ? (o.rowSize[idx] <= 1 ? height : height / BI.pixRatio + BI.pixUnit) : height; var tr = BI._lazyCreateWidget({ type: "bi.default", tagName: "tr", height: height, css: { - "max-height": BI.isNumber(o.rowSize[idx]) ? (o.rowSize[idx] <= 1 ? height : height / BI.pixRatio + BI.pixUnit) : height + "max-height": rowHeight, + "min-height": rowHeight } });