/*
 * Creator:     ML
 * CreatDate:   2019-11-18
 * descripts：  医嘱查询
 * */
import React from 'react';
import DoctorAdviceFind from './component/DoctorAdviceFind'; // 医嘱查询 find
import DoctorAdviceGrap from './component/DoctorAdviceGrap'; // 医嘱视图
import './style/index.less';

class DoctorAdvice extends React.Component {
    componentDidMount() {
        this.props.onRef && this.props.onRef(this);
    }

    // 初始化数据
    handleInit = (param) => {
        this.dafRef && this.dafRef?.handleInit(param);
    }

    onRef = (ref) => {
        this.child = ref
    }

    getCharts = (res) => {
        this.child && this.child.getDate && this.child.getDate(res);
    }

    getDec = (localeProvider) => {
        this.child && this.child.getDec && this.child.getDec(localeProvider);
    }

    render() {
        return (
            <div className="doctorAdvice" >
                <DoctorAdviceFind
                    tabHeight={this.props.tabHeight || (this.props.isDoctorAdviceGrap === 'N' ? 100 : '')}
                    getCharts={this.getCharts}
                    getDec={this.getDec}
                    modal={this.props && this.props.modal ? this.props.modal : ''}
                ></DoctorAdviceFind>
                {this.props.isDoctorAdviceGrap !== 'N' ? <DoctorAdviceGrap onRef={this.onRef} /> : ''}
            </div>
        )
    }
}

export default DoctorAdvice;