<template>
  <div>
    <Main v-if="showPage === 'Main'" @changePage="changePage" :editObj="editObj.editObj"></Main>
    <Details v-else-if="showPage === 'Details'" @changePage="changePage" :editObj="editObj.editObj">
    </Details>
  </div>
</template>

<script setup>
// 10:超速行驶 20:疲劳驾驶 30:违章信息 40:群众举报 50:交通事故 60:酒后驾驶 之前共用一个Main,一个Details,这里保持不动,
import Main from "@/views/yxkzgl/jtaq/jsy/csxs/Main/index.vue";
import Details from "@/views/yxkzgl/jtaq/jsy/csxs/Details/index.vue";
import { reactive, ref } from "vue";
let showPage = ref('Main')
let editObj = reactive({
  editObj: {
    type: '50'
  }
}) // 50为交通事故
const changePage = (val, obj) => {
  if (obj) {
    editObj.editObj = obj
  } else {
    editObj.editObj = null
  }
  showPage.value = val
}
</script>