@befly-addon/admin 1.0.25 → 1.0.27
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/package.json +3 -3
- package/views/403/index.vue +0 -1
- package/views/admin/components/edit.vue +1 -2
- package/views/admin/components/role.vue +1 -2
- package/views/admin/index.vue +1 -0
- package/views/dict/components/edit.vue +2 -2
- package/views/dict/index.vue +1 -2
- package/views/index/components/addonList.vue +1 -0
- package/views/index/components/environmentInfo.vue +1 -0
- package/views/index/components/operationLogs.vue +1 -0
- package/views/index/components/performanceMetrics.vue +1 -0
- package/views/index/components/serviceStatus.vue +1 -0
- package/views/index/components/systemNotifications.vue +1 -0
- package/views/index/components/systemOverview.vue +1 -0
- package/views/index/components/systemResources.vue +1 -0
- package/views/index/components/userInfo.vue +1 -0
- package/views/login/components/emailLoginForm.vue +1 -1
- package/views/login/components/registerForm.vue +1 -1
- package/views/login/index_1.vue +1 -0
- package/views/menu/components/edit.vue +2 -1
- package/views/menu/index.vue +1 -0
- package/views/role/components/api.vue +1 -0
- package/views/role/components/edit.vue +1 -1
- package/views/role/components/menu.vue +2 -1
- package/views/role/index.vue +1 -0
- package/views/user/index.vue +1 -0
- package/util.ts +0 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Befly - 管理后台功能组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"apis/",
|
|
19
19
|
"tables/",
|
|
20
20
|
"views/",
|
|
21
|
+
"util",
|
|
21
22
|
"addon.config.json",
|
|
22
|
-
"util.ts",
|
|
23
23
|
"README.md",
|
|
24
24
|
"package.json",
|
|
25
25
|
"menu.json"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"url": "https://github.com/chenbimo/befly.git",
|
|
40
40
|
"directory": "packages/addon-admin"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "ccd0726d53a6902503bbfa58164f0644f28b8d5b",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"befly": "3.8.12"
|
|
45
45
|
}
|
package/views/403/index.vue
CHANGED
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import { shallowRef } from 'vue';
|
|
37
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
38
38
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
|
|
39
|
-
import { Modal } from '@opentiny/vue';
|
|
40
39
|
import { $Http } from '@/plugins/http';
|
|
41
40
|
|
|
42
41
|
const $Prop = defineProps({
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script setup>
|
|
19
|
-
import {
|
|
19
|
+
import { $ref } from 'vue-macros/macros';
|
|
20
20
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Select as TinySelect, Tag as TinyTag, Modal } from '@opentiny/vue';
|
|
21
|
-
import { Modal } from '@opentiny/vue';
|
|
22
21
|
import { $Http } from '@/plugins/http';
|
|
23
22
|
|
|
24
23
|
const $Prop = defineProps({
|
package/views/admin/index.vue
CHANGED
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
</template>
|
|
79
79
|
|
|
80
80
|
<script setup>
|
|
81
|
+
import { $ref } from 'vue-macros/macros';
|
|
81
82
|
import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
|
|
82
83
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
83
84
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import {
|
|
37
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
38
|
+
import { watch } from 'vue';
|
|
38
39
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
|
|
39
|
-
import { Modal } from '@opentiny/vue';
|
|
40
40
|
import { $Http } from '@/plugins/http';
|
|
41
41
|
|
|
42
42
|
const $Prop = defineProps({
|
package/views/dict/index.vue
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
67
|
<script setup>
|
|
68
|
+
import { $ref } from 'vue-macros/macros';
|
|
68
69
|
import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
|
|
69
70
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
70
71
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
@@ -74,8 +75,6 @@ import IconLucideTrash2 from '~icons/lucide/trash-2';
|
|
|
74
75
|
import EditDialog from './components/edit.vue';
|
|
75
76
|
import { $Http } from '@/plugins/http';
|
|
76
77
|
|
|
77
|
-
import EditDialog from './components/edit.vue';
|
|
78
|
-
|
|
79
78
|
// 响应式数据
|
|
80
79
|
const $Data = $ref({
|
|
81
80
|
dictList: [],
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup>
|
|
56
|
+
import { $ref } from 'vue-macros/macros';
|
|
56
57
|
import IconLucideActivity from '~icons/lucide/activity';
|
|
57
58
|
import IconLucideTrendingUp from '~icons/lucide/trending-up';
|
|
58
59
|
import IconLucideAlertCircle from '~icons/lucide/alert-circle';
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
+
import { $ref } from 'vue-macros/macros';
|
|
29
30
|
import IconLucideBell from '~icons/lucide/bell';
|
|
30
31
|
import IconLucideCheckCircle from '~icons/lucide/check-circle';
|
|
31
32
|
import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
|
-
import { shallowRef } from 'vue';
|
|
28
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
29
29
|
import { useRouter, useRoute } from 'vue-router';
|
|
30
30
|
import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Modal } from '@opentiny/vue';
|
|
31
31
|
import IconLucideUser from '~icons/lucide/user';
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script setup>
|
|
40
|
-
import { shallowRef } from 'vue';
|
|
40
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
41
41
|
import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput } from '@opentiny/vue';
|
|
42
42
|
import IconLucideUser from '~icons/lucide/user';
|
|
43
43
|
import IconLucideMail from '~icons/lucide/mail';
|
package/views/login/index_1.vue
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
+
import { $ref } from 'vue-macros/macros';
|
|
29
30
|
import WelcomePanel from './components/welcomePanel.vue';
|
|
30
31
|
import EmailLoginForm from './components/emailLoginForm.vue';
|
|
31
32
|
import RegisterForm from './components/registerForm.vue';
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script setup>
|
|
31
|
-
import {
|
|
31
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
32
|
+
import { watch } from 'vue';
|
|
32
33
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
|
|
33
34
|
import { $Http } from '@/plugins/http';
|
|
34
35
|
|
package/views/menu/index.vue
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
70
|
<script setup>
|
|
71
|
+
import { $ref } from 'vue-macros/macros';
|
|
71
72
|
import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
|
|
72
73
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
73
74
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script setup>
|
|
36
|
+
import { $ref } from 'vue-macros/macros';
|
|
36
37
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Search as TinySearch, Checkbox as TinyCheckbox, CheckboxGroup as TinyCheckboxGroup, Modal } from '@opentiny/vue';
|
|
37
38
|
import { $Http } from '@/plugins/http';
|
|
38
39
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script setup>
|
|
33
|
-
import { shallowRef } from 'vue';
|
|
33
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
34
34
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
|
|
35
35
|
import { $Http } from '@/plugins/http';
|
|
36
36
|
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script setup>
|
|
14
|
-
import {
|
|
14
|
+
import { $ref, $shallowRef } from 'vue-macros/macros';
|
|
15
|
+
import { nextTick } from 'vue';
|
|
15
16
|
import { Button as TinyButton, DialogBox as TinyDialogBox, Tree as TinyTree, Modal } from '@opentiny/vue';
|
|
16
17
|
|
|
17
18
|
import { arrayToTree } from '@/utils';
|
package/views/role/index.vue
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
</template>
|
|
78
78
|
|
|
79
79
|
<script setup>
|
|
80
|
+
import { $ref } from 'vue-macros/macros';
|
|
80
81
|
import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
|
|
81
82
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
82
83
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
package/views/user/index.vue
CHANGED
package/util.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 自定义布局处理函数
|
|
5
|
-
* 根据文件名后缀判断使用哪个布局
|
|
6
|
-
* @param routes - 原始路由配置
|
|
7
|
-
* @param inheritLayout - 继承的布局名称(来自父级目录)
|
|
8
|
-
* @returns 处理后的路由配置
|
|
9
|
-
*/
|
|
10
|
-
export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): RouteRecordRaw[] {
|
|
11
|
-
const result: RouteRecordRaw[] = [];
|
|
12
|
-
|
|
13
|
-
for (const route of routes) {
|
|
14
|
-
const currentPath = route.path || '';
|
|
15
|
-
|
|
16
|
-
// 检查当前路径是否有 _数字 格式
|
|
17
|
-
const pathMatch = currentPath.match(/_(\d+)$/);
|
|
18
|
-
const currentLayout = pathMatch ? pathMatch[1] : inheritLayout;
|
|
19
|
-
|
|
20
|
-
// 如果有子路由,递归处理(传递当前布局给子级)
|
|
21
|
-
if (route.children && route.children.length > 0) {
|
|
22
|
-
// 清理路径:如果是 xxx_数字 格式,去掉 _数字
|
|
23
|
-
const cleanPath = pathMatch ? currentPath.replace(/_\d+$/, '') : currentPath;
|
|
24
|
-
|
|
25
|
-
result.push({
|
|
26
|
-
...route,
|
|
27
|
-
path: cleanPath,
|
|
28
|
-
children: Layouts(route.children, currentLayout)
|
|
29
|
-
});
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// 没有子路由的叶子节点,需要包裹布局
|
|
34
|
-
const lastPart = currentPath;
|
|
35
|
-
|
|
36
|
-
// 匹配 _数字 格式(如 index_1, news_2)
|
|
37
|
-
const match = lastPart.match(/_(\d+)$/);
|
|
38
|
-
// 优先使用文件自己的布局,其次使用继承的布局,最后使用 default
|
|
39
|
-
const layoutName = match ? match[1] : currentLayout || 'default';
|
|
40
|
-
|
|
41
|
-
// 计算清理后的路径
|
|
42
|
-
let cleanPath: string;
|
|
43
|
-
if (lastPart === 'index' || (lastPart.startsWith('index_') && match)) {
|
|
44
|
-
// index 或 index_数字 → 改为空路径(由父级路径表示)
|
|
45
|
-
cleanPath = '';
|
|
46
|
-
} else if (match) {
|
|
47
|
-
// xxx_数字 → 去掉 _数字 后缀
|
|
48
|
-
cleanPath = lastPart.replace(/_\d+$/, '');
|
|
49
|
-
} else {
|
|
50
|
-
// 其他 → 保持原样
|
|
51
|
-
cleanPath = lastPart;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// 根据布局名称加载对应组件
|
|
55
|
-
const layoutComponent = layoutName === 'default' ? () => import('@/layouts/default.vue') : () => import(`@/layouts/${layoutName}.vue`);
|
|
56
|
-
|
|
57
|
-
// 包裹布局
|
|
58
|
-
result.push({
|
|
59
|
-
path: cleanPath,
|
|
60
|
-
component: layoutComponent,
|
|
61
|
-
children: [
|
|
62
|
-
{
|
|
63
|
-
...route,
|
|
64
|
-
path: ''
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return result;
|
|
71
|
-
}
|