@befly-addon/admin 1.0.11 → 1.0.12
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/menu/all.ts +1 -1
- package/apis/menu/list.ts +1 -1
- package/apis/menu/upd.ts +1 -2
- package/package.json +3 -3
- package/tables/menu.json +0 -13
- package/views/menu/components/edit.vue +5 -14
- package/views/menu/index.vue +0 -6
package/apis/menu/all.ts
CHANGED
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
if (allMenus.length === 0) {
|
|
41
41
|
allMenus = await befly.db.getAll({
|
|
42
42
|
table: 'addon_admin_menu',
|
|
43
|
-
fields: ['id', 'pid', 'name', 'path', 'icon', '
|
|
43
|
+
fields: ['id', 'pid', 'name', 'path', 'icon', 'sort'],
|
|
44
44
|
orderBy: ['sort#ASC', 'id#ASC']
|
|
45
45
|
});
|
|
46
46
|
}
|
package/apis/menu/list.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
try {
|
|
6
6
|
const menus = await befly.db.getAll({
|
|
7
7
|
table: 'addon_admin_menu',
|
|
8
|
-
fields: ['id', 'name', 'path', 'icon', 'sort', 'pid', '
|
|
8
|
+
fields: ['id', 'name', 'path', 'icon', 'sort', 'pid', 'state', 'created_at', 'updated_at'],
|
|
9
9
|
orderBy: [
|
|
10
10
|
{ field: 'sort', direction: 'ASC' },
|
|
11
11
|
{ field: 'id', direction: 'ASC' }
|
package/apis/menu/upd.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Befly - 管理后台功能组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"url": "https://github.com/chenbimo/befly.git",
|
|
39
39
|
"directory": "packages/addon-admin"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "40b4c3e6591454ff060416a6275142792e7de66c",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"befly": "3.8.
|
|
43
|
+
"befly": "3.8.4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@module-federation/vite": "^1.9.0",
|
package/tables/menu.json
CHANGED
|
@@ -63,18 +63,5 @@
|
|
|
63
63
|
"nullable": false,
|
|
64
64
|
"unsigned": true,
|
|
65
65
|
"regexp": null
|
|
66
|
-
},
|
|
67
|
-
"type": {
|
|
68
|
-
"name": "菜单类型",
|
|
69
|
-
"detail": "",
|
|
70
|
-
"type": "number",
|
|
71
|
-
"min": 1,
|
|
72
|
-
"max": 2,
|
|
73
|
-
"default": 1,
|
|
74
|
-
"index": true,
|
|
75
|
-
"unique": false,
|
|
76
|
-
"nullable": false,
|
|
77
|
-
"unsigned": true,
|
|
78
|
-
"regexp": "^(1|2)$"
|
|
79
66
|
}
|
|
80
67
|
}
|
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
<tiny-form-item label="图标" prop="icon">
|
|
11
11
|
<tiny-input v-model="$Data.formData.icon" placeholder="请输入图标名称,如:User" />
|
|
12
12
|
</tiny-form-item>
|
|
13
|
-
<tiny-form-item label="菜单类型" prop="type">
|
|
14
|
-
<tiny-radio-group v-model="$Data.formData.type">
|
|
15
|
-
<tiny-radio :label="0">目录</tiny-radio>
|
|
16
|
-
<tiny-radio :label="1">菜单</tiny-radio>
|
|
17
|
-
</tiny-radio-group>
|
|
18
|
-
</tiny-form-item>
|
|
19
13
|
<tiny-form-item label="排序" prop="sort">
|
|
20
14
|
<tiny-numeric v-model="$Data.formData.sort" :min="0" :max="9999" />
|
|
21
15
|
</tiny-form-item>
|
|
@@ -66,8 +60,8 @@ const $Data = $ref({
|
|
|
66
60
|
name: '',
|
|
67
61
|
path: '',
|
|
68
62
|
icon: '',
|
|
69
|
-
type: 1,
|
|
70
63
|
sort: 0,
|
|
64
|
+
pid: 0,
|
|
71
65
|
state: 1
|
|
72
66
|
}
|
|
73
67
|
});
|
|
@@ -75,8 +69,7 @@ const $Data = $ref({
|
|
|
75
69
|
const $Data2 = $shallowRef({
|
|
76
70
|
formRules: {
|
|
77
71
|
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
|
|
78
|
-
path: [{ required: true, message: '请输入菜单路径', trigger: 'blur' }]
|
|
79
|
-
type: [{ required: true, message: '请选择菜单类型', trigger: 'change' }]
|
|
72
|
+
path: [{ required: true, message: '请输入菜单路径', trigger: 'blur' }]
|
|
80
73
|
}
|
|
81
74
|
});
|
|
82
75
|
|
|
@@ -91,10 +84,9 @@ const $Method = {
|
|
|
91
84
|
if ($Prop.actionType === 'upd' && $Prop.rowData) {
|
|
92
85
|
$Data.formData.id = $Prop.rowData.id || 0;
|
|
93
86
|
$Data.formData.name = $Prop.rowData.name || '';
|
|
94
|
-
$Data.formData.path = $Prop.rowData.path
|
|
95
|
-
$Data.formData.icon = $Prop.rowData.icon
|
|
96
|
-
$Data.formData.
|
|
97
|
-
$Data.formData.sort = $Prop.rowData.sort || 0;
|
|
87
|
+
$Data.formData.path = $Prop.rowData.path ?? '';
|
|
88
|
+
$Data.formData.icon = $Prop.rowData.icon ?? '';
|
|
89
|
+
$Data.formData.sort = $Prop.rowData.sort ?? 0;
|
|
98
90
|
$Data.formData.state = $Prop.rowData.state ?? 1;
|
|
99
91
|
} else {
|
|
100
92
|
// 重置表单
|
|
@@ -102,7 +94,6 @@ const $Method = {
|
|
|
102
94
|
$Data.formData.name = '';
|
|
103
95
|
$Data.formData.path = '';
|
|
104
96
|
$Data.formData.icon = '';
|
|
105
|
-
$Data.formData.type = 1;
|
|
106
97
|
$Data.formData.sort = 0;
|
|
107
98
|
$Data.formData.state = 1;
|
|
108
99
|
}
|
package/views/menu/index.vue
CHANGED
|
@@ -29,12 +29,6 @@
|
|
|
29
29
|
<span v-else>-</span>
|
|
30
30
|
</template>
|
|
31
31
|
</tiny-grid-column>
|
|
32
|
-
<tiny-grid-column field="type" title="类型" :width="100">
|
|
33
|
-
<template #default="{ row }">
|
|
34
|
-
<tiny-tag v-if="row.type === 0" type="info">目录</tiny-tag>
|
|
35
|
-
<tiny-tag v-else type="success">菜单</tiny-tag>
|
|
36
|
-
</template>
|
|
37
|
-
</tiny-grid-column>
|
|
38
32
|
<tiny-grid-column field="sort" title="排序" :width="80" />
|
|
39
33
|
<tiny-grid-column field="state" title="状态" :width="100">
|
|
40
34
|
<template #default="{ row }">
|