xto-fronted 0.4.89 → 0.4.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/404-Bq0LY5Cd.js +1 -0
- package/dist/assets/404-Cw_4ZCL6.css +1 -0
- package/dist/assets/{index-BDgOY6Rp.js → index-7ZZxpSfk.js} +1 -1
- package/dist/assets/index-BJUe8VUp.js +1 -0
- package/dist/assets/{index-Bz0BgZQ1.js → index-BlOR_ICg.js} +1 -1
- package/dist/assets/index-BlRslYYI.css +1 -0
- package/dist/assets/index-BudArKxR.css +1 -0
- package/dist/assets/{index-CwRA10ac.js → index-BzbOWBCV.js} +1 -1
- package/dist/assets/index-CFhWBbxk.css +1 -0
- package/dist/assets/{index-CfpZmcpk.css → index-CH6aTfYg.css} +1 -1
- package/dist/assets/{index-BIoRANs0.js → index-CT5f37nN.js} +1 -1
- package/dist/assets/index-Ce-kjtEM.js +2 -0
- package/dist/assets/{index-t-2Y0KhA.css → index-Cpew6d-v.css} +1 -1
- package/dist/assets/index-DkkuYBgT.css +1 -0
- package/dist/assets/index-vfvEFrCH.css +1 -0
- package/dist/assets/{index-CwJSA85U.js → index-wVLLAoVp.js} +1 -1
- package/dist/assets/vendor-DZmPBJ9d.js +16 -0
- package/dist/assets/vue-vendor-DjmFuEnG.js +29 -0
- package/dist/assets/{xto-base-PwLGsxxb.js → xto-base-B5HYOo6i.js} +1 -1
- package/dist/assets/{xto-core-CtL4zKiV.js → xto-core-DZYp_YAR.js} +1 -1
- package/dist/assets/{xto-data-bCXQa7fT.js → xto-data-ogck6x_i.js} +1 -1
- package/dist/assets/{xto-feedback-CPydp0kn.js → xto-feedback-C0-6cAL6.js} +1 -1
- package/dist/assets/{xto-form-bywohdAf.js → xto-form-IDg_78Vf.js} +1 -1
- package/dist/assets/{xto-navigation-Bbdpine9.js → xto-navigation-CPYLzfu7.js} +1 -1
- package/dist/index.html +9 -9
- package/package.json +91 -91
- package/src/App.vue +48 -48
- package/src/assets/styles/_dark.scss +639 -572
- package/src/assets/styles/_root.scss +183 -183
- package/src/assets/styles/_variables.scss +69 -69
- package/src/assets/styles/index.scss +460 -460
- package/src/components/Layout/Sidebar.vue +198 -198
- package/src/components/Layout/TopMenu.vue +1170 -1170
- package/src/components/Layout/index.vue +192 -192
- package/src/directives/permission.ts +12 -3
- package/src/index.ts +100 -100
- package/src/router/layoutRoute.ts +59 -59
- package/src/stores/menu.ts +64 -3
- package/src/types/json-bigint.d.ts +18 -18
- package/src/utils/permission.ts +12 -5
- package/src/utils/request.ts +184 -164
- package/src/views/dashboard/index.vue +545 -545
- package/src/views/error/403.vue +251 -251
- package/src/views/error/404.vue +253 -253
- package/src/views/login/index.vue +586 -586
- package/src/views/system/menu/index.vue +690 -690
- package/src/views/system/role/index.vue +583 -583
- package/src/views/system/user/index.vue +655 -655
- package/dist/App.vue.d.ts +0 -2
- package/dist/api/auth.d.ts +0 -8
- package/dist/api/system.d.ts +0 -16
- package/dist/api/user.d.ts +0 -13
- package/dist/assets/404-C9Uh6Uu-.css +0 -1
- package/dist/assets/404-zjGLLssH.js +0 -1
- package/dist/assets/index-B5xc4gQB.css +0 -1
- package/dist/assets/index-CAdztNsv.css +0 -1
- package/dist/assets/index-CCXrcISf.css +0 -1
- package/dist/assets/index-D8NDxq9d.js +0 -1
- package/dist/assets/index-DEB6-Iv_.js +0 -2
- package/dist/assets/index-DM4Ezclc.css +0 -1
- package/dist/assets/index-DYv7nImj.css +0 -1
- package/dist/assets/vendor-CUVPinTg.js +0 -13
- package/dist/assets/vue-vendor-DeJXJVbN.js +0 -29
- package/dist/components/Layout/Footer.vue.d.ts +0 -2
- package/dist/components/Layout/Header.vue.d.ts +0 -5
- package/dist/components/Layout/MixTopMenu.vue.d.ts +0 -5
- package/dist/components/Layout/Sidebar.vue.d.ts +0 -11
- package/dist/components/Layout/SidebarMenuItem.vue.d.ts +0 -5
- package/dist/components/Layout/Tabs.vue.d.ts +0 -2
- package/dist/components/Layout/TopMenu.vue.d.ts +0 -5
- package/dist/components/Layout/index.vue.d.ts +0 -2
- package/dist/composables/useApp.d.ts +0 -29
- package/dist/composables/useAuth.d.ts +0 -6
- package/dist/composables/useForm.d.ts +0 -20
- package/dist/composables/useI18n.d.ts +0 -30
- package/dist/composables/useTable.d.ts +0 -29
- package/dist/directives/permission.d.ts +0 -4
- package/dist/enums/index.d.ts +0 -32
- package/dist/index-BRvi9qW-.js +0 -515
- package/dist/index-BVGW4DDQ.js +0 -189
- package/dist/index-Bmf0YbVq.js +0 -189
- package/dist/index-C2-a5KSQ.js +0 -4233
- package/dist/index-CeZ0CSSs.js +0 -641
- package/dist/index-D25KzR0I.js +0 -479
- package/dist/index-DEYOivza.js +0 -641
- package/dist/index-DReodgBw.js +0 -4233
- package/dist/index-DjERNRXX.js +0 -515
- package/dist/index-gBlRG4kk.js +0 -479
- package/dist/index.d.ts +0 -59
- package/dist/index.es.js +0 -94
- package/dist/index.umd.js +0 -8
- package/dist/main.d.ts +0 -0
- package/dist/router/dynamicRoutes.d.ts +0 -30
- package/dist/router/guards.d.ts +0 -17
- package/dist/router/index.d.ts +0 -6
- package/dist/router/layoutRoute.d.ts +0 -22
- package/dist/router/staticRoutes.d.ts +0 -2
- package/dist/stores/app.d.ts +0 -93
- package/dist/stores/auth.d.ts +0 -41
- package/dist/stores/index.d.ts +0 -10
- package/dist/stores/locale.d.ts +0 -42
- package/dist/stores/menu.d.ts +0 -77
- package/dist/stores/user.d.ts +0 -92
- package/dist/style.css +0 -1
- package/dist/utils/auth.d.ts +0 -27
- package/dist/utils/config.d.ts +0 -30
- package/dist/utils/permission.d.ts +0 -18
- package/dist/utils/request.d.ts +0 -24
- package/dist/utils/storage.d.ts +0 -24
- package/dist/views/dashboard/index.vue.d.ts +0 -2
- package/dist/views/error/403.vue.d.ts +0 -2
- package/dist/views/error/404.vue.d.ts +0 -2
- package/dist/views/login/index.vue.d.ts +0 -4
- package/dist/views/system/menu/index.vue.d.ts +0 -4
- package/dist/views/system/role/index.vue.d.ts +0 -4
- package/dist/views/system/user/index.vue.d.ts +0 -4
|
@@ -1,199 +1,199 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
import { useRoute, useRouter } from 'vue-router'
|
|
4
|
-
import { useMenuStore } from '@/stores/menu'
|
|
5
|
-
import { useUserStore } from '@/stores/user'
|
|
6
|
-
import { useAuthStore } from '@/stores/auth'
|
|
7
|
-
import { useAppStore } from '@/stores/app'
|
|
8
|
-
import { Menu } from '@xto/navigation'
|
|
9
|
-
import { Button } from '@xto/base'
|
|
10
|
-
import { local } from '@/utils/storage'
|
|
11
|
-
import SidebarMenuItem from './SidebarMenuItem.vue'
|
|
12
|
-
|
|
13
|
-
// Props
|
|
14
|
-
const props = withDefaults(defineProps<{
|
|
15
|
-
menuList?: any[]
|
|
16
|
-
showLogo?: boolean
|
|
17
|
-
showUser?: boolean
|
|
18
|
-
}>(), {
|
|
19
|
-
menuList: () => [],
|
|
20
|
-
showLogo: true,
|
|
21
|
-
showUser: true
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const route = useRoute()
|
|
25
|
-
const router = useRouter()
|
|
26
|
-
const menuStore = useMenuStore()
|
|
27
|
-
const userStore = useUserStore()
|
|
28
|
-
const authStore = useAuthStore()
|
|
29
|
-
const appStore = useAppStore()
|
|
30
|
-
|
|
31
|
-
// 使用传入的菜单列表,如果没有传入则使用 store 中的
|
|
32
|
-
const displayMenuList = computed(() => props.menuList.length > 0 ? props.menuList : menuStore.menuList)
|
|
33
|
-
|
|
34
|
-
const isCollapsed = computed(() => appStore.isCollapsed)
|
|
35
|
-
const activeMenu = computed(() => route.path)
|
|
36
|
-
|
|
37
|
-
// 菜单展开状态持久化
|
|
38
|
-
const OPENED_MENUS_KEY = 'sidebar_opened_menus'
|
|
39
|
-
const openedMenus = ref<string[]>(local.get<string[]>(OPENED_MENUS_KEY) || [])
|
|
40
|
-
|
|
41
|
-
// 监听变化并持久化
|
|
42
|
-
watch(openedMenus, (val) => {
|
|
43
|
-
local.set(OPENED_MENUS_KEY, val)
|
|
44
|
-
}, { deep: true })
|
|
45
|
-
|
|
46
|
-
// 递归查找当前路由对应的父菜单路径
|
|
47
|
-
const findMenuPath = (menus: any[], path: string, parentUrls: string[] = []): string[] | null => {
|
|
48
|
-
for (const menu of menus) {
|
|
49
|
-
// 当前菜单匹配
|
|
50
|
-
if (path === menu.menuUrl || path.startsWith(menu.menuUrl + '/')) {
|
|
51
|
-
return [...parentUrls, menu.menuUrl]
|
|
52
|
-
}
|
|
53
|
-
// 递归查找子菜单
|
|
54
|
-
if (menu.children?.length) {
|
|
55
|
-
const result = findMenuPath(menu.children, path, [...parentUrls, menu.menuUrl])
|
|
56
|
-
if (result) return result
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return null
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// 监听路由变化,只展开当前路由相关的父菜单
|
|
63
|
-
watch([() => route.path, displayMenuList], ([path, menus]) => {
|
|
64
|
-
if (menus.length > 0) {
|
|
65
|
-
const menuPath = findMenuPath(menus, path)
|
|
66
|
-
if (menuPath) {
|
|
67
|
-
// 只保留路径上的父菜单(不包括当前页面本身)
|
|
68
|
-
openedMenus.value = menuPath.slice(0, -1)
|
|
69
|
-
} else {
|
|
70
|
-
// 如果找不到匹配的菜单,关闭所有
|
|
71
|
-
openedMenus.value = []
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, { immediate: true })
|
|
75
|
-
|
|
76
|
-
// 菜单主题相关
|
|
77
|
-
const menuBgColor = computed(() => appStore.isDark ? '#1d1e1f' : '#fff')
|
|
78
|
-
const menuTextColor = computed(() => appStore.isDark ? '#cfd3dc' : '#303133')
|
|
79
|
-
const menuActiveTextColor = computed(() => '#409eff')
|
|
80
|
-
|
|
81
|
-
// 菜单选择
|
|
82
|
-
const handleMenuSelect = (index: string) => {
|
|
83
|
-
if (index && index !== route.path) {
|
|
84
|
-
router.push(index)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// 退出登录
|
|
89
|
-
const handleLogout = () => {
|
|
90
|
-
authStore.logout()
|
|
91
|
-
userStore.clearUserInfo()
|
|
92
|
-
menuStore.clearMenu()
|
|
93
|
-
router.push('/login')
|
|
94
|
-
}
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<template>
|
|
98
|
-
<div class="sidebar" :class="{ 'sidebar--collapsed': isCollapsed }">
|
|
99
|
-
<!-- Logo -->
|
|
100
|
-
<div v-if="props.showLogo" class="sidebar__logo">
|
|
101
|
-
<img src="/vite.svg" alt="Logo" class="sidebar__logo-img" />
|
|
102
|
-
<span v-show="!isCollapsed" class="sidebar__logo-text">{{ appStore.appName }}</span>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<!-- 菜单 -->
|
|
106
|
-
<Menu
|
|
107
|
-
v-model="activeMenu"
|
|
108
|
-
v-model:openeds="openedMenus"
|
|
109
|
-
mode="vertical"
|
|
110
|
-
:collapse="isCollapsed"
|
|
111
|
-
:collapse-transition="false"
|
|
112
|
-
:background-color="menuBgColor"
|
|
113
|
-
:text-color="menuTextColor"
|
|
114
|
-
:active-text-color="menuActiveTextColor"
|
|
115
|
-
class="sidebar__menu"
|
|
116
|
-
@select="handleMenuSelect"
|
|
117
|
-
>
|
|
118
|
-
<template v-for="menu in displayMenuList" :key="menu.menuUrl">
|
|
119
|
-
<SidebarMenuItem :menu="menu" />
|
|
120
|
-
</template>
|
|
121
|
-
</Menu>
|
|
122
|
-
|
|
123
|
-
<!-- 用户信息 -->
|
|
124
|
-
<div v-if="props.showUser && !isCollapsed" class="sidebar__user">
|
|
125
|
-
<div class="sidebar__user-info">
|
|
126
|
-
<span class="sidebar__user-name">{{ userStore.userName }}</span>
|
|
127
|
-
<span class="sidebar__user-role">{{ userStore.departmentName }}</span>
|
|
128
|
-
</div>
|
|
129
|
-
<Button type="text" size="small" @click="handleLogout">退出</Button>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</template>
|
|
133
|
-
|
|
134
|
-
<style lang="scss" scoped>
|
|
135
|
-
.sidebar {
|
|
136
|
-
height: 100%;
|
|
137
|
-
display: flex;
|
|
138
|
-
flex-direction: column;
|
|
139
|
-
background-color: var(--bg-color);
|
|
140
|
-
border-right: 1px solid var(--color-border-lighter);
|
|
141
|
-
|
|
142
|
-
&--collapsed {
|
|
143
|
-
.sidebar__logo {
|
|
144
|
-
justify-content: center;
|
|
145
|
-
padding: 0;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
&__logo {
|
|
150
|
-
height: 50px;
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
padding: 0 20px;
|
|
154
|
-
gap: 10px;
|
|
155
|
-
border-bottom: 1px solid var(--color-border-lighter);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&__logo-img {
|
|
159
|
-
width: 32px;
|
|
160
|
-
height: 32px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&__logo-text {
|
|
164
|
-
font-size: 16px;
|
|
165
|
-
font-weight: 600;
|
|
166
|
-
color: var(--color-primary);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&__menu {
|
|
170
|
-
flex: 1;
|
|
171
|
-
border-right: none;
|
|
172
|
-
overflow-y: auto;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
&__user {
|
|
176
|
-
padding: 10px;
|
|
177
|
-
border-top: 1px solid var(--color-border-lighter);
|
|
178
|
-
display: flex;
|
|
179
|
-
align-items: center;
|
|
180
|
-
justify-content: space-between;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
&__user-info {
|
|
184
|
-
display: flex;
|
|
185
|
-
flex-direction: column;
|
|
186
|
-
gap: 2px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&__user-name {
|
|
190
|
-
font-size: 14px;
|
|
191
|
-
font-weight: 500;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
&__user-role {
|
|
195
|
-
font-size: 12px;
|
|
196
|
-
color: var(--color-text-secondary);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
4
|
+
import { useMenuStore } from '@/stores/menu'
|
|
5
|
+
import { useUserStore } from '@/stores/user'
|
|
6
|
+
import { useAuthStore } from '@/stores/auth'
|
|
7
|
+
import { useAppStore } from '@/stores/app'
|
|
8
|
+
import { Menu } from '@xto/navigation'
|
|
9
|
+
import { Button } from '@xto/base'
|
|
10
|
+
import { local } from '@/utils/storage'
|
|
11
|
+
import SidebarMenuItem from './SidebarMenuItem.vue'
|
|
12
|
+
|
|
13
|
+
// Props
|
|
14
|
+
const props = withDefaults(defineProps<{
|
|
15
|
+
menuList?: any[]
|
|
16
|
+
showLogo?: boolean
|
|
17
|
+
showUser?: boolean
|
|
18
|
+
}>(), {
|
|
19
|
+
menuList: () => [],
|
|
20
|
+
showLogo: true,
|
|
21
|
+
showUser: true
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const route = useRoute()
|
|
25
|
+
const router = useRouter()
|
|
26
|
+
const menuStore = useMenuStore()
|
|
27
|
+
const userStore = useUserStore()
|
|
28
|
+
const authStore = useAuthStore()
|
|
29
|
+
const appStore = useAppStore()
|
|
30
|
+
|
|
31
|
+
// 使用传入的菜单列表,如果没有传入则使用 store 中的
|
|
32
|
+
const displayMenuList = computed(() => props.menuList.length > 0 ? props.menuList : menuStore.menuList)
|
|
33
|
+
|
|
34
|
+
const isCollapsed = computed(() => appStore.isCollapsed)
|
|
35
|
+
const activeMenu = computed(() => route.path)
|
|
36
|
+
|
|
37
|
+
// 菜单展开状态持久化
|
|
38
|
+
const OPENED_MENUS_KEY = 'sidebar_opened_menus'
|
|
39
|
+
const openedMenus = ref<string[]>(local.get<string[]>(OPENED_MENUS_KEY) || [])
|
|
40
|
+
|
|
41
|
+
// 监听变化并持久化
|
|
42
|
+
watch(openedMenus, (val) => {
|
|
43
|
+
local.set(OPENED_MENUS_KEY, val)
|
|
44
|
+
}, { deep: true })
|
|
45
|
+
|
|
46
|
+
// 递归查找当前路由对应的父菜单路径
|
|
47
|
+
const findMenuPath = (menus: any[], path: string, parentUrls: string[] = []): string[] | null => {
|
|
48
|
+
for (const menu of menus) {
|
|
49
|
+
// 当前菜单匹配
|
|
50
|
+
if (path === menu.menuUrl || path.startsWith(menu.menuUrl + '/')) {
|
|
51
|
+
return [...parentUrls, menu.menuUrl]
|
|
52
|
+
}
|
|
53
|
+
// 递归查找子菜单
|
|
54
|
+
if (menu.children?.length) {
|
|
55
|
+
const result = findMenuPath(menu.children, path, [...parentUrls, menu.menuUrl])
|
|
56
|
+
if (result) return result
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 监听路由变化,只展开当前路由相关的父菜单
|
|
63
|
+
watch([() => route.path, displayMenuList], ([path, menus]) => {
|
|
64
|
+
if (menus.length > 0) {
|
|
65
|
+
const menuPath = findMenuPath(menus, path)
|
|
66
|
+
if (menuPath) {
|
|
67
|
+
// 只保留路径上的父菜单(不包括当前页面本身)
|
|
68
|
+
openedMenus.value = menuPath.slice(0, -1)
|
|
69
|
+
} else {
|
|
70
|
+
// 如果找不到匹配的菜单,关闭所有
|
|
71
|
+
openedMenus.value = []
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, { immediate: true })
|
|
75
|
+
|
|
76
|
+
// 菜单主题相关
|
|
77
|
+
const menuBgColor = computed(() => appStore.isDark ? '#1d1e1f' : '#fff')
|
|
78
|
+
const menuTextColor = computed(() => appStore.isDark ? '#cfd3dc' : '#303133')
|
|
79
|
+
const menuActiveTextColor = computed(() => '#409eff')
|
|
80
|
+
|
|
81
|
+
// 菜单选择
|
|
82
|
+
const handleMenuSelect = (index: string) => {
|
|
83
|
+
if (index && index !== route.path) {
|
|
84
|
+
router.push(index)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 退出登录
|
|
89
|
+
const handleLogout = () => {
|
|
90
|
+
authStore.logout()
|
|
91
|
+
userStore.clearUserInfo()
|
|
92
|
+
menuStore.clearMenu()
|
|
93
|
+
router.push('/login')
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<div class="sidebar" :class="{ 'sidebar--collapsed': isCollapsed }">
|
|
99
|
+
<!-- Logo -->
|
|
100
|
+
<div v-if="props.showLogo" class="sidebar__logo">
|
|
101
|
+
<img src="/vite.svg" alt="Logo" class="sidebar__logo-img" />
|
|
102
|
+
<span v-show="!isCollapsed" class="sidebar__logo-text">{{ appStore.appName }}</span>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<!-- 菜单 -->
|
|
106
|
+
<Menu
|
|
107
|
+
v-model="activeMenu"
|
|
108
|
+
v-model:openeds="openedMenus"
|
|
109
|
+
mode="vertical"
|
|
110
|
+
:collapse="isCollapsed"
|
|
111
|
+
:collapse-transition="false"
|
|
112
|
+
:background-color="menuBgColor"
|
|
113
|
+
:text-color="menuTextColor"
|
|
114
|
+
:active-text-color="menuActiveTextColor"
|
|
115
|
+
class="sidebar__menu"
|
|
116
|
+
@select="handleMenuSelect"
|
|
117
|
+
>
|
|
118
|
+
<template v-for="menu in displayMenuList" :key="menu.menuUrl">
|
|
119
|
+
<SidebarMenuItem :menu="menu" />
|
|
120
|
+
</template>
|
|
121
|
+
</Menu>
|
|
122
|
+
|
|
123
|
+
<!-- 用户信息 -->
|
|
124
|
+
<div v-if="props.showUser && !isCollapsed" class="sidebar__user">
|
|
125
|
+
<div class="sidebar__user-info">
|
|
126
|
+
<span class="sidebar__user-name">{{ userStore.userName }}</span>
|
|
127
|
+
<span class="sidebar__user-role">{{ userStore.departmentName }}</span>
|
|
128
|
+
</div>
|
|
129
|
+
<Button type="text" size="small" @click="handleLogout">退出</Button>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<style lang="scss" scoped>
|
|
135
|
+
.sidebar {
|
|
136
|
+
height: 100%;
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
background-color: var(--bg-color);
|
|
140
|
+
border-right: 1px solid var(--color-border-lighter);
|
|
141
|
+
|
|
142
|
+
&--collapsed {
|
|
143
|
+
.sidebar__logo {
|
|
144
|
+
justify-content: center;
|
|
145
|
+
padding: 0;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__logo {
|
|
150
|
+
height: 50px;
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
padding: 0 20px;
|
|
154
|
+
gap: 10px;
|
|
155
|
+
border-bottom: 1px solid var(--color-border-lighter);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__logo-img {
|
|
159
|
+
width: 32px;
|
|
160
|
+
height: 32px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__logo-text {
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
font-weight: 600;
|
|
166
|
+
color: var(--color-primary);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&__menu {
|
|
170
|
+
flex: 1;
|
|
171
|
+
border-right: none;
|
|
172
|
+
overflow-y: auto;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&__user {
|
|
176
|
+
padding: 10px;
|
|
177
|
+
border-top: 1px solid var(--color-border-lighter);
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: space-between;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&__user-info {
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
186
|
+
gap: 2px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&__user-name {
|
|
190
|
+
font-size: 14px;
|
|
191
|
+
font-weight: 500;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&__user-role {
|
|
195
|
+
font-size: 12px;
|
|
196
|
+
color: var(--color-text-secondary);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
199
|
</style>
|