salary-management-front/pc4mobx/hrmSalary/components/UnifiedTable/index.js

27 lines
776 B
JavaScript
Raw Normal View History

2023-02-17 17:21:05 +08:00
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import "./index.less";
class Index extends Component {
render() {
2023-02-22 13:36:59 +08:00
const { columns, xWidth = 1440 } = this.props;
2023-02-17 17:21:05 +08:00
const unifiedColumns = _.map(columns, (item, index) => {
if (index === 0 || index === 2) {
return { ...item, fixed: "left", width: 150 };
} else if (index === 1) {
return { ...item, fixed: "left", width: 176 };
}
if (item.dataIndex === "operate") {
2023-07-03 15:42:11 +08:00
return { ...item, fixed: "right", width: item.width || "120px" };
2023-02-17 17:21:05 +08:00
}
return { ...item, width: "33%" };
});
return (
2023-02-22 13:36:59 +08:00
<WeaTable className="unifiedTable" {...this.props} columns={unifiedColumns} scroll={{ x: xWidth }}/>
2023-02-17 17:21:05 +08:00
);
}
}
export default Index;