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

30 lines
1.1 KiB
JavaScript

import React from 'react'
import { Row, Col, Modal, Button } from 'antd'
import { WeaInput } from 'ecCom'
import RequiredLabelTip from '../../../components/requiredLabelTip'
export default class AddCategoryModal extends React.Component {
constructor(props) {
super(props)
this.state = {
name: this.props.title ? this.props.title : ""
}
}
render() {
return (
<Modal title="新增分类" footer={<Button type="primary" onClick={() => {this.props.onSave(this.state.name)}}>保存</Button>} width={600}
visible={this.props.visible} onCancel={() => {this.props.onCancel()}}
>
<div style={{padding: "20px"}}>
<Row>
<Col span={6}>分类名称<RequiredLabelTip /></Col>
<Col span={18}>
<WeaInput value={this.state.name} onChange={(value) => {this.setState({name: value})}}/>
</Col>
</Row>
</div>
</Modal>
)
}
}