fix: 修复crud2编辑器内设置多列右侧固定显示问题

This commit is contained in:
zhangtao07 2024-04-19 17:17:43 +08:00
parent 38ddbd5981
commit 37e6369364
2 changed files with 14 additions and 3 deletions

View File

@ -60,8 +60,17 @@ export default class Head extends React.PureComponent<Props> {
tdColumns: Array<TdProps>; tdColumns: Array<TdProps>;
prependColumns(columns: Array<any>) { prependColumns(columns: Array<any>) {
const {rowSelectionFixed, expandableFixed, draggable} = this.props; const {
if (draggable) { rowSelectionFixed,
expandableFixed,
draggable,
selectable,
expandable
} = this.props;
if (expandable) {
columns.unshift({});
}
if (draggable || selectable) {
columns.unshift({}); columns.unshift({});
} else { } else {
if (expandableFixed) { if (expandableFixed) {

View File

@ -234,9 +234,11 @@ function getAfterRightWidth(
for (let i = doms.length - 0; i > index; i--) { for (let i = doms.length - 0; i > index; i--) {
if (columns && columns[i] && isFixedRightColumn(columns[i].fixed)) { if (columns && columns[i] && isFixedRightColumn(columns[i].fixed)) {
const dom = doms[i] as HTMLElement; const dom = doms[i] as HTMLElement;
if (dom) {
width += dom.offsetWidth; width += dom.offsetWidth;
} }
} }
}
return width; return width;
} }