@befly-addon/admin 1.0.31 → 1.0.33
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 +2 -29
- package/views/403/index.vue +2 -5
- package/views/admin/components/edit.vue +32 -40
- package/views/admin/components/role.vue +11 -16
- package/views/admin/index.vue +47 -63
- package/views/dict/components/edit.vue +31 -40
- package/views/dict/index.vue +44 -59
- package/views/index/components/addonList.vue +2 -5
- package/views/index/components/environmentInfo.vue +1 -2
- package/views/index/components/operationLogs.vue +3 -6
- package/views/index/components/performanceMetrics.vue +1 -6
- package/views/index/components/quickActions.vue +3 -5
- package/views/index/components/serviceStatus.vue +1 -12
- package/views/index/components/systemNotifications.vue +2 -11
- package/views/index/components/systemOverview.vue +1 -6
- package/views/index/components/systemResources.vue +1 -6
- package/views/index/components/userInfo.vue +3 -9
- package/views/login/components/emailLoginForm.vue +13 -21
- package/views/login/components/registerForm.vue +20 -28
- package/views/menu/components/edit.vue +25 -34
- package/views/menu/index.vue +46 -63
- package/views/news/index.vue +0 -1
- package/views/role/components/api.vue +10 -16
- package/views/role/components/edit.vue +26 -35
- package/views/role/components/menu.vue +10 -15
- package/views/role/index.vue +50 -66
- package/views/user/index.vue +5 -10
package/views/dict/index.vue
CHANGED
|
@@ -1,62 +1,50 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="page-dict 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
|
-
</TinyDropdownItem>
|
|
46
|
-
<TinyDropdownItem :item-data="{ command: 'del' }" divided>
|
|
47
|
-
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
48
|
-
删除
|
|
49
|
-
</TinyDropdownItem>
|
|
50
|
-
</TinyDropdownMenu>
|
|
51
|
-
</template>
|
|
52
|
-
</TinyDropdown>
|
|
53
|
-
</template>
|
|
54
|
-
</TinyGridColumn>
|
|
55
|
-
</TinyGrid>
|
|
22
|
+
<t-table :data="$Data.dictList" :columns="$Data.columns" header-cell-class-name="custom-table-cell-class" size="small" height="100%" row-key="id">
|
|
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="del" :divider="true">
|
|
37
|
+
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
38
|
+
删除
|
|
39
|
+
</t-dropdown-item>
|
|
40
|
+
</t-dropdown-menu>
|
|
41
|
+
</t-dropdown>
|
|
42
|
+
</template>
|
|
43
|
+
</t-table>
|
|
56
44
|
</div>
|
|
57
45
|
|
|
58
46
|
<div class="main-page">
|
|
59
|
-
<
|
|
47
|
+
<t-pagination :current-page="$Data.pagerConfig.currentPage" :page-size="$Data.pagerConfig.pageSize" :total="$Data.pagerConfig.total" @current-change="$Method.onPageChange" @size-change="$Method.handleSizeChange" />
|
|
60
48
|
</div>
|
|
61
49
|
|
|
62
50
|
<!-- 编辑对话框组件 -->
|
|
@@ -65,26 +53,23 @@
|
|
|
65
53
|
</template>
|
|
66
54
|
|
|
67
55
|
<script setup>
|
|
68
|
-
import TinyButton from '@opentiny/vue-button';
|
|
69
|
-
import TinyGrid from '@opentiny/vue-grid';
|
|
70
|
-
import TinyGridColumn from '@opentiny/vue-grid-column';
|
|
71
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
72
|
-
import TinyDropdown from '@opentiny/vue-dropdown';
|
|
73
|
-
import TinyDropdownMenu from '@opentiny/vue-dropdown-menu';
|
|
74
|
-
import TinyDropdownItem from '@opentiny/vue-dropdown-item';
|
|
75
|
-
import TinyPager from '@opentiny/vue-pager';
|
|
76
|
-
import Modal from '@opentiny/vue-modal';
|
|
77
|
-
import IconLucidePlus from '~icons/lucide/plus';
|
|
78
|
-
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
79
|
-
import IconLucidePencil from '~icons/lucide/pencil';
|
|
80
|
-
import IconLucideTrash2 from '~icons/lucide/trash-2';
|
|
81
|
-
|
|
82
56
|
import EditDialog from './components/edit.vue';
|
|
83
57
|
import { $Http } from '@/plugins/http';
|
|
84
58
|
|
|
85
59
|
// 响应式数据
|
|
86
60
|
const $Data = $ref({
|
|
87
61
|
dictList: [],
|
|
62
|
+
columns: [
|
|
63
|
+
{ colKey: 'index', title: '序号', width: 60, align: 'center' },
|
|
64
|
+
{ colKey: 'name', title: '字典名称' },
|
|
65
|
+
{ colKey: 'code', title: '字典代码', width: 150 },
|
|
66
|
+
{ colKey: 'value', title: '字典值', width: 200 },
|
|
67
|
+
{ colKey: 'pid', title: '父级ID', width: 100 },
|
|
68
|
+
{ colKey: 'sort', title: '排序', width: 80 },
|
|
69
|
+
{ colKey: 'description', title: '描述', ellipsis: true },
|
|
70
|
+
{ colKey: 'state', title: '状态', width: 100 },
|
|
71
|
+
{ colKey: 'operation', title: '操作', width: 120, align: 'right' }
|
|
72
|
+
],
|
|
88
73
|
pagerConfig: {
|
|
89
74
|
currentPage: 1,
|
|
90
75
|
pageSize: 30,
|
|
@@ -114,7 +99,7 @@ const $Method = {
|
|
|
114
99
|
$Data.pagerConfig.total = res.data.total || 0;
|
|
115
100
|
} catch (error) {
|
|
116
101
|
console.error('加载字典列表失败:', error);
|
|
117
|
-
|
|
102
|
+
MessagePlugin.info({
|
|
118
103
|
message: '加载数据失败',
|
|
119
104
|
status: 'error'
|
|
120
105
|
});
|
|
@@ -123,7 +108,7 @@ const $Method = {
|
|
|
123
108
|
|
|
124
109
|
// 删除字典
|
|
125
110
|
async apiDictDel(row) {
|
|
126
|
-
|
|
111
|
+
DialogPlugin.confirm({
|
|
127
112
|
header: '确认删除',
|
|
128
113
|
body: `确定要删除字典"${row.name}" 吗?`,
|
|
129
114
|
status: 'warning'
|
|
@@ -131,14 +116,14 @@ const $Method = {
|
|
|
131
116
|
try {
|
|
132
117
|
const res = await $Http('/addon/admin/dict/del', { id: row.id });
|
|
133
118
|
if (res.code === 0) {
|
|
134
|
-
|
|
119
|
+
MessagePlugin.info({ message: '删除成功', status: 'success' });
|
|
135
120
|
$Method.apiDictList();
|
|
136
121
|
} else {
|
|
137
|
-
|
|
122
|
+
MessagePlugin.info({ message: res.msg || '删除失败', status: 'error' });
|
|
138
123
|
}
|
|
139
124
|
} catch (error) {
|
|
140
125
|
console.error('删除失败:', error);
|
|
141
|
-
|
|
126
|
+
MessagePlugin.info({ message: '删除失败', status: 'error' });
|
|
142
127
|
}
|
|
143
128
|
});
|
|
144
129
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucidePackage />
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<div class="addon-info">
|
|
14
14
|
<div class="addon-title">
|
|
15
15
|
<span class="addon-name">{{ addon.title }}</span>
|
|
16
|
-
<
|
|
16
|
+
<t-tag type="success" size="small">{{ addon.version }}</t-tag>
|
|
17
17
|
</div>
|
|
18
18
|
<div class="addon-desc">{{ addon.description }}</div>
|
|
19
19
|
</div>
|
|
@@ -24,9 +24,6 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script setup>
|
|
27
|
-
import IconLucideBox from '~icons/lucide/box';
|
|
28
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
29
|
-
import IconLucidePackage from '~icons/lucide/package';
|
|
30
27
|
import { $Http } from '@/plugins/http';
|
|
31
28
|
|
|
32
29
|
// 组件内部数据
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideServer />
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script setup>
|
|
39
|
-
import IconLucideServer from '~icons/lucide/server';
|
|
40
39
|
import { $Http } from '@/plugins/http';
|
|
41
40
|
|
|
42
41
|
// 组件内部数据
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideFileText />
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
<span class="col-module">{{ log.module }}</span>
|
|
23
23
|
<span class="col-ip">{{ log.ip }}</span>
|
|
24
24
|
<span class="col-status">
|
|
25
|
-
<
|
|
25
|
+
<t-tag :type="log.status === 'success' ? 'success' : 'danger'" size="small">
|
|
26
26
|
{{ log.status === 'success' ? '成功' : '失败' }}
|
|
27
|
-
</
|
|
27
|
+
</t-tag>
|
|
28
28
|
</span>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
@@ -34,9 +34,6 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
38
|
-
import IconLucideFileText from '~icons/lucide/file-text';
|
|
39
|
-
|
|
40
37
|
// 组件内部数据
|
|
41
38
|
const operationLogs = $ref([
|
|
42
39
|
{ id: 1, userName: '管理员', action: '创建角色', module: '权限管理', ip: '192.168.1.100', status: 'success', createdAt: Date.now() - 120000 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideActivity />
|
|
@@ -53,11 +53,6 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup>
|
|
56
|
-
import IconLucideActivity from '~icons/lucide/activity';
|
|
57
|
-
import IconLucideTrendingUp from '~icons/lucide/trending-up';
|
|
58
|
-
import IconLucideAlertCircle from '~icons/lucide/alert-circle';
|
|
59
|
-
import IconLucideClock from '~icons/lucide/clock';
|
|
60
|
-
import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
|
|
61
56
|
import { $Http } from '@/plugins/http';
|
|
62
57
|
|
|
63
58
|
// 组件内部数据
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-content">
|
|
4
|
-
<
|
|
4
|
+
<t-button type="primary" size="large" @click="handleClearCache">
|
|
5
5
|
<template #prefix>
|
|
6
6
|
<IconLucideRotateCw />
|
|
7
7
|
</template>
|
|
8
8
|
刷新缓存
|
|
9
|
-
</
|
|
9
|
+
</t-button>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
|
-
import TinyButton from '@opentiny/vue-button';
|
|
16
|
-
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
17
15
|
const handleClearCache = () => {
|
|
18
16
|
console.log('刷新缓存');
|
|
19
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideCheckCircle />
|
|
@@ -35,17 +35,6 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup>
|
|
38
|
-
import IconLucideCheckCircle from '~icons/lucide/check-circle';
|
|
39
|
-
import IconLucideZap from '~icons/lucide/zap';
|
|
40
|
-
import IconLucideCloud from '~icons/lucide/cloud';
|
|
41
|
-
import IconLucideCircle from '~icons/lucide/circle';
|
|
42
|
-
import IconLucideXCircle from '~icons/lucide/x-circle';
|
|
43
|
-
import IconLucideCheck from '~icons/lucide/check';
|
|
44
|
-
import IconLucideX from '~icons/lucide/x';
|
|
45
|
-
import IconLucideAlertCircle from '~icons/lucide/alert-circle';
|
|
46
|
-
import IconLucideDatabase from '~icons/lucide/database';
|
|
47
|
-
import IconLucideMail from '~icons/lucide/mail';
|
|
48
|
-
import IconLucideHardDrive from '~icons/lucide/hard-drive';
|
|
49
38
|
import { $Http } from '@/plugins/http';
|
|
50
39
|
|
|
51
40
|
// 组件内部数据
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideBell />
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<span class="notification-title">{{ notification.title }}</span>
|
|
19
19
|
<span class="notification-time">{{ formatTime(notification.createdAt) }}</span>
|
|
20
20
|
</div>
|
|
21
|
-
<
|
|
21
|
+
<t-tag v-if="!notification.isRead" type="primary" size="small">新</t-tag>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
@@ -26,15 +26,6 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
-
import IconLucideBell from '~icons/lucide/bell';
|
|
30
|
-
import IconLucideCheckCircle from '~icons/lucide/check-circle';
|
|
31
|
-
import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
|
|
32
|
-
import IconLucideXCircle from '~icons/lucide/x-circle';
|
|
33
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
34
|
-
import IconLucideInfo from '~icons/lucide/info';
|
|
35
|
-
import IconLucideCheck from '~icons/lucide/check';
|
|
36
|
-
import IconLucideX from '~icons/lucide/x';
|
|
37
|
-
|
|
38
29
|
// 组件内部数据
|
|
39
30
|
const notifications = $ref([
|
|
40
31
|
{ id: 1, type: 'warning', title: '系统更新提醒 - v1.1.0 版本已发布', isRead: false, createdAt: Date.now() - 3600000 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideInfo />
|
|
@@ -39,11 +39,6 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import IconLucideWebhook from '~icons/lucide/webhook';
|
|
43
|
-
import IconLucideUsers from '~icons/lucide/users';
|
|
44
|
-
import IconLucideUser from '~icons/lucide/user';
|
|
45
|
-
import IconLucideMenu from '~icons/lucide/menu';
|
|
46
|
-
import IconLucideInfo from '~icons/lucide/info';
|
|
47
42
|
import { $Http } from '@/plugins/http';
|
|
48
43
|
|
|
49
44
|
// 组件内部数据
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block">
|
|
3
3
|
<div class="section-header flex items-center gap-2">
|
|
4
4
|
<IconLucideActivity />
|
|
@@ -39,11 +39,6 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import IconLucideDisc from '~icons/lucide/disc';
|
|
43
|
-
import TinyProgress from '@opentiny/vue-progress';
|
|
44
|
-
import IconLucideCpu from '~icons/lucide/cpu';
|
|
45
|
-
import IconLucideHardDrive from '~icons/lucide/hard-drive';
|
|
46
|
-
import IconLucideActivity from '~icons/lucide/activity';
|
|
47
42
|
import { $Http } from '@/plugins/http';
|
|
48
43
|
|
|
49
44
|
// 组件内部数据
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div class="section-block user-info-card">
|
|
3
3
|
<div class="user-header">
|
|
4
4
|
<div class="user-avatar">
|
|
@@ -26,23 +26,17 @@
|
|
|
26
26
|
|
|
27
27
|
<!-- 仅 dev 角色显示刷新缓存按钮 -->
|
|
28
28
|
<div v-if="$Data.userInfo.roleCode === 'dev'" class="user-actions">
|
|
29
|
-
<
|
|
29
|
+
<t-button type="primary" size="mini" :loading="$Data.refreshing" @click="$Method.handleRefreshCache">
|
|
30
30
|
<template #icon>
|
|
31
31
|
<IconLucideRotateCw />
|
|
32
32
|
</template>
|
|
33
33
|
刷新缓存
|
|
34
|
-
</
|
|
34
|
+
</t-button>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script setup>
|
|
40
|
-
import IconLucidePhone from '~icons/lucide/phone';
|
|
41
|
-
import IconLucideClock from '~icons/lucide/clock';
|
|
42
|
-
import TinyButton from '@opentiny/vue-button';
|
|
43
|
-
import IconLucideUser from '~icons/lucide/user';
|
|
44
|
-
import IconLucideMail from '~icons/lucide/mail';
|
|
45
|
-
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
46
40
|
import { $Http } from '@/plugins/http';
|
|
47
41
|
|
|
48
42
|
// 响应式数据
|
|
@@ -1,38 +1,30 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
1
|
+
<template>
|
|
2
|
+
<t-form :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="90px" label-position="left" :show-message="false">
|
|
3
|
+
<t-form-item prop="account" label="账号">
|
|
4
|
+
<t-input v-model="$Data.formData.account" placeholder="请输入用户名或邮箱" size="large" clearable>
|
|
5
5
|
<template #prefix-icon>
|
|
6
6
|
<IconLucideUser />
|
|
7
7
|
</template>
|
|
8
|
-
</
|
|
9
|
-
</
|
|
8
|
+
</t-input>
|
|
9
|
+
</t-form-item>
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
11
|
+
<t-form-item prop="password" label="密码">
|
|
12
|
+
<t-input v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
|
|
13
13
|
<template #prefix-icon>
|
|
14
14
|
<IconLucideLock />
|
|
15
15
|
</template>
|
|
16
|
-
</
|
|
17
|
-
</
|
|
16
|
+
</t-input>
|
|
17
|
+
</t-form-item>
|
|
18
18
|
|
|
19
19
|
<div class="form-footer">
|
|
20
20
|
<a href="#" class="forgot-password">忘记密码?</a>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
-
<
|
|
24
|
-
</
|
|
23
|
+
<t-button theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.apiLogin"> 登录 </t-button>
|
|
24
|
+
</t-form>
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
|
-
import { useRouter } from 'vue-router';
|
|
29
|
-
import TinyButton from '@opentiny/vue-button';
|
|
30
|
-
import TinyForm from '@opentiny/vue-form';
|
|
31
|
-
import TinyFormItem from '@opentiny/vue-form-item';
|
|
32
|
-
import TinyInput from '@opentiny/vue-input';
|
|
33
|
-
import Modal from '@opentiny/vue-modal';
|
|
34
|
-
import IconLucideUser from '~icons/lucide/user';
|
|
35
|
-
import IconLucideLock from '~icons/lucide/lock';
|
|
36
28
|
import { $Http } from '@/plugins/http';
|
|
37
29
|
import { $Storage } from '@/plugins/storage';
|
|
38
30
|
|
|
@@ -80,7 +72,7 @@ const $Method = {
|
|
|
80
72
|
$Storage.local.set('userInfo', res.data.userInfo);
|
|
81
73
|
}
|
|
82
74
|
|
|
83
|
-
|
|
75
|
+
MessagePlugin.info({
|
|
84
76
|
message: '登录成功',
|
|
85
77
|
status: 'success'
|
|
86
78
|
});
|
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
1
|
+
<template>
|
|
2
|
+
<t-form :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="70px" label-position="left">
|
|
3
|
+
<t-form-item prop="username" label="用户名">
|
|
4
|
+
<t-input v-model="$Data.formData.username" placeholder="请输入用户名" size="large" clearable>
|
|
5
5
|
<template #prefix-icon>
|
|
6
6
|
<IconLucideUser />
|
|
7
7
|
</template>
|
|
8
|
-
</
|
|
9
|
-
</
|
|
8
|
+
</t-input>
|
|
9
|
+
</t-form-item>
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
11
|
+
<t-form-item prop="email" label="邮箱">
|
|
12
|
+
<t-input v-model="$Data.formData.email" placeholder="请输入邮箱" size="large" clearable>
|
|
13
13
|
<template #prefix-icon>
|
|
14
14
|
<IconLucideMail />
|
|
15
15
|
</template>
|
|
16
|
-
</
|
|
17
|
-
</
|
|
16
|
+
</t-input>
|
|
17
|
+
</t-form-item>
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
<
|
|
19
|
+
<t-form-item prop="password" label="密码">
|
|
20
|
+
<t-input v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
|
|
21
21
|
<template #prefix-icon>
|
|
22
22
|
<IconLucideLock />
|
|
23
23
|
</template>
|
|
24
|
-
</
|
|
25
|
-
</
|
|
24
|
+
</t-input>
|
|
25
|
+
</t-form-item>
|
|
26
26
|
|
|
27
|
-
<
|
|
28
|
-
<
|
|
27
|
+
<t-form-item prop="nickname" label="昵称">
|
|
28
|
+
<t-input v-model="$Data.formData.nickname" placeholder="请输入昵称(选填)" size="large" clearable>
|
|
29
29
|
<template #prefix-icon>
|
|
30
30
|
<IconLucideSmile />
|
|
31
31
|
</template>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
32
|
+
</t-input>
|
|
33
|
+
</t-form-item>
|
|
34
34
|
|
|
35
|
-
<
|
|
36
|
-
</
|
|
35
|
+
<t-button theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.handleSubmit"> 注册 </t-button>
|
|
36
|
+
</t-form>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script setup>
|
|
40
|
-
import TinyButton from '@opentiny/vue-button';
|
|
41
|
-
import TinyForm from '@opentiny/vue-form';
|
|
42
|
-
import TinyFormItem from '@opentiny/vue-form-item';
|
|
43
|
-
import TinyInput from '@opentiny/vue-input';
|
|
44
|
-
import IconLucideUser from '~icons/lucide/user';
|
|
45
|
-
import IconLucideMail from '~icons/lucide/mail';
|
|
46
|
-
import IconLucideLock from '~icons/lucide/lock';
|
|
47
|
-
import IconLucideSmile from '~icons/lucide/smile';
|
|
48
40
|
import { $Http } from '@/plugins/http';
|
|
49
41
|
|
|
50
42
|
const emit = defineEmits(['success']);
|
|
@@ -1,43 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
</
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
</
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
</
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
</
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
</
|
|
21
|
-
</
|
|
22
|
-
</
|
|
2
|
+
<t-dialog v-model:visible="$Data.visible" :title="$Prop.actionType === 'add' ? '添加菜单' : '编辑菜单'" width="600px" :append-to-body="true" :show-footer="true" top="10vh">
|
|
3
|
+
<t-form :model="$Data.formData" label-width="120px" label-position="left" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)">
|
|
4
|
+
<t-form-item label="菜单名称" prop="name">
|
|
5
|
+
<t-input v-model="$Data.formData.name" placeholder="请输入菜单名称" />
|
|
6
|
+
</t-form-item>
|
|
7
|
+
<t-form-item label="菜单路径" prop="path">
|
|
8
|
+
<t-input v-model="$Data.formData.path" placeholder="请输入菜单路径,如:/user" />
|
|
9
|
+
</t-form-item>
|
|
10
|
+
<t-form-item label="图标" prop="icon">
|
|
11
|
+
<t-input v-model="$Data.formData.icon" placeholder="请输入图标名称,如:User" />
|
|
12
|
+
</t-form-item>
|
|
13
|
+
<t-form-item label="排序" prop="sort">
|
|
14
|
+
<t-input-number v-model="$Data.formData.sort" :min="0" :max="9999" />
|
|
15
|
+
</t-form-item>
|
|
16
|
+
<t-form-item label="状态" prop="state">
|
|
17
|
+
<t-radio-group v-model="$Data.formData.state">
|
|
18
|
+
<t-radio :label="1">正常</t-radio>
|
|
19
|
+
<t-radio :label="2">禁用</t-radio>
|
|
20
|
+
</t-radio-group>
|
|
21
|
+
</t-form-item>
|
|
22
|
+
</t-form>
|
|
23
23
|
<template #footer>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
24
|
+
<t-button @click="$Method.onClose">取消</t-button>
|
|
25
|
+
<t-button type="primary" @click="$Method.onSubmit">确定</t-button>
|
|
26
26
|
</template>
|
|
27
|
-
</
|
|
27
|
+
</t-dialog>
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script setup>
|
|
31
31
|
import { watch } from 'vue';
|
|
32
|
-
import TinyButton from '@opentiny/vue-button';
|
|
33
|
-
import TinyDialogBox from '@opentiny/vue-dialog-box';
|
|
34
|
-
import TinyForm from '@opentiny/vue-form';
|
|
35
|
-
import TinyFormItem from '@opentiny/vue-form-item';
|
|
36
|
-
import TinyInput from '@opentiny/vue-input';
|
|
37
|
-
import TinyNumeric from '@opentiny/vue-numeric';
|
|
38
|
-
import TinyRadio from '@opentiny/vue-radio';
|
|
39
|
-
import TinyRadioGroup from '@opentiny/vue-radio-group';
|
|
40
|
-
import Modal from '@opentiny/vue-modal';
|
|
41
32
|
import { $Http } from '@/plugins/http';
|
|
42
33
|
|
|
43
34
|
const $Prop = defineProps({
|
|
@@ -122,7 +113,7 @@ const $Method = {
|
|
|
122
113
|
|
|
123
114
|
const res = await $Http($Prop.actionType === 'add' ? '/addon/admin/menuIns' : '/addon/admin/menuUpd', $Data.formData);
|
|
124
115
|
|
|
125
|
-
|
|
116
|
+
MessagePlugin.info({
|
|
126
117
|
message: $Prop.actionType === 'add' ? '添加成功' : '编辑成功',
|
|
127
118
|
status: 'success'
|
|
128
119
|
});
|