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

43 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-02-28 09:29:46 +08:00
import React from 'react'
import { Button } from 'antd';
import "./index.less"
export default class SlideModalTitle extends React.Component {
2022-03-03 15:28:00 +08:00
componentWillMount() { // 初始化渲染页面
this.state = {
editable: this.props.editable === undefined ? "true": this.props.editable
}
}
2022-02-28 09:29:46 +08:00
render() {
return <div className="slideTitleWrapper">
<div className="iconWrapper">
<i className='icon-coms-meeting' />
</div>
<div className="slideTitle">
2022-03-16 13:28:34 +08:00
{
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>
}
2022-02-28 09:29:46 +08:00
</div>
<div className="btnWrapper">
2022-03-10 13:51:13 +08:00
{this.props.btns}
2022-03-03 15:28:00 +08:00
{
this.state.editable && <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
}
2022-03-15 11:06:56 +08:00
{this.props.customOperate}
2022-02-28 09:29:46 +08:00
</div>
</div>
}
}