import React,{Component} from 'react';
import {
    Table,Button, Col, Row, Input, Select, message,Pagination,Card,Tabs
} from 'antd';
import { $http } from '../../containers/config/https';
const { TextArea } = Input;
class TableDataSelectMethod extends Component {
    constructor(props) {
        super(props);
        this.state = {
            className:"",
            methodContent:""
        };
    }
    getSelectMethod=(className)=>{
        //var className=this.props.className
        let data = {
            params: [{className:className}]
        }
        $http.post("urlS",this, {
            code: "01040046",
            data: data,
            success: function (res) { 
                if (+res.errorCode === 0) {
                   this.setState({
                    methodContent:res.result
                   })
                } else {
                    message.error('失败：' + res.errorMessage);
                }
            },
            error:function (error) {
                message.error('失败：' + error);
            }
        })    
    }
    componentDidMount() {
        this.setState({
            className:this.props.className
        })
        
        if(this.props.className!=""){
            this.getSelectMethod(this.props.className)
        }
        
    }
    componentWillReceiveProps(nextProps){
        var className=""
        if(nextProps.className !== undefined){
            className=nextProps.className
        }else{
            className
        }
       
        if(className!==""){
            this.getSelectMethod(className)
        }
    }
    render() {
        return (
            <div><TextArea style={{fontSize:'20px'}} rows={20} value={this.state.methodContent}/></div>
        );
    }
}

export default TableDataSelectMethod;