Skip to content

Commit

Permalink
fix: 合计和固定列错位[#540]
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchch6 committed Jul 22, 2020
1 parent ecf0664 commit f3541df
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 2 additions & 2 deletions build/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion demo/index.js

Large diffs are not rendered by default.

39 changes: 7 additions & 32 deletions dist/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demo.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 2 additions & 1 deletion src/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`}
Expand Down

0 comments on commit f3541df

Please sign in to comment.