37 lines
1.2 KiB
JavaScript
37 lines
1.2 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={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()
|
|
}}
|
|
>
|
|
<div style={{padding: "20px"}}>
|
|
<Row style={{display:"flex", alignItems:"center"}}>
|
|
<Col span={6}>分类名称<RequiredLabelTip /></Col>
|
|
<Col span={18}>
|
|
<WeaInput value={this.state.name} onChange={(value) => {
|
|
this.setState({name: value})
|
|
}}/>
|
|
</Col>
|
|
</Row>
|
|
</div>
|
|
</Modal>
|
|
)
|
|
}
|
|
}
|