leadal-auth 0.0.2 → 0.0.3
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/leadal-auth/leadal-auth.common.js +1 -1
- package/leadal-auth/leadal-auth.umd.js +1 -1
- package/leadal-auth/leadal-auth.umd.min.js +1 -1
- package/package.json +31 -8
- package/babel.config.js +0 -5
- package/jsconfig.json +0 -19
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/public/models/age_gender_model-shard1 +0 -0
- package/public/models/age_gender_model-weights_manifest.json +0 -1
- package/public/models/face_expression_model-shard1 +0 -0
- package/public/models/face_expression_model-weights_manifest.json +0 -1
- package/public/models/face_landmark_68_model-shard1 +0 -0
- package/public/models/face_landmark_68_model-weights_manifest.json +0 -1
- package/public/models/face_landmark_68_tiny_model-shard1 +0 -0
- package/public/models/face_landmark_68_tiny_model-weights_manifest.json +0 -1
- package/public/models/face_recognition_model-shard1 +0 -0
- package/public/models/face_recognition_model-shard2 +0 -6
- package/public/models/face_recognition_model-weights_manifest.json +0 -1
- package/public/models/mtcnn_model-shard1 +0 -0
- package/public/models/mtcnn_model-weights_manifest.json +0 -1
- package/public/models/ssd_mobilenetv1_model-shard1 +0 -0
- package/public/models/ssd_mobilenetv1_model-shard2 +8 -137
- package/public/models/ssd_mobilenetv1_model-weights_manifest.json +0 -1
- package/public/models/tiny_face_detector_model-shard1 +0 -0
- package/public/models/tiny_face_detector_model-weights_manifest.json +0 -1
- package/src/App.vue +0 -19
- package/src/api/card.js +0 -58
- package/src/api/face.js +0 -37
- package/src/api/finger.js +0 -64
- package/src/api/index.js +0 -100
- package/src/assets/BIN.png +0 -0
- package/src/assets/CLOSE.svg +0 -11
- 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 +0 -100
- package/src/components/card-register/components/CardTable.vue +0 -94
- package/src/components/card-register/components/RegisterDialog.vue +0 -137
- package/src/components/card-register/index.vue +0 -110
- package/src/components/edit-user-dialog.vue +0 -141
- package/src/components/empty.vue +0 -13
- package/src/components/face-register/components/ChooseCameraOrPicture.vue +0 -59
- package/src/components/face-register/components/FaceDetected.vue +0 -543
- package/src/components/face-register/components/FaceInfo.vue +0 -171
- package/src/components/face-register/components/FacePicture.vue +0 -85
- package/src/components/face-register/components/UploadPicture.vue +0 -336
- package/src/components/face-register/index.vue +0 -242
- package/src/components/finger-register/index.vue +0 -707
- package/src/components/organ-tree.vue +0 -211
- package/src/components/tree-select.vue +0 -131
- package/src/components/user-drawer.vue +0 -147
- package/src/components/user-info.vue +0 -272
- package/src/components/user-table.vue +0 -405
- package/src/main.js +0 -25
- package/src/package/auth-manage/index.vue +0 -468
- package/src/package/index.js +0 -22
- package/src/store/index.js +0 -39
- package/src/styles/common.scss +0 -183
- package/src/styles/index.scss +0 -38
- package/src/utils/dict.js +0 -47
- package/src/utils/event-bus.js +0 -6
- package/src/utils/request-auth.js +0 -64
- package/src/utils/request.js +0 -64
- package/src/utils/websocket.js +0 -282
- package/vue.config.js +0 -43
|
@@ -1,707 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex-center align-center h100 w100">
|
|
3
|
-
<!-- 指纹注册弹窗 -->
|
|
4
|
-
<div class="finger-dialog">
|
|
5
|
-
<div class="finger-register-content">
|
|
6
|
-
<div
|
|
7
|
-
style="
|
|
8
|
-
color: #333;
|
|
9
|
-
font-size: 24px;
|
|
10
|
-
margin-bottom: 12px;
|
|
11
|
-
padding-top: 48px;
|
|
12
|
-
text-align: center;
|
|
13
|
-
margin-top: 24px;
|
|
14
|
-
"
|
|
15
|
-
>
|
|
16
|
-
{{ stepTips }}
|
|
17
|
-
</div>
|
|
18
|
-
<div
|
|
19
|
-
style="
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
padding-top: 50px;
|
|
24
|
-
"
|
|
25
|
-
>
|
|
26
|
-
<!-- 左手区域 -->
|
|
27
|
-
<div class="hand-area left-hand">
|
|
28
|
-
<div class="hand-image-wrapper">
|
|
29
|
-
<img :src="leftHandleImg" class="hand-image" />
|
|
30
|
-
<!-- 左手指尖按钮 -->
|
|
31
|
-
<div class="finger-buttons-overlay">
|
|
32
|
-
<div
|
|
33
|
-
v-for="(finger, index) in leftFingers"
|
|
34
|
-
:key="'left-' + index"
|
|
35
|
-
:class="[
|
|
36
|
-
'finger-circle',
|
|
37
|
-
{
|
|
38
|
-
active:
|
|
39
|
-
selectedFinger && selectedFinger.value === finger.value,
|
|
40
|
-
ready: !!finger.fingerInfo,
|
|
41
|
-
},
|
|
42
|
-
]"
|
|
43
|
-
:style="{ top: finger.top + 'px', left: finger.left + 'px' }"
|
|
44
|
-
@click="handleSelectFinger(finger)"
|
|
45
|
-
></div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<!-- 右手区域 -->
|
|
51
|
-
<div class="hand-area right-hand">
|
|
52
|
-
<div class="hand-image-wrapper">
|
|
53
|
-
<img :src="rightHandleImg" class="hand-image" />
|
|
54
|
-
<!-- 右手指尖按钮 -->
|
|
55
|
-
<div class="finger-buttons-overlay">
|
|
56
|
-
<div
|
|
57
|
-
v-for="(finger, index) in rightFingers"
|
|
58
|
-
:key="'right-' + index"
|
|
59
|
-
:class="[
|
|
60
|
-
'finger-circle',
|
|
61
|
-
{
|
|
62
|
-
active:
|
|
63
|
-
selectedFinger && selectedFinger.value === finger.value,
|
|
64
|
-
ready: !!finger.fingerInfo,
|
|
65
|
-
},
|
|
66
|
-
]"
|
|
67
|
-
:style="{ top: finger.top + 'px', left: finger.left + 'px' }"
|
|
68
|
-
@click="handleSelectFinger(finger)"
|
|
69
|
-
></div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<!-- 指纹状态区域 -->
|
|
75
|
-
<div class="fingerprint-status">
|
|
76
|
-
<div class="fingerprint-image-container">
|
|
77
|
-
<div class="delete-button">
|
|
78
|
-
<el-button
|
|
79
|
-
type="text"
|
|
80
|
-
size="large"
|
|
81
|
-
@click="handleDeleteFinger"
|
|
82
|
-
v-if="selectedFinger && selectedFinger.fingerInfo"
|
|
83
|
-
>
|
|
84
|
-
<i class="el-icon-delete" style="font-size: 20px; color: #999;"></i>
|
|
85
|
-
</el-button>
|
|
86
|
-
</div>
|
|
87
|
-
<img :src="currentFingerprintImage" class="fingerprint-image" />
|
|
88
|
-
<p class="status-text">
|
|
89
|
-
{{ fingerStatusText }}
|
|
90
|
-
</p>
|
|
91
|
-
|
|
92
|
-
<!-- fingerInfo存在 显示删除按钮 固定在右上角 -->
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<!-- <div class="flex-center align-center w100">
|
|
99
|
-
<el-button
|
|
100
|
-
type="primary"
|
|
101
|
-
style="
|
|
102
|
-
width: 214px;
|
|
103
|
-
height: 40px;
|
|
104
|
-
border-radius: 20px;
|
|
105
|
-
font-size: 16px;
|
|
106
|
-
"
|
|
107
|
-
:loading="loading"
|
|
108
|
-
:disabled="!selectedFinger || fingerRegisterStep !== 5 || !fingerTemp"
|
|
109
|
-
@click="handleSaveFingerprint"
|
|
110
|
-
>保存</el-button
|
|
111
|
-
>
|
|
112
|
-
</div> -->
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</template>
|
|
116
|
-
|
|
117
|
-
<script>
|
|
118
|
-
import {
|
|
119
|
-
uploadFingerApi,
|
|
120
|
-
getMaxFingerSeqApi,
|
|
121
|
-
findByUserIdApi,
|
|
122
|
-
deleteFingerApi,
|
|
123
|
-
} from "@/api/finger";
|
|
124
|
-
|
|
125
|
-
export default {
|
|
126
|
-
name: "FingerRegisterView",
|
|
127
|
-
props: {
|
|
128
|
-
row: {
|
|
129
|
-
type: Object,
|
|
130
|
-
default: () => {},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
data() {
|
|
134
|
-
return {
|
|
135
|
-
// -1:指纹录入失败,请重试
|
|
136
|
-
// 0:请选择需要采集的手指
|
|
137
|
-
// 1:请将手指放在设备上
|
|
138
|
-
// 2:再次将手指放在设备上
|
|
139
|
-
// 3:最后一次将手指放在设备上
|
|
140
|
-
// 4:指纹采集完成
|
|
141
|
-
// 5:正在录入
|
|
142
|
-
// 6:指纹录入完成
|
|
143
|
-
fingerRegisterStep: 0,
|
|
144
|
-
currentFingerprintImage: require("@/assets/finger-status-start.png"),
|
|
145
|
-
gifTimeoutId: null,
|
|
146
|
-
selectedFinger: null,
|
|
147
|
-
fingerTemp: null, // 指纹模板(base64 字符串)
|
|
148
|
-
fingerId: null, // 后端接口指纹id
|
|
149
|
-
fid: null, // 指纹仪唯一id
|
|
150
|
-
loading: false,
|
|
151
|
-
leftFingers: [
|
|
152
|
-
{
|
|
153
|
-
label: "大拇指",
|
|
154
|
-
value: "left-thumb",
|
|
155
|
-
top: 122,
|
|
156
|
-
left: 6,
|
|
157
|
-
index: 0,
|
|
158
|
-
fingerInfo: null,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
label: "食指",
|
|
162
|
-
value: "left-index",
|
|
163
|
-
top: 20,
|
|
164
|
-
left: 60,
|
|
165
|
-
index: 1,
|
|
166
|
-
fingerInfo: null,
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
label: "中指",
|
|
170
|
-
value: "left-middle",
|
|
171
|
-
top: 3,
|
|
172
|
-
left: 98,
|
|
173
|
-
index: 2,
|
|
174
|
-
fingerInfo: null,
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
label: "无名指",
|
|
178
|
-
value: "left-ring",
|
|
179
|
-
top: 12,
|
|
180
|
-
left: 136,
|
|
181
|
-
index: 3,
|
|
182
|
-
fingerInfo: null,
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
label: "小拇指",
|
|
186
|
-
value: "left-little",
|
|
187
|
-
top: 35,
|
|
188
|
-
left: 176,
|
|
189
|
-
index: 4,
|
|
190
|
-
fingerInfo: null,
|
|
191
|
-
},
|
|
192
|
-
],
|
|
193
|
-
rightFingers: [
|
|
194
|
-
{
|
|
195
|
-
label: "大拇指",
|
|
196
|
-
value: "right-thumb",
|
|
197
|
-
top: 118,
|
|
198
|
-
left: 178,
|
|
199
|
-
index: 5,
|
|
200
|
-
fingerInfo: null,
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
label: "食指",
|
|
204
|
-
value: "right-index",
|
|
205
|
-
top: 16,
|
|
206
|
-
left: 121,
|
|
207
|
-
index: 6,
|
|
208
|
-
fingerInfo: null,
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
label: "中指",
|
|
212
|
-
value: "right-middle",
|
|
213
|
-
top: 0,
|
|
214
|
-
left: 83,
|
|
215
|
-
index: 7,
|
|
216
|
-
fingerInfo: null,
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
label: "无名指",
|
|
220
|
-
value: "right-ring",
|
|
221
|
-
top: 11,
|
|
222
|
-
left: 43,
|
|
223
|
-
index: 8,
|
|
224
|
-
fingerInfo: null,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: "小拇指",
|
|
228
|
-
value: "right-little",
|
|
229
|
-
top: 42,
|
|
230
|
-
left: 5,
|
|
231
|
-
index: 9,
|
|
232
|
-
fingerInfo: null,
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
};
|
|
236
|
-
},
|
|
237
|
-
computed: {
|
|
238
|
-
// ...mapGetters(["userId", "devSn", "devType", "tenantId"]),
|
|
239
|
-
userId() {
|
|
240
|
-
return this.row.userId;
|
|
241
|
-
},
|
|
242
|
-
devSn() {
|
|
243
|
-
return this.$store.getters.getFingerprintDeviceSN;
|
|
244
|
-
},
|
|
245
|
-
devType() {
|
|
246
|
-
return 1;
|
|
247
|
-
},
|
|
248
|
-
tenantId() {
|
|
249
|
-
return null;
|
|
250
|
-
},
|
|
251
|
-
leftHandleImg() {
|
|
252
|
-
return this.selectedFinger && this.selectedFinger.value.includes("left")
|
|
253
|
-
? require("@/assets/blue-left.png")
|
|
254
|
-
: require("@/assets/left.png");
|
|
255
|
-
},
|
|
256
|
-
rightHandleImg() {
|
|
257
|
-
return this.selectedFinger && this.selectedFinger.value.includes("right")
|
|
258
|
-
? require("@/assets/blue-right.png")
|
|
259
|
-
: require("@/assets/right.png");
|
|
260
|
-
},
|
|
261
|
-
stepTips() {
|
|
262
|
-
if (this.fingerRegisterStep === -1) {
|
|
263
|
-
return "指纹采集异常,请重试!";
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return this.fingerRegisterStep === 0
|
|
267
|
-
? "请选择需要采集的手指"
|
|
268
|
-
: this.fingerRegisterStep === 1
|
|
269
|
-
? "请将手指放在设备上"
|
|
270
|
-
: this.fingerRegisterStep === 2
|
|
271
|
-
? "请再次将手指放在设备上"
|
|
272
|
-
: this.fingerRegisterStep === 3
|
|
273
|
-
? "最后一次将手指放在设备上"
|
|
274
|
-
: this.fingerRegisterStep === 4
|
|
275
|
-
? "正在指纹采集"
|
|
276
|
-
: this.fingerRegisterStep === 5
|
|
277
|
-
? "指纹采集成功"
|
|
278
|
-
: "未知状态";
|
|
279
|
-
},
|
|
280
|
-
fingerStatusText() {
|
|
281
|
-
if (this.fingerRegisterStep === -1) {
|
|
282
|
-
return "指纹采集异常,请重试!";
|
|
283
|
-
}
|
|
284
|
-
return this.fingerRegisterStep === 0
|
|
285
|
-
? "采集指纹一共需要三次按压"
|
|
286
|
-
: this.fingerRegisterStep === 1
|
|
287
|
-
? "请将手指放在设备上"
|
|
288
|
-
: this.fingerRegisterStep === 2
|
|
289
|
-
? "请再次将手指放在设备上"
|
|
290
|
-
: this.fingerRegisterStep === 3
|
|
291
|
-
? "最后一次将手指放在设备上"
|
|
292
|
-
: this.fingerRegisterStep === 4
|
|
293
|
-
? "正在处理指纹数据..."
|
|
294
|
-
: this.fingerRegisterStep === 5
|
|
295
|
-
? "指纹采集成功"
|
|
296
|
-
: "准备采集指纹";
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
watch: {
|
|
300
|
-
fingerRegisterStep(newStep) {
|
|
301
|
-
clearTimeout(this.gifTimeoutId);
|
|
302
|
-
const gifDuration = 800;
|
|
303
|
-
|
|
304
|
-
if (newStep === 1 || newStep === 0 || newStep === -1) {
|
|
305
|
-
this.currentFingerprintImage = require("@/assets/finger-status-start.png");
|
|
306
|
-
} else if (newStep === 2) {
|
|
307
|
-
this.currentFingerprintImage = require("@/assets/finger-status-1.gif");
|
|
308
|
-
this.gifTimeoutId = setTimeout(() => {
|
|
309
|
-
this.currentFingerprintImage = require("@/assets/finger-status-1-last.png");
|
|
310
|
-
}, gifDuration);
|
|
311
|
-
} else if (newStep === 3) {
|
|
312
|
-
this.currentFingerprintImage = require("@/assets/finger-status-2.gif");
|
|
313
|
-
this.gifTimeoutId = setTimeout(() => {
|
|
314
|
-
this.currentFingerprintImage = require("@/assets/finger-status-2-last.png");
|
|
315
|
-
}, gifDuration);
|
|
316
|
-
} else if (newStep === 4) {
|
|
317
|
-
this.currentFingerprintImage = require("@/assets/finger-status-3.gif");
|
|
318
|
-
this.gifTimeoutId = setTimeout(() => {
|
|
319
|
-
this.currentFingerprintImage = require("@/assets/finger-status-3-last.png");
|
|
320
|
-
}, gifDuration);
|
|
321
|
-
} else if (newStep === 5) {
|
|
322
|
-
this.currentFingerprintImage = require("@/assets/finger-status-compeleted.png");
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
mounted() {
|
|
327
|
-
this.loadCurrentUserFingerInfo();
|
|
328
|
-
this.$authEventBus.$on(
|
|
329
|
-
"startCollectionMessage",
|
|
330
|
-
this.startCollectionMessage
|
|
331
|
-
);
|
|
332
|
-
},
|
|
333
|
-
beforeDestroy() {
|
|
334
|
-
clearTimeout(this.gifTimeoutId);
|
|
335
|
-
this.$authEventBus.$off(
|
|
336
|
-
"startCollectionMessage",
|
|
337
|
-
this.startCollectionMessage
|
|
338
|
-
);
|
|
339
|
-
// 如果正在采集指纹,需要取消采集
|
|
340
|
-
if (this.fingerRegisterStep > 0 && this.fingerRegisterStep < 5) {
|
|
341
|
-
this.cancelCollection();
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
methods: {
|
|
345
|
-
cancelCollection() {
|
|
346
|
-
this.$authEventBus.$emit("cancelCollection");
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
// 处理用户主动取消采集
|
|
350
|
-
handleCancelCollection() {
|
|
351
|
-
this.$confirm("确定要退出指纹采集吗?", "提示", {
|
|
352
|
-
confirmButtonText: "确定",
|
|
353
|
-
cancelButtonText: "取消",
|
|
354
|
-
type: "warning"
|
|
355
|
-
}).then(() => {
|
|
356
|
-
this.cancelCollection();
|
|
357
|
-
this.$message.info("已退出指纹采集");
|
|
358
|
-
}).catch(() => {
|
|
359
|
-
// 用户取消操作
|
|
360
|
-
});
|
|
361
|
-
},
|
|
362
|
-
startCollectionMessage(data) {
|
|
363
|
-
console.log("startCollectionMessage:", data);
|
|
364
|
-
|
|
365
|
-
if (data.status === 200 || data.result === 0) {
|
|
366
|
-
// 采集成功
|
|
367
|
-
const { count, temp, image } = data.data;
|
|
368
|
-
|
|
369
|
-
console.log(`指纹采集进度: ${count}/4`);
|
|
370
|
-
|
|
371
|
-
// 根据count更新采集步骤
|
|
372
|
-
if (count === 1) {
|
|
373
|
-
this.fingerRegisterStep = 2; // 第一次采集完成,提示第二次
|
|
374
|
-
} else if (count === 2) {
|
|
375
|
-
this.fingerRegisterStep = 3; // 第二次采集完成,提示第三次
|
|
376
|
-
} else if (count === 3) {
|
|
377
|
-
this.fingerRegisterStep = 4; // 第三次采集完成,正在处理
|
|
378
|
-
} else if (count === 4) {
|
|
379
|
-
// 采集完成,获取到指纹模板
|
|
380
|
-
this.fingerRegisterStep = 5; // 指纹采集成功
|
|
381
|
-
this.fingerTemp = temp; // 保存指纹模板
|
|
382
|
-
console.log("✅ 指纹采集完成,获取到指纹模板");
|
|
383
|
-
|
|
384
|
-
// 自动保存指纹
|
|
385
|
-
this.$nextTick(() => {
|
|
386
|
-
this.addFingerprint();
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// 如果有指纹图像,可以显示(可选)
|
|
391
|
-
if (image) {
|
|
392
|
-
console.log("收到指纹图像数据");
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
} else {
|
|
396
|
-
// 采集失败
|
|
397
|
-
console.error("指纹采集失败:", data.msg || "未知错误");
|
|
398
|
-
this.fingerRegisterStep = -1; // 采集异常
|
|
399
|
-
this.$message?.error?.(data.msg || "指纹采集失败,请重试");
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
handleClose() {
|
|
403
|
-
// 如果在采集过程中,建议添加确认关闭的提示
|
|
404
|
-
},
|
|
405
|
-
async handleSelectFinger(finger) {
|
|
406
|
-
if (this.fingerRegisterStep > 0 && this.fingerRegisterStep < 5) {
|
|
407
|
-
this.$message({
|
|
408
|
-
message: "指纹采集尚未完成,请先完成当前采集",
|
|
409
|
-
type: "warning",
|
|
410
|
-
});
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
if (!finger.fingerInfo) {
|
|
415
|
-
try {
|
|
416
|
-
const res = await getMaxFingerSeqApi({
|
|
417
|
-
devSn: this.devSn,
|
|
418
|
-
devType: this.devType,
|
|
419
|
-
fingerNo: finger.index,
|
|
420
|
-
tenantId: this.tenantId,
|
|
421
|
-
userId: this.userId,
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
this.fingerId = res.data.fingerId;
|
|
425
|
-
this.fid = res.data.fingerSeq;
|
|
426
|
-
this.selectedFinger = finger;
|
|
427
|
-
this.fingerRegisterStep = 1;
|
|
428
|
-
this.fingerTemp = null; // 重置指纹模板
|
|
429
|
-
|
|
430
|
-
console.log(`开始采集 ${finger.label} 指纹,fingerId: ${this.fingerId}, fid: ${this.fid}`);
|
|
431
|
-
this.startCollection();
|
|
432
|
-
} catch (error) {
|
|
433
|
-
console.error("获取指纹信息失败:", error);
|
|
434
|
-
}
|
|
435
|
-
} else {
|
|
436
|
-
this.selectedFinger = finger;
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
handleSaveFingerprint() {
|
|
440
|
-
this.addFingerprint();
|
|
441
|
-
},
|
|
442
|
-
handleDeleteFinger() {
|
|
443
|
-
this.$confirm("确定删除指纹吗?")
|
|
444
|
-
.then(() => {
|
|
445
|
-
deleteFingerApi({ fingerId: this.selectedFinger.fingerInfo.id })
|
|
446
|
-
.then(() => {
|
|
447
|
-
this.selectedFinger = null;
|
|
448
|
-
this.fingerRegisterStep = 0;
|
|
449
|
-
this.$message.success("删除成功");
|
|
450
|
-
this.loadCurrentUserFingerInfo();
|
|
451
|
-
})
|
|
452
|
-
})
|
|
453
|
-
.catch(() => {});
|
|
454
|
-
},
|
|
455
|
-
startCollection() {
|
|
456
|
-
// 开始采集指纹
|
|
457
|
-
this.$authEventBus.$emit("startCollection");
|
|
458
|
-
},
|
|
459
|
-
loadCurrentUserFingerInfo() {
|
|
460
|
-
findByUserIdApi({
|
|
461
|
-
devType: this.devType,
|
|
462
|
-
tenantId: this.tenantId,
|
|
463
|
-
userId: this.userId,
|
|
464
|
-
}).then((res) => {
|
|
465
|
-
const data = res.data;
|
|
466
|
-
const newLeftArr = this.leftFingers.map((r) => {
|
|
467
|
-
const item = data.find((a) => a.fingerNo === r.index);
|
|
468
|
-
return { ...r, fingerInfo: item };
|
|
469
|
-
});
|
|
470
|
-
|
|
471
|
-
const newRightArr = this.rightFingers.map((r) => {
|
|
472
|
-
const item = data.find((a) => a.fingerNo === r.index);
|
|
473
|
-
return { ...r, fingerInfo: item };
|
|
474
|
-
});
|
|
475
|
-
this.leftFingers = newLeftArr;
|
|
476
|
-
this.rightFingers = newRightArr;
|
|
477
|
-
});
|
|
478
|
-
},
|
|
479
|
-
addFingerprint() {
|
|
480
|
-
if (!this.fingerId) {
|
|
481
|
-
this.$message.error("未获取到指纹ID");
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
if (!this.fingerTemp) {
|
|
486
|
-
this.$message.error("未获取到指纹模板");
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
if (!this.selectedFinger) {
|
|
491
|
-
this.$message.error("请先选择手指");
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
if (!this.fid) {
|
|
495
|
-
this.$message.error("未获取到指纹序列号");
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
this.loading = true;
|
|
500
|
-
console.log("开始保存指纹到服务器...");
|
|
501
|
-
|
|
502
|
-
uploadFingerApi({
|
|
503
|
-
data: this.fingerTemp,
|
|
504
|
-
fingerId: this.fingerId,
|
|
505
|
-
})
|
|
506
|
-
.then(() => {
|
|
507
|
-
console.log("✅ 指纹保存成功");
|
|
508
|
-
this.loadCurrentUserFingerInfo();
|
|
509
|
-
|
|
510
|
-
// 重置状态
|
|
511
|
-
this.selectedFinger = null;
|
|
512
|
-
this.fingerRegisterStep = 0;
|
|
513
|
-
this.fingerTemp = null;
|
|
514
|
-
this.fingerId = null;
|
|
515
|
-
this.fid = null;
|
|
516
|
-
|
|
517
|
-
this.$message.success("指纹录入成功!");
|
|
518
|
-
})
|
|
519
|
-
.catch((error) => {
|
|
520
|
-
console.error("❌ 指纹保存失败:", error);
|
|
521
|
-
this.fingerRegisterStep = -1;
|
|
522
|
-
})
|
|
523
|
-
.finally(() => {
|
|
524
|
-
this.loading = false;
|
|
525
|
-
});
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
};
|
|
529
|
-
</script>
|
|
530
|
-
|
|
531
|
-
<style scoped>
|
|
532
|
-
/* 弹窗样式 */
|
|
533
|
-
.finger-dialog {
|
|
534
|
-
width: 100%;
|
|
535
|
-
height: 100%;
|
|
536
|
-
border-radius: 12px;
|
|
537
|
-
overflow: hidden;
|
|
538
|
-
background: #f8f8fb;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
.dialog-header {
|
|
542
|
-
display: flex;
|
|
543
|
-
justify-content: space-between;
|
|
544
|
-
align-items: center;
|
|
545
|
-
padding: 16px 20px;
|
|
546
|
-
border-bottom: 1px solid #eee;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.title {
|
|
550
|
-
font-size: 18px;
|
|
551
|
-
font-weight: 500;
|
|
552
|
-
color: #333;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.close-icon {
|
|
556
|
-
width: 16px;
|
|
557
|
-
height: 16px;
|
|
558
|
-
cursor: pointer;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
/* 内容布局 */
|
|
562
|
-
.finger-register-content {
|
|
563
|
-
height: calc(100% - 182px);
|
|
564
|
-
margin-left: 24px;
|
|
565
|
-
margin-right: 24px;
|
|
566
|
-
border-radius: 12px;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/* 手部区域样式 */
|
|
570
|
-
.hand-area {
|
|
571
|
-
width: 210px;
|
|
572
|
-
display: flex;
|
|
573
|
-
flex-direction: column;
|
|
574
|
-
margin-left: 20px;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
.hand-image-wrapper {
|
|
578
|
-
display: flex;
|
|
579
|
-
justify-content: center;
|
|
580
|
-
align-items: center;
|
|
581
|
-
position: relative;
|
|
582
|
-
margin-bottom: 20px;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.hand-image {
|
|
586
|
-
width: 200px;
|
|
587
|
-
height: 260px;
|
|
588
|
-
object-fit: contain;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
/* 指尖按钮样式 */
|
|
592
|
-
.finger-buttons-overlay {
|
|
593
|
-
position: absolute;
|
|
594
|
-
top: 0;
|
|
595
|
-
left: 0;
|
|
596
|
-
width: 100%;
|
|
597
|
-
height: 100%;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
.finger-circle {
|
|
601
|
-
position: absolute;
|
|
602
|
-
width: 26px;
|
|
603
|
-
height: 26px;
|
|
604
|
-
border-radius: 50%;
|
|
605
|
-
border: 3px solid #c0c0c0;
|
|
606
|
-
background-color: #f8f8fb;
|
|
607
|
-
cursor: pointer;
|
|
608
|
-
transition: all 0.3s;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.finger-circle:hover {
|
|
612
|
-
transform: scale(1.1);
|
|
613
|
-
box-shadow: 0 0 5px rgba(59, 128, 239, 0.5);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
.finger-circle.active {
|
|
617
|
-
border: 3px solid #3b80ef;
|
|
618
|
-
background: #3b80ef3f;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
.finger-circle.ready {
|
|
622
|
-
width: 25px;
|
|
623
|
-
height: 25px;
|
|
624
|
-
background: url(@/assets/finger-ready.png) no-repeat;
|
|
625
|
-
background-size: 100% 100%;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
/* 指纹状态区域 */
|
|
629
|
-
.fingerprint-status {
|
|
630
|
-
width: 300px;
|
|
631
|
-
height: 300px;
|
|
632
|
-
margin-left: 32px;
|
|
633
|
-
display: flex;
|
|
634
|
-
flex-direction: column;
|
|
635
|
-
border: 1px dashed #d6d9e1;
|
|
636
|
-
background: white;
|
|
637
|
-
border-radius: 12px;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.status-header {
|
|
641
|
-
padding: 12px;
|
|
642
|
-
background-color: #f5f5f5;
|
|
643
|
-
border-bottom: 1px solid #eee;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
.status-title {
|
|
647
|
-
font-size: 14px;
|
|
648
|
-
color: #666;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
.fingerprint-image-container {
|
|
652
|
-
flex: 1;
|
|
653
|
-
display: flex;
|
|
654
|
-
flex-direction: column;
|
|
655
|
-
justify-content: center;
|
|
656
|
-
align-items: center;
|
|
657
|
-
padding: 0px 20px 20px 20px;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
.fingerprint-image {
|
|
661
|
-
width: 120px;
|
|
662
|
-
height: 120px;
|
|
663
|
-
margin-bottom: 20px;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
.status-text {
|
|
667
|
-
font-size: 14px;
|
|
668
|
-
color: #999;
|
|
669
|
-
text-align: center;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
.collect-progress {
|
|
673
|
-
margin: 0 20px 20px;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
.progress-text {
|
|
677
|
-
font-size: 14px;
|
|
678
|
-
color: #666;
|
|
679
|
-
margin-bottom: 5px;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
.progress-bar {
|
|
683
|
-
height: 8px;
|
|
684
|
-
background-color: #eee;
|
|
685
|
-
border-radius: 4px;
|
|
686
|
-
overflow: hidden;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
.progress-inner {
|
|
690
|
-
height: 100%;
|
|
691
|
-
background-color: #3b80ef;
|
|
692
|
-
transition: width 0.3s;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/* 底部按钮 */
|
|
696
|
-
.dialog-footer .el-button {
|
|
697
|
-
margin: 20px 10px;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.delete-button {
|
|
701
|
-
width: 100%;
|
|
702
|
-
height: 40px;
|
|
703
|
-
display: flex;
|
|
704
|
-
justify-content: flex-end;
|
|
705
|
-
align-items: center;
|
|
706
|
-
}
|
|
707
|
-
</style>
|