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>;
prependColumns(columns: Array<any>) {
const {rowSelectionFixed, expandableFixed, draggable} = this.props;
if (draggable) {
const {
rowSelectionFixed,
expandableFixed,
draggable,
selectable,
expandable
} = this.props;
if (expandable) {
columns.unshift({});
}
if (draggable || selectable) {
columns.unshift({});
} else {
if (expandableFixed) {

View File

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