befly-admin 3.4.30 → 3.4.31
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/bunfig.toml +0 -2
- package/package.json +4 -3
- package/src/layouts/default.vue +35 -38
- package/src/types/auto-imports.d.ts +1 -0
- package/src/types/components.d.ts +4 -0
- package/vite.config.js +5 -29
package/bunfig.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-admin",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.31",
|
|
4
4
|
"description": "Befly Admin - 基于 Vue3 + OpenTiny Vue 的后台管理系统",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"sync:admin": "bunx befly sync:admin"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@befly-addon/admin": "1.0.33",
|
|
32
33
|
"axios": "^1.13.2",
|
|
33
34
|
"pinia": "^3.0.4",
|
|
35
|
+
"tdesign-vue-next": "^1.10.6",
|
|
34
36
|
"vue": "^3.5.22",
|
|
35
37
|
"vue-router": "^4.6.3"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
|
-
"@befly-addon/admin": "1.0.32",
|
|
39
40
|
"@iconify-json/lucide": "^1.2.72",
|
|
40
41
|
"@unocss/preset-attributify": "^66.5.6",
|
|
41
42
|
"@unocss/preset-uno": "^66.5.6",
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"node": ">=24.0.0",
|
|
57
58
|
"pnpm": ">=10.0.0"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "e4130ff7b23ea4f0913969220c6374d550d2acc5"
|
|
60
61
|
}
|
package/src/layouts/default.vue
CHANGED
|
@@ -9,26 +9,43 @@
|
|
|
9
9
|
<div class="user-info-bar">
|
|
10
10
|
<div class="user-text">
|
|
11
11
|
<span class="user-name">{{ $Data.userInfo.nickname || '管理员' }}</span>
|
|
12
|
-
<
|
|
12
|
+
<t-tag theme="primary" size="small" variant="light">{{ $Data.userInfo.role || '超级管理员' }}</t-tag>
|
|
13
13
|
</div>
|
|
14
|
-
<
|
|
14
|
+
<t-button variant="text" size="medium" @click="$Method.handleLogout">
|
|
15
|
+
<template #icon>
|
|
16
|
+
<i-lucide:x />
|
|
17
|
+
</template>
|
|
18
|
+
</t-button>
|
|
15
19
|
</div>
|
|
16
20
|
</div>
|
|
17
21
|
</div>
|
|
18
22
|
|
|
19
23
|
<!-- 菜单栏 -->
|
|
20
24
|
<div class="layout-menu">
|
|
21
|
-
<
|
|
22
|
-
<template
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
<t-menu :value="$Data.currentMenuKey" :expanded="$Data.expandedKeys" style="height: 100%" @change="$Method.onMenuClick" @expand="(value) => ($Data.expandedKeys = value)">
|
|
26
|
+
<template v-for="menu in $Data.userMenus" :key="menu.id">
|
|
27
|
+
<!-- 无子菜单 -->
|
|
28
|
+
<t-menu-item v-if="!menu.children || menu.children.length === 0" :value="menu.path">
|
|
29
|
+
<template #icon>
|
|
30
|
+
<i-lucide:home v-if="menu.path === '/addon/admin/'" />
|
|
31
|
+
<i-lucide:file-text v-else />
|
|
32
|
+
</template>
|
|
33
|
+
{{ menu.name }}
|
|
34
|
+
</t-menu-item>
|
|
35
|
+
<!-- 有子菜单 -->
|
|
36
|
+
<t-submenu v-else :value="String(menu.id)" :title="menu.name">
|
|
37
|
+
<template #icon>
|
|
38
|
+
<i-lucide:folder />
|
|
39
|
+
</template>
|
|
40
|
+
<t-menu-item v-for="child in menu.children" :key="child.id" :value="child.path">
|
|
41
|
+
<template #icon>
|
|
42
|
+
<i-lucide:file-text />
|
|
43
|
+
</template>
|
|
44
|
+
{{ child.name }}
|
|
45
|
+
</t-menu-item>
|
|
46
|
+
</t-submenu>
|
|
30
47
|
</template>
|
|
31
|
-
</
|
|
48
|
+
</t-menu>
|
|
32
49
|
</div>
|
|
33
50
|
|
|
34
51
|
<!-- 内容区域 -->
|
|
@@ -40,7 +57,6 @@
|
|
|
40
57
|
|
|
41
58
|
<script setup>
|
|
42
59
|
import { arrayToTree } from '@/utils';
|
|
43
|
-
import { iconClose } from '@opentiny/vue-icon';
|
|
44
60
|
|
|
45
61
|
const router = useRouter();
|
|
46
62
|
const route = useRoute();
|
|
@@ -55,7 +71,7 @@ const $Data = $ref({
|
|
|
55
71
|
userMenus: [],
|
|
56
72
|
userMenusFlat: [], // 一维菜单数据
|
|
57
73
|
expandedKeys: [],
|
|
58
|
-
|
|
74
|
+
currentMenuKey: '',
|
|
59
75
|
userInfo: {
|
|
60
76
|
nickname: '管理员',
|
|
61
77
|
role: '超级管理员'
|
|
@@ -96,7 +112,7 @@ const $Method = {
|
|
|
96
112
|
while (menu.pid) {
|
|
97
113
|
const parent = $Data.userMenusFlat.find((m) => m.id === menu.pid);
|
|
98
114
|
if (parent) {
|
|
99
|
-
expandedKeys.unshift(parent.id);
|
|
115
|
+
expandedKeys.unshift(String(parent.id));
|
|
100
116
|
menu = parent;
|
|
101
117
|
} else {
|
|
102
118
|
break;
|
|
@@ -106,17 +122,14 @@ const $Method = {
|
|
|
106
122
|
// 使用 nextTick 确保 DOM 更新后再设置高亮
|
|
107
123
|
nextTick(() => {
|
|
108
124
|
$Data.expandedKeys = expandedKeys;
|
|
109
|
-
|
|
110
|
-
if ($From.treeMenuRef) {
|
|
111
|
-
$From.treeMenuRef.setCurrentKey(currentMenu.id);
|
|
112
|
-
}
|
|
125
|
+
$Data.currentMenuKey = currentPath;
|
|
113
126
|
});
|
|
114
127
|
},
|
|
115
128
|
|
|
116
129
|
// 处理菜单点击
|
|
117
|
-
onMenuClick(
|
|
118
|
-
if (
|
|
119
|
-
router.push(
|
|
130
|
+
onMenuClick(path) {
|
|
131
|
+
if (path) {
|
|
132
|
+
router.push(path);
|
|
120
133
|
}
|
|
121
134
|
},
|
|
122
135
|
|
|
@@ -223,22 +236,6 @@ $Method.fetchUserMenus();
|
|
|
223
236
|
padding: 16px 12px;
|
|
224
237
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
225
238
|
border: 1px solid #e8eaed;
|
|
226
|
-
|
|
227
|
-
.tiny-tree-menu:before {
|
|
228
|
-
display: none;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.menu-item {
|
|
232
|
-
display: flex;
|
|
233
|
-
align-items: center;
|
|
234
|
-
width: 100%;
|
|
235
|
-
padding: 2px 0;
|
|
236
|
-
transition: all 0.2s ease;
|
|
237
|
-
|
|
238
|
-
&:hover {
|
|
239
|
-
color: #0052d9;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
239
|
}
|
|
243
240
|
|
|
244
241
|
.layout-main {
|
|
@@ -103,6 +103,7 @@ declare module 'vue' {
|
|
|
103
103
|
readonly $Config: UnwrapRef<typeof import('../config/index.js')['$Config']>
|
|
104
104
|
readonly $Http: UnwrapRef<typeof import('../plugins/http.js')['$Http']>
|
|
105
105
|
readonly $Storage: UnwrapRef<typeof import('../plugins/storage.js')['$Storage']>
|
|
106
|
+
readonly DialogPlugin: UnwrapRef<typeof import('tdesign-vue-next')['DialogPlugin']>
|
|
106
107
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
107
108
|
readonly MessagePlugin: UnwrapRef<typeof import('tdesign-vue-next')['MessagePlugin']>
|
|
108
109
|
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
|
|
@@ -14,6 +14,7 @@ declare module 'vue' {
|
|
|
14
14
|
'ILucide:fileText': typeof import('~icons/lucide/file-text')['default']
|
|
15
15
|
'ILucide:folder': typeof import('~icons/lucide/folder')['default']
|
|
16
16
|
'ILucide:home': typeof import('~icons/lucide/home')['default']
|
|
17
|
+
'ILucide:x': typeof import('~icons/lucide/x')['default']
|
|
17
18
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
18
19
|
RouterView: typeof import('vue-router')['RouterView']
|
|
19
20
|
TButton: typeof import('tdesign-vue-next')['Button']
|
|
@@ -27,11 +28,14 @@ declare module 'vue' {
|
|
|
27
28
|
TInput: typeof import('tdesign-vue-next')['Input']
|
|
28
29
|
TInputNumber: typeof import('tdesign-vue-next')['InputNumber']
|
|
29
30
|
TLink: typeof import('tdesign-vue-next')['Link']
|
|
31
|
+
TMenu: typeof import('tdesign-vue-next')['Menu']
|
|
32
|
+
TMenuItem: typeof import('tdesign-vue-next')['MenuItem']
|
|
30
33
|
TPagination: typeof import('tdesign-vue-next')['Pagination']
|
|
31
34
|
TRadio: typeof import('tdesign-vue-next')['Radio']
|
|
32
35
|
TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup']
|
|
33
36
|
TSelect: typeof import('tdesign-vue-next')['Select']
|
|
34
37
|
TSpace: typeof import('tdesign-vue-next')['Space']
|
|
38
|
+
TSubmenu: typeof import('tdesign-vue-next')['Submenu']
|
|
35
39
|
TTable: typeof import('tdesign-vue-next')['Table']
|
|
36
40
|
TTag: typeof import('tdesign-vue-next')['Tag']
|
|
37
41
|
TTree: typeof import('tdesign-vue-next')['Tree']
|
package/vite.config.js
CHANGED
|
@@ -122,33 +122,9 @@ export default defineConfig({
|
|
|
122
122
|
return 'framework-pinia';
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
//
|
|
126
|
-
if (id.includes('
|
|
127
|
-
return '
|
|
128
|
-
}
|
|
129
|
-
if (id.includes('@opentiny/vue-renderless/src/table')) {
|
|
130
|
-
return 'tiny-table';
|
|
131
|
-
}
|
|
132
|
-
if (id.includes('@opentiny/vue-renderless/src/tree')) {
|
|
133
|
-
return 'tiny-tree';
|
|
134
|
-
}
|
|
135
|
-
if (id.includes('@opentiny/vue-renderless/src/form')) {
|
|
136
|
-
return 'tiny-form';
|
|
137
|
-
}
|
|
138
|
-
if (id.includes('node_modules/@opentiny/vue-renderless/')) {
|
|
139
|
-
return 'tiny-renderless';
|
|
140
|
-
}
|
|
141
|
-
if (id.includes('node_modules/@opentiny/vue-theme/')) {
|
|
142
|
-
return 'tiny-theme';
|
|
143
|
-
}
|
|
144
|
-
if (id.includes('node_modules/@opentiny/vue-locale/')) {
|
|
145
|
-
return 'tiny-locale';
|
|
146
|
-
}
|
|
147
|
-
if (id.includes('node_modules/@opentiny/vue-common/')) {
|
|
148
|
-
return 'tiny-common';
|
|
149
|
-
}
|
|
150
|
-
if (id.includes('node_modules/@opentiny/vue-icon/')) {
|
|
151
|
-
return 'tiny-icon';
|
|
125
|
+
// TDesign Vue Next
|
|
126
|
+
if (id.includes('node_modules/tdesign-vue-next/') || id.includes('node_modules/.bun/tdesign-vue-next')) {
|
|
127
|
+
return 'tdesign';
|
|
152
128
|
}
|
|
153
129
|
|
|
154
130
|
// 工具库(独立文件)
|
|
@@ -161,7 +137,7 @@ export default defineConfig({
|
|
|
161
137
|
return 'lib-lodash';
|
|
162
138
|
}
|
|
163
139
|
|
|
164
|
-
// echarts
|
|
140
|
+
// echarts 及相关库
|
|
165
141
|
if (id.includes('node_modules/echarts/') || id.includes('node_modules/.bun/echarts')) {
|
|
166
142
|
return 'lib-echarts';
|
|
167
143
|
}
|
|
@@ -180,7 +156,7 @@ export default defineConfig({
|
|
|
180
156
|
}
|
|
181
157
|
|
|
182
158
|
// befly-addon
|
|
183
|
-
if (id.includes('@befly-addon/')) {
|
|
159
|
+
if (id.includes('@befly-addon/') || id.includes('packages/addonAdmin/') || id.includes('packages\\addonAdmin\\')) {
|
|
184
160
|
return 'befly-addon';
|
|
185
161
|
}
|
|
186
162
|
|