<template>
    <div class="flex flex-col" style="height: 100vh">
        <DocNavBar title="专病随访详情"></DocNavBar>
        
        <HypertensionDetail v-if="diseaseType === '1'" :visitInfo="info"></HypertensionDetail>
        <DiabetesDetail v-if="diseaseType === '2'" :visitInfo="info"></DiabetesDetail>
        <CoronaryHeartDiseaseDetail v-if="diseaseType === '3'" :visitInfo="info"></CoronaryHeartDiseaseDetail>
        <StrokeDetail v-if="diseaseType === '4'" :visitInfo="info"></StrokeDetail>
        <CopdDetail v-if="diseaseType === '5'" :visitInfo="info"></CopdDetail>
        <ChronicKidneyDiseaseDetail v-if="diseaseType === '6'" :visitInfo="info"></ChronicKidneyDiseaseDetail>
        <DyslipidemiaDetail v-if="diseaseType === '7'" :visitInfo="info"></DyslipidemiaDetail>
    </div>
</template>
<script>
import { getSeparateFUDetail } from '@/api/doctor/separateFU'
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import HypertensionDetail from './components/HypertensionDetail.vue'
import DiabetesDetail from './components/DiabetesDetail.vue'
import CoronaryHeartDiseaseDetail from './components/CoronaryHeartDiseaseDetail.vue'
import StrokeDetail from './components/StrokeDetail.vue'
import CopdDetail from './components/CopdDetail.vue'
import ChronicKidneyDiseaseDetail from './components/ChronicKidneyDiseaseDetail.vue'
import DyslipidemiaDetail from './components/DyslipidemiaDetail.vue'
export default {
    components: { DocNavBar, HypertensionDetail, DiabetesDetail, CoronaryHeartDiseaseDetail, StrokeDetail, CopdDetail, ChronicKidneyDiseaseDetail, DyslipidemiaDetail },
    props: {
        relationId: String
    },
    data() {
        return {
            info: {}
        }
    },
    computed: {
        diseaseType() {
            return this.$route.query.diseaseType
        }
    },
    created() {
        this.load()
    },
    methods: {
        load() {
            if (!this.relationId) {
                this.$message.info('未获取到信息')
                return
            }
            let params = {
                id: this.relationId,
                diseaseType: this.diseaseType
            }
            getSeparateFUDetail(params).then(res => {
                console.log(666, res)
                let result = res.data || {}
                this.info = result
            })
        }
    }
}
</script>