@befly-addon/admin 1.0.30 → 1.0.32
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 +4 -3
- package/views/403/index.vue +3 -5
- package/views/admin/components/edit.vue +32 -33
- package/views/admin/components/role.vue +11 -12
- package/views/admin/index.vue +47 -49
- package/views/dict/components/edit.vue +31 -32
- package/views/dict/index.vue +43 -45
- package/views/index/components/addonList.vue +1 -2
- package/views/index/components/operationLogs.vue +2 -3
- package/views/index/components/quickActions.vue +2 -4
- package/views/index/components/systemNotifications.vue +1 -2
- package/views/index/components/systemResources.vue +0 -1
- package/views/index/components/userInfo.vue +2 -3
- package/views/login/components/emailLoginForm.vue +13 -14
- package/views/login/components/registerForm.vue +19 -20
- package/views/menu/components/edit.vue +25 -26
- package/views/menu/index.vue +45 -48
- package/views/news/index.vue +0 -2
- package/views/role/components/api.vue +10 -11
- package/views/role/components/edit.vue +26 -27
- package/views/role/components/menu.vue +10 -12
- package/views/role/index.vue +49 -51
- package/views/user/index.vue +4 -5
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<t-dialog v-model:visible="$Data.visible" title="菜单权限" width="600px" :append-to-body="true" :show-footer="true" top="10vh" @close="$Method.onClose">
|
|
3
3
|
<div class="comp-role-menu">
|
|
4
|
-
<
|
|
4
|
+
<t-tree :data="$Data.menuTreeData" node-key="id" show-checkbox default-expand-all :props="{ label: 'name' }" :ref="(el) => ($From.tree = el)" />
|
|
5
5
|
</div>
|
|
6
6
|
<template #footer>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
7
|
+
<t-button @click="$Method.onClose">取消</t-button>
|
|
8
|
+
<t-button type="primary" @click="$Method.onSubmit">保存</t-button>
|
|
9
9
|
</template>
|
|
10
|
-
</
|
|
10
|
+
</t-dialog>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script setup>
|
|
14
14
|
import { nextTick } from 'vue';
|
|
15
|
-
import { Button as TinyButton, DialogBox as TinyDialogBox, Tree as TinyTree, Modal } from '@opentiny/vue';
|
|
16
|
-
|
|
17
15
|
import { arrayToTree } from '@/utils';
|
|
18
16
|
import { $Http } from '@/plugins/http';
|
|
19
17
|
|
|
@@ -70,7 +68,7 @@ const $Method = {
|
|
|
70
68
|
$Data.menuTreeData = arrayToTree(menuList);
|
|
71
69
|
} catch (error) {
|
|
72
70
|
console.error('加载菜单失败:', error);
|
|
73
|
-
|
|
71
|
+
MessagePlugin.info({ message: '加载菜单失败', status: 'error' });
|
|
74
72
|
}
|
|
75
73
|
},
|
|
76
74
|
|
|
@@ -101,7 +99,7 @@ const $Method = {
|
|
|
101
99
|
async onSubmit() {
|
|
102
100
|
try {
|
|
103
101
|
if (!$From.tree) {
|
|
104
|
-
|
|
102
|
+
MessagePlugin.info({ message: '菜单树未初始化', status: 'error' });
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
107
105
|
|
|
@@ -116,21 +114,21 @@ const $Method = {
|
|
|
116
114
|
});
|
|
117
115
|
|
|
118
116
|
if (res.code === 0) {
|
|
119
|
-
|
|
117
|
+
MessagePlugin.info({
|
|
120
118
|
message: '保存成功',
|
|
121
119
|
status: 'success'
|
|
122
120
|
});
|
|
123
121
|
$Data.visible = false;
|
|
124
122
|
$Emit('success');
|
|
125
123
|
} else {
|
|
126
|
-
|
|
124
|
+
MessagePlugin.info({
|
|
127
125
|
message: res.msg || '保存失败',
|
|
128
126
|
status: 'error'
|
|
129
127
|
});
|
|
130
128
|
}
|
|
131
129
|
} catch (error) {
|
|
132
130
|
console.error('保存失败:', error);
|
|
133
|
-
|
|
131
|
+
MessagePlugin.info({
|
|
134
132
|
message: '保存失败',
|
|
135
133
|
status: 'error'
|
|
136
134
|
});
|
package/views/role/index.vue
CHANGED
|
@@ -2,67 +2,57 @@
|
|
|
2
2
|
<div class="page-role page-table">
|
|
3
3
|
<div class="main-tool">
|
|
4
4
|
<div class="left">
|
|
5
|
-
<
|
|
5
|
+
<t-button type="primary" @click="$Method.onAction('add', {})">
|
|
6
6
|
<template #icon>
|
|
7
7
|
<IconLucidePlus />
|
|
8
8
|
</template>
|
|
9
9
|
添加角色
|
|
10
|
-
</
|
|
10
|
+
</t-button>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="right">
|
|
13
|
-
<
|
|
13
|
+
<t-button @click="$Method.handleRefresh">
|
|
14
14
|
<template #icon>
|
|
15
15
|
<IconLucideRotateCw />
|
|
16
16
|
</template>
|
|
17
17
|
刷新
|
|
18
|
-
</
|
|
18
|
+
</t-button>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
<div class="main-table">
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<TinyDropdownItem :item-data="{ command: 'del' }" divided>
|
|
53
|
-
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
54
|
-
删除
|
|
55
|
-
</TinyDropdownItem>
|
|
56
|
-
</TinyDropdownMenu>
|
|
57
|
-
</template>
|
|
58
|
-
</TinyDropdown>
|
|
59
|
-
</template>
|
|
60
|
-
</TinyGridColumn>
|
|
61
|
-
</TinyGrid>
|
|
22
|
+
<t-table :data="$Data.tableData" :columns="$Data.columns" header-cell-class-name="custom-table-cell-class" size="small" height="100%" row-key="id" bordered>
|
|
23
|
+
<template #state="{ row }">
|
|
24
|
+
<t-tag v-if="row.state === 1" theme="success">正常</t-tag>
|
|
25
|
+
<t-tag v-else-if="row.state === 2" theme="warning">禁用</t-tag>
|
|
26
|
+
<t-tag v-else theme="danger">已删除</t-tag>
|
|
27
|
+
</template>
|
|
28
|
+
<template #operation="{ row }">
|
|
29
|
+
<t-dropdown trigger="click" min-column-width="120" @click="(data) => $Method.onAction(data.value, row)">
|
|
30
|
+
<t-button variant="text" size="small">操作</t-button>
|
|
31
|
+
<t-dropdown-menu slot="dropdown">
|
|
32
|
+
<t-dropdown-item value="upd">
|
|
33
|
+
<IconLucidePencil />
|
|
34
|
+
编辑
|
|
35
|
+
</t-dropdown-item>
|
|
36
|
+
<t-dropdown-item value="menu">
|
|
37
|
+
<IconLucideSettings />
|
|
38
|
+
菜单权限
|
|
39
|
+
</t-dropdown-item>
|
|
40
|
+
<t-dropdown-item value="api">
|
|
41
|
+
<IconLucideCode />
|
|
42
|
+
接口权限
|
|
43
|
+
</t-dropdown-item>
|
|
44
|
+
<t-dropdown-item value="del" :divider="true">
|
|
45
|
+
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
46
|
+
删除
|
|
47
|
+
</t-dropdown-item>
|
|
48
|
+
</t-dropdown-menu>
|
|
49
|
+
</t-dropdown>
|
|
50
|
+
</template>
|
|
51
|
+
</t-table>
|
|
62
52
|
</div>
|
|
63
53
|
|
|
64
54
|
<div class="main-page">
|
|
65
|
-
<
|
|
55
|
+
<t-pagination :current-page="$Data.pagerConfig.currentPage" :page-size="$Data.pagerConfig.pageSize" :total="$Data.pagerConfig.total" @current-change="$Method.onPageChange" @size-change="$Method.handleSizeChange" />
|
|
66
56
|
</div>
|
|
67
57
|
|
|
68
58
|
<!-- 编辑对话框组件 -->
|
|
@@ -77,7 +67,6 @@
|
|
|
77
67
|
</template>
|
|
78
68
|
|
|
79
69
|
<script setup>
|
|
80
|
-
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
70
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
82
71
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
83
72
|
import IconLucidePencil from '~icons/lucide/pencil';
|
|
@@ -92,6 +81,15 @@ import { $Http } from '@/plugins/http';
|
|
|
92
81
|
// 响应式数据
|
|
93
82
|
const $Data = $ref({
|
|
94
83
|
tableData: [],
|
|
84
|
+
columns: [
|
|
85
|
+
{ colKey: 'index', title: '序号', width: 100, align: 'center' },
|
|
86
|
+
{ colKey: 'name', title: '角色名称', width: 150 },
|
|
87
|
+
{ colKey: 'code', title: '角色代码', width: 150 },
|
|
88
|
+
{ colKey: 'description', title: '描述', minWidth: 150, ellipsis: true },
|
|
89
|
+
{ colKey: 'sort', title: '排序', width: 80, align: 'center' },
|
|
90
|
+
{ colKey: 'state', title: '状态', width: 100, align: 'center' },
|
|
91
|
+
{ colKey: 'operation', title: '操作', width: 120, align: 'center', fixed: 'right' }
|
|
92
|
+
],
|
|
95
93
|
pagerConfig: {
|
|
96
94
|
currentPage: 1,
|
|
97
95
|
pageSize: 30,
|
|
@@ -122,7 +120,7 @@ const $Method = {
|
|
|
122
120
|
$Data.pagerConfig.total = res.data.total || 0;
|
|
123
121
|
} catch (error) {
|
|
124
122
|
console.error('加载角色列表失败:', error);
|
|
125
|
-
|
|
123
|
+
MessagePlugin.info({
|
|
126
124
|
message: '加载数据失败',
|
|
127
125
|
status: 'error'
|
|
128
126
|
});
|
|
@@ -131,7 +129,7 @@ const $Method = {
|
|
|
131
129
|
|
|
132
130
|
// 删除角色
|
|
133
131
|
async apiRoleDel(row) {
|
|
134
|
-
|
|
132
|
+
DialogPlugin.confirm({
|
|
135
133
|
header: '确认删除',
|
|
136
134
|
body: `确定要删除角色"${row.name}" 吗?`,
|
|
137
135
|
status: 'warning'
|
|
@@ -139,14 +137,14 @@ const $Method = {
|
|
|
139
137
|
try {
|
|
140
138
|
const res = await $Http('/addon/admin/role/del', { id: row.id });
|
|
141
139
|
if (res.code === 0) {
|
|
142
|
-
|
|
140
|
+
MessagePlugin.info({ message: '删除成功', status: 'success' });
|
|
143
141
|
$Method.apiRoleList();
|
|
144
142
|
} else {
|
|
145
|
-
|
|
143
|
+
MessagePlugin.info({ message: res.msg || '删除失败', status: 'error' });
|
|
146
144
|
}
|
|
147
145
|
} catch (error) {
|
|
148
146
|
console.error('删除失败:', error);
|
|
149
|
-
|
|
147
|
+
MessagePlugin.info({ message: '删除失败', status: 'error' });
|
|
150
148
|
}
|
|
151
149
|
});
|
|
152
150
|
},
|
package/views/user/index.vue
CHANGED
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
<div class="table-wrapper">
|
|
35
35
|
<t-table :data="$Data.userList" :columns="$Data.columns" row-key="id" :loading="$Data.loading" bordered stripe hover max-height="100%">
|
|
36
36
|
<template #state="{ row }">
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
<
|
|
37
|
+
<t-tag v-if="row.state === 1" type="success">正常</t-tag>
|
|
38
|
+
<t-tag v-else-if="row.state === 2" type="warning">禁用</t-tag>
|
|
39
|
+
<t-tag v-else type="danger">已删除</t-tag>
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<template #lastLoginTime="{ row }">
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<t-dialog v-model:visible="$Data.roleVisible" header="分配角色" width="600px" :on-confirm="$Method.handleRoleSubmit">
|
|
64
64
|
<div class="role-dialog">
|
|
65
65
|
<div class="user-info">
|
|
66
|
-
<
|
|
66
|
+
<t-tag type="primary">{{ $Data.currentUser.username }}</t-tag>
|
|
67
67
|
<span class="user-email">{{ $Data.currentUser.email }}</span>
|
|
68
68
|
</div>
|
|
69
69
|
<t-divider />
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<script setup>
|
|
77
|
-
import { Tag as TinyTag, Modal } from '@opentiny/vue';
|
|
78
77
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
79
78
|
import IconLucideSearch from '~icons/lucide/search';
|
|
80
79
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|