salary-management-front/pc4mobx/hrmSalary/pages/ledger/step3/AddCategoryModal.js

37 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-03-29 17:33:54 +08:00
import React from 'react'
import { Row, Col, Modal, Button } from 'antd'
import { WeaInput } from 'ecCom'
2022-04-06 14:26:16 +08:00
import RequiredLabelTip from '../../../components/requiredLabelTip'
2022-03-29 17:33:54 +08:00
export default class AddCategoryModal extends React.Component {
constructor(props) {
super(props)
this.state = {
2022-05-13 15:25:21 +08:00
name: this.props.title ? this.props.title : ""
2022-03-29 17:33:54 +08:00
}
}
render() {
return (
<Modal title={this.props.title && this.props.title !== '' ? "修改分类" : "新增分类"} footer={<Button type="primary" onClick={() => {
this.props.onSave(this.state.name)
}}>保存</Button>} width={600}
visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}}
2022-03-29 17:33:54 +08:00
>
<div style={{padding: "20px"}}>
2022-07-28 17:16:40 +08:00
<Row style={{display:"flex", alignItems:"center"}}>
2022-04-06 14:26:16 +08:00
<Col span={6}>分类名称<RequiredLabelTip /></Col>
2022-03-29 17:33:54 +08:00
<Col span={18}>
<WeaInput value={this.state.name} onChange={(value) => {
this.setState({name: value})
}}/>
2022-03-29 17:33:54 +08:00
</Col>
</Row>
</div>
</Modal>
2022-07-28 17:16:40 +08:00
)
2022-03-29 17:33:54 +08:00
}
2022-07-28 17:16:40 +08:00
}