import React,{ useState,useEffect,useRef } from 'react';

import {} from "@/api/checkPointManage.js";
// import {getOutpatientList} from "@/api/checkCondition.js";
import { Button,Form,Input,Select} from 'antd';

import ModalWrap from '@/components/Modal/modal.js';
import SituationList from './components/situationList/situationList';
import CreateFlow from './components/createFlow/createFlow';

const SituationCreate = () => {

  let [ifShowDialog,setifShowDialog] = useState(false);
  const [isAdd,set_isAdd] = useState(true);

  const modalNode = useRef(null);


  const commitForm = async ()=>{  //表单提交
      console.log('提交表单');
        
  }
  
  const updateSituationCreateModState=(updateObj)=>{
        const {key,value} = updateObj;
        if(key == 'isAdd')set_isAdd(value);
  }

  useEffect(()=>{
    // getData();
   
    // console.log(this);
  },[]);

  return ( 
    <div className="app-container">
          {/* <h1>情境管理</h1> */}
          <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
                <h1>1111</h1>
          </ModalWrap>
          <div className="content">
                 {!isAdd&&<SituationList updateSituationCreateModState={updateSituationCreateModState} />}
                 {isAdd&&<CreateFlow />}
          </div>
          <div style={{display:'flex',flexDirection:'row'}}>
          
          </div>
    </div>
  );
}




 
export default SituationCreate;