<!--
 * @Author: sjjh
 * @Date: 2025-04-07 11:49:37
 * @Description:
-->
<template>
  <div class="inpatientDoctor-home-container">
    <el-container>
      <!-- 患者列表 -->
      <el-aside minWidth="83px" :width="`${patientAside ? '254px' : '83px'}`">
        <PatientList v-model:expand="patientAside" />
      </el-aside>
      <!--  main-->
      <el-container class="inpatientDoctor-home-main">
        <el-header height="auto"><inPatientBarDoctorFold /></el-header>
        <el-main>
          <el-tabs v-model="activeTabName" type="card" class="patient-tabs">
            <el-tab-pane label="临床医嘱" name="prescription">
              <Advice ref="adviceRef" />
            </el-tab-pane>
            <el-tab-pane label="诊断录入" name="diagnosis">
              <Diagnose ref="diagnosisRef" :patientInfo="patientInfo" />
            </el-tab-pane>
            <el-tab-pane label="住院病历" name="emr">
              <emr />
            </el-tab-pane>
            <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane>
            <el-tab-pane label="检验申请" name="test">
              <TestApplication />
            </el-tab-pane>
            <el-tab-pane label="检查申请" name="examine">
              <ExamineApplication />
            </el-tab-pane>
            <el-tab-pane label="手术申请" name="surgery">
              <SurgeryApplication />
            </el-tab-pane>
            <el-tab-pane label="输血申请" name="blood">
              <BloodTtransfusionAapplication />
            </el-tab-pane>
          </el-tabs>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script setup>
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue';
// const { proxy } = getCurrentInstance()
// const emits = defineEmits([])
// const props = defineProps({})
import Emr from "./emr/index.vue";
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
import {
  PatientList,
  Advice,
  Diagnose,
  BloodTtransfusionAapplication,
  ExamineApplication,
  SurgeryApplication,
  TestApplication,
} from './index.js';
const state = reactive({});
onBeforeMount(() => {});
onMounted(() => {});
defineExpose({ state });
const activeTabName = ref('prescription');
const diagnosisRef = ref();
const adviceRef = ref();
const patientAside = ref(true);
const patientInfo = ref({});
provide('diagnosisInit', (value) => {
  patientInfo.value = value;
  diagnosisRef.value.getList();
});
provide('getAdviceList', (value) => {
  adviceRef.value.getListInfo();
});
provide('adviceDiagnoInit', (value) => {
  adviceRef.value.getDiagnosisInfo();
});
</script>
<style lang="scss" scoped>
.inpatientDoctor-home-container {
  height: 100%;
  height: calc(100vh - 84px);
  .el-container {
    height: 100%;
  }
  :deep(.el-aside) {
    padding: 0;
  }
  .inpatientDoctor-home-main {
    background-color: #ffffff;
    :deep(.el-header) {
      padding: 0px;
      margin-bottom: 0px;
    }
    .el-main {
      padding: 0px 8px;
    }
    :deep(.patient-tabs) {
      height: 100%;
      .el-tabs__header {
        margin: 0;
      }
      .el-tabs__content {
        height: calc(100% - 40px);
      }
      .el-tab-pane {
        height: 100%;
      }
    }
  }
}
</style>
