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

73 lines
2.4 KiB
JavaScript
Raw Normal View History

import React from "react";
import { Button } from "antd";
import { WeaReqTop } from "ecCom";
import "./index.less";
2022-02-28 09:29:46 +08:00
export default class SlideModalTitle extends React.Component {
2022-03-03 15:28:00 +08:00
componentWillMount() { // 初始化渲染页面
this.state = {
2022-06-16 16:27:15 +08:00
editable: this.props.editable
};
}
componentWillReceiveProps(nextProps) {
this.setState({
editable: nextProps.editable
});
2022-03-03 15:28:00 +08:00
}
render() {
const { selectedTab, tabs, subtitle, customOperate, subItemChange } = this.props;
return <div className="reqTopWrapper">
<WeaReqTop
title={subtitle}
buttonSpace={10}
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
buttons={(this.props.showOperateBtn && this.state.editable && this.props.selectedTab != 1) ? [
<Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
] : !_.isEmpty(customOperate) ? customOperate: []}
showDropIcon={false}
dropMenuDatas={[]}
tabDatas={tabs || []}
selectedKey={String(selectedTab) || ""}
onChange={ key => subItemChange(key) }
/>
</div>;
// return <div className="slideTitleWrapper">
// <div className="iconWrapper">
// <i className="icon-coms-fa"/>
// </div>
// <div className="slideTitle">
// {
// this.props.subtitle && <div className="subtitle">
// {
// this.props.tabs ?
// <div>
// <div className="mainTitle">{this.props.subtitle}</div>
// <div className="subTab">
// {this.props.tabs.map(item => (
// <span className={item.key == this.props.selectedTab ? "subItem subItemSelected" : "subItem"}
// onClick={() => this.props.subItemChange(item)}>{item.title}</span>
// ))}
// </div>
// </div> : <div>{this.props.subtitle}</div>
// }
// </div>
// }
// </div>
// <div className="btnWrapper">
// {this.props.btns}
// {
// this.props.showOperateBtn && this.state.editable && this.props.selectedTab != 1 &&
// <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
// }
// {this.props.customOperate}
{/* </div>*/
2022-02-28 09:29:46 +08:00
}
{/*</div>;*/
}
}
}