|
|
|
@ -127,15 +127,15 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div class="right-user-img"> |
|
|
|
<!-- <img src="http://172.17.162.10:15000/api/minio/getImg?bucket=4&fileName=b89ea010-56fd-492c-a6d7-f4cb317116cb" alt="人员照片"> --> |
|
|
|
<!-- <img src="http://172.17.162.10:15000/api/minio/getImg?bucket=4&fileName=43321071-5f90-4c9a-9337-26dcd0ab7d02.bmp" alt="人员照片"> --> |
|
|
|
<img :src="imageUrl || require('@/assets/images/user.jpg')" alt="人员照片"> |
|
|
|
<div style="display: flex; flex-direction: column; align-items: center; "> |
|
|
|
<el-button v-if="!hasBindFaceDb" size="small" type="primary" :loading="autoGetLoading" style="margin: 10px 0 !important;" @click="autoGetFaceUsers"> |
|
|
|
<el-button v-if="!hasBindFaceDb" size="small" type="primary" :loading="autoGetLoading" style="margin: 10px 0 0 0 !important;" @click="autoGetFaceUsers"> |
|
|
|
<i class="iconfont icon-zidonggengxin" style="font-size: 14px !important;" /> |
|
|
|
{{ crud.status.edit === 1 && form.facetBarcode !== null ? '重新获取' : '手动获取' }} |
|
|
|
</el-button> |
|
|
|
<!-- 新增清除按钮 --> |
|
|
|
<el-button v-if="form.facetBarcode" size="small" style="margin: 0 !important; background-color: rgb(246, 81, 99); border-color: rgb(246, 81, 99); color: rgb(255, 255, 255);" @click="clearFaceInfo"> |
|
|
|
<el-button v-if="form.facetBarcode" size="small" style="margin: 10px 0 0 0 !important; background-color: rgb(246, 81, 99); border-color: rgb(246, 81, 99); color: rgb(255, 255, 255);" @click="clearFaceInfo"> |
|
|
|
<i class="iconfont icon-shanchu" style="font-size:14px" /> |
|
|
|
{{ hasBindFaceDb ? '解绑人脸' : '清除人脸' }} |
|
|
|
</el-button> |
|
|
|
@ -170,11 +170,7 @@ |
|
|
|
:class="{active: tempSelectFace?.guid === item.guid}" |
|
|
|
@click="tempSelectFace = item" |
|
|
|
> |
|
|
|
<img |
|
|
|
:src="baseApi + '/api/minio/getImg?bucket=2&fileName=' + item.guid" |
|
|
|
alt="人脸照片" |
|
|
|
class="face-img" |
|
|
|
> |
|
|
|
<img :src="getMinioImgUrl(item.guid)" alt="人脸照片" class="face-img"> |
|
|
|
<div class="face-info"> |
|
|
|
<div class="face-name">{{ item.name }}</div> |
|
|
|
<div class="face-barcode">{{ item.barcode }}</div> |
|
|
|
@ -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` |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|