initialValue defaultValue
<Form.Item label="项目编码:">
<Select defaultValue={record.id} sstyle={{ width: '100%' }} >
<Option value={record.id}>{record.id}</Option>
</Select>
</Form.Item>
<Form.Item label="项目编码:">
{getFieldDecorator('task_code', {
initialValue: record.id|| '',
})(
<Select sstyle={{ width: '100%' }} disabled>
<Option value={record.id}>{record.id}</Option>
</Select>
)}
</Form.Item>
Input > onChange(e) > aaa=>(e)={值 = e.target.value}
<Input onChange = {(e) = {this.aaa(e)}} />
InputNumber > onChange(e) > aaa=>(value)={值 = value }
<InputNumber onChange={(value)=>{this.aaa(value)}} min={0} precision={2}/>
this.props.form.getFieldValue("name")
0 this.state = {
0 name:""
0 }
0
1 onChange =(value)=>{
2 let {name} = this.state;
3
4 console.log(name);
5
6 console.log(this.state.name);
7
8 console.log(this.props.form.getFieldValue("name"));
9 this.setState({
10 name:value
11 },()=>{
12
13
14
15
16
17
18
19 console.log(name);
20
21 console.log(this.state.name);
22
23 console.log(this.props.form.getFieldValue("name"));
24 })
25
26 console.log(name);
27
28 console.log(this.state.name);
29
30 console.log(this.props.form.getFieldValue("name"));
31 }
32
<SearchPanel wrappedComponentRef={(form1) => { return this.form2 = form1}}/>
<SearchPanel wrappedComponentRef={(form) => { return this.form = form}}/>
this.form.props.form.validateFields((err1,values1) => {
console.log(err1,values1)
})
this.props.form.validateFields((err,values)=>{
console.log(err,values)
})
let {getFieldDecorator} = this.props.form
<Form {...formItemLayout} labelAlign="left" >
<Form.Item label="项目编码" colon={true}>
{getFieldDecorator('project_id', {
})(
<Input placeholder="请输入项目编码" />
)}
</Form.Item>
</Form>
<Button style={{marginLeft:"30px",display:"inline-block"}} onClick={()=>{this.props.form.resetFields()}}>重置</Button>
const formItemLayout = {
labelCol: {
xs: { span: 5,offset:1 },
sm: { span: 5,offset:1 },
md: { span: 5,offset:1 },
},
wrapperCol: {
xs: { span: 14,offset:2 },
sm: { span: 14,offset:2 },
md: { span: 14 ,offset:2 },
},
};
Fragment > Card > Form ...formItemLayout > Row("一个!一个row是24span") > Col span={8} > Form.Item
<Fragment>
<Card style={{borderBottom:"1px solid #E9E9E9"}} bordered={false}>
<Form {...formItemLayout} labelAlign="left" >
<Row>
<Col span={8}>
<Form.Item label="项目编码:">
{getFieldDecorator('project_id', {
})(
<Input placeholder="请输入项目编码" />
)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item label="任务编码:">
{getFieldDecorator('projectName', {
})(
<Input placeholder="请输入项目名称" />
)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item>
<Button type="primary" style={{display:"inline-block"}} onClick={()=>{this.query()}}>查询</Button>
<Button style={{marginLeft:"30px",display:"inline-block"}} onClick={()=>{this.props.form.resetFields()}}>重置</Button>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item label="任务类目:">
{getFieldDecorator('projectCode11', {
})(
<Select placeholder="请选择" >
<Option value="jack">Jack</Option>
<Option value="lucy">Lucy</Option>
<Option value="Yiminghe">yiminghe</Option>
</Select>
)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item label="分包归属:">
{getFieldDecorator('projectName11', {
})(
<Select placeholder="请选择" >
<Option value="jack">Jack</Option>
<Option value="lucy">Lucy</Option>
<Option value="Yiminghe">yiminghe</Option>
</Select>
)}
</Form.Item>
</Col>
</Row>
<Row>
<Col span={8}>
<Title>任务包详情</Title>
</Col>
<Col span={8} offset={8}>
<Button icon="plus" type="primary" style={{float:"right",marginRight:"20px"}} onClick={()=>{this.build_showModal("新建打包任务")}}>新建</Button>
</Col>
</Row>
</Form>
</Card>
<Card bordered={false}>
{}
<Table dataSource={dataSource}
columns={columns}
pagination={{
...this.state.pagination
}}
onChange={this.pageNumberChange}
rowKey={(_,index)=>index}
/>
</Card>
</Fragment>