From 8adbc259b71d7b7486372b97d0bc8bc900ac74c2 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Thu, 30 Jul 2026 17:28:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 39 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index d2ffd9d..ea974ed 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -127,15 +127,15 @@
- + 人员照片
- + {{ crud.status.edit === 1 && form.facetBarcode !== null ? '重新获取' : '手动获取' }} - + {{ hasBindFaceDb ? '解绑人脸' : '清除人脸' }} @@ -170,11 +170,7 @@ :class="{active: tempSelectFace?.guid === item.guid}" @click="tempSelectFace = item" > - 人脸照片 + 人脸照片
{{ item.name }}
{{ item.barcode }}
@@ -279,6 +275,7 @@ export default { } } return { + linkSrc: window.g.ApiUrl, headers: { Authorization: getToken() }, @@ -357,7 +354,7 @@ export default { toSyncUser() { this.syncLoading = true FetchSyncUser().then((res) => { - console.log('res', res) + console.log('同步用户数据res', res) if (res.code !== null) { this.$message({ message: '同步用户数据成功', type: 'success', offset: 8 }) this.crud.toQuery() @@ -374,7 +371,7 @@ export default { toSyncFace() { this.syncFaceLoading = true FetchSyncUserFace().then((res) => { - console.log('res', res) + console.log('自动绑定人脸数据res', res) if (res) { this.$message({ message: res.message, type: 'success', offset: 8 }) this.crud.toQuery() @@ -399,15 +396,14 @@ export default { }, // 选择部门时,获取完整信息(含编码、名称) handleDeptChange(val) { - console.log('val', val) this.selectedDeptInfo = val this.form.departmentid = val ? val.deptsId : null }, // 根据 deptsId 查找完整部门对象 findDeptObjById(deptsId) { if (!deptsId) return null - console.log('deptsId', deptsId) - console.log(' this.deptGroupOptions', this.deptGroupOptions) + // console.log('deptsId', deptsId) + // console.log(' this.deptGroupOptions', this.deptGroupOptions) const group = this.deptGroupOptions.find(g => g.options.some(o => o.deptsId === deptsId)) console.log('group', group) for (const group of this.deptGroupOptions) { @@ -488,8 +484,7 @@ export default { this.hasBindFaceDb = !!form.facePhoto && !!form.facetBarcode if (form.facePhoto) { - const linkSrc = window.g.ApiUrl - this.imageUrl = linkSrc + '/api/minio/getImg?bucket=4&fileName=' + form.facePhoto + '.bmp' + this.imageUrl = this.getMinioImgUrl(form.facePhoto) } else { this.imageUrl = null } @@ -511,7 +506,7 @@ export default { } userRoles = [...this.roleDatas] - console.log('角色回显处理完成:', this.roleDatas) + // console.log('角色回显处理完成:', this.roleDatas) }).catch(() => { this.roleDatas = [] userRoles = [] @@ -525,8 +520,8 @@ export default { this.$message({ message: '角色不能为空', type: 'warning', offset: 8 }) return false } - console.log('this.selectedDeptInfo', this.selectedDeptInfo) - console.log('crud.form.departmentid', crud.form.departmentid) + // console.log('this.selectedDeptInfo', this.selectedDeptInfo) + // console.log('crud.form.departmentid', crud.form.departmentid) // 部门赋值 if (this.selectedDeptInfo) { crud.form.departmentid = this.selectedDeptInfo.internalId @@ -860,9 +855,8 @@ export default { this.form.lastname = userInfo.name } // const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API - const linkSrc = window.g.ApiUrl if (userInfo.guid) { - this.imageUrl = linkSrc + '/api/minio/getImg?bucket=4&fileName=' + userInfo.guid + '.bmp' + this.imageUrl = this.getMinioImgUrl(userInfo.guid) // this.imageUrl = 'http://172.17.162.10:15000/api/minio/getImg?bucket=4&fileName=b89ea010-56fd-492c-a6d7-f4cb317116cb.bmp' } else { this.imageUrl = null @@ -893,6 +887,11 @@ export default { this.form.facePhoto = null this.imageUrl = null } + }, + // 获取minio图片完整地址 + getMinioImgUrl(fileName) { + if (!fileName) return '' + return `${this.linkSrc}/api/minio/getImg?bucket=4&fileName=${fileName}.bmp` } } }