1
|
1
|
<template>
|
2
|
|
- <div>123 </div>
|
|
2
|
+ <div>
|
|
3
|
+ <BasicTable style="flex: auto" :clickToRowSelect="false" @register="registerTable">
|
|
4
|
+ <template #toolbar>
|
|
5
|
+ <Authority value="api:yt:user:post">
|
|
6
|
+ <a-button type="primary" @click="handleCreate">新增账号</a-button>
|
|
7
|
+ </Authority>
|
|
8
|
+ <Authority value="api:yt:user:delete">
|
|
9
|
+ <Popconfirm
|
|
10
|
+ title="您确定要批量删除数据"
|
|
11
|
+ ok-text="确定"
|
|
12
|
+ cancel-text="取消"
|
|
13
|
+ @confirm="() => {}"
|
|
14
|
+ >
|
|
15
|
+ <a-button color="error"> 批量删除 </a-button>
|
|
16
|
+ </Popconfirm>
|
|
17
|
+ </Authority>
|
|
18
|
+ </template>
|
|
19
|
+ <template #status="{ record }">
|
|
20
|
+ <Tag
|
|
21
|
+ :color="
|
|
22
|
+ record.userStatusEnum === 'NORMAL'
|
|
23
|
+ ? 'green'
|
|
24
|
+ : record.userStatusEnum === 'DISABLED'
|
|
25
|
+ ? 'red'
|
|
26
|
+ : 'orange'
|
|
27
|
+ "
|
|
28
|
+ >
|
|
29
|
+ {{
|
|
30
|
+ record.userStatusEnum === 'NORMAL'
|
|
31
|
+ ? '正常'
|
|
32
|
+ : record.userStatusEnum === 'DISABLED'
|
|
33
|
+ ? '已禁用'
|
|
34
|
+ : '已过期'
|
|
35
|
+ }}
|
|
36
|
+ </Tag>
|
|
37
|
+ </template>
|
|
38
|
+ <template #action="{ record }">
|
|
39
|
+ <TableAction
|
|
40
|
+ :actions="[
|
|
41
|
+ // {
|
|
42
|
+ // label: '进入',
|
|
43
|
+ // icon: 'ant-design:login-outlined',
|
|
44
|
+ // tooltip: `以${!isAdmin(role) ? '客户' : '平台'}用户身份登录`,
|
|
45
|
+ // onClick: handleLoginCustomAdmin.bind(null, record),
|
|
46
|
+ // },
|
|
47
|
+ {
|
|
48
|
+ label: '用户详情',
|
|
49
|
+ auth: 'api:yt:user:get',
|
|
50
|
+ icon: 'clarity:info-standard-line',
|
|
51
|
+ tooltip: '用户详情',
|
|
52
|
+ onClick: handledetail.bind(null, record),
|
|
53
|
+ ifShow: record.level != 0,
|
|
54
|
+ },
|
|
55
|
+ {
|
|
56
|
+ label: '编辑',
|
|
57
|
+ auth: 'api:yt:user:update',
|
|
58
|
+ icon: 'clarity:note-edit-line',
|
|
59
|
+ tooltip: '编辑',
|
|
60
|
+ onClick: handleEdit.bind(null, record),
|
|
61
|
+ ifShow: record.level != 0,
|
|
62
|
+ },
|
|
63
|
+ ]"
|
|
64
|
+ :drop-down-actions="[
|
|
65
|
+ {
|
|
66
|
+ label: '删除',
|
|
67
|
+ auth: 'api:yt:user:delete',
|
|
68
|
+ icon: 'ant-design:delete-outlined',
|
|
69
|
+ color: 'error',
|
|
70
|
+ tooltip: '删除',
|
|
71
|
+ ifShow: record.level != 0,
|
|
72
|
+ popConfirm: {
|
|
73
|
+ title: '是否确认删除',
|
|
74
|
+ confirm: handleDeleteOrBatchDelete.bind(null, record),
|
|
75
|
+ },
|
|
76
|
+ },
|
|
77
|
+ {
|
|
78
|
+ label: '清除密码',
|
|
79
|
+ auth: 'api:yt:user:resetPassword',
|
|
80
|
+ icon: 'ant-design:delete-outlined',
|
|
81
|
+ color: 'error',
|
|
82
|
+ tooltip: '清除密码',
|
|
83
|
+ popConfirm: {
|
|
84
|
+ title: '是否确认清除密码',
|
|
85
|
+ confirm: handleClearPassword.bind(null, record),
|
|
86
|
+ },
|
|
87
|
+ },
|
|
88
|
+ ]"
|
|
89
|
+ />
|
|
90
|
+ </template>
|
|
91
|
+ </BasicTable>
|
|
92
|
+ </div>
|
3
|
93
|
</template>
|
4
|
94
|
|
5
|
|
-<script lang="ts" setup></script> |
|
95
|
+<script lang="ts" setup>
|
|
96
|
+ import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
97
|
+ import { getTenantList } from '/@/api/system/account';
|
|
98
|
+ import { columns, searchFormSchema } from './config';
|
|
99
|
+ // import { useResetOrganizationTree } from '/@/views/common/organizationIdTree';
|
|
100
|
+ import { reactive } from 'vue';
|
|
101
|
+ import { Authority } from '/@/components/Authority';
|
|
102
|
+
|
|
103
|
+ const searchInfo = reactive<Recordable>({});
|
|
104
|
+
|
|
105
|
+ // const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
|
|
106
|
+
|
|
107
|
+ const [registerTable, {}] = useTable({
|
|
108
|
+ title: '租户账号列表',
|
|
109
|
+ columns,
|
|
110
|
+ api: getTenantList,
|
|
111
|
+ formConfig: {
|
|
112
|
+ labelWidth: 100,
|
|
113
|
+ schemas: searchFormSchema,
|
|
114
|
+ // resetFunc: resetFn,
|
|
115
|
+ },
|
|
116
|
+ useSearchForm: true,
|
|
117
|
+ showTableSetting: true,
|
|
118
|
+ bordered: true,
|
|
119
|
+ showIndexColumn: false,
|
|
120
|
+ rowKey: 'id',
|
|
121
|
+ searchInfo: searchInfo,
|
|
122
|
+ clickToRowSelect: false,
|
|
123
|
+ actionColumn: {
|
|
124
|
+ width: 200,
|
|
125
|
+ title: '操作',
|
|
126
|
+ slots: { customRender: 'action' },
|
|
127
|
+ fixed: 'right',
|
|
128
|
+ },
|
|
129
|
+ });
|
|
130
|
+
|
|
131
|
+ const handleCreate = () => {};
|
|
132
|
+ const handledetail = (_data?: any[]) => {};
|
|
133
|
+ const handleEdit = (_data?: any[]) => {};
|
|
134
|
+ const handleDeleteOrBatchDelete = (_data?: any[]) => {};
|
|
135
|
+ const handleClearPassword = (_data?: any[]) => {};
|
|
136
|
+</script> |
...
|
...
|
|