//功能模块参数设置
import React from 'react';
import {
    Card, Input, Row, Col, Button, Pagination, Table, Select, message, Form
} from 'antd';
import { $http } from '../../../containers/config/https';
import '../../../assets/css/App.css'
import store from '../../../store';
import './style/index.less'
const FormItem = Form.Item;

const FormHandel = Form.create()(
    class AppProp extends React.Component {
        constructor(props) {
            super(props);
            this.state = {
                appCode: '',
                appDesc: '',
                moduleID: '',
                moduleData: [],
                appData:[],
                appId:'',
                appPage:1,
                appPageSize:10,
                appTotal:0,
                propData:[],
                propCode:'',
                propDesc:'',
                propRemark:'',
                propPage:1,
                propPageSize:10,
                propTotal:0,
                propId:'',
                typeData:[],
                typeID:'',
                typeValueData:[],
                typeValueID:'',
                propValue:'',
                hospData:[],
                hospID:'',
                settingData:[],
                setId:'',
            }
            this.appColumns = [
                { key: '1',title: '代码',dataIndex: 'Code',width: "40%", align: 'center' },
                { key: '2',title: '描述',dataIndex: 'Descripts', width: "60%",align: 'center' },
            ];
            this.propColumns = [
                { key: '1',title: '代码',dataIndex: 'Code',width: "16.5%", align: 'center' },
                { key: '2',title: '描述',dataIndex: 'Descripts', width: "25.5%",align: 'center' },
                { key: '3',title: '备注',dataIndex: 'Remark',width: "58%",align: 'center' }
            ];
            this.settingColumns = [
                { key: '1',title: '类型',dataIndex: 'Type',width: "13.5%",align: 'center' },
                { key: '2',title: '类型值',dataIndex: 'TypeValue', width: "29.5%",align: 'center' },
                { key: '3',title: '参数值',dataIndex: 'setValue',width: "29.5%",align: 'center' },
                { key: '4',title: '医院',dataIndex: 'Hospital',width: "27.5%",align: 'center' }
            ]
        }

        componentDidMount() {
            this.loadInfo();//获取下拉框信息
            // 初始化列表数据
            this.handleAppQuery()
        }

        //获取下拉框信息
        loadInfo(){
            var params = [{}]
            $http.post('urlS', this, {
                code: "02010008",
                data: params,
                success: function (res) {
                    if (res.errorCode === '0') {
                        for(var i = 0; i < res.authortype.length; i++) {
                            this.state.typeData.push(<Select.Option value={res.authortype[i].id} key={i}>{res.authortype[i].descripts}</Select.Option>)
                        }
                        for(var j = 0; j < res.hospital.length; j++) {
                            this.state.hospData.push(<Select.Option value={res.hospital[j].id} key={j}>{res.hospital[j].descripts}</Select.Option>)
                        }
                        for(var k = 0; k < res.module.length; k++) {
                            this.state.moduleData.push(<Select.Option value={res.module[k].id} key={j}>{res.module[k].descripts}</Select.Option>)
                        }
                    }
                }
            });
        }

        //获取授权类型信息
        loadTypeValue(value){
            this.setState({
                typeValueID:'',
                typeValueData:[],
            },()=>{
                if ((value==="Loc")&&(this.state.hospID==="")) {
                    return;
                }
                let data = {}
                data = {
                    params: [{
                        TypeCode: value,
                        hospID: this.state.hospID,
                    }],
                }
                $http.post('urlS', this, {
                    code: "02010009",
                    data: data,
                    success: function (res) {
                        if (res.errorCode === '0' && res.result ) {
                            for(var i = 0; i < res.result.length; i++) {
                                //console.log(res.result[i])
                                this.state.typeValueData.push(<Select.Option value={res.result[i].id} key={i}>{res.result[i].descripts}</Select.Option>)
                            }
                        }
                    }
                });
            })
        }

        // App查询
        handleAppQuery = () => {
            this.setState({
                appPage:1,
            },()=>{
                this.handleAppPageQuery();
            })
        }
        // App查询
        handleAppPageQuery = () => {
            this.setState({
                propData:[],
                propCode:'',
                propDesc:'',
                propRemark:'',
                propPage:1,
                propPageSize:10,
                propTotal:0,
                propId:'',
                typeID:'',
                typeValueData:[],
                typeValueID:'',
                propValue:'',
                hospID:'',
                settingData:[],
                setId:'',
            })
            let data = {}
            data = {
                params: [{
                    Code: this.state.appCode,
                    Descripts: this.state.appDesc,
                    ModuleID: this.state.moduleID,
                }],
                pagination:[{ 
                    pageSize: this.state.appPageSize,
                    currentPage: this.state.appPage,
                    sort: "ID",
                    dir: "desc"
                }]
            }
            $http.post('urlS', this, {
                code: '02010004',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 && res.result) {
                        for(var i = 0; i < res.result.rows.length; i++) {
                            res.result.rows[i].key = i
                        }
                        this.setState({
                            appData: res.result.rows,
                            appTotal: res.result.total,
                            appId: '',
                            propData:[],
                            propId:'',
                            settingData:[],
                        })
                    } else {
                        return;
                    }
                }
            })
        }

        // Prop查询
        handlePropQuery = () => {
            this.setState({
                propPage:1,
            },()=>{
                this.handlePropPageQuery();
            })
        }

        // Prop查询
        handlePropPageQuery = () => {
            if(this.state.appId===""){
                return;
            }
            this.setState({
                propData:[],
                propCode:'',
                propDesc:'',
                propRemark:'',
                propId:'',
                typeID:'',
                typeValueData:[],
                typeValueID:'',
                propValue:'',
                hospID:'',
                settingData:[],
                setId:'',
            })
            let data = {}
            data = {
                params: [{
                    appId: this.state.appId,
                }],
                pagination:[{ 
                    pageSize: this.state.propPageSize,
                    currentPage: this.state.propPage,
                    sort: "ID",
                    dir: "desc"
                }]
            }
            $http.post('urlS', this, {
                code: '02010005',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 ) {
                        for(var i = 0; i < res.result.rows.length; i++) {
                            res.result.rows[i].key = i
                        }
                        this.setState({
                            propData: res.result.rows,
                            propTotal: res.result.total,
                        })
                    } else {
                        return;
                    }
                }
            })
        }

        // Set查询
        handleSetQuery = () => {
            if(this.state.propId===""){
                return;
            }
            let data = {}
            data = {
                params: [{
                    propId: this.state.propId,
                }],
            }
            $http.post('urlS', this, {
                code: '02010011',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 ) {
                        for(var i = 0; i < res.result.rows.length; i++) {
                            res.result.rows[i].key = i
                        }
                        this.setState({
                            settingData: res.result.rows,
                        })
                    } else {
                        return;
                    }
                }
            })
        }

        // Prop保存
        handlePropSave = () => {
            if(this.state.appId===""){
                message.error("请选择左边的功能模块再做保存操作!!!");
                return;
            }
            if(this.state.propCode==="") {message.warning("代码不能为空!");return;}
            if(this.state.propDesc==="") {message.warning("描述不能为空!");return;}
            if(this.state.propRemark==="") {message.warning("备注不能为空!");return;}
            let data = {}
            data={
                params: [{
                    appID:this.state.appId,
                    propID: this.state.propId,
                    propCode: this.state.propCode,
                    propDesc:this.state.propDesc,
                    propRemark:this.state.propRemark,
                }],
            }
            $http.post('urlS', this, {
                code: '02010006',
                data: data,
                success: function (res) {   
                    if (+res.errorCode === 0 ) {
                        message.success('保存成功');
                        this.handlePropQuery();
                    } else {
                        return;
                    }
                }
            })
        }

        // Prop清空
        handlePropClear = () =>{
            this.setState({
                propId:'',
                propCode:'',
                propDesc:'',
                propRemark:'',
            });
        }

        // Prop删除
        handlePropDel = () => {
            if(this.state.propId===""){
                message.error("请选择记录再做删除操作!!!");
                return;
            }
            let data = {}
            data = {
                params: [{
                    ID: this.state.propId,
                }],
            }
            $http.post('urlS', this, {
                code: '02010007',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 ) {
                        message.success('删除成功');
                        this.handlePropQuery();
                    } else {
                        return;
                    }
                }
            })
        }

        //set保存
        handleSetSave = () => {
            if(this.state.propId===""){
                message.error("请选择上面的参数再做保存操作!!!");
                return;
            }
            if ((this.state.typeID==="Hosp") && (this.state.hospID==="")) {
                message.error("类型为全院时，医院是必填项，请选择医院再做保存操作!!!");
                return;
            }
            if(this.state.propValue==="") {message.warning("参数值不能为空!");return;}
            if(this.state.typeID==="") {message.warning("类型不能为空!");return;}
            if(this.state.typeValueID==="") {message.warning("类型值不能为空!");return;}
            let data = {}
            data={
                params: [{
                    propID: this.state.propId,
                    ID: this.state.setId,
                    propValue: this.state.propValue,
                    propType: this.state.typeID,
                    propTypeValue:this.state.typeValueID,
                    propHospital:this.state.hospID,
                }],
            }
            $http.post('urlS', this, {
                code: '02010010',
                data: data,
                success: function (res) {  
                    if (+res.errorCode === 0 ) {
                        message.success('保存成功');
                        this.handleSetQuery();
                    } else {
                        return;
                    }
                }
            })
        }

        // set删除
        handleSetDel = () => {
            if(this.state.setId===""){
                message.error("请选择记录再做删除操作!!!");
                return;
            }
            let data = {}
            data = {
                params: [{
                    ID: this.state.setId,
                }],
            }
            $http.post('urlS', this, {
                code: '02010012',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 ) {
                        message.success('删除成功');
                        this.handleSetQuery();
                        this.setState({
                            setId:'',
                            typeID:'',
                            typeValueID:'',
                            propValue:'',
                            hospID:'',
                            typeValueData:[],
                        })
                    } else {
                        return;
                    }
                }
            })
        }

        //处理多个input的公共方法
        onChangeInput(name, e){
            this.setState({
                [name]: e.target.value
            })
            if (e.target.value==="" && ((name==="appCode")||(name==="appDesc"))) {
                this.handleAppQuery();
            }
        }
        ///处理多个select下拉的公共方法
        selectOnChange=(name,value,option)=>{
            if(value){
                this.setState({
                    [name]:value,
                })
                if (name==="typeID") {
                    this.loadTypeValue(value);
                    this.setState({
                        typeValueID:'',
                    })
                }
                if ((name==="hospID")&&(this.state.typeID==="Loc")) {
                    this.loadTypeValue("Loc");
                    this.setState({
                        typeValueID:'',
                    })
                }
            }else{
                this.setState({
                    [name]:'',
                })
            }
            if (name==="typeID") {
                this.setState({
                    typeValueData:[],
                    typeValueID:'',
                })
            }
            if ((name==="hospID")&&(this.state.typeID==="Loc")) {
                this.setState({
                    typeValueData:[],
                    typeValueID:'',
                })
            }
            if (name==="moduleID") {
                this.handleAppQuery()
            }
        }

        setAppRowClassName = (record) => {
            return record.ID === this.state.appId ? 'clickRowStyle' : '';
        }
    
        onClickAppRow = (record) => {
            //给右边的编辑form传值
            return {
                onClick: () => {
                    this.setState({
                        appId:record.ID,
                        propData:[],
                        setId:'',
                        settingData:[],
                        propCode:'',
                        propDesc:'',
                        propRemark:'',
                        propPage:1,
                        propPageSize:10,
                        propTotal:0,
                        propId:'',
                        typeID:'',
                        typeValueID:'',
                        propValue:'',
                        hospID:'',
                        typeValueData:[],
                    },()=>{
                        this.handlePropQuery();
                    })
                }
            };
        }

        setPropRowClassName = (record) => {
            return record.ID === this.state.propId ? 'clickRowStyle' : '';
        }
    
        onClickPropRow = (record) => {
            //给右边的编辑form传值
            return {
                onClick: () => {
                    if (this.state.propId==="") {
                        this.setState({
                            propId:record.ID,
                            propCode:record.Code,
                            propDesc:record.Descripts,
                            propRemark:record.Remark,
                        },()=>{
                            this.handleSetQuery();
                        })
                    }else{
                        if(this.state.propId!==record.ID){
                            this.setState({
                                propId:record.ID,
                                propCode:record.Code,
                                propDesc:record.Descripts,
                                propRemark:record.Remark,
                                setId:'',
                                typeID:'',
                                typeValueID:'',
                                propValue:'',
                                hospID:'',
                                typeValueData:[],
                            },()=>{
                                this.handleSetQuery();
                            })
                        }else{
                            this.setState({
                                propId:'',
                                propCode:'',
                                propDesc:'',
                                propRemark:'',
                                setId:'',
                                settingData:[],
                                typeID:'',
                                typeValueID:'',
                                propValue:'',
                                hospID:'',
                                typeValueData:[],
                            },()=>{
                                
                            })
                        }
                    }
                }
            };
        }

        setSettingRowClassName = (record) => {
            return record.ID === this.state.setId ? 'clickRowStyle' : '';
        }
    
        onClickSettingRow = (record) => {
            //给右边的编辑form传值
            return {
                onClick: () => {
                    if (this.state.propId==="") {
                        this.setState({
                            hospID:Number(record.HospitalDr)===0? '' : Number(record.HospitalDr),
                        },()=>{
                            this.loadTypeValue(record.TypeCode);
                            setTimeout(() => {
                                this.setState({
                                    setId:record.ID,
                                    typeID:record.TypeCode,
                                    typeValueID:String(record.TypeValueDr),
                                    propValue:record.setValue,
                                    hospID:Number(record.HospitalDr)===0? '' : Number(record.HospitalDr),
                                },()=>{
        
                                })
                            },300)
                        })
                    }else{
                        if(this.state.setId!==record.ID){
                            this.setState({
                                hospID:Number(record.HospitalDr)===0? '' : Number(record.HospitalDr),
                            },()=>{
                                this.loadTypeValue(record.TypeCode);
                                setTimeout(() => {
                                    this.setState({
                                        setId:record.ID,
                                        typeID:record.TypeCode,
                                        typeValueID:String(record.TypeValueDr),
                                        propValue:record.setValue,
                                        hospID:Number(record.HospitalDr)===0? '' : Number(record.HospitalDr),
                                    },()=>{
            
                                    })
                                },300)
                            })
                        }else{
                            this.setState({
                                setId:'',
                                typeID:'',
                                typeValueID:'',
                                propValue:'',
                                hospID:'',
                                typeValueData:[],
                            },()=>{
                                
                            })
                        }
                    }
                }
            };
        }

        // 提供修改page和pageSize的回调函数
        AppcompilePage(page, pageSize) {
            // 修改page，或者pageSize
            this.setState({appPage: page, appPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handleAppPageQuery()
            })
        }

        // 页码改变的回调，参数是改变后的页码及每页条数
        AppPageChange = (page, pageSize)=> {
            this.setState({appPage: page, appPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handleAppPageQuery();
            });
        }

        // 条数改变的回调
        ApponShowSizeChange = (current, size) => {
        this.setState({appPage: current, appPageSize: size}, () => {
                // 重新调用查询方法
                this.handleAppPageQuery();
            });
        }

        // 提供修改page和pageSize的回调函数
        PropcompilePage(page, pageSize) {
            // 修改page，或者pageSize
            this.setState({propPage: page, propPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handlePropPageQuery()
            })
        }

        // 页码改变的回调，参数是改变后的页码及每页条数
        PropPageChange = (page, pageSize)=> {
            this.setState({propPage: page, propPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handlePropPageQuery();
            });
        }

        // 条数改变的回调
        ProponShowSizeChange = (current, size) => {
            this.setState({propPage: current, propPageSize: size}, () => {
                // 重新调用查询方法
                this.handlePropPageQuery();
            });
        }
    
        // 提供修改page和pageSize的回调函数
        SetcompilePage(page, pageSize) {
            // 修改page，或者pageSize
            this.setState({setPage: page, setPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handleQuery()
            })
        }

        // 页码改变的回调，参数是改变后的页码及每页条数
        SetPageChange = (page, pageSize)=> {
            this.setState({setPage: page, setPageSize: pageSize}, () => {
                // 重新调用查询方法
                this.handleQuery();
            });
        }

        // 条数改变的回调
        SetonShowSizeChange = (current, size) => {
        this.setState({setPage: current, setPageSize: size}, () => {
                // 重新调用查询方法
                this.handleQuery();
            });
        }

        // 显示分页总条数
        showTotal(total) {
            return `共 ${total} 条`;
        }

        render() {
            const { getFieldDecorator } = this.props.form;
            let formItemLayout = {
                labelCol: { span: 8 },
                wrapperCol: { span: 16 }
            };
            let formItemLayoutProp = {
                labelCol: { span: 1 },
                wrapperCol: { span: 23 }
            };
            return (
                <div>
                    <Row>
                        <Card  
                            size="small"
                            title="功能模块参数设置"
                            headStyle={{background: 'rgba(100,169,130,1)'}}
                        >
                            <Col span={8} >
                                <Form>
                                    <Row>
                                        <Col span={6} >
                                            <FormItem {...formItemLayout} label='代码'>
                                                {getFieldDecorator('appCode', {
                                                    initialValue:this.state.appCode,
                                                    rules: [{ required: false, message: '代码是必填项,请选择！' }]
                                                    })(
                                                        <Input 
                                                            allowClear={true}
                                                            onChange={this.onChangeInput.bind(this,"appCode")}
                                                            onPressEnter={() => this.handleAppQuery()}
                                                        />
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={7} >
                                            <FormItem {...formItemLayout} label='描述'>
                                                {getFieldDecorator('appDesc', {
                                                    initialValue:this.state.appDesc,
                                                    rules: [{ required: false, message: '描述是必填项,请选择！' }]
                                                    })(
                                                        <Input 
                                                            allowClear={true}
                                                            onChange={this.onChangeInput.bind(this,"appDesc")}
                                                            onPressEnter={() => this.handleAppQuery()}
                                                        />
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={7} >
                                            <FormItem {...formItemLayout} label='模块'>
                                                {getFieldDecorator('moduleID', {
                                                    initialValue:this.state.moduleID,
                                                    rules: [{ required: false, message: '模块是必填项,请选择！' }]
                                                    })(
                                                        <Select
                                                            allowClear={true}
                                                            showSearch 
                                                            optionFilterProp="children" 
                                                            onChange={this.selectOnChange.bind(this,"moduleID")}
                                                            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                        >
                                                        {this.state.moduleData}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4}>
                                            <FormItem>
                                                <Button style={{ marginLeft: '10px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleAppQuery}>查询</Button>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Table
                                            dataSource={this.state.appData}
                                            columns={this.appColumns}
                                            rowClassName={this.setAppRowClassName}
                                            pagination={false}
                                            bordered
                                            onRow={this.onClickAppRow}
                                            scroll={{ y: store.getState().tableHeight.y + 30  }}
                                            style={{height: (store.getState().tableHeight.y + 70 )}}
                                        />
                                        {/* 分页: total--总条数  defaultCurrent--默认的当前页 hideOnSinglePage--只有一页时隐藏分页器 */}
                                        <Pagination
                                            showTotal={() => this.showTotal(this.state.appTotal)}
                                            size="small"
                                            showQuickJumper
                                            showSizeChanger
                                            defaultCurrent={1}
                                            current={this.state.appPage}
                                            total={this.state.appTotal}
                                            onChange={this.AppPageChange}
                                            onShowSizeChange={this.ApponShowSizeChange}
                                            style={{textAlign: "right", marginTop: '15px'}}
                                        />
                                    </Row>
                                </Form>
                            </Col>
                            <Col span={16} >
                                <Card bodyStyle={{padding:'8px'}}>
                                    <Row>
                                        <Col span={4} >
                                            <Input 
                                                style={{ width: '98%'}}
                                                placeholder="代码"
                                                allowClear={true}
                                                value={this.state.propCode}
                                                onChange={this.onChangeInput.bind(this,"propCode")}
                                            />
                                        </Col>
                                        <Col span={6} >
                                            <Input 
                                                style={{ width: '98%'}}
                                                placeholder="描述"
                                                allowClear={true}
                                                value={this.state.propDesc}
                                                onChange={this.onChangeInput.bind(this,"propDesc")}
                                            />
                                        </Col>
                                        <Col span={8} >
                                            <Input 
                                                placeholder="备注"
                                                allowClear={true}
                                                value={this.state.propRemark}
                                                onChange={this.onChangeInput.bind(this,"propRemark")}
                                            />
                                        </Col>
                                        <Col span={6} >
                                            <Button style={{ marginLeft: '20px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handlePropSave}>保存</Button>
                                            <Button style={{ marginLeft: '20px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handlePropClear}>清空</Button>
                                            <Button style={{ marginLeft: '20px', background: 'rgba(255,0,0,1)',color:'#ffffff'}}  onClick={this.handlePropDel}>删除</Button>
                                        </Col>
                                    </Row>
                                    <Row style={{marginTop:'8px'}}>
                                        <Table
                                            dataSource={this.state.propData}
                                            columns={this.propColumns}
                                            rowClassName={this.setPropRowClassName}
                                            pagination={false}
                                            bordered
                                            onRow={this.onClickPropRow}
                                            scroll={{ y: store.getState().tableHeight.y - 345}}
                                            style={{height: (store.getState().tableHeight.y-305 )}}
                                        />
                                        {/* 分页: total--总条数  defaultCurrent--默认的当前页 hideOnSinglePage--只有一页时隐藏分页器 */}
                                        <Pagination
                                            showTotal={() => this.showTotal(this.state.propTotal)}
                                            size="small"
                                            showQuickJumper
                                            showSizeChanger
                                            defaultCurrent={1}
                                            current={this.state.propPage}
                                            total={this.state.propTotal}
                                            onChange={this.PropPageChange}
                                            onShowSizeChange={this.ProponShowSizeChange}
                                            style={{textAlign: "right", marginTop: '15px'}}
                                        />
                                    </Row>
                                </Card>
                                <Card bodyStyle={{padding:'8px'}}>
                                    <Row>
                                        <Col span={20} >
                                            <Select
                                                placeholder="类型"
                                                style={{ width: '13%'}}
                                                allowClear={true}
                                                showSearch 
                                                optionFilterProp="children" 
                                                value={this.state.typeID}
                                                onChange={this.selectOnChange.bind(this,"typeID")}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                            >
                                            {this.state.typeData}
                                            </Select>
                                            <Select
                                                placeholder="类型值"
                                                style={{ width: '28.5%',marginLeft: '0.5%'}}
                                                allowClear={true}
                                                showSearch 
                                                optionFilterProp="children" 
                                                onChange={this.selectOnChange.bind(this,"typeValueID")}
                                                value={this.state.typeValueID}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                            >
                                            {this.state.typeValueData}
                                            </Select>
                                            <Input 
                                                placeholder=""
                                                allowClear={true}
                                                style={{ width: '28.5%',marginLeft: '0.5%'}}
                                                value={this.state.propValue}
                                                onChange={this.onChangeInput.bind(this,"propValue")}
                                            />
                                            <Select
                                                placeholder="医院"
                                                style={{ width: '28.5%',marginLeft: '0.5%'}}
                                                allowClear={true}
                                                showSearch 
                                                optionFilterProp="children" 
                                                value={this.state.hospID}
                                                onChange={this.selectOnChange.bind(this,"hospID")}
                                                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                            >
                                            {this.state.hospData}
                                            </Select>
                                        </Col>
                                        <Col span={4} >
                                            <Button style={{ marginLeft: '20px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handleSetSave}>保存</Button>
                                            {/* <Button style={{ marginLeft: '18px', background: 'rgba(100,169,130,1)',color:'#ffffff'}}  onClick={this.handlePropValueClear}>清空</Button> */}
                                            <Button style={{ marginLeft: '25px', background: 'rgba(255,0,0,1)',color:'#ffffff'}}  onClick={this.handleSetDel}>删除</Button>
                                        </Col>
                                    </Row>
                                    <Row style={{marginTop:'8px'}}>
                                        <Col span={20} >              
                                            <Table
                                                dataSource={this.state.settingData}
                                                columns={this.settingColumns}
                                                rowClassName={this.setSettingRowClassName}
                                                pagination={false}
                                                bordered
                                                onRow={this.onClickSettingRow}
                                                scroll={{ y: (store.getState().tableHeight.y - 285)}}
                                                style={{height: (store.getState().tableHeight.y-250)}}
                                            />
                                        </Col>
                                    </Row>
                                </Card>
                            </Col>
                        </Card>
                    </Row>
                </div>
            )
        }
    }
);
export default Form.create()(FormHandel);