<template>
  <keep-alive include="UnitManageHome">
    <unit-manage-home  @getTabName="getTabName" ref="unitHomeRef" @changeOperation="changeOperation"  v-if="!operationType"/>

    <unit-manage-detail :operation-type="operationType" :tab-name="tabName" :current-ob-obj="currentOpObj" @changeOperation="changeOperation" v-else/>
  </keep-alive>


</template>

<script>
import CommonStaLayout from "@/components/common/CommonStaLayout.vue";
import {useClickRouterToHome} from "@/unit/use-method/usePagination";
import UnitWatchHome from "@/view/other/c-views/data-watch/data-gather-watch/unit-watch/UnitWatchHome.vue";
import UnitWatchDetail from "@/view/other/c-views/data-watch/data-gather-watch/unit-watch/UnitWatchDetail.vue";
import UnitManageHome from "@/view/other/c-views/system-manage/system-manage/unit-manage/UnitManageHome.vue";
import UnitManageDetail from "@/view/other/c-views/system-manage/system-manage/unit-manage/UnitManageDetail.vue";
import {ref} from "vue";

export default {
  name: "UnitManage",
  components: {UnitManageDetail, UnitManageHome, UnitWatchDetail, UnitWatchHome, CommonStaLayout},
  setup() {
    const unitHomeRef = ref(null)
    const tabName = ref('')
    function getTabName(t) {
      tabName.value = t
    }
    const {changeOperation,currentOpObj,operationType} = useClickRouterToHome()
    return {
      changeOperation,currentOpObj,operationType,
      unitHomeRef,
      getTabName,
      tabName
    }
  }
}
</script>

<style scoped lang="scss">
.fa{
  font-size: 20px;
}
</style>
