2023-12-15 18:08:45 +08:00
|
|
|
<template>
|
2023-12-17 16:05:38 +08:00
|
|
|
<div class="permissions-manage-page">
|
|
|
|
<div class="menu-box">
|
2024-06-03 09:13:22 +08:00
|
|
|
<CommonMenu :menuData="menuData" @selectMenu="selectMenu"/>
|
2023-12-17 16:05:38 +08:00
|
|
|
</div>
|
|
|
|
<div class="content-box">
|
|
|
|
<div class="header-box">
|
2024-06-03 09:13:22 +08:00
|
|
|
<PageTabs ref="pageTabsRef"/>
|
2023-12-17 16:05:38 +08:00
|
|
|
</div>
|
|
|
|
<div class="main-box">
|
|
|
|
<div class="background-block">
|
2024-06-03 09:13:22 +08:00
|
|
|
<RouterView/>
|
2023-12-17 16:05:38 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-15 18:08:45 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang='ts' setup>
|
2024-06-03 09:13:22 +08:00
|
|
|
import {onMounted, ref} from 'vue'
|
2024-05-17 12:06:29 +08:00
|
|
|
import type {MenuItem} from '@/utils/public-interface'
|
2023-12-17 16:05:38 +08:00
|
|
|
import CommonMenu from '@/components/common-menu.vue'
|
|
|
|
import PageTabs from '@/components/page-tabs.vue'
|
2024-06-03 09:13:22 +08:00
|
|
|
import {useRoute, useRouter} from "vue-router";
|
|
|
|
import {useUserStore} from "@/stores/user-info-store";
|
2023-12-15 18:08:45 +08:00
|
|
|
|
2024-06-03 09:13:22 +08:00
|
|
|
const router = useRouter()
|
|
|
|
const route = useRoute();
|
|
|
|
const menuData = ref([])
|
2023-12-17 16:05:38 +08:00
|
|
|
|
|
|
|
const pageTabsRef = ref()
|
|
|
|
const selectMenu = (e: MenuItem) => {
|
|
|
|
pageTabsRef.value.setTab(e)
|
|
|
|
}
|
2024-06-03 09:13:22 +08:00
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
const paths = route.path.split("/")
|
|
|
|
const e: any = await useUserStore().getMenuChild("/" + paths[1])
|
|
|
|
menuData.value = e
|
|
|
|
if (e && e.length > 0) {
|
|
|
|
router.push(e[0].path)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2023-12-15 18:08:45 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss' scoped>
|
2023-12-17 16:05:38 +08:00
|
|
|
.permissions-manage-page {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.menu-box {
|
|
|
|
width: 200px;
|
|
|
|
height: 100%;
|
|
|
|
background: white;
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content-box {
|
|
|
|
width: calc(100% - 200px);
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.header-box {
|
|
|
|
width: 100%;
|
|
|
|
height: 50px;
|
|
|
|
}
|
2023-12-15 18:08:45 +08:00
|
|
|
|
2023-12-17 16:05:38 +08:00
|
|
|
.main-box {
|
|
|
|
width: 100%;
|
|
|
|
height: calc(100% - 50px);
|
|
|
|
padding: 10px;
|
2024-06-03 09:13:22 +08:00
|
|
|
|
2023-12-17 16:05:38 +08:00
|
|
|
.background-block {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background: white;
|
|
|
|
border-radius: 15px;
|
|
|
|
padding: 20px;
|
2024-02-19 21:05:39 +08:00
|
|
|
|
2023-12-17 16:05:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}</style>
|