/*
 * Create:      柿子
 * CreateDate:  2023/02/08
 * Describe：   新手术医嘱录入 - 支持病历录入病历
 * */
import React, { Component } from 'react';
import { Row, Col } from 'antd';
import DoctorDiag from './DoctorDiag.jsx'
import OutpatientStationTabs from 'pages/workstation/OutPatientStationTabs';
import './style/OperationSearch.less';

export default class OperationApplyDoctorNew extends Component {
  constructor(props) {
    super(props);
    this.state = {
      leftspan: 5,
      rightspan: 19,
      patient: '',
      admID: '',
      patID: '',
      iconType: 'double-left',
      child: '',
    }
  }

  onBtnClick = () => {
    this.setState({
      leftspan: 5 - this.state.leftspan,
    });
  }

  updateState = (state) => {
    this.setState(state);
  }

  onClose = () => {
    this.setState({
      visible: true,
    });
  }

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

  render() {
    const { leftspan } = this.state;
    return (
      <div style={{ height: "100%" }} className="operationSearch">
        <Row style={{ height: '100%', width: '100%', overflowY: 'hidden' }}>
          <Col
            className={this.state.iconType == 'double-left' ? '' : 'visibleIcon'}
            span={leftspan}
            style={{
              border: this.state.iconType == 'double-left' ? '1px solid #cccccc' : '0px',
              height: '100%',
              overflowY: 'hidden',
              background: '#ffffff',
              boxSizing: 'border-box',
              // transition: 'all 1s linear'
            }}
          >
            <DoctorDiag child={this.state.child} updateState={this.updateState} iconType={this.state.iconType} />
          </Col>
          <Col span={this.state.rightspan} style={{ height: '100%' }}>
            <OutpatientStationTabs
              billingDoctor="Y"
              patientFlag={leftspan > 0 ? 'N' : 'Y'}
              cannelStopFlag="N"
              iconType={this.state.iconType}
              patient={this.state.patient}
              updateState={this.updateState}
              admID={this.state.admID}
              onRef={this.onRef}
            />
          </Col>
        </Row>
      </div>
    )
  }
}