树选择的渲染

方法

 get tProps() {
        let arr = [];

        const {findDoclist} = this.props.emr;
        findDoclist.map((item, key) => {
            arr.push({title: item.name,key:key,value:key,id:item.id,})
        })
        console.log(arr, '=====',findDoclist)
        return {
            treeData: arr,
            // treeData:this.state.findDoclist,
            value: this.state.value,
            onChange: this.onChange.bind(this, this.state.value),
            treeCheckable: true,
            showCheckedStrategy: SHOW_PARENT,
            searchPlaceholder: 'Please select',
        }
    }
结构
     <Row>
          <Col md={24}>
              <FormItem label="会诊医生">
                   {getFieldDecorator('doctorIds',{

                    })(<TreeSelect {...this.tProps}  style={{width:"357px"}}/>
                                        
                     )}
                </FormItem>
          </Col>
    </Row>
 

posted on 2019-11-13 17:34  张花花  阅读(250)  评论(0编辑  收藏  举报