xto-fronted 0.4.93 → 0.4.95
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-C9Uh6Uu-.css +1 -0
- package/dist/assets/404-zjGLLssH.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/dist/assets/index-B5xc4gQB.css +1 -0
- package/dist/assets/index-BDgOY6Rp.js +1 -0
- package/dist/assets/index-BIoRANs0.js +1 -0
- package/dist/assets/index-BRR97dc6.js +1 -0
- package/dist/assets/index-Bz0BgZQ1.js +1 -0
- package/dist/assets/index-CAdztNsv.css +1 -0
- package/dist/assets/index-CCXrcISf.css +1 -0
- package/dist/assets/index-CfpZmcpk.css +1 -0
- package/dist/assets/index-CwJSA85U.js +1 -0
- package/dist/assets/index-CwRA10ac.js +1 -0
- package/dist/assets/index-D8NDxq9d.js +1 -0
- package/dist/assets/index-DEB6-Iv_.js +2 -0
- package/dist/assets/index-DM4Ezclc.css +1 -0
- package/dist/assets/index-DYv7nImj.css +1 -0
- package/dist/assets/index-t-2Y0KhA.css +1 -0
- package/dist/assets/vendor-CUVPinTg.js +13 -0
- package/dist/assets/vue-vendor-DeJXJVbN.js +29 -0
- package/dist/assets/xto-base-CL2NKZJJ.css +1 -0
- package/dist/assets/xto-base-PwLGsxxb.js +1 -0
- package/dist/assets/xto-business--V1F5Gwb.css +1 -0
- package/dist/assets/xto-core-CtL4zKiV.js +1 -0
- package/dist/assets/xto-data-MxZsiJgi.css +1 -0
- package/dist/assets/xto-data-bCXQa7fT.js +1 -0
- package/dist/assets/xto-feedback-Bxx38c3P.css +1 -0
- package/dist/assets/xto-feedback-CPydp0kn.js +1 -0
- package/dist/assets/xto-form-Cu6q3VLG.css +1 -0
- package/dist/assets/xto-form-bywohdAf.js +1 -0
- package/dist/assets/xto-layout-BDD6sSlM.css +1 -0
- package/dist/assets/xto-navigation-Bbdpine9.js +1 -0
- package/dist/assets/xto-navigation-XfpyMpEo.css +1 -0
- package/dist/components/Layout/MixTopMenu.vue.d.ts +6 -1
- package/dist/components/Layout/Sidebar.vue.d.ts +2 -0
- package/dist/components/Layout/TopMenu.vue.d.ts +6 -1
- package/dist/components/Layout/index.vue.d.ts +6 -1
- package/dist/{index-D59X6HmM.js → index-3ekBp4iW.js} +2 -2
- package/dist/{index-Cp8kqjtv.js → index-58aI1w0v.js} +2 -2
- package/dist/{index-me_Uu2lk.js → index-A_B_Ap_A.js} +1560 -1590
- package/dist/{index-lJrh5CFc.js → index-B5DLfOYb.js} +23 -23
- package/dist/index-BAmYUT0G.js +189 -0
- package/dist/{index-B4U8Dy2W.js → index-BK4Mut6H.js} +2 -2
- package/dist/index-BRvi9qW-.js +515 -0
- package/dist/index-BVGW4DDQ.js +189 -0
- package/dist/index-BXg94yA2.js +515 -0
- package/dist/index-Bmf0YbVq.js +189 -0
- package/dist/index-C2-a5KSQ.js +4233 -0
- package/dist/index-CAHSv7LK.js +4285 -0
- package/dist/index-CeZ0CSSs.js +641 -0
- package/dist/index-Cf8E7FM1.js +4270 -0
- package/dist/index-CgyQqbdx.js +189 -0
- package/dist/index-ChowNrlU.js +641 -0
- package/dist/index-D25KzR0I.js +479 -0
- package/dist/index-DCBIjLHy.js +515 -0
- package/dist/index-DEYOivza.js +641 -0
- package/dist/index-DReodgBw.js +4233 -0
- package/dist/index-DjERNRXX.js +515 -0
- package/dist/index-LSdsO2Ox.js +479 -0
- package/dist/index-UJixTdep.js +479 -0
- package/dist/index-gBlRG4kk.js +479 -0
- package/dist/index-xWU3J3OH.js +641 -0
- package/dist/index.es.js +1 -1
- package/dist/index.html +28 -0
- package/dist/index.umd.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +91 -91
- package/src/App.vue +48 -48
- package/src/assets/styles/_dark.scss +639 -639
- 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/MixTopMenu.vue +8 -1
- package/src/components/Layout/Sidebar.vue +200 -198
- package/src/components/Layout/SidebarMenuItem.vue +158 -158
- package/src/components/Layout/TopMenu.vue +1177 -1170
- package/src/components/Layout/index.vue +199 -192
- package/src/composables/useI18n.ts +43 -43
- package/src/index.ts +100 -100
- package/src/router/layoutRoute.ts +59 -59
- package/src/stores/index.ts +15 -15
- package/src/stores/locale.ts +66 -66
- package/src/types/json-bigint.d.ts +18 -18
- package/src/types/xto.d.ts +172 -172
- package/src/utils/request.ts +184 -184
- 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
|
@@ -1,193 +1,200 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import { useAppStore } from '@/stores/app'
|
|
4
|
-
import { useMenuStore } from '@/stores/menu'
|
|
5
|
-
import Sidebar from './Sidebar.vue'
|
|
6
|
-
import Header from './Header.vue'
|
|
7
|
-
import TopMenu from './TopMenu.vue'
|
|
8
|
-
import MixTopMenu from './MixTopMenu.vue'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
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
|
-
</div>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
height: 100%;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.
|
|
123
|
-
flex: 1;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
flex-shrink: 0;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useAppStore } from '@/stores/app'
|
|
4
|
+
import { useMenuStore } from '@/stores/menu'
|
|
5
|
+
import Sidebar from './Sidebar.vue'
|
|
6
|
+
import Header from './Header.vue'
|
|
7
|
+
import TopMenu from './TopMenu.vue'
|
|
8
|
+
import MixTopMenu from './MixTopMenu.vue'
|
|
9
|
+
|
|
10
|
+
// Props
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
logoSrc?: string
|
|
13
|
+
}>(), {
|
|
14
|
+
logoSrc: '/vite.svg'
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const appStore = useAppStore()
|
|
18
|
+
const menuStore = useMenuStore()
|
|
19
|
+
|
|
20
|
+
const sidebarWidth = computed(() =>
|
|
21
|
+
appStore.isCollapsed ? '64px' : '210px'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// 布局模式
|
|
25
|
+
const layoutMode = computed(() => appStore.layout)
|
|
26
|
+
|
|
27
|
+
// 是否显示混合模式(mix模式)
|
|
28
|
+
const isMixMode = computed(() => layoutMode.value === 'mix')
|
|
29
|
+
|
|
30
|
+
// 左侧菜单数据
|
|
31
|
+
// sidebar模式:显示全部菜单
|
|
32
|
+
// mix模式:显示当前选中一级菜单的子菜单
|
|
33
|
+
const sidebarMenuList = computed(() => {
|
|
34
|
+
if (layoutMode.value === 'sidebar') {
|
|
35
|
+
return menuStore.menuList
|
|
36
|
+
} else if (layoutMode.value === 'mix') {
|
|
37
|
+
// mix模式下显示当前选中一级菜单的子菜单
|
|
38
|
+
return appStore.mixSubMenus
|
|
39
|
+
}
|
|
40
|
+
return []
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// mix模式下是否显示左侧菜单(有子菜单时才显示)
|
|
44
|
+
const showMixSidebar = computed(() => {
|
|
45
|
+
if (!isMixMode.value) return false
|
|
46
|
+
return sidebarMenuList.value.length > 0
|
|
47
|
+
})
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<!-- sidebar模式:左侧菜单 + 顶部Header + 主内容 -->
|
|
52
|
+
<div v-if="layoutMode === 'sidebar'" class="layout layout--sidebar">
|
|
53
|
+
<aside class="layout__aside" :style="{ width: sidebarWidth }">
|
|
54
|
+
<Sidebar :menu-list="sidebarMenuList" :show-logo="true" :show-user="true" :logo-src="props.logoSrc" />
|
|
55
|
+
</aside>
|
|
56
|
+
<div class="layout__main">
|
|
57
|
+
<header class="layout__header">
|
|
58
|
+
<Header />
|
|
59
|
+
</header>
|
|
60
|
+
<main class="layout__content">
|
|
61
|
+
<router-view />
|
|
62
|
+
</main>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- top模式:顶部菜单 + 主内容 -->
|
|
67
|
+
<div v-if="layoutMode === 'top'" class="layout layout--top">
|
|
68
|
+
<div class="layout__top-menu">
|
|
69
|
+
<TopMenu :logo-src="props.logoSrc" />
|
|
70
|
+
</div>
|
|
71
|
+
<div class="layout__main">
|
|
72
|
+
<main class="layout__content">
|
|
73
|
+
<router-view />
|
|
74
|
+
</main>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- mix模式:顶部一级菜单 + (左侧子菜单 + 主内容) -->
|
|
79
|
+
<div v-if="layoutMode === 'mix'" class="layout layout--mix">
|
|
80
|
+
<!-- 顶部一级菜单 -->
|
|
81
|
+
<div class="layout__mix-top-menu">
|
|
82
|
+
<MixTopMenu :logo-src="props.logoSrc" />
|
|
83
|
+
</div>
|
|
84
|
+
<!-- 下方:左侧子菜单 + 主内容 -->
|
|
85
|
+
<div class="layout__mix-body">
|
|
86
|
+
<aside v-if="showMixSidebar" class="layout__aside" :style="{ width: sidebarWidth }">
|
|
87
|
+
<Sidebar :menu-list="sidebarMenuList" :show-logo="false" :show-user="false" />
|
|
88
|
+
</aside>
|
|
89
|
+
<main class="layout__content">
|
|
90
|
+
<router-view />
|
|
91
|
+
</main>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<style lang="scss" scoped>
|
|
97
|
+
.layout {
|
|
98
|
+
display: flex;
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
|
|
102
|
+
// 左侧菜单模式
|
|
103
|
+
&--sidebar {
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
|
|
106
|
+
.layout__aside {
|
|
107
|
+
height: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.layout__main {
|
|
111
|
+
flex: 1;
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
height: 100%;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// 顶部菜单模式
|
|
119
|
+
&--top {
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
|
|
122
|
+
.layout__main {
|
|
123
|
+
flex: 1;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
height: calc(100% - 50px);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.layout__content {
|
|
130
|
+
flex: 1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 混合菜单模式
|
|
135
|
+
&--mix {
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
|
|
138
|
+
.layout__mix-top-menu {
|
|
139
|
+
width: 100%;
|
|
140
|
+
height: 50px;
|
|
141
|
+
background-color: var(--bg-color);
|
|
142
|
+
border-bottom: 1px solid var(--color-border-lighter);
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.layout__mix-body {
|
|
147
|
+
flex: 1;
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: row;
|
|
150
|
+
height: calc(100% - 50px);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__aside {
|
|
155
|
+
transition: width 0.3s;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
height: 100%;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&__top-menu {
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 50px;
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
background-color: var(--bg-color);
|
|
166
|
+
border-bottom: 1px solid var(--color-border-lighter);
|
|
167
|
+
flex-shrink: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__mix-top-menu {
|
|
171
|
+
width: 100%;
|
|
172
|
+
height: 50px;
|
|
173
|
+
box-sizing: border-box;
|
|
174
|
+
flex-shrink: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&__main {
|
|
178
|
+
flex: 1;
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
height: 100%;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&__header {
|
|
186
|
+
height: 50px;
|
|
187
|
+
box-sizing: border-box;
|
|
188
|
+
background-color: var(--bg-color);
|
|
189
|
+
border-bottom: 1px solid var(--color-border-lighter);
|
|
190
|
+
flex-shrink: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&__content {
|
|
194
|
+
flex: 1;
|
|
195
|
+
overflow: auto;
|
|
196
|
+
background-color: var(--bg-color-page);
|
|
197
|
+
padding: 0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
193
200
|
</style>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 国际化组合式函数
|
|
3
|
-
* 提供便捷的国际化操作
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { useLocaleStore } from '@/stores/locale'
|
|
7
|
-
import type { LocaleCode, LocaleMessages } from '@xto/core/locale'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 使用国际化
|
|
11
|
-
* 封装 locale store,提供更简洁的 API
|
|
12
|
-
*/
|
|
13
|
-
export function useI18n() {
|
|
14
|
-
const localeStore = useLocaleStore()
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
/** 当前语言代码 */
|
|
18
|
-
locale: localeStore.locale,
|
|
19
|
-
/** 当前语言名称 */
|
|
20
|
-
localeName: localeStore.localeName,
|
|
21
|
-
/** 支持的语言列表 */
|
|
22
|
-
locales: localeStore.locales,
|
|
23
|
-
/** 翻译函数 */
|
|
24
|
-
t: localeStore.t,
|
|
25
|
-
/** 当前语言包 */
|
|
26
|
-
messages: localeStore.messages,
|
|
27
|
-
/** 切换语言 */
|
|
28
|
-
setLocale: localeStore.changeLocale,
|
|
29
|
-
/** 添加自定义翻译 */
|
|
30
|
-
addMessages: localeStore.addMessages
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 创建翻译函数
|
|
36
|
-
* 用于在非组件上下文中使用翻译
|
|
37
|
-
*/
|
|
38
|
-
export function createTranslator() {
|
|
39
|
-
const localeStore = useLocaleStore()
|
|
40
|
-
return localeStore.t
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 导出类型
|
|
1
|
+
/**
|
|
2
|
+
* 国际化组合式函数
|
|
3
|
+
* 提供便捷的国际化操作
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useLocaleStore } from '@/stores/locale'
|
|
7
|
+
import type { LocaleCode, LocaleMessages } from '@xto/core/locale'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 使用国际化
|
|
11
|
+
* 封装 locale store,提供更简洁的 API
|
|
12
|
+
*/
|
|
13
|
+
export function useI18n() {
|
|
14
|
+
const localeStore = useLocaleStore()
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
/** 当前语言代码 */
|
|
18
|
+
locale: localeStore.locale,
|
|
19
|
+
/** 当前语言名称 */
|
|
20
|
+
localeName: localeStore.localeName,
|
|
21
|
+
/** 支持的语言列表 */
|
|
22
|
+
locales: localeStore.locales,
|
|
23
|
+
/** 翻译函数 */
|
|
24
|
+
t: localeStore.t,
|
|
25
|
+
/** 当前语言包 */
|
|
26
|
+
messages: localeStore.messages,
|
|
27
|
+
/** 切换语言 */
|
|
28
|
+
setLocale: localeStore.changeLocale,
|
|
29
|
+
/** 添加自定义翻译 */
|
|
30
|
+
addMessages: localeStore.addMessages
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 创建翻译函数
|
|
36
|
+
* 用于在非组件上下文中使用翻译
|
|
37
|
+
*/
|
|
38
|
+
export function createTranslator() {
|
|
39
|
+
const localeStore = useLocaleStore()
|
|
40
|
+
return localeStore.t
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 导出类型
|
|
44
44
|
export type { LocaleCode, LocaleMessages }
|