<script setup>
/**
 * name：
 * user：sa0ChunLuyu
 * date：2023年4月11日 09:32:32
 */
import {
  $response, HospitalInfoAction
} from '~/api'

import $router from '~/router'
import {onBeforeRouteUpdate} from "vue-router";

const hospital_info = ref(false)
const HospitalInfo = async () => {
  const response = await HospitalInfoAction()
  $response(response, () => {
    hospital_info.value = response.data.info
  })
}

const default_page_options = {
  type: 0,
}
const page_options = ref(JSON.parse(JSON.stringify(default_page_options)))
onBeforeRouteUpdate((to) => {
  routerChange(to.query)
})

const routerChange = (query) => {
  page_options.value = {
    type: Number(query.type) || default_page_options.type,
  }
  HospitalInfo()
}

onMounted(() => {
  routerChange($router.currentRoute.value.query)
})

const pagePush = () => {
  const type = page_options.value.type
  page_options.value.type = -1
  $router.push({
    query: {
      type
    }
  })
}
 
const tabChange = (e) => {
  page_options.value.type = e
  pagePush()
}
const hospital_id = ref(0)
</script>
<template>
  <div>
    <n-card  >
      <div v-if="!!hospital_info">
      
        <Additional13 :hospital="hospital_info.id" v-if="page_options.type === 0"></Additional13>
    
      </div>
    </n-card>
  </div>
</template>
<style scoped>

</style>
<route>
{"meta":{"title":"额外配置"}}
</route>

