leadal-auth 0.0.1
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/README.md +83 -0
- package/babel.config.js +5 -0
- package/jsconfig.json +19 -0
- package/ld-auth/demo.html +1 -0
- package/ld-auth/ld-auth.common.js +44730 -0
- package/ld-auth/ld-auth.css +1 -0
- package/ld-auth/ld-auth.umd.js +44730 -0
- package/ld-auth/ld-auth.umd.min.js +55 -0
- package/package.json +58 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/public/models/age_gender_model-shard1 +0 -0
- package/public/models/age_gender_model-weights_manifest.json +1 -0
- package/public/models/face_expression_model-shard1 +0 -0
- package/public/models/face_expression_model-weights_manifest.json +1 -0
- package/public/models/face_landmark_68_model-shard1 +0 -0
- package/public/models/face_landmark_68_model-weights_manifest.json +1 -0
- package/public/models/face_landmark_68_tiny_model-shard1 +0 -0
- package/public/models/face_landmark_68_tiny_model-weights_manifest.json +1 -0
- package/public/models/face_recognition_model-shard1 +0 -0
- package/public/models/face_recognition_model-shard2 +6 -0
- package/public/models/face_recognition_model-weights_manifest.json +1 -0
- package/public/models/mtcnn_model-shard1 +0 -0
- package/public/models/mtcnn_model-weights_manifest.json +1 -0
- package/public/models/ssd_mobilenetv1_model-shard1 +0 -0
- package/public/models/ssd_mobilenetv1_model-shard2 +145 -0
- package/public/models/ssd_mobilenetv1_model-weights_manifest.json +1 -0
- package/public/models/tiny_face_detector_model-shard1 +0 -0
- package/public/models/tiny_face_detector_model-weights_manifest.json +1 -0
- package/src/App.vue +19 -0
- package/src/api/card.js +58 -0
- package/src/api/face.js +37 -0
- package/src/api/finger.js +64 -0
- package/src/api/index.js +100 -0
- package/src/assets/BIN.png +0 -0
- package/src/assets/CLOSE.svg +11 -0
- package/src/assets/blue-left.png +0 -0
- package/src/assets/blue-right.png +0 -0
- package/src/assets/finger-ready.png +0 -0
- package/src/assets/finger-select.png +0 -0
- package/src/assets/finger-status-1-last.png +0 -0
- package/src/assets/finger-status-1.gif +0 -0
- package/src/assets/finger-status-2-last.png +0 -0
- package/src/assets/finger-status-2.gif +0 -0
- package/src/assets/finger-status-3-last.png +0 -0
- package/src/assets/finger-status-3.gif +0 -0
- package/src/assets/finger-status-compeleted.png +0 -0
- package/src/assets/finger-status-start.png +0 -0
- package/src/assets/icon-camera.png +0 -0
- package/src/assets/icon-picture.png +0 -0
- package/src/assets/icon-success.png +0 -0
- package/src/assets/img-camera.png +0 -0
- package/src/assets/img-card.png +0 -0
- package/src/assets/img-loading.png +0 -0
- package/src/assets/left.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/right.png +0 -0
- package/src/assets/ukey1.png +0 -0
- package/src/assets/ukey2.png +0 -0
- package/src/assets//346/214/207/347/272/271/350/257/206/345/210/2531.png +0 -0
- package/src/assets//346/214/207/347/272/271/350/257/206/345/210/2532.png +0 -0
- package/src/components/auth-com.vue +100 -0
- package/src/components/card-register/components/CardTable.vue +94 -0
- package/src/components/card-register/components/RegisterDialog.vue +137 -0
- package/src/components/card-register/index.vue +110 -0
- package/src/components/edit-user-dialog.vue +141 -0
- package/src/components/empty.vue +13 -0
- package/src/components/face-register/components/ChooseCameraOrPicture.vue +59 -0
- package/src/components/face-register/components/FaceDetected.vue +543 -0
- package/src/components/face-register/components/FaceInfo.vue +171 -0
- package/src/components/face-register/components/FacePicture.vue +85 -0
- package/src/components/face-register/components/UploadPicture.vue +336 -0
- package/src/components/face-register/index.vue +242 -0
- package/src/components/finger-register/index.vue +685 -0
- package/src/components/organ-tree.vue +211 -0
- package/src/components/tree-select.vue +131 -0
- package/src/components/user-drawer.vue +147 -0
- package/src/components/user-info.vue +272 -0
- package/src/components/user-table.vue +405 -0
- package/src/main.js +26 -0
- package/src/package/auth-manage/index.vue +461 -0
- package/src/package/index.js +22 -0
- package/src/store/index.js +39 -0
- package/src/styles/common.scss +183 -0
- package/src/styles/index.scss +38 -0
- package/src/utils/dict.js +47 -0
- package/src/utils/event-bus.js +6 -0
- package/src/utils/request-auth.js +64 -0
- package/src/utils/request.js +64 -0
- package/src/utils/websocket.js +282 -0
- package/vue.config.js +43 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-info-main">
|
|
3
|
+
<el-scrollbar style="height: 100%; padding: 16px; box-sizing: border-box">
|
|
4
|
+
<el-form
|
|
5
|
+
:model="form"
|
|
6
|
+
:rules="rules"
|
|
7
|
+
label-width="100%"
|
|
8
|
+
label-position="left"
|
|
9
|
+
>
|
|
10
|
+
<el-collapse v-model="active">
|
|
11
|
+
<el-collapse-item name="base">
|
|
12
|
+
<template slot="title">
|
|
13
|
+
<span class="collapse-title"
|
|
14
|
+
><span class="title-bar" />基础信息</span
|
|
15
|
+
>
|
|
16
|
+
</template>
|
|
17
|
+
<div class="form-item">
|
|
18
|
+
<el-form-item label="姓名" prop="name">
|
|
19
|
+
<el-input
|
|
20
|
+
v-model="form.name"
|
|
21
|
+
placeholder="请输入姓名"
|
|
22
|
+
@input="handleNameChange"
|
|
23
|
+
/>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item label="拼音" prop="spelling">
|
|
26
|
+
<el-input v-model="form.spelling" placeholder="请输入拼音" />
|
|
27
|
+
</el-form-item>
|
|
28
|
+
<el-form-item label="所属单位" prop="organName">
|
|
29
|
+
<el-input v-model="form.organName" disabled />
|
|
30
|
+
</el-form-item>
|
|
31
|
+
<el-form-item label="密级" prop="secretLevel">
|
|
32
|
+
<el-select
|
|
33
|
+
placeholder="请选择密级"
|
|
34
|
+
style="width: 100%"
|
|
35
|
+
v-model="form.secretLevel"
|
|
36
|
+
>
|
|
37
|
+
<el-option
|
|
38
|
+
v-for="item in secretList"
|
|
39
|
+
:key="item.value"
|
|
40
|
+
:label="item.label"
|
|
41
|
+
:value="item.value"
|
|
42
|
+
/>
|
|
43
|
+
</el-select>
|
|
44
|
+
</el-form-item>
|
|
45
|
+
<el-form-item placeholder="请选择性别" label="性别" prop="gender">
|
|
46
|
+
<el-select style="width: 100%" v-model="form.gender">
|
|
47
|
+
<el-option
|
|
48
|
+
v-for="item in genderList"
|
|
49
|
+
:key="item.value"
|
|
50
|
+
:label="item.label"
|
|
51
|
+
:value="item.value"
|
|
52
|
+
/>
|
|
53
|
+
</el-select>
|
|
54
|
+
</el-form-item>
|
|
55
|
+
</div>
|
|
56
|
+
</el-collapse-item>
|
|
57
|
+
<el-collapse-item name="account">
|
|
58
|
+
<template slot="title">
|
|
59
|
+
<span class="collapse-title"
|
|
60
|
+
><span class="title-bar" />账号信息</span
|
|
61
|
+
>
|
|
62
|
+
</template>
|
|
63
|
+
<div class="form-item">
|
|
64
|
+
<el-form-item label="状态" prop="enabled">
|
|
65
|
+
<div class="form-status">
|
|
66
|
+
<el-radio-group
|
|
67
|
+
placeholder="请选择状态"
|
|
68
|
+
v-model="form.enabled"
|
|
69
|
+
>
|
|
70
|
+
<el-radio :label="true">启用</el-radio>
|
|
71
|
+
<el-radio :label="false">禁用</el-radio>
|
|
72
|
+
</el-radio-group>
|
|
73
|
+
</div>
|
|
74
|
+
</el-form-item>
|
|
75
|
+
<el-form-item label="中文账号" prop="cnAccount">
|
|
76
|
+
<el-input
|
|
77
|
+
placeholder="请输入中文账号"
|
|
78
|
+
v-model="form.cnAccount"
|
|
79
|
+
/>
|
|
80
|
+
</el-form-item>
|
|
81
|
+
<el-form-item label="英文账号" prop="enAccount">
|
|
82
|
+
<el-input
|
|
83
|
+
placeholder="请输入英文账号"
|
|
84
|
+
v-model="form.enAccount"
|
|
85
|
+
/>
|
|
86
|
+
</el-form-item>
|
|
87
|
+
<el-form-item label="邮箱" prop="email">
|
|
88
|
+
<el-input placeholder="请输入邮箱" v-model="form.email" />
|
|
89
|
+
</el-form-item>
|
|
90
|
+
</div>
|
|
91
|
+
</el-collapse-item>
|
|
92
|
+
</el-collapse>
|
|
93
|
+
</el-form>
|
|
94
|
+
</el-scrollbar>
|
|
95
|
+
</div>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script>
|
|
99
|
+
import { apiOrganTree, apiUserLoad } from "@/api";
|
|
100
|
+
import { GENDER, SECRET_LEVEL_LIST, dictToArray } from "@/utils/dict";
|
|
101
|
+
import pinyin from "pinyin";
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
name: "user-info",
|
|
105
|
+
props: {
|
|
106
|
+
drawerInfo: {
|
|
107
|
+
type: Object,
|
|
108
|
+
default: () => {},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
secretList: SECRET_LEVEL_LIST,
|
|
114
|
+
active: ["base", "account"],
|
|
115
|
+
lastAutoSpelling: "", // 记录最后一次自动转换的拼音
|
|
116
|
+
form: {
|
|
117
|
+
enabled: true,
|
|
118
|
+
spelling: "",
|
|
119
|
+
name: "",
|
|
120
|
+
},
|
|
121
|
+
rules: {
|
|
122
|
+
enabled: [{ required: true, message: "状态不能为空", trigger: "blur" }],
|
|
123
|
+
name: [{ required: true, message: "姓名不能为空!", trigger: "blur" }],
|
|
124
|
+
spelling: [
|
|
125
|
+
{
|
|
126
|
+
required: true,
|
|
127
|
+
message: "拼音不能为空!",
|
|
128
|
+
trigger: ["blur", "change"],
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
organName: [
|
|
132
|
+
{ required: true, message: "所属单位不能为空!", trigger: ["change"] },
|
|
133
|
+
],
|
|
134
|
+
secretLevel: [
|
|
135
|
+
{ required: true, message: "密级不能为空!", trigger: ["change"] },
|
|
136
|
+
],
|
|
137
|
+
gender: [
|
|
138
|
+
{ required: true, message: "性别不能为空!", trigger: ["change"] },
|
|
139
|
+
],
|
|
140
|
+
cnAccount: [
|
|
141
|
+
{
|
|
142
|
+
required: true,
|
|
143
|
+
message: "中文账号不能为空!",
|
|
144
|
+
trigger: ["blur", "change"],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
computed: {
|
|
151
|
+
genderList() {
|
|
152
|
+
return dictToArray(GENDER);
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
mounted() {
|
|
156
|
+
this.f_init();
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
methods: {
|
|
160
|
+
async f_init() {
|
|
161
|
+
console.log("drawerInfo1241241", this.drawerInfo);
|
|
162
|
+
if (this.drawerInfo?.userId) {
|
|
163
|
+
const res = await apiUserLoad({ id: this.drawerInfo?.userId });
|
|
164
|
+
this.form = {
|
|
165
|
+
...res.data,
|
|
166
|
+
organName: res.data.organNamePath,
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
this.$set(this.form, "organId", this.drawerInfo.organ.id);
|
|
170
|
+
this.$set(this.form, "organName", this.drawerInfo.organ.caption);
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
async f_loadNode(node, resolve) {
|
|
174
|
+
if (node.level === 0) {
|
|
175
|
+
const res = await apiOrganTree();
|
|
176
|
+
resolve(res.data || []);
|
|
177
|
+
} else {
|
|
178
|
+
const res = await apiOrganTree({ parentId: node.data.id });
|
|
179
|
+
res.data.forEach((item) => {
|
|
180
|
+
item.parentId = node.data.id;
|
|
181
|
+
item.parentName = node.data.caption;
|
|
182
|
+
});
|
|
183
|
+
resolve(res.data || []);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
h_getFormData() {
|
|
187
|
+
return this.form;
|
|
188
|
+
},
|
|
189
|
+
handleNameChange(value) {
|
|
190
|
+
// 只有当拼音字段为空或者与之前的转换结果一致时才自动更新
|
|
191
|
+
if (value) {
|
|
192
|
+
const pinyinArray = pinyin(value, {
|
|
193
|
+
style: pinyin.STYLE_NORMAL, // 不带声调的拼音
|
|
194
|
+
heteronym: false, // 不启用多音字
|
|
195
|
+
segment: true, // 启用分词
|
|
196
|
+
});
|
|
197
|
+
// 将拼音数组扁平化并连接成字符串
|
|
198
|
+
const spellingResult = pinyinArray.flat().join("");
|
|
199
|
+
this.form.spelling = spellingResult;
|
|
200
|
+
} else {
|
|
201
|
+
this.form.spelling = "";
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<style lang="scss" scoped>
|
|
209
|
+
.user-info-main {
|
|
210
|
+
width: 100%;
|
|
211
|
+
height: 100%;
|
|
212
|
+
|
|
213
|
+
.collapse-title {
|
|
214
|
+
display: flex;
|
|
215
|
+
color: rgba(16, 16, 16, 100);
|
|
216
|
+
font-size: 16px;
|
|
217
|
+
text-align: left;
|
|
218
|
+
font-family: SourceHanSansSC-regular;
|
|
219
|
+
align-items: center;
|
|
220
|
+
|
|
221
|
+
.title-bar {
|
|
222
|
+
display: inline-block;
|
|
223
|
+
margin-right: 10px;
|
|
224
|
+
width: 4px;
|
|
225
|
+
height: 16px;
|
|
226
|
+
font-size: 16px;
|
|
227
|
+
background: #3391ff;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.form-item {
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
align-items: center;
|
|
235
|
+
width: calc(100% - 28px);
|
|
236
|
+
padding: 0 14px;
|
|
237
|
+
|
|
238
|
+
.form-status {
|
|
239
|
+
padding: 4px 6px;
|
|
240
|
+
background: #f7f9fe;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
::v-deep {
|
|
245
|
+
.el-collapse {
|
|
246
|
+
border: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.el-collapse-item__wrap {
|
|
250
|
+
border-bottom: 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.el-collapse-item__header {
|
|
254
|
+
border-bottom: 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.el-form-item {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
align-items: center;
|
|
261
|
+
width: calc(100% - 28px);
|
|
262
|
+
padding: 10px 14px 0 14px;
|
|
263
|
+
margin-bottom: 4px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.el-form-item__content {
|
|
267
|
+
width: 100%;
|
|
268
|
+
margin-left: 0 !important;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
</style>
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-table" v-loading="loading">
|
|
3
|
+
<div class="user-opt f_between">
|
|
4
|
+
<div>
|
|
5
|
+
<el-button
|
|
6
|
+
:disabled="!organId"
|
|
7
|
+
type="primary"
|
|
8
|
+
@click="h_addUser"
|
|
9
|
+
icon="el-icon-circle-plus-outline"
|
|
10
|
+
>新增</el-button
|
|
11
|
+
>
|
|
12
|
+
<el-button
|
|
13
|
+
:disabled="!organId"
|
|
14
|
+
type="danger"
|
|
15
|
+
plain
|
|
16
|
+
icon="el-icon-delete"
|
|
17
|
+
@click="h_removeUser"
|
|
18
|
+
>删除</el-button
|
|
19
|
+
>
|
|
20
|
+
<el-button
|
|
21
|
+
:disabled="!organId"
|
|
22
|
+
type="warning"
|
|
23
|
+
plain
|
|
24
|
+
icon="el-icon-refresh"
|
|
25
|
+
@click="h_changeOrg"
|
|
26
|
+
>调换</el-button
|
|
27
|
+
>
|
|
28
|
+
<el-button
|
|
29
|
+
:disabled="!organId"
|
|
30
|
+
plain
|
|
31
|
+
icon="el-icon-circle-check"
|
|
32
|
+
@click="h_statusChange(true)"
|
|
33
|
+
>启用</el-button
|
|
34
|
+
>
|
|
35
|
+
<el-button
|
|
36
|
+
:disabled="!organId"
|
|
37
|
+
plain
|
|
38
|
+
icon="el-icon-circle-close"
|
|
39
|
+
@click="h_statusChange(false)"
|
|
40
|
+
>禁用</el-button
|
|
41
|
+
>
|
|
42
|
+
<el-button
|
|
43
|
+
:disabled="!organId"
|
|
44
|
+
plain
|
|
45
|
+
icon="el-icon-refresh"
|
|
46
|
+
@click="h_resetPwd"
|
|
47
|
+
>密码重置</el-button
|
|
48
|
+
>
|
|
49
|
+
</div>
|
|
50
|
+
<!-- <el-input
|
|
51
|
+
v-model="search"
|
|
52
|
+
placeholder="请输入用户名称"
|
|
53
|
+
style="width: 240px"
|
|
54
|
+
>
|
|
55
|
+
<i slot="suffix" class="el-input__icon el-icon-search"></i>
|
|
56
|
+
</el-input> -->
|
|
57
|
+
<el-input
|
|
58
|
+
size="small"
|
|
59
|
+
placeholder="请输入用户名称"
|
|
60
|
+
v-model="keyWord"
|
|
61
|
+
class="input-with-select"
|
|
62
|
+
@keyup.native.enter="handleSearch"
|
|
63
|
+
style="width: 240px"
|
|
64
|
+
>
|
|
65
|
+
<el-button
|
|
66
|
+
slot="append"
|
|
67
|
+
icon="el-icon-search"
|
|
68
|
+
@click="handleSearch"
|
|
69
|
+
></el-button>
|
|
70
|
+
</el-input>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="user-table-main">
|
|
73
|
+
<div class="user-table-content">
|
|
74
|
+
<el-table
|
|
75
|
+
ref="table"
|
|
76
|
+
:data="table.data"
|
|
77
|
+
stripe
|
|
78
|
+
height="100%"
|
|
79
|
+
:header-cell-style="{ background: '#f7f8fa' }"
|
|
80
|
+
@selection-change="h_selectionChange"
|
|
81
|
+
@row-click="h_rowClick"
|
|
82
|
+
>
|
|
83
|
+
<el-table-column type="selection" width="55"> </el-table-column>
|
|
84
|
+
<el-table-column label="序号" type="index" width="50">
|
|
85
|
+
</el-table-column>
|
|
86
|
+
<el-table-column prop="name" label="用户名称" />
|
|
87
|
+
<el-table-column prop="spelling" label="拼音" />
|
|
88
|
+
<el-table-column prop="secretLevelLabel" label="密级" />
|
|
89
|
+
<el-table-column prop="enabledLabel" label="状态" />
|
|
90
|
+
<el-table-column
|
|
91
|
+
label="操作"
|
|
92
|
+
header-align="center"
|
|
93
|
+
align="center"
|
|
94
|
+
width="80"
|
|
95
|
+
>
|
|
96
|
+
<template #default="{ row }">
|
|
97
|
+
<span class="row-opt" @click="h_rowOpt(row)">编辑</span>
|
|
98
|
+
</template>
|
|
99
|
+
</el-table-column>
|
|
100
|
+
</el-table>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="user-table-pagination f_end">
|
|
103
|
+
<el-pagination
|
|
104
|
+
class="pagination"
|
|
105
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
106
|
+
:current-page="table.pagination.current"
|
|
107
|
+
:page-size="table.pagination.size"
|
|
108
|
+
:total="table.pagination.total"
|
|
109
|
+
@size-change="h_sizeChange"
|
|
110
|
+
@current-change="h_currentChange"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<el-dialog
|
|
115
|
+
v-if="visible"
|
|
116
|
+
:visible="visible"
|
|
117
|
+
title="调换机构"
|
|
118
|
+
width="540px"
|
|
119
|
+
:destroy-on-close="true"
|
|
120
|
+
:close-on-click-modal="false"
|
|
121
|
+
:before-close="h_close"
|
|
122
|
+
:append-to-body="true"
|
|
123
|
+
>
|
|
124
|
+
<el-form
|
|
125
|
+
ref="form"
|
|
126
|
+
:model="form"
|
|
127
|
+
:rules="rules"
|
|
128
|
+
label-width="120px"
|
|
129
|
+
size="small"
|
|
130
|
+
>
|
|
131
|
+
<el-form-item label="所属机构" prop="id">
|
|
132
|
+
<tree-select
|
|
133
|
+
:value.sync="form.id"
|
|
134
|
+
:defaultLabel="form.caption"
|
|
135
|
+
:defaultProps="{
|
|
136
|
+
label: 'caption',
|
|
137
|
+
value: 'id',
|
|
138
|
+
children: 'children',
|
|
139
|
+
isLeaf: (data) => {
|
|
140
|
+
return data.hasChild === false;
|
|
141
|
+
},
|
|
142
|
+
}"
|
|
143
|
+
:load="f_loadNode"
|
|
144
|
+
@setNode="h_setNode"
|
|
145
|
+
/>
|
|
146
|
+
</el-form-item>
|
|
147
|
+
</el-form>
|
|
148
|
+
<div slot="footer" class="dialog-footer f_center">
|
|
149
|
+
<el-button size="mini" @click="h_close"> 取消 </el-button>
|
|
150
|
+
<el-button type="primary" size="mini" @click="h_submit">
|
|
151
|
+
确定
|
|
152
|
+
</el-button>
|
|
153
|
+
</div>
|
|
154
|
+
</el-dialog>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<script>
|
|
159
|
+
import {
|
|
160
|
+
apiDelUser,
|
|
161
|
+
apiUserPage,
|
|
162
|
+
apiUpdateStatus,
|
|
163
|
+
apiResetPwd,
|
|
164
|
+
apiOrganTree,
|
|
165
|
+
apiUserMove,
|
|
166
|
+
} from "@/api/index";
|
|
167
|
+
|
|
168
|
+
import TreeSelect from "@/components/tree-select.vue";
|
|
169
|
+
|
|
170
|
+
import { SECRET_LEVEL } from "@/utils/dict";
|
|
171
|
+
|
|
172
|
+
export default {
|
|
173
|
+
name: "user-table",
|
|
174
|
+
props: {
|
|
175
|
+
organ: {
|
|
176
|
+
type: Object,
|
|
177
|
+
default: () => {},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
components: {
|
|
181
|
+
TreeSelect,
|
|
182
|
+
},
|
|
183
|
+
data() {
|
|
184
|
+
return {
|
|
185
|
+
loading: false,
|
|
186
|
+
visible: false,
|
|
187
|
+
selection: [],
|
|
188
|
+
form: {},
|
|
189
|
+
rules: {
|
|
190
|
+
id: [
|
|
191
|
+
{
|
|
192
|
+
required: true,
|
|
193
|
+
message: "所属机构不能为空!",
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
node: {},
|
|
198
|
+
row: {},
|
|
199
|
+
search: "",
|
|
200
|
+
keyWord: "",
|
|
201
|
+
table: {
|
|
202
|
+
data: [],
|
|
203
|
+
pagination: {
|
|
204
|
+
current: 1,
|
|
205
|
+
size: 10,
|
|
206
|
+
total: 0,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
computed: {
|
|
212
|
+
organId() {
|
|
213
|
+
return !!this.organ?.id;
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
watch: {
|
|
217
|
+
search() {
|
|
218
|
+
this.f_loadData(true);
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
methods: {
|
|
222
|
+
handleSearch() {
|
|
223
|
+
this.search = this.keyWord;
|
|
224
|
+
},
|
|
225
|
+
f_init(val) {
|
|
226
|
+
this.node = val;
|
|
227
|
+
this.f_loadData();
|
|
228
|
+
},
|
|
229
|
+
async f_loadData(init = false) {
|
|
230
|
+
this.loading = true;
|
|
231
|
+
try {
|
|
232
|
+
if (init) this.$set(this.table.pagination, "current", 1);
|
|
233
|
+
const params = {
|
|
234
|
+
keyword: this.search || undefined,
|
|
235
|
+
organId: this.node.id,
|
|
236
|
+
page: this.table.pagination.current,
|
|
237
|
+
size: this.table.pagination.size,
|
|
238
|
+
};
|
|
239
|
+
const res = await apiUserPage(params);
|
|
240
|
+
res.data.data.forEach((item) => {
|
|
241
|
+
item.enabledLabel = item.enabled ? "启用" : "禁用";
|
|
242
|
+
item.secretLevelLabel = SECRET_LEVEL[item.secretLevel];
|
|
243
|
+
});
|
|
244
|
+
this.$set(this.table, "data", res.data.data || []);
|
|
245
|
+
this.table.pagination.total = res.data.total;
|
|
246
|
+
this.loading = false;
|
|
247
|
+
} catch (err) {
|
|
248
|
+
this.loading = false;
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
async f_loadNode(node, resolve) {
|
|
252
|
+
if (node.level === 0) {
|
|
253
|
+
const res = await apiOrganTree();
|
|
254
|
+
resolve(res.data || []);
|
|
255
|
+
} else {
|
|
256
|
+
const res = await apiOrganTree({ parentId: node.data.id });
|
|
257
|
+
res.data.forEach((item) => {
|
|
258
|
+
item.parentId = node.data.id;
|
|
259
|
+
item.parentName = node.data.caption;
|
|
260
|
+
});
|
|
261
|
+
resolve(res.data || []);
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
h_addUser() {
|
|
265
|
+
this.$emit("drawer");
|
|
266
|
+
},
|
|
267
|
+
h_selectionChange(val) {
|
|
268
|
+
this.selection = val;
|
|
269
|
+
},
|
|
270
|
+
h_rowClick(row) {
|
|
271
|
+
this.$refs.table.toggleRowSelection(row);
|
|
272
|
+
},
|
|
273
|
+
h_rowOpt(row) {
|
|
274
|
+
this.$emit("drawer", row.id, row);
|
|
275
|
+
},
|
|
276
|
+
h_changeOrg() {
|
|
277
|
+
this.form = {...this.node};
|
|
278
|
+
if (!this.selection?.length)
|
|
279
|
+
return this.$message.warning("请至少选择一条操作项!");
|
|
280
|
+
this.visible = true;
|
|
281
|
+
},
|
|
282
|
+
h_resetPwd() {
|
|
283
|
+
if (!this.selection?.length)
|
|
284
|
+
return this.$message.warning("请至少选择一条操作项!");
|
|
285
|
+
this.$confirm("确认重置选中的用户密码?", "提示", "warning")
|
|
286
|
+
.then(async (res) => {
|
|
287
|
+
if (res) {
|
|
288
|
+
const ids = this.selection.map((item) => item.id);
|
|
289
|
+
await apiResetPwd({ ids });
|
|
290
|
+
this.f_loadData();
|
|
291
|
+
this.$message.success(`重置密码成功!`);
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
.catch((err) => {
|
|
295
|
+
console.error("用户状态 err", err);
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
async h_statusChange(val) {
|
|
299
|
+
if (!this.selection?.length)
|
|
300
|
+
return this.$message.warning("请至少选择一条操作项!");
|
|
301
|
+
this.$confirm("确认修改选中的用户状态?", "提示", "warning")
|
|
302
|
+
.then(async (res) => {
|
|
303
|
+
if (res) {
|
|
304
|
+
const ids = this.selection.map((item) => item.id);
|
|
305
|
+
await apiUpdateStatus({ ids, status: val });
|
|
306
|
+
this.f_loadData();
|
|
307
|
+
this.$message.success(`${val ? "启用" : "禁用"}成功!`);
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
.catch((err) => {
|
|
311
|
+
console.error("用户状态 err", err);
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
h_removeUser() {
|
|
315
|
+
if (!this.selection?.length)
|
|
316
|
+
return this.$message.warning("请至少选择一条操作项!");
|
|
317
|
+
this.$confirm("确认删除选中的用户?", "提示", "warning")
|
|
318
|
+
.then(async (res) => {
|
|
319
|
+
if (res) {
|
|
320
|
+
const ids = this.selection.map((item) => item.id);
|
|
321
|
+
await apiDelUser({ ids: ids.join(",") });
|
|
322
|
+
this.f_loadData(true);
|
|
323
|
+
this.$message.success("删除成功!");
|
|
324
|
+
}
|
|
325
|
+
})
|
|
326
|
+
.catch((err) => {
|
|
327
|
+
console.error("删除用户 err", err);
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
h_currentChange(current) {
|
|
331
|
+
this.table.pagination.current = current;
|
|
332
|
+
this.f_loadData();
|
|
333
|
+
},
|
|
334
|
+
h_sizeChange(size) {
|
|
335
|
+
this.table.pagination.size = size;
|
|
336
|
+
this.f_loadData();
|
|
337
|
+
},
|
|
338
|
+
async h_submit() {
|
|
339
|
+
const ids = this.selection.map((item) => item.id);
|
|
340
|
+
try {
|
|
341
|
+
await apiUserMove({ entityIds: ids, targetId: this.form.id });
|
|
342
|
+
this.f_loadData(true);
|
|
343
|
+
this.h_close();
|
|
344
|
+
this.$message.success("调换机构成功!");
|
|
345
|
+
this.$emit("refreshTree");
|
|
346
|
+
} catch (err) {
|
|
347
|
+
console.error("调换机构 err", err);
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
h_setNode(val) {
|
|
351
|
+
this.$set(this.form, "id", val.id);
|
|
352
|
+
this.$set(this.form, "caption", val.caption);
|
|
353
|
+
},
|
|
354
|
+
h_close() {
|
|
355
|
+
this.visible = false;
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
</script>
|
|
360
|
+
|
|
361
|
+
<style lang="scss" scoped>
|
|
362
|
+
.user-table {
|
|
363
|
+
width: 100%;
|
|
364
|
+
height: 100%;
|
|
365
|
+
padding: 14px;
|
|
366
|
+
border: 1px solid #cedded;
|
|
367
|
+
box-sizing: border-box;
|
|
368
|
+
|
|
369
|
+
.user-opt {
|
|
370
|
+
width: 100%;
|
|
371
|
+
height: 50px;
|
|
372
|
+
padding-bottom: 10px;
|
|
373
|
+
|
|
374
|
+
::v-deep {
|
|
375
|
+
.el-button {
|
|
376
|
+
padding: 7px 20px;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.user-table-main {
|
|
382
|
+
width: 100%;
|
|
383
|
+
height: calc(100% - 50px);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.user-table-content {
|
|
387
|
+
width: 100%;
|
|
388
|
+
height: calc(100% - 40px);
|
|
389
|
+
|
|
390
|
+
.row-opt {
|
|
391
|
+
cursor: pointer;
|
|
392
|
+
color: #3391ff;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.user-table-pagination {
|
|
397
|
+
width: 100%;
|
|
398
|
+
height: 40px;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
::v-deep .el-button {
|
|
403
|
+
border-radius: 8px;
|
|
404
|
+
}
|
|
405
|
+
</style>
|
package/src/main.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import App from "./App.vue";
|
|
3
|
+
import LdAuth from "@/package/index.js";
|
|
4
|
+
// import LdAuth from './package/index.js'
|
|
5
|
+
import store from "./store";
|
|
6
|
+
|
|
7
|
+
import ElementUI from "element-ui";
|
|
8
|
+
import "element-ui/lib/theme-chalk/index.css";
|
|
9
|
+
|
|
10
|
+
import "./styles/index.scss";
|
|
11
|
+
|
|
12
|
+
Vue.use(LdAuth, {
|
|
13
|
+
baseUrl: "http://dftdm.netiler.com",
|
|
14
|
+
authUrl: "http://dftdm.netiler.com",
|
|
15
|
+
websocketUrl: "ws://10.1.22.32:38280",
|
|
16
|
+
});
|
|
17
|
+
Vue.use(ElementUI, {
|
|
18
|
+
size: "medium",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
Vue.config.productionTip = false;
|
|
22
|
+
|
|
23
|
+
new Vue({
|
|
24
|
+
store,
|
|
25
|
+
render: (h) => h(App),
|
|
26
|
+
}).$mount("#app");
|