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

49 lines
1.9 KiB
JavaScript

import React from 'react'
import { Checkbox, Radio, Row, Col } from "antd"
import { WeaInput } from "ecCom"
const CheckboxGroup = Checkbox.Group;
export default class CustomForm extends React.Component {
render() {
return (
<div style={{padding: "20px"}}>
{
this.props.condition.map(item => {
return (
<Row style={{lineHeight: "40px"}}>
<Col span={6}>
{item.label} :
</Col>
<Col span={18}>
{
item.conditionType == "INPUT" &&
<WeaInput value={item.value} />
}
{
item.conditionType == "RADIO" && item.options &&
<Radio.Group>
{
item.options.map(o => (
<Radio value={o.key}>{o.showname}</Radio>
))
}
</Radio.Group>
}
{
item.conditionType == "CHECKBOX" &&
item.options &&
<CheckboxGroup options={item.options.map(o => ({label: o.showname, value: o.key}))} />
}
</Col>
</Row>
)
})
}
</div>
)
}
}