Commit 92d0fce3 authored by superman's avatar superman

update

parent 3055db68
node_modules node_modules
.DS_Store .DS_Store
.idea
This diff is collapsed.
...@@ -25,6 +25,7 @@ import { ...@@ -25,6 +25,7 @@ import {
formatDateTime, formatDateTime,
arrayRemoveIndex, arrayRemoveIndex,
UUID, UUID,
NULL,
formItemLayout, formItemLayout,
smallFormItemLayout, smallFormItemLayout,
footerFormSubmitLayout footerFormSubmitLayout
...@@ -91,63 +92,67 @@ export default class DateTimeSatausForm extends Component { ...@@ -91,63 +92,67 @@ export default class DateTimeSatausForm extends Component {
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Form horizontal onSubmit={this.handleSubmit.bind(this)}> <Form horizontal onSubmit={this.handleSubmit.bind(this)}>
{ <Row style={{padding:'0 20px'}}>
!isCreate && <Col span="24">
<Form.Item label="产品状态" {...formItemLayout} wrapperCol={{span:20}}> {
<Radio.Group {...getFieldProps('status', {initialValue: product.status + ''})}> !isCreate &&
<Form.Item label="产品状态" {...formItemLayout} wrapperCol={{span:20}}>
<Radio.Group {...getFieldProps('status', {initialValue: product.status + ''})}>
{
ProductStatus.map((status, index)=>
<Radio.Button key={status} data-value={status}
value={status}>{PRODUCT_STATUS[status]}</Radio.Button>
)
}
</Radio.Group>
</Form.Item>
}
<Form.Item label="预约开始时间" {...formItemLayout}>
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择预约开始时间"
{...getFieldProps('fundReservationStartTime', {
initialValue: fundReservationStartTime ? formatDateTime(fundReservationStartTime) : ''
})}
/>
</Form.Item>
<Form.Item label="募集开始与结束时间" {...formItemLayout}>
<DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss"
{...getFieldProps('fundRaisedStartTime', {
initialValue: [
fundReservationStartTime ? formatDateTime(fundReservationStartTime) : '',
fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : ''
]
})}
/>
</Form.Item>
<Form.Item label="汇款结束时间" {...formItemLayout}>
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择汇款结束时间"
{...getFieldProps('remittanceEndTime', {
initialValue: remittanceEndTime ? formatDateTime(remittanceEndTime) : ''
})}
/>
</Form.Item>
<Form.Item label="基金成立与到期时间" {...formItemLayout}>
<DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss"
{...getFieldProps('fundEstablishedTime', {
initialValue: [
fundEstablishedTime ? formatDateTime(fundEstablishedTime) : '',
fundExpireTime ? formatDateTime(fundExpireTime) : ''
]
})}
/>
</Form.Item>
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}>
<Button type="primary" htmlType="submit" loading={loading}><Icon type="save"/>保存</Button>
{ {
ProductStatus.map((status, index)=> !this.props.isCreate &&
<Radio.Button key={status} data-value={status} <Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
value={status}>{PRODUCT_STATUS[status]}</Radio.Button> style={{marginLeft:'1em'}}>
) <Icon type="rollback"/>返回
</Button>
} }
</Radio.Group> </Form.Item>
</Form.Item> </Col>
} </Row>
<Form.Item label="预约开始时间" {...formItemLayout}>
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择预约开始时间"
{...getFieldProps('fundReservationStartTime', {
initialValue: fundReservationStartTime ? formatDateTime(fundReservationStartTime) : ''
})}
/>
</Form.Item>
<Form.Item label="募集开始与结束时间" {...formItemLayout}>
<DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss"
{...getFieldProps('fundRaisedStartTime', {
initialValue: [
fundReservationStartTime ? formatDateTime(fundReservationStartTime) : '',
fundRaisedEndTime ? formatDateTime(fundRaisedEndTime) : ''
]
})}
/>
</Form.Item>
<Form.Item label="汇款结束时间" {...formItemLayout}>
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择汇款结束时间"
{...getFieldProps('remittanceEndTime', {
initialValue: remittanceEndTime ? formatDateTime(remittanceEndTime) : ''
})}
/>
</Form.Item>
<Form.Item label="基金成立与到期时间" {...formItemLayout}>
<DatePicker.RangePicker showTime format="yyyy-MM-dd HH:mm:ss"
{...getFieldProps('fundEstablishedTime', {
initialValue: [
fundEstablishedTime ? formatDateTime(fundEstablishedTime) : '',
fundExpireTime ? formatDateTime(fundExpireTime) : ''
]
})}
/>
</Form.Item>
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}>
<Button type="primary" htmlType="submit" loading={loading}><Icon type="save"/>保存</Button>
{
!this.props.isCreate &&
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
style={{marginLeft:'1em'}}>
<Icon type="rollback" />返回
</Button>
}
</Form.Item>
</Form> </Form>
</Spin> </Spin>
); );
......
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
Table, Table,
Spin Spin
} from 'antd'; } from 'antd';
import {arrayRemoveIndex, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils'; import {arrayRemoveIndex, NULL, UUID, formItemLayout, smallFormItemLayout, footerFormSubmitLayout} from '../../utils';
export function CreateBaseElement() { export function CreateBaseElement() {
...@@ -97,54 +97,78 @@ export default class ElementForm extends Component { ...@@ -97,54 +97,78 @@ export default class ElementForm extends Component {
} }
render() { render() {
const {form:{getFieldProps}, loading} = this.props; const {form:{getFieldProps}, loading, isEdit} = this.props;
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Form horizontal onSubmit={this.handleSubmit.bind(this)}> <Form horizontal onSubmit={this.handleSubmit.bind(this)}>
<Form.Item> <Row style={{padding:'0 20px'}}>
<h3>可以设置以下要素,或者自定义其他要素</h3> <Col span="24">
<p>总规模、投资亮点、托管方、结算方式、资金用途、融资方、担保主体、风控措施、还款来源、发行方、认购起点、大小额配比</p> {
</Form.Item> isEdit ?
<Form.Item> <div>
{ <Form.Item>
this.state.elements.map((item, index)=> <h3>可以设置以下要素,或者自定义其他要素</h3>
<div key={item.key} style={{marginBottom:8}}> <p>总规模、投资亮点、托管方、结算方式、资金用途、融资方、担保主体、风控措施、还款来源、发行方、认购起点、大小额配比</p>
<Input.Group> </Form.Item>
<Col span="6"> <Form.Item>
<Input placeholder="标题" {
{...getFieldProps(index + '.title', { this.state.elements.map((item, index)=>
initialValue: item.title <div key={item.key} style={{marginBottom:8}}>
})} <Input.Group>
/> <Col span="6">
</Col> <Input placeholder="标题"
<Col span="10"> {...getFieldProps(index + '.title', {
<Input type="textarea" placeholder="内容" autosize initialValue: item.title
{...getFieldProps(index + '.content', { })}
initialValue: item.content />
})} </Col>
/> <Col span="10">
</Col> <Input type="textarea" placeholder="内容" autosize
<Col span="4"> {...getFieldProps(index + '.content', {
<Icon type="cross" title="删除" initialValue: item.content
onClick={this.handleRemoveElement.bind(this, index)}/> })}
</Col> />
</Input.Group> </Col>
</div> <Col span="4">
) <Icon type="cross" title="删除"
} onClick={this.handleRemoveElement.bind(this, index)}/>
</Form.Item> </Col>
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}> </Input.Group>
<Button onClick={this.handleAddElement.bind(this)} style={{marginRight:'1em'}}><Icon </div>
type="plus"/>添加</Button> )
<Button type="primary" htmlType="submit" loading={loading}><Icon type="save"/>保存</Button> }
{ </Form.Item>
!this.props.isCreate && </div>
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}} :
style={{marginLeft:'1em'}}> <table>
<Icon type="rollback" />返回 <tbody>
</Button> {
} this.state.elements.map(item=>
</Form.Item> <tr>
<th>{item.title}</th>
<td>{item.content || NULL}</td>
</tr>
)
}
</tbody>
</table>
}
<Form.Item {...footerFormSubmitLayout} style={{marginTop:30}}>
<Button onClick={this.handleAddElement.bind(this)} style={{marginRight:'1em'}}><Icon
type="plus"/>添加</Button>
<Button type="primary" htmlType="submit" loading={loading}><Icon
type="save"/>保存</Button>
{
!this.props.isCreate &&
<Button onClick={e=>{e.preventDefault(); this.props.history.goBack();}}
style={{marginLeft:'1em'}}>
<Icon type="rollback"/>返回
</Button>
}
</Form.Item>
</Col>
</Row>
</Form> </Form>
</Spin> </Spin>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment