index.vue
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<a-layout style="height: 100%">
<a-layout-header style="display: flex">
<div class="title">
<span>{{ title }}</span>
</div>
<div style="flex: 1"></div>
<a-flex gap="large" align="center">
<a-button type="link" @click="themeStore.isCompact=!themeStore.isCompact">
<template #icon>
<l-icon :type="themeStore.isCompact?'full-screen-two':'off-screen-two'"/>
</template>
</a-button>
<a-button type="link" @click="themeStore.isDark=!themeStore.isDark">
<template #icon>
<l-icon :type="themeStore.isDark?'sun-one':'moon'"/>
</template>
</a-button>
<a-dropdown>
<div style="cursor: pointer;display: flex;align-items: center">
<!-- <a-avatar></a-avatar>-->
<!-- <div style="margin-left: 10px"> {{ userStore.user?.fullName }}</div>-->
</div>
<!-- <template #overlay>
<a-menu>
<a-menu-item @click="onLogout" key="0">
退出登录
</a-menu-item>
</a-menu>
</template>-->
</a-dropdown>
</a-flex>
</a-layout-header>
<a-layout>
<a-layout-sider>
<a-menu mode="inline" @click="(item:any)=>router.push(item.key)" v-model:selectedKeys="current"
:items="menuList" v-model:open-keys="openKeys"></a-menu>
</a-layout-sider>
<a-layout-content style="flex: 1;overflow-y: auto;width: 100%;overflow-x: hidden;padding: 10px">
<router-view/>
</a-layout-content>
</a-layout>
</a-layout>
</template>
<script setup lang="ts">
import {useThemeStore} from "@/store/useThemeStore.ts";
import {ref} from "vue";
import router from "@/router";
import LIcon from "@/components/l-Icon/l-Icon.vue";
import {useRoute} from "vue-router";
import useRequest from "@/hooks/useRequest.ts";
const title = import.meta.env.VITE_APP_TITLE;
const openKeys = ref(['GL'])
const menuList = [{
label: '管理',
key: 'GL',
children: [{
title: 'air_route',
label: '航线管理',
key: 'air_route',
},]
},]
const route = useRoute()
const themeStore = useThemeStore()
const current = ref([route.name])
</script>
<style scoped>
.title {
font-weight: bold;
font-size: x-large;
}
</style>