@befly-addon/admin 1.0.24 → 1.0.26
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/apis/admin/roleSave.ts +1 -2
- package/package.json +2 -2
- package/util.ts +23 -17
- 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/apis/admin/roleSave.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { Yes, No } from 'befly';
|
|
|
7
7
|
export default {
|
|
8
8
|
name: '管理员角色保存',
|
|
9
9
|
fields: {
|
|
10
|
-
adminId: Fields._id,
|
|
11
10
|
roleCode: {
|
|
12
11
|
name: '角色编码',
|
|
13
12
|
type: 'string',
|
|
@@ -33,7 +32,7 @@ export default {
|
|
|
33
32
|
// 更新管理员的角色ID、角色编码和角色类型
|
|
34
33
|
await befly.db.updData({
|
|
35
34
|
table: 'addon_admin_admin',
|
|
36
|
-
where: { id: ctx.body.
|
|
35
|
+
where: { id: ctx.body.id },
|
|
37
36
|
data: {
|
|
38
37
|
roleId: role.id,
|
|
39
38
|
roleCode: role.code,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Befly - 管理后台功能组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -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": "ca96814c3b67376809086cd8bef8e7816b736483",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"befly": "3.8.12"
|
|
45
45
|
}
|
package/util.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import type { RouteRecordRaw } from 'vue-router';
|
|
1
|
+
import type { RouteRecordRaw, Component } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 布局配置接口
|
|
5
|
+
*/
|
|
6
|
+
export interface LayoutConfig {
|
|
7
|
+
path: string;
|
|
8
|
+
layoutName: string;
|
|
9
|
+
component: Component;
|
|
10
|
+
children?: LayoutConfig[];
|
|
11
|
+
meta?: Record<string, any>;
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
/**
|
|
4
15
|
* 自定义布局处理函数
|
|
5
16
|
* 根据文件名后缀判断使用哪个布局
|
|
6
17
|
* @param routes - 原始路由配置
|
|
7
18
|
* @param inheritLayout - 继承的布局名称(来自父级目录)
|
|
8
|
-
* @returns
|
|
19
|
+
* @returns 处理后的布局配置(不包含实际的布局组件导入)
|
|
9
20
|
*/
|
|
10
|
-
export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''):
|
|
11
|
-
const result:
|
|
21
|
+
export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): LayoutConfig[] {
|
|
22
|
+
const result: LayoutConfig[] = [];
|
|
12
23
|
|
|
13
24
|
for (const route of routes) {
|
|
14
25
|
const currentPath = route.path || '';
|
|
@@ -23,9 +34,11 @@ export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): RouteReco
|
|
|
23
34
|
const cleanPath = pathMatch ? currentPath.replace(/_\d+$/, '') : currentPath;
|
|
24
35
|
|
|
25
36
|
result.push({
|
|
26
|
-
...route,
|
|
27
37
|
path: cleanPath,
|
|
28
|
-
|
|
38
|
+
layoutName: currentLayout || 'default',
|
|
39
|
+
component: route.component!,
|
|
40
|
+
children: Layouts(route.children, currentLayout),
|
|
41
|
+
meta: route.meta
|
|
29
42
|
});
|
|
30
43
|
continue;
|
|
31
44
|
}
|
|
@@ -51,19 +64,12 @@ export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): RouteReco
|
|
|
51
64
|
cleanPath = lastPart;
|
|
52
65
|
}
|
|
53
66
|
|
|
54
|
-
//
|
|
55
|
-
const layoutComponent = layoutName === 'default' ? () => import('@/layouts/default.vue') : () => import(`@/layouts/${layoutName}.vue`);
|
|
56
|
-
|
|
57
|
-
// 包裹布局
|
|
67
|
+
// 返回布局配置(不执行实际导入)
|
|
58
68
|
result.push({
|
|
59
69
|
path: cleanPath,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
...route,
|
|
64
|
-
path: ''
|
|
65
|
-
}
|
|
66
|
-
]
|
|
70
|
+
layoutName: layoutName,
|
|
71
|
+
component: route.component!,
|
|
72
|
+
meta: route.meta
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
75
|
|
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