<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import Navbar from '@/viewsnew/application/module/Navbar/index.vue'
import { useRoute, useRouter } from 'vue-router'
import { getMenuTree } from '@/api/permission/menu'
const route = useRoute()
const applicationId:any = ref('')
const menuList = ref([])
const isNavbar = ref(false)
const projectName:any = ref('')
onMounted(()=>{
    if (route.query.id) {
        applicationId.value = route.query.id
        projectName.value = route.query.name
        getmenuinfo()
    }
})
function getmenuinfo() {
   const params = { 
    appId: applicationId.value,
    name:'',
    isdisplay:''
   }
   getMenuTree(params).then(res => {
    menuList.value = res.data
    isNavbar.value = true
   })
}
</script>
<template>
    <div class="system-box">
        <Navbar v-if="isNavbar" :menuList="menuList" :projectName="projectName" 
        :isFixed="true" :applicationId="applicationId"></Navbar>
    </div>
</template>

<style lang="less" scoped>
.system-box {
    width: 100%;
    height: 100vh;
}
</style>
