<template>
  <div>
    <YpHome v-if="showModel == '研判首页'" @change="changeModel"></YpHome>
    <YjList v-if="showModel == '态势预警列表'" :item="itemYj" @change="changeModel"></YjList>
    <YjDetail v-if="showModel == '预警详情'" :item="itemDetail" @change="changeModel"></YjDetail>
  </div>
</template>

<script setup>
import YpHome from "./components/ypHome.vue";
import YjList from "./components/yjList.vue";
import YjDetail from "./components/yjDetail.vue";
import { onMounted, ref } from "vue";
const showModel = ref('研判首页')
const itemYj = ref({})
const itemDetail = ref({})
onMounted(()=>{
  // route.query.id ? lookDeatl(route.query.id): getLits();
})

function changeModel(val){
  showModel.value = val.type ;
  if(val.data){
    if(val.type == '态势预警列表'){
      itemYj.value = val.data
    }else if(val.type == '预警详情'){
      itemDetail.value = val.data
    }
  }
}


</script>

<style lang="scss" scoped>

</style>
