befly-admin 3.5.31 → 3.5.33
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/README.md +32 -32
- package/package.json +21 -21
- package/src/App.vue +3 -3
- package/src/components/DetailPanel.vue +6 -6
- package/src/layouts/default.vue +139 -24
- package/src/main.js +13 -21
- package/src/plugins/config.js +29 -0
- package/src/plugins/global.js +1 -1
- package/src/plugins/http.js +11 -19
- package/src/plugins/router.js +45 -0
- package/src/plugins/storage.js +5 -12
- package/src/styles/global.scss +1 -1
- package/src/types/auto-imports.d.ts +5 -10
- package/src/types/components.d.ts +0 -18
- package/src/types/typed-router.d.ts +87 -22
- package/src/types/unplugin-vue-router-client.d.ts +3 -0
- package/src/views/dashboard/index.vue +117 -0
- package/src/views/index2.vue +9 -6
- package/vite.config.js +6 -5
- package/src/config/index.js +0 -20
- package/src/router/index.js +0 -86
- package/src/utils/index.js +0 -130
- package/src/views/index3.vue +0 -707
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { $Storage } from "@/plugins/storage";
|
|
2
|
+
import { applyTokenAuthGuard, buildLayoutRoutes, createLayoutComponentResolver } from "befly-vite/utils/router";
|
|
3
|
+
import { createRouter, createWebHashHistory } from "vue-router";
|
|
4
|
+
import { routes } from "vue-router/auto-routes";
|
|
5
|
+
|
|
6
|
+
// 应用自定义布局系统
|
|
7
|
+
const layoutRoutes = buildLayoutRoutes(
|
|
8
|
+
routes,
|
|
9
|
+
createLayoutComponentResolver({
|
|
10
|
+
resolveDefaultLayout: () => import("@/layouts/default.vue"),
|
|
11
|
+
resolveNamedLayout: (layoutName) => import(`@/layouts/${layoutName}.vue`)
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// 添加根路径重定向
|
|
16
|
+
const finalRoutes = [
|
|
17
|
+
{
|
|
18
|
+
path: "/",
|
|
19
|
+
redirect: $Config.homePath
|
|
20
|
+
}
|
|
21
|
+
].concat(layoutRoutes);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 创建并导出路由实例
|
|
25
|
+
* 可直接在 main.js 中使用 app.use(router)
|
|
26
|
+
*/
|
|
27
|
+
export const router = createRouter({
|
|
28
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
29
|
+
routes: finalRoutes
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 路由守卫 - 基础验证
|
|
33
|
+
applyTokenAuthGuard(router, {
|
|
34
|
+
getToken: () => $Storage.local.get("token"),
|
|
35
|
+
loginPath: $Config.loginPath,
|
|
36
|
+
homePath: $Config.homePath
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// 路由就绪后处理
|
|
40
|
+
router.afterEach((_to) => {
|
|
41
|
+
// 可以在这里添加页面访问统计等
|
|
42
|
+
if (import.meta.env.DEV) {
|
|
43
|
+
// 开发环境调试日志请使用更合适的日志方案(此处避免 console 触发 lint 门禁)
|
|
44
|
+
}
|
|
45
|
+
});
|
package/src/plugins/storage.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// 获取命名空间
|
|
7
|
-
const NAMESPACE = import.meta.env.VITE_STORAGE_NAMESPACE ||
|
|
7
|
+
const NAMESPACE = import.meta.env.VITE_STORAGE_NAMESPACE || "befly";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 存储操作类
|
|
@@ -45,9 +45,7 @@ class StorageManager {
|
|
|
45
45
|
const fullKey = this.getKey(key);
|
|
46
46
|
const serializedValue = JSON.stringify(value);
|
|
47
47
|
storage.setItem(fullKey, serializedValue);
|
|
48
|
-
} catch
|
|
49
|
-
console.error(`Storage.set error for key "${key}":`, error);
|
|
50
|
-
}
|
|
48
|
+
} catch {}
|
|
51
49
|
},
|
|
52
50
|
|
|
53
51
|
/**
|
|
@@ -65,8 +63,7 @@ class StorageManager {
|
|
|
65
63
|
return defaultValue;
|
|
66
64
|
}
|
|
67
65
|
return JSON.parse(value);
|
|
68
|
-
} catch
|
|
69
|
-
console.error(`Storage.get error for key "${key}":`, error);
|
|
66
|
+
} catch {
|
|
70
67
|
return defaultValue;
|
|
71
68
|
}
|
|
72
69
|
},
|
|
@@ -80,9 +77,7 @@ class StorageManager {
|
|
|
80
77
|
try {
|
|
81
78
|
const fullKey = this.getKey(key);
|
|
82
79
|
storage.removeItem(fullKey);
|
|
83
|
-
} catch
|
|
84
|
-
console.error(`Storage.remove error for key "${key}":`, error);
|
|
85
|
-
}
|
|
80
|
+
} catch {}
|
|
86
81
|
},
|
|
87
82
|
|
|
88
83
|
/**
|
|
@@ -98,9 +93,7 @@ class StorageManager {
|
|
|
98
93
|
storage.removeItem(key);
|
|
99
94
|
}
|
|
100
95
|
});
|
|
101
|
-
} catch
|
|
102
|
-
console.error('Storage.clear error:', error);
|
|
103
|
-
}
|
|
96
|
+
} catch {}
|
|
104
97
|
},
|
|
105
98
|
|
|
106
99
|
/**
|
package/src/styles/global.scss
CHANGED
|
@@ -10,7 +10,7 @@ html,
|
|
|
10
10
|
body {
|
|
11
11
|
margin: 0;
|
|
12
12
|
padding: 0;
|
|
13
|
-
font-family: -apple-system, BlinkMacSystemFont,
|
|
13
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "PingFang SC", "Microsoft YaHei";
|
|
14
14
|
font-size: var(--font-size-md);
|
|
15
15
|
color: var(--text-primary);
|
|
16
16
|
background: var(--bg-color-page);
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
// biome-ignore lint: disable
|
|
7
7
|
export {}
|
|
8
8
|
declare global {
|
|
9
|
-
const $Config: typeof import('../config
|
|
9
|
+
const $Config: typeof import('../plugins/config.js').$Config
|
|
10
10
|
const $Http: typeof import('../plugins/http.js').$Http
|
|
11
11
|
const $Storage: typeof import('../plugins/storage.js').$Storage
|
|
12
|
-
const DialogPlugin: typeof import(
|
|
12
|
+
const DialogPlugin: typeof import("tdesign-vue-next").DialogPlugin
|
|
13
13
|
const EffectScope: typeof import('vue').EffectScope
|
|
14
14
|
const MessagePlugin: typeof import('tdesign-vue-next').MessagePlugin
|
|
15
15
|
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
|
|
16
|
-
const arrayToTree: typeof import('../utils/index.js').arrayToTree
|
|
17
16
|
const computed: typeof import('vue').computed
|
|
18
17
|
const createApp: typeof import('vue').createApp
|
|
19
18
|
const createPinia: typeof import('pinia').createPinia
|
|
@@ -61,6 +60,7 @@ declare global {
|
|
|
61
60
|
const readonly: typeof import('vue').readonly
|
|
62
61
|
const ref: typeof import('vue').ref
|
|
63
62
|
const resolveComponent: typeof import('vue').resolveComponent
|
|
63
|
+
const router: typeof import('../plugins/router.js').router
|
|
64
64
|
const setActivePinia: typeof import('pinia').setActivePinia
|
|
65
65
|
const setMapStoreSuffix: typeof import('pinia').setMapStoreSuffix
|
|
66
66
|
const shallowReactive: typeof import('vue').shallowReactive
|
|
@@ -87,8 +87,6 @@ declare global {
|
|
|
87
87
|
const watchEffect: typeof import('vue').watchEffect
|
|
88
88
|
const watchPostEffect: typeof import('vue').watchPostEffect
|
|
89
89
|
const watchSyncEffect: typeof import('vue').watchSyncEffect
|
|
90
|
-
const withDefaultColumns: typeof import('../utils/index.js').withDefaultColumns
|
|
91
|
-
const withTreeTableProps: typeof import('../utils/index.js').withTreeTableProps
|
|
92
90
|
}
|
|
93
91
|
// for type re-export
|
|
94
92
|
declare global {
|
|
@@ -102,14 +100,12 @@ import { UnwrapRef } from 'vue'
|
|
|
102
100
|
declare module 'vue' {
|
|
103
101
|
interface GlobalComponents {}
|
|
104
102
|
interface ComponentCustomProperties {
|
|
105
|
-
readonly $Config: UnwrapRef<typeof import('../config
|
|
103
|
+
readonly $Config: UnwrapRef<typeof import('../plugins/config.js')['$Config']>
|
|
106
104
|
readonly $Http: UnwrapRef<typeof import('../plugins/http.js')['$Http']>
|
|
107
105
|
readonly $Storage: UnwrapRef<typeof import('../plugins/storage.js')['$Storage']>
|
|
108
|
-
readonly DialogPlugin: UnwrapRef<typeof import('tdesign-vue-next')['DialogPlugin']>
|
|
109
106
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
110
107
|
readonly MessagePlugin: UnwrapRef<typeof import('tdesign-vue-next')['MessagePlugin']>
|
|
111
108
|
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
|
|
112
|
-
readonly arrayToTree: UnwrapRef<typeof import('../utils/index.js')['arrayToTree']>
|
|
113
109
|
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
|
114
110
|
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
|
115
111
|
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
|
|
@@ -157,6 +153,7 @@ declare module 'vue' {
|
|
|
157
153
|
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
|
158
154
|
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
|
159
155
|
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
|
156
|
+
readonly router: UnwrapRef<typeof import('../plugins/router.js')['router']>
|
|
160
157
|
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
|
|
161
158
|
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
|
|
162
159
|
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
|
@@ -183,7 +180,5 @@ declare module 'vue' {
|
|
|
183
180
|
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
|
184
181
|
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
|
185
182
|
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
|
186
|
-
readonly withDefaultColumns: UnwrapRef<typeof import('../utils/index.js')['withDefaultColumns']>
|
|
187
|
-
readonly withTreeTableProps: UnwrapRef<typeof import('../utils/index.js')['withTreeTableProps']>
|
|
188
183
|
}
|
|
189
184
|
}
|
|
@@ -12,39 +12,21 @@ export {}
|
|
|
12
12
|
declare module 'vue' {
|
|
13
13
|
export interface GlobalComponents {
|
|
14
14
|
DetailPanel: typeof import('./../components/DetailPanel.vue')['default']
|
|
15
|
-
Dialog: typeof import('./../components/Dialog.vue')['default']
|
|
16
15
|
'ILucide:box': typeof import('~icons/lucide/box')['default']
|
|
17
16
|
'ILucide:camera': typeof import('~icons/lucide/camera')['default']
|
|
18
17
|
'ILucide:fileText': typeof import('~icons/lucide/file-text')['default']
|
|
19
18
|
'ILucide:folder': typeof import('~icons/lucide/folder')['default']
|
|
20
19
|
'ILucide:home': typeof import('~icons/lucide/home')['default']
|
|
21
20
|
'ILucide:logOut': typeof import('~icons/lucide/log-out')['default']
|
|
22
|
-
'ILucide:panelLeftClose': typeof import('~icons/lucide/panel-left-close')['default']
|
|
23
|
-
'ILucide:panelLeftOpen': typeof import('~icons/lucide/panel-left-open')['default']
|
|
24
21
|
'ILucide:settings': typeof import('~icons/lucide/settings')['default']
|
|
25
22
|
'ILucide:user': typeof import('~icons/lucide/user')['default']
|
|
26
|
-
'ILucide:x': typeof import('~icons/lucide/x')['default']
|
|
27
23
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
28
24
|
RouterView: typeof import('vue-router')['RouterView']
|
|
29
|
-
TAvatar: typeof import('tdesign-vue-next')['Avatar']
|
|
30
25
|
TButton: typeof import('tdesign-vue-next')['Button']
|
|
31
|
-
TCard: typeof import('tdesign-vue-next')['Card']
|
|
32
|
-
TIcon: typeof import('tdesign-vue-next')['Icon']
|
|
33
|
-
TIconBell: typeof import('tdesign-vue-next')['IconBell']
|
|
34
|
-
TIconChevronDown: typeof import('tdesign-vue-next')['IconChevronDown']
|
|
35
|
-
TIconChevronUp: typeof import('tdesign-vue-next')['IconChevronUp']
|
|
36
|
-
TIconMoney: typeof import('tdesign-vue-next')['IconMoney']
|
|
37
|
-
TIconShop: typeof import('tdesign-vue-next')['IconShop']
|
|
38
|
-
TIconUser: typeof import('tdesign-vue-next')['IconUser']
|
|
39
|
-
TLink: typeof import('tdesign-vue-next')['Link']
|
|
40
26
|
TMenu: typeof import('tdesign-vue-next')['Menu']
|
|
41
27
|
TMenuItem: typeof import('tdesign-vue-next')['MenuItem']
|
|
42
|
-
TOption: typeof import('tdesign-vue-next')['Option']
|
|
43
|
-
TProgress: typeof import('tdesign-vue-next')['Progress']
|
|
44
|
-
TSelect: typeof import('tdesign-vue-next')['Select']
|
|
45
28
|
TSpace: typeof import('tdesign-vue-next')['Space']
|
|
46
29
|
TSubmenu: typeof import('tdesign-vue-next')['Submenu']
|
|
47
|
-
TTag: typeof import('tdesign-vue-next')['Tag']
|
|
48
30
|
TUpload: typeof import('tdesign-vue-next')['Upload']
|
|
49
31
|
}
|
|
50
32
|
}
|
|
@@ -37,6 +37,13 @@ declare module 'vue-router/auto-routes' {
|
|
|
37
37
|
Record<never, never>,
|
|
38
38
|
| never
|
|
39
39
|
>,
|
|
40
|
+
'/addon/admin/config/': RouteRecordInfo<
|
|
41
|
+
'/addon/admin/config/',
|
|
42
|
+
'/addon/admin/config',
|
|
43
|
+
Record<never, never>,
|
|
44
|
+
Record<never, never>,
|
|
45
|
+
| never
|
|
46
|
+
>,
|
|
40
47
|
'/addon/admin/config/dict/': RouteRecordInfo<
|
|
41
48
|
'/addon/admin/config/dict/',
|
|
42
49
|
'/addon/admin/config/dict',
|
|
@@ -44,6 +51,13 @@ declare module 'vue-router/auto-routes' {
|
|
|
44
51
|
Record<never, never>,
|
|
45
52
|
| never
|
|
46
53
|
>,
|
|
54
|
+
'/addon/admin/config/dictType/': RouteRecordInfo<
|
|
55
|
+
'/addon/admin/config/dictType/',
|
|
56
|
+
'/addon/admin/config/dictType',
|
|
57
|
+
Record<never, never>,
|
|
58
|
+
Record<never, never>,
|
|
59
|
+
| never
|
|
60
|
+
>,
|
|
47
61
|
'/addon/admin/config/system/': RouteRecordInfo<
|
|
48
62
|
'/addon/admin/config/system/',
|
|
49
63
|
'/addon/admin/config/system',
|
|
@@ -51,6 +65,13 @@ declare module 'vue-router/auto-routes' {
|
|
|
51
65
|
Record<never, never>,
|
|
52
66
|
| never
|
|
53
67
|
>,
|
|
68
|
+
'/addon/admin/log/': RouteRecordInfo<
|
|
69
|
+
'/addon/admin/log/',
|
|
70
|
+
'/addon/admin/log',
|
|
71
|
+
Record<never, never>,
|
|
72
|
+
Record<never, never>,
|
|
73
|
+
| never
|
|
74
|
+
>,
|
|
54
75
|
'/addon/admin/log/email/': RouteRecordInfo<
|
|
55
76
|
'/addon/admin/log/email/',
|
|
56
77
|
'/addon/admin/log/email',
|
|
@@ -79,6 +100,13 @@ declare module 'vue-router/auto-routes' {
|
|
|
79
100
|
Record<never, never>,
|
|
80
101
|
| never
|
|
81
102
|
>,
|
|
103
|
+
'/addon/admin/people/': RouteRecordInfo<
|
|
104
|
+
'/addon/admin/people/',
|
|
105
|
+
'/addon/admin/people',
|
|
106
|
+
Record<never, never>,
|
|
107
|
+
Record<never, never>,
|
|
108
|
+
| never
|
|
109
|
+
>,
|
|
82
110
|
'/addon/admin/people/admin/': RouteRecordInfo<
|
|
83
111
|
'/addon/admin/people/admin/',
|
|
84
112
|
'/addon/admin/people/admin',
|
|
@@ -86,6 +114,13 @@ declare module 'vue-router/auto-routes' {
|
|
|
86
114
|
Record<never, never>,
|
|
87
115
|
| never
|
|
88
116
|
>,
|
|
117
|
+
'/addon/admin/permission/': RouteRecordInfo<
|
|
118
|
+
'/addon/admin/permission/',
|
|
119
|
+
'/addon/admin/permission',
|
|
120
|
+
Record<never, never>,
|
|
121
|
+
Record<never, never>,
|
|
122
|
+
| never
|
|
123
|
+
>,
|
|
89
124
|
'/addon/admin/permission/api/': RouteRecordInfo<
|
|
90
125
|
'/addon/admin/permission/api/',
|
|
91
126
|
'/addon/admin/permission/api',
|
|
@@ -107,16 +142,16 @@ declare module 'vue-router/auto-routes' {
|
|
|
107
142
|
Record<never, never>,
|
|
108
143
|
| never
|
|
109
144
|
>,
|
|
110
|
-
'/
|
|
111
|
-
'/
|
|
112
|
-
'/
|
|
145
|
+
'/dashboard/': RouteRecordInfo<
|
|
146
|
+
'/dashboard/',
|
|
147
|
+
'/dashboard',
|
|
113
148
|
Record<never, never>,
|
|
114
149
|
Record<never, never>,
|
|
115
150
|
| never
|
|
116
151
|
>,
|
|
117
|
-
'/
|
|
118
|
-
'/
|
|
119
|
-
'/
|
|
152
|
+
'/index2': RouteRecordInfo<
|
|
153
|
+
'/index2',
|
|
154
|
+
'/index2',
|
|
120
155
|
Record<never, never>,
|
|
121
156
|
Record<never, never>,
|
|
122
157
|
| never
|
|
@@ -134,87 +169,117 @@ declare module 'vue-router/auto-routes' {
|
|
|
134
169
|
* @internal
|
|
135
170
|
*/
|
|
136
171
|
export interface _RouteFileInfoMap {
|
|
137
|
-
'
|
|
172
|
+
'../addonAdmin/views/index/index.vue': {
|
|
138
173
|
routes:
|
|
139
174
|
| '/addon/admin//'
|
|
140
175
|
views:
|
|
141
176
|
| never
|
|
142
177
|
}
|
|
143
|
-
'
|
|
178
|
+
'../addonAdmin/views/403_1/index.vue': {
|
|
144
179
|
routes:
|
|
145
180
|
| '/addon/admin/403_1/'
|
|
146
181
|
views:
|
|
147
182
|
| never
|
|
148
183
|
}
|
|
149
|
-
'
|
|
184
|
+
'../addonAdmin/views/config/index.vue': {
|
|
185
|
+
routes:
|
|
186
|
+
| '/addon/admin/config/'
|
|
187
|
+
views:
|
|
188
|
+
| never
|
|
189
|
+
}
|
|
190
|
+
'../addonAdmin/views/config/dict/index.vue': {
|
|
150
191
|
routes:
|
|
151
192
|
| '/addon/admin/config/dict/'
|
|
152
193
|
views:
|
|
153
194
|
| never
|
|
154
195
|
}
|
|
155
|
-
'
|
|
196
|
+
'../addonAdmin/views/config/dictType/index.vue': {
|
|
197
|
+
routes:
|
|
198
|
+
| '/addon/admin/config/dictType/'
|
|
199
|
+
views:
|
|
200
|
+
| never
|
|
201
|
+
}
|
|
202
|
+
'../addonAdmin/views/config/system/index.vue': {
|
|
156
203
|
routes:
|
|
157
204
|
| '/addon/admin/config/system/'
|
|
158
205
|
views:
|
|
159
206
|
| never
|
|
160
207
|
}
|
|
161
|
-
'
|
|
208
|
+
'../addonAdmin/views/log/index.vue': {
|
|
209
|
+
routes:
|
|
210
|
+
| '/addon/admin/log/'
|
|
211
|
+
views:
|
|
212
|
+
| never
|
|
213
|
+
}
|
|
214
|
+
'../addonAdmin/views/log/email/index.vue': {
|
|
162
215
|
routes:
|
|
163
216
|
| '/addon/admin/log/email/'
|
|
164
217
|
views:
|
|
165
218
|
| never
|
|
166
219
|
}
|
|
167
|
-
'
|
|
220
|
+
'../addonAdmin/views/log/login/index.vue': {
|
|
168
221
|
routes:
|
|
169
222
|
| '/addon/admin/log/login/'
|
|
170
223
|
views:
|
|
171
224
|
| never
|
|
172
225
|
}
|
|
173
|
-
'
|
|
226
|
+
'../addonAdmin/views/log/operate/index.vue': {
|
|
174
227
|
routes:
|
|
175
228
|
| '/addon/admin/log/operate/'
|
|
176
229
|
views:
|
|
177
230
|
| never
|
|
178
231
|
}
|
|
179
|
-
'
|
|
232
|
+
'../addonAdmin/views/login_1/index.vue': {
|
|
180
233
|
routes:
|
|
181
234
|
| '/addon/admin/login_1/'
|
|
182
235
|
views:
|
|
183
236
|
| never
|
|
184
237
|
}
|
|
185
|
-
'
|
|
238
|
+
'../addonAdmin/views/people/index.vue': {
|
|
239
|
+
routes:
|
|
240
|
+
| '/addon/admin/people/'
|
|
241
|
+
views:
|
|
242
|
+
| never
|
|
243
|
+
}
|
|
244
|
+
'../addonAdmin/views/people/admin/index.vue': {
|
|
186
245
|
routes:
|
|
187
246
|
| '/addon/admin/people/admin/'
|
|
188
247
|
views:
|
|
189
248
|
| never
|
|
190
249
|
}
|
|
191
|
-
'
|
|
250
|
+
'../addonAdmin/views/permission/index.vue': {
|
|
251
|
+
routes:
|
|
252
|
+
| '/addon/admin/permission/'
|
|
253
|
+
views:
|
|
254
|
+
| never
|
|
255
|
+
}
|
|
256
|
+
'../addonAdmin/views/permission/api/index.vue': {
|
|
192
257
|
routes:
|
|
193
258
|
| '/addon/admin/permission/api/'
|
|
194
259
|
views:
|
|
195
260
|
| never
|
|
196
261
|
}
|
|
197
|
-
'
|
|
262
|
+
'../addonAdmin/views/permission/menu/index.vue': {
|
|
198
263
|
routes:
|
|
199
264
|
| '/addon/admin/permission/menu/'
|
|
200
265
|
views:
|
|
201
266
|
| never
|
|
202
267
|
}
|
|
203
|
-
'
|
|
268
|
+
'../addonAdmin/views/permission/role/index.vue': {
|
|
204
269
|
routes:
|
|
205
270
|
| '/addon/admin/permission/role/'
|
|
206
271
|
views:
|
|
207
272
|
| never
|
|
208
273
|
}
|
|
209
|
-
'src/views/
|
|
274
|
+
'src/views/dashboard/index.vue': {
|
|
210
275
|
routes:
|
|
211
|
-
| '/
|
|
276
|
+
| '/dashboard/'
|
|
212
277
|
views:
|
|
213
278
|
| never
|
|
214
279
|
}
|
|
215
|
-
'src/views/
|
|
280
|
+
'src/views/index2.vue': {
|
|
216
281
|
routes:
|
|
217
|
-
| '/
|
|
282
|
+
| '/index2'
|
|
218
283
|
views:
|
|
219
284
|
| never
|
|
220
285
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dashboard">
|
|
3
|
+
<div class="header">
|
|
4
|
+
<div class="title">工作台</div>
|
|
5
|
+
<div class="desc">这里是业务首页(admin 自有页面),系统管理功能仍在 /addon/admin/*。</div>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="cards">
|
|
9
|
+
<TCard class="card" title="今日概览" :bordered="false">
|
|
10
|
+
<div class="kv">
|
|
11
|
+
<div class="item">
|
|
12
|
+
<div class="k">新增用户</div>
|
|
13
|
+
<div class="v">—</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="item">
|
|
16
|
+
<div class="k">新增订单</div>
|
|
17
|
+
<div class="v">—</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="item">
|
|
20
|
+
<div class="k">待处理事项</div>
|
|
21
|
+
<div class="v">—</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</TCard>
|
|
25
|
+
|
|
26
|
+
<TCard class="card" title="快捷入口" :bordered="false">
|
|
27
|
+
<div class="quick">
|
|
28
|
+
<TButton theme="primary" variant="base" @click="$Method.goSystem">进入系统管理</TButton>
|
|
29
|
+
<TButton theme="default" variant="outline" @click="$Method.refresh">刷新</TButton>
|
|
30
|
+
</div>
|
|
31
|
+
</TCard>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup>
|
|
37
|
+
import { Button as TButton, Card as TCard } from "tdesign-vue-next";
|
|
38
|
+
|
|
39
|
+
definePage({
|
|
40
|
+
meta: {
|
|
41
|
+
title: "工作台",
|
|
42
|
+
layout: "default"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const router = useRouter();
|
|
47
|
+
|
|
48
|
+
const $Method = {
|
|
49
|
+
goSystem() {
|
|
50
|
+
router.push("/addon/admin");
|
|
51
|
+
},
|
|
52
|
+
refresh() {
|
|
53
|
+
window.location.reload();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped lang="scss">
|
|
59
|
+
.dashboard {
|
|
60
|
+
padding: 16px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.header {
|
|
64
|
+
padding: 12px 0;
|
|
65
|
+
|
|
66
|
+
.title {
|
|
67
|
+
font-size: 18px;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
color: var(--text-primary);
|
|
70
|
+
margin-bottom: 6px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.desc {
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
color: var(--text-secondary);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.cards {
|
|
80
|
+
display: grid;
|
|
81
|
+
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
|
82
|
+
gap: 12px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.card {
|
|
86
|
+
border-radius: var(--border-radius-large);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.kv {
|
|
90
|
+
display: grid;
|
|
91
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
92
|
+
gap: 12px;
|
|
93
|
+
|
|
94
|
+
.item {
|
|
95
|
+
padding: 10px 12px;
|
|
96
|
+
border-radius: var(--border-radius);
|
|
97
|
+
background: var(--bg-color-page);
|
|
98
|
+
|
|
99
|
+
.k {
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
color: var(--text-secondary);
|
|
102
|
+
margin-bottom: 8px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.v {
|
|
106
|
+
font-size: 18px;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
color: var(--text-primary);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.quick {
|
|
114
|
+
display: flex;
|
|
115
|
+
gap: 10px;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
package/src/views/index2.vue
CHANGED
|
@@ -142,18 +142,21 @@
|
|
|
142
142
|
</div>
|
|
143
143
|
</template>
|
|
144
144
|
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
<script setup>
|
|
146
|
+
definePage({
|
|
147
|
+
meta: {
|
|
148
|
+
title: "数据面板",
|
|
149
|
+
layout: "default"
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
</script>
|
|
150
153
|
|
|
151
154
|
<style lang="scss" scoped>
|
|
152
155
|
.dashboard {
|
|
153
156
|
padding: 20px;
|
|
154
157
|
min-height: 100vh;
|
|
155
158
|
background-color: #f5f7fa;
|
|
156
|
-
font-family:
|
|
159
|
+
font-family: "Arial", sans-serif;
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
h1 {
|
package/vite.config.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
import { createBeflyViteConfig } from "befly-vite";
|
|
4
|
+
import { scanViews } from "befly-vite/utils/scanViews";
|
|
4
5
|
|
|
5
6
|
export default createBeflyViteConfig({
|
|
6
|
-
root: fileURLToPath(new URL(
|
|
7
|
+
root: fileURLToPath(new URL(".", import.meta.url)),
|
|
7
8
|
scanViews: scanViews,
|
|
8
9
|
optimizeDeps: {
|
|
9
|
-
include: [
|
|
10
|
+
include: []
|
|
10
11
|
}
|
|
11
12
|
});
|
package/src/config/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 内部配置
|
|
3
|
-
* 存放框架内置的配置变量,不建议修改
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 内置配置对象
|
|
8
|
-
*/
|
|
9
|
-
export const $Config = {
|
|
10
|
-
/** 应用标题 */
|
|
11
|
-
appTitle: import.meta.env.VITE_APP_TITLE || '野蜂飞舞',
|
|
12
|
-
/** API 基础地址 */
|
|
13
|
-
apiBaseUrl: import.meta.env.VITE_API_BASE_URL || '',
|
|
14
|
-
/** 存储命名空间 */
|
|
15
|
-
storageNamespace: import.meta.env.VITE_STORAGE_NAMESPACE || 'befly_admin',
|
|
16
|
-
/** 是否开发环境 */
|
|
17
|
-
isDev: import.meta.env.DEV,
|
|
18
|
-
/** 是否生产环境 */
|
|
19
|
-
isProd: import.meta.env.PROD
|
|
20
|
-
};
|