fix: 合计和固定列错位[#540]

This commit is contained in:
yangchch6 2020-07-22 10:21:27 +08:00
parent ecf0664a3c
commit f3541dfe03
7 changed files with 15 additions and 39 deletions

View File

@ -1304,7 +1304,7 @@ var Table = function (_Component) {
}
// const leftFixedWidth = this.columnManager.getLeftColumnsWidth(this.contentWidth);
// const rightFixedWidth = this.columnManager.getRightColumnsWidth(this.contentWidth);
var expandIconWidth = expandIconAsCell ? 33 : 0;
var expandIconWidth = expandIconAsCell ? 32 : 0;
var parStyle = {};
if (!fixed) {
parStyle = { 'marginLeft': leftFixedWidth + expandIconWidth, 'marginRight': rightFixedWidth };

View File

@ -603,8 +603,8 @@ var TableRow = function (_Component) {
expandIndexInThisTable = expandIconColumnIndex;
}
for (var i = 0; i < columns.length; i++) {
if (expandIconAsCell && i === 0 && !showSum) {
cells.push(_react2["default"].createElement(
if (expandIconAsCell && i === 0) {
showSum ? cells.push(_react2["default"].createElement('td', { width: expandIconCellWidth })) : cells.push(_react2["default"].createElement(
'td',
{
className: clsPrefix + '-expand-icon-cell ' + isExpandIconAsCell,

File diff suppressed because one or more lines are too long

39
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1127,7 +1127,7 @@ class Table extends Component {
}
// const leftFixedWidth = this.columnManager.getLeftColumnsWidth(this.contentWidth);
// const rightFixedWidth = this.columnManager.getRightColumnsWidth(this.contentWidth);
let expandIconWidth = expandIconAsCell ? 33 : 0;
let expandIconWidth = expandIconAsCell ? 32 : 0;
let parStyle = {}
if(!fixed){
parStyle = {'marginLeft':leftFixedWidth + expandIconWidth,'marginRight':rightFixedWidth}

View File

@ -481,7 +481,8 @@ class TableRow extends Component{
expandIndexInThisTable = expandIconColumnIndex
}
for (let i = 0; i < columns.length; i++) {
if (expandIconAsCell && i === 0 && !showSum ) {
if (expandIconAsCell && i === 0) {
showSum ? cells.push(<td width={expandIconCellWidth}></td>) :
cells.push(
<td
className={`${clsPrefix}-expand-icon-cell ${isExpandIconAsCell}`}