@befly-addon/admin 1.0.31 → 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 -30
- package/views/403/index.vue +2 -4
- package/views/admin/components/edit.vue +32 -40
- package/views/admin/components/role.vue +11 -16
- package/views/admin/index.vue +47 -57
- package/views/dict/components/edit.vue +31 -40
- package/views/dict/index.vue +43 -53
- package/views/index/components/addonList.vue +1 -2
- package/views/index/components/operationLogs.vue +2 -3
- package/views/index/components/quickActions.vue +2 -3
- 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 +12 -17
- package/views/login/components/registerForm.vue +19 -23
- package/views/menu/components/edit.vue +25 -34
- package/views/menu/index.vue +45 -56
- 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 +49 -59
- package/views/user/index.vue +4 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "Befly - 管理后台功能组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -39,35 +39,9 @@
|
|
|
39
39
|
"url": "https://github.com/chenbimo/befly.git",
|
|
40
40
|
"directory": "packages/addon-admin"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "7f8bd9dc5342e59953997d58e6abf6ca2469b211",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"befly": "3.8.12"
|
|
45
|
-
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"@opentiny/vue-button": "~3.27.0",
|
|
48
|
-
"@opentiny/vue-checkbox": "~3.27.0",
|
|
49
|
-
"@opentiny/vue-checkbox-group": "~3.27.0",
|
|
50
|
-
"@opentiny/vue-dialog-box": "~3.27.0",
|
|
51
|
-
"@opentiny/vue-dropdown": "~3.27.0",
|
|
52
|
-
"@opentiny/vue-dropdown-item": "~3.27.0",
|
|
53
|
-
"@opentiny/vue-dropdown-menu": "~3.27.0",
|
|
54
|
-
"@opentiny/vue-form": "~3.27.0",
|
|
55
|
-
"@opentiny/vue-form-item": "~3.27.0",
|
|
56
|
-
"@opentiny/vue-grid": "~3.27.0",
|
|
57
|
-
"@opentiny/vue-grid-column": "~3.27.0",
|
|
58
|
-
"@opentiny/vue-icon": "~3.27.0",
|
|
59
|
-
"@opentiny/vue-input": "~3.27.0",
|
|
60
|
-
"@opentiny/vue-modal": "~3.27.0",
|
|
61
|
-
"@opentiny/vue-numeric": "~3.27.0",
|
|
62
|
-
"@opentiny/vue-pager": "~3.27.0",
|
|
63
|
-
"@opentiny/vue-progress": "~3.27.0",
|
|
64
|
-
"@opentiny/vue-radio": "~3.27.0",
|
|
65
|
-
"@opentiny/vue-radio-group": "~3.27.0",
|
|
66
|
-
"@opentiny/vue-search": "~3.27.0",
|
|
67
|
-
"@opentiny/vue-select": "~3.27.0",
|
|
68
|
-
"@opentiny/vue-tag": "~3.27.0",
|
|
69
|
-
"@opentiny/vue-tree": "~3.27.0",
|
|
70
|
-
"vue": "^3.0.0",
|
|
71
|
-
"vue-router": "^4.0.0"
|
|
44
|
+
"befly": "3.8.12",
|
|
45
|
+
"tdesign-vue-next": "^1.10.6"
|
|
72
46
|
}
|
|
73
47
|
}
|
package/views/403/index.vue
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<h1 class="error-title">无权限访问</h1>
|
|
6
6
|
<p class="error-description">抱歉,您没有访问该页面的权限</p>
|
|
7
7
|
<div class="error-actions">
|
|
8
|
-
<
|
|
9
|
-
<
|
|
8
|
+
<t-button type="primary" @click="$Method.goHome">返回首页</t-button>
|
|
9
|
+
<t-button @click="$Method.goBack">返回上一页</t-button>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
<script setup>
|
|
16
16
|
import { useRouter } from 'vue-router';
|
|
17
|
-
import TinyButton from '@opentiny/vue-button';
|
|
18
|
-
|
|
19
17
|
const router = useRouter();
|
|
20
18
|
|
|
21
19
|
const $Method = {
|
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
</
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
</
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
</
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
</
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
</
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
</
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
</
|
|
27
|
-
</
|
|
28
|
-
</
|
|
2
|
+
<t-dialog v-model:visible="$Data.visible" :title="$Prop.actionType === 'upd' ? '编辑管理员' : '添加管理员'" width="600px" :append-to-body="true" :show-footer="true" :esc-closable="false" top="10vh" @close="$Method.onClose">
|
|
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="username">
|
|
5
|
+
<t-input v-model="$Data.formData.username" placeholder="请输入用户名" :disabled="$Prop.actionType === 'upd'" />
|
|
6
|
+
</t-form-item>
|
|
7
|
+
<t-form-item label="邮箱" prop="email">
|
|
8
|
+
<t-input v-model="$Data.formData.email" placeholder="请输入邮箱" />
|
|
9
|
+
</t-form-item>
|
|
10
|
+
<t-form-item v-if="$Prop.actionType === 'add'" label="密码" prop="password">
|
|
11
|
+
<t-input v-model="$Data.formData.password" type="password" placeholder="请输入密码,至少6位" />
|
|
12
|
+
</t-form-item>
|
|
13
|
+
<t-form-item label="姓名" prop="name">
|
|
14
|
+
<t-input v-model="$Data.formData.name" placeholder="请输入姓名" />
|
|
15
|
+
</t-form-item>
|
|
16
|
+
<t-form-item label="昵称" prop="nickname">
|
|
17
|
+
<t-input v-model="$Data.formData.nickname" placeholder="请输入昵称" />
|
|
18
|
+
</t-form-item>
|
|
19
|
+
<t-form-item label="手机号" prop="phone">
|
|
20
|
+
<t-input v-model="$Data.formData.phone" placeholder="请输入手机号" />
|
|
21
|
+
</t-form-item>
|
|
22
|
+
<t-form-item v-if="$Prop.actionType === 'upd'" label="状态" prop="state">
|
|
23
|
+
<t-radio-group v-model="$Data.formData.state">
|
|
24
|
+
<t-radio :label="1">正常</t-radio>
|
|
25
|
+
<t-radio :label="2">禁用</t-radio>
|
|
26
|
+
</t-radio-group>
|
|
27
|
+
</t-form-item>
|
|
28
|
+
</t-form>
|
|
29
29
|
<template #footer>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
30
|
+
<t-button @click="$Method.onClose">取消</t-button>
|
|
31
|
+
<t-button type="primary" @click="$Method.onSubmit">确定</t-button>
|
|
32
32
|
</template>
|
|
33
|
-
</
|
|
33
|
+
</t-dialog>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import TinyButton from '@opentiny/vue-button';
|
|
38
|
-
import TinyDialogBox from '@opentiny/vue-dialog-box';
|
|
39
|
-
import TinyForm from '@opentiny/vue-form';
|
|
40
|
-
import TinyFormItem from '@opentiny/vue-form-item';
|
|
41
|
-
import TinyInput from '@opentiny/vue-input';
|
|
42
|
-
import TinyRadio from '@opentiny/vue-radio';
|
|
43
|
-
import TinyRadioGroup from '@opentiny/vue-radio-group';
|
|
44
|
-
import Modal from '@opentiny/vue-modal';
|
|
45
37
|
import { $Http } from '@/plugins/http';
|
|
46
38
|
|
|
47
39
|
const $Prop = defineProps({
|
|
@@ -133,7 +125,7 @@ const $Method = {
|
|
|
133
125
|
|
|
134
126
|
const res = await $Http($Prop.actionType === 'upd' ? '/addon/admin/admin/upd' : '/addon/admin/admin/ins', $Data.formData);
|
|
135
127
|
|
|
136
|
-
|
|
128
|
+
MessagePlugin.info({
|
|
137
129
|
message: $Prop.actionType === 'upd' ? '编辑成功' : '添加成功',
|
|
138
130
|
status: 'success'
|
|
139
131
|
});
|
|
@@ -141,7 +133,7 @@ const $Method = {
|
|
|
141
133
|
$Method.onClose();
|
|
142
134
|
} catch (error) {
|
|
143
135
|
console.error('提交失败:', error);
|
|
144
|
-
|
|
136
|
+
MessagePlugin.info({
|
|
145
137
|
message: '提交失败',
|
|
146
138
|
status: 'error'
|
|
147
139
|
});
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<t-dialog v-model:visible="$Data.visible" title="分配角色" width="600px" :append-to-body="true" :show-footer="true" :esc-closable="false" top="20vh" @close="$Method.onClose">
|
|
3
3
|
<div class="role-dialog">
|
|
4
4
|
<div class="user-info">
|
|
5
|
-
<
|
|
5
|
+
<t-tag type="info">{{ $Prop.rowData.username }}</t-tag>
|
|
6
6
|
<span class="user-email">{{ $Prop.rowData.email }}</span>
|
|
7
7
|
</div>
|
|
8
8
|
<tiny-divider />
|
|
9
|
-
<
|
|
9
|
+
<t-select v-model="$Data.checkedRoleCode" :options="$Data.roleOptions" placeholder="请选择角色" />
|
|
10
10
|
</div>
|
|
11
11
|
<template #footer>
|
|
12
|
-
<
|
|
13
|
-
<
|
|
12
|
+
<t-button @click="$Method.onClose">取消</t-button>
|
|
13
|
+
<t-button type="primary" @click="$Method.onSubmit">确定</t-button>
|
|
14
14
|
</template>
|
|
15
|
-
</
|
|
15
|
+
</t-dialog>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script setup>
|
|
19
|
-
import TinyButton from '@opentiny/vue-button';
|
|
20
|
-
import TinyDialogBox from '@opentiny/vue-dialog-box';
|
|
21
|
-
import TinySelect from '@opentiny/vue-select';
|
|
22
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
23
|
-
import Modal from '@opentiny/vue-modal';
|
|
24
19
|
import { $Http } from '@/plugins/http';
|
|
25
20
|
|
|
26
21
|
const $Prop = defineProps({
|
|
@@ -78,7 +73,7 @@ const $Method = {
|
|
|
78
73
|
}));
|
|
79
74
|
} catch (error) {
|
|
80
75
|
console.error('加载角色列表失败:', error);
|
|
81
|
-
|
|
76
|
+
MessagePlugin.info({ message: '加载角色列表失败', status: 'error' });
|
|
82
77
|
}
|
|
83
78
|
},
|
|
84
79
|
|
|
@@ -99,7 +94,7 @@ const $Method = {
|
|
|
99
94
|
// 提交角色分配
|
|
100
95
|
async onSubmit() {
|
|
101
96
|
if (!$Data.checkedRoleCode) {
|
|
102
|
-
|
|
97
|
+
MessagePlugin.info({ message: '请选择角色', status: 'warning' });
|
|
103
98
|
return;
|
|
104
99
|
}
|
|
105
100
|
|
|
@@ -110,15 +105,15 @@ const $Method = {
|
|
|
110
105
|
});
|
|
111
106
|
|
|
112
107
|
if (res.code === 0) {
|
|
113
|
-
|
|
108
|
+
MessagePlugin.info({ message: '角色分配成功', status: 'success' });
|
|
114
109
|
$Method.onClose();
|
|
115
110
|
$Emit('success');
|
|
116
111
|
} else {
|
|
117
|
-
|
|
112
|
+
MessagePlugin.info({ message: res.msg || '分配失败', status: 'error' });
|
|
118
113
|
}
|
|
119
114
|
} catch (error) {
|
|
120
115
|
console.error('分配失败:', error);
|
|
121
|
-
|
|
116
|
+
MessagePlugin.info({ message: '分配失败', status: 'error' });
|
|
122
117
|
}
|
|
123
118
|
}
|
|
124
119
|
};
|
package/views/admin/index.vue
CHANGED
|
@@ -2,71 +2,61 @@
|
|
|
2
2
|
<div class="page-admin 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
|
+
</t-button>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="right">
|
|
20
|
-
<
|
|
20
|
+
<t-button @click="$Method.handleRefresh">
|
|
21
21
|
<template #icon>
|
|
22
22
|
<IconLucideRotateCw />
|
|
23
23
|
</template>
|
|
24
24
|
刷新
|
|
25
|
-
</
|
|
25
|
+
</t-button>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div class="main-table">
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<TinyDropdownItem :item-data="{ command: 'del' }" divided>
|
|
57
|
-
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
58
|
-
删除
|
|
59
|
-
</TinyDropdownItem>
|
|
60
|
-
</TinyDropdownMenu>
|
|
61
|
-
</template>
|
|
62
|
-
</TinyDropdown>
|
|
63
|
-
</template>
|
|
64
|
-
</TinyGridColumn>
|
|
65
|
-
</TinyGrid>
|
|
30
|
+
<t-table :data="$Data.tableData" :columns="$Data.columns" header-cell-class-name="custom-table-cell-class" size="small" height="100%" row-key="id">
|
|
31
|
+
<template #state="{ row }">
|
|
32
|
+
<t-tag v-if="row.state === 1" theme="success">正常</t-tag>
|
|
33
|
+
<t-tag v-else-if="row.state === 2" theme="warning">禁用</t-tag>
|
|
34
|
+
<t-tag v-else theme="danger">已删除</t-tag>
|
|
35
|
+
</template>
|
|
36
|
+
<template #operation="{ row }">
|
|
37
|
+
<t-dropdown trigger="click" min-column-width="120" @click="(data) => $Method.onAction(data.value, row)">
|
|
38
|
+
<t-button variant="text" size="small">操作</t-button>
|
|
39
|
+
<t-dropdown-menu slot="dropdown">
|
|
40
|
+
<t-dropdown-item value="role">
|
|
41
|
+
<IconLucideUser />
|
|
42
|
+
分配角色
|
|
43
|
+
</t-dropdown-item>
|
|
44
|
+
<t-dropdown-item value="upd">
|
|
45
|
+
<IconLucidePencil />
|
|
46
|
+
编辑
|
|
47
|
+
</t-dropdown-item>
|
|
48
|
+
<t-dropdown-item value="del" :divider="true">
|
|
49
|
+
<IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
|
|
50
|
+
删除
|
|
51
|
+
</t-dropdown-item>
|
|
52
|
+
</t-dropdown-menu>
|
|
53
|
+
</t-dropdown>
|
|
54
|
+
</template>
|
|
55
|
+
</t-table>
|
|
66
56
|
</div>
|
|
67
57
|
|
|
68
58
|
<div class="main-page">
|
|
69
|
-
<
|
|
59
|
+
<t-pagination :current-page="$Data.pagerConfig.currentPage" :page-size="$Data.pagerConfig.pageSize" :total="$Data.pagerConfig.total" @current-change="$Method.onPageChange" @size-change="$Method.handleSizeChange" />
|
|
70
60
|
</div>
|
|
71
61
|
|
|
72
62
|
<!-- 编辑对话框组件 -->
|
|
@@ -78,15 +68,6 @@
|
|
|
78
68
|
</template>
|
|
79
69
|
|
|
80
70
|
<script setup>
|
|
81
|
-
import TinyButton from '@opentiny/vue-button';
|
|
82
|
-
import TinyGrid from '@opentiny/vue-grid';
|
|
83
|
-
import TinyGridColumn from '@opentiny/vue-grid-column';
|
|
84
|
-
import TinyTag from '@opentiny/vue-tag';
|
|
85
|
-
import TinyDropdown from '@opentiny/vue-dropdown';
|
|
86
|
-
import TinyDropdownMenu from '@opentiny/vue-dropdown-menu';
|
|
87
|
-
import TinyDropdownItem from '@opentiny/vue-dropdown-item';
|
|
88
|
-
import TinyPager from '@opentiny/vue-pager';
|
|
89
|
-
import Modal from '@opentiny/vue-modal';
|
|
90
71
|
import IconLucidePlus from '~icons/lucide/plus';
|
|
91
72
|
import IconLucideRotateCw from '~icons/lucide/rotate-cw';
|
|
92
73
|
import IconLucidePencil from '~icons/lucide/pencil';
|
|
@@ -100,6 +81,15 @@ import { $Http } from '@/plugins/http';
|
|
|
100
81
|
// 响应式数据
|
|
101
82
|
const $Data = $ref({
|
|
102
83
|
tableData: [],
|
|
84
|
+
columns: [
|
|
85
|
+
{ colKey: 'index', title: '序号', width: 60, align: 'center' },
|
|
86
|
+
{ colKey: 'username', title: '用户名' },
|
|
87
|
+
{ colKey: 'email', title: '邮箱', width: 200 },
|
|
88
|
+
{ colKey: 'nickname', title: '昵称', width: 150 },
|
|
89
|
+
{ colKey: 'roleCode', title: '角色', width: 120 },
|
|
90
|
+
{ colKey: 'state', title: '状态', width: 100 },
|
|
91
|
+
{ colKey: 'operation', title: '操作', width: 120, align: 'right' }
|
|
92
|
+
],
|
|
103
93
|
pagerConfig: {
|
|
104
94
|
currentPage: 1,
|
|
105
95
|
pageSize: 30,
|
|
@@ -130,7 +120,7 @@ const $Method = {
|
|
|
130
120
|
$Data.pagerConfig.total = res.data.total || 0;
|
|
131
121
|
} catch (error) {
|
|
132
122
|
console.error('加载管理员列表失败:', error);
|
|
133
|
-
|
|
123
|
+
MessagePlugin.info({
|
|
134
124
|
message: '加载数据失败',
|
|
135
125
|
status: 'error'
|
|
136
126
|
});
|
|
@@ -139,7 +129,7 @@ const $Method = {
|
|
|
139
129
|
|
|
140
130
|
// 删除管理员
|
|
141
131
|
async apiAdminDel(row) {
|
|
142
|
-
|
|
132
|
+
DialogPlugin.confirm({
|
|
143
133
|
header: '确认删除',
|
|
144
134
|
body: `确定要删除管理员"${row.username}" 吗?`,
|
|
145
135
|
status: 'warning'
|
|
@@ -147,14 +137,14 @@ const $Method = {
|
|
|
147
137
|
try {
|
|
148
138
|
const res = await $Http('/addon/admin/admin/del', { id: row.id });
|
|
149
139
|
if (res.code === 0) {
|
|
150
|
-
|
|
140
|
+
MessagePlugin.info({ message: '删除成功', status: 'success' });
|
|
151
141
|
$Method.apiAdminList();
|
|
152
142
|
} else {
|
|
153
|
-
|
|
143
|
+
MessagePlugin.info({ message: res.msg || '删除失败', status: 'error' });
|
|
154
144
|
}
|
|
155
145
|
} catch (error) {
|
|
156
146
|
console.error('删除失败:', error);
|
|
157
|
-
|
|
147
|
+
MessagePlugin.info({ message: '删除失败', status: 'error' });
|
|
158
148
|
}
|
|
159
149
|
});
|
|
160
150
|
},
|
|
@@ -1,49 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
</
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
</
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
</
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
</
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
</
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
</
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
</
|
|
27
|
-
</
|
|
28
|
-
</
|
|
2
|
+
<t-dialog v-model:visible="$Data.visible" :title="$Prop.actionType === 'upd' ? '编辑字典' : '添加字典'" width="600px" :append-to-body="true" :show-footer="true" :esc-closable="false" top="10vh" @close="$Method.onClose">
|
|
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="code">
|
|
8
|
+
<t-input v-model="$Data.formData.code" placeholder="请输入字典代码,如:gender" />
|
|
9
|
+
</t-form-item>
|
|
10
|
+
<t-form-item label="字典值" prop="value">
|
|
11
|
+
<t-input v-model="$Data.formData.value" placeholder="请输入字典值" />
|
|
12
|
+
</t-form-item>
|
|
13
|
+
<t-form-item label="父级ID" prop="pid">
|
|
14
|
+
<t-input-number v-model="$Data.formData.pid" :min="0" :max="999999999999999" />
|
|
15
|
+
</t-form-item>
|
|
16
|
+
<t-form-item label="排序" prop="sort">
|
|
17
|
+
<t-input-number v-model="$Data.formData.sort" :min="0" :max="9999" />
|
|
18
|
+
</t-form-item>
|
|
19
|
+
<t-form-item label="描述" prop="description">
|
|
20
|
+
<t-input v-model="$Data.formData.description" type="textarea" placeholder="请输入描述" :rows="3" />
|
|
21
|
+
</t-form-item>
|
|
22
|
+
<t-form-item label="状态" prop="state">
|
|
23
|
+
<t-radio-group v-model="$Data.formData.state">
|
|
24
|
+
<t-radio :label="1">正常</t-radio>
|
|
25
|
+
<t-radio :label="2">禁用</t-radio>
|
|
26
|
+
</t-radio-group>
|
|
27
|
+
</t-form-item>
|
|
28
|
+
</t-form>
|
|
29
29
|
<template #footer>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
30
|
+
<t-button @click="$Method.onClose">取消</t-button>
|
|
31
|
+
<t-button type="primary" @click="$Method.onSubmit">确定</t-button>
|
|
32
32
|
</template>
|
|
33
|
-
</
|
|
33
|
+
</t-dialog>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
37
|
import { watch } from 'vue';
|
|
38
|
-
import TinyButton from '@opentiny/vue-button';
|
|
39
|
-
import TinyDialogBox from '@opentiny/vue-dialog-box';
|
|
40
|
-
import TinyForm from '@opentiny/vue-form';
|
|
41
|
-
import TinyFormItem from '@opentiny/vue-form-item';
|
|
42
|
-
import TinyInput from '@opentiny/vue-input';
|
|
43
|
-
import TinyNumeric from '@opentiny/vue-numeric';
|
|
44
|
-
import TinyRadio from '@opentiny/vue-radio';
|
|
45
|
-
import TinyRadioGroup from '@opentiny/vue-radio-group';
|
|
46
|
-
import Modal from '@opentiny/vue-modal';
|
|
47
38
|
import { $Http } from '@/plugins/http';
|
|
48
39
|
|
|
49
40
|
const $Prop = defineProps({
|
|
@@ -137,7 +128,7 @@ const $Method = {
|
|
|
137
128
|
|
|
138
129
|
const res = await $Http($Prop.actionType === 'add' ? '/addon/admin/dictIns' : '/addon/admin/dictUpd', $Data.formData);
|
|
139
130
|
|
|
140
|
-
|
|
131
|
+
MessagePlugin.info({
|
|
141
132
|
message: $Prop.actionType === 'add' ? '添加成功' : '编辑成功',
|
|
142
133
|
status: 'success'
|
|
143
134
|
});
|