From 111174d324ab4b74d03a32b3051bcdefaf8fee25 Mon Sep 17 00:00:00 2001 From: chenghuan Date: Wed, 1 Apr 2026 10:19:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=A8=E6=88=B7=E6=A8=A1=E5=9D=97):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A4=BE=E4=BC=9A=E8=BA=AB=E4=BB=BD=E5=92=8C?= =?UTF-8?q?=E8=AF=81=E4=BB=B6=E7=85=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在用户新增/修改表单中添加社会身份选择项,支持动态加载社会身份数据 - 增加证件照上传功能,允许用户上传和预览证件照片 - 更新表单数据结构,确保社会身份和证件照信息的保存与展示 - 在用户列表中添加社会身份列,提升用户信息的可视化 --- src/views/modules/user/user-add-or-update.vue | 72 ++++++++++++++++++- src/views/modules/user/user.vue | 1 + 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/views/modules/user/user-add-or-update.vue b/src/views/modules/user/user-add-or-update.vue index a26ff61..2e1a6c1 100644 --- a/src/views/modules/user/user-add-or-update.vue +++ b/src/views/modules/user/user-add-or-update.vue @@ -25,6 +25,16 @@ + + + + + + + + + + + + + @@ -110,7 +129,10 @@ baseUrl: global.baseUrl, visible: false, dialogVisible: false, + photoDialogVisible: false, fileList: [], + photoFileList: [], + socialIdentityList: [], pickerOptions: { shortcuts: [{ text: '今天', @@ -156,6 +178,8 @@ wylqPower: 0, prescriptAPower: 0, prescriptBPower: 0, + socialIdentity: '', + photo: '', }, dataRule: { password: [{ @@ -187,12 +211,25 @@ } }, methods: { + getSocialIdentityList() { + this.$http({ + url: this.$http.adornUrl("/book/sysdictdata/selectByType/user_profile"), + method: 'get', + }).then(({ data }) => { + if (data && data.code === 0) { + this.socialIdentityList = data.dataList || []; + } else { + this.socialIdentityList = []; + } + }) + }, init(id) { this.dataForm.id = id || 0 this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { + this.getSocialIdentityList() this.$http({ url: this.$http.adornUrl(`/book/user/info/${this.dataForm.id}`), method: 'get', @@ -206,6 +243,8 @@ this.dataForm.age = data.user.age this.dataForm.sex = data.user.sex this.dataForm.avatar = data.user.avatar + this.dataForm.socialIdentity = data.user.socialIdentity + this.dataForm.photo = data.user.photo this.dataForm.nickname = data.user.nickname this.dataForm.tel = data.user.tel this.dataForm.password = data.user.password @@ -231,6 +270,15 @@ attr.push(img) this.fileList = attr } + if (data.user.photo && data.user.photo != "") { + var photoImg = { + name: '', + url: data.user.photo + } + var photoAttr = [] + photoAttr.push(photoImg) + this.photoFileList = photoAttr + } } }) } @@ -271,6 +319,8 @@ 'age': this.dataForm.age, 'sex': this.dataForm.sex, 'avatar': this.dataForm.avatar, + 'socialIdentity': this.dataForm.socialIdentity, + 'photo': this.dataForm.photo, 'nickname': this.dataForm.nickname, 'tel': this.dataForm.tel, 'pointPower': this.dataForm.pointPower, @@ -320,6 +370,10 @@ this.dataForm.avatar = file.url; this.dialogVisible = true; }, + handlePictureCardPreviewPhoto(file) { + this.dataForm.photo = file.url; + this.photoDialogVisible = true; + }, handlePicSuccess(res, file) { if (res.msg == "success") { this.dataForm.avatar = res.url; @@ -328,15 +382,29 @@ this.$message.error("上传失败"); } }, + handlePicSuccessPhoto(res, file) { + if (res.msg == "success") { + this.dataForm.photo = res.url; + this.$message.success("上传成功"); + } else { + this.$message.error("上传失败"); + } + }, handleRemove(file) { this.dataForm.avatar = ''; }, + handleRemovePhoto(file) { + this.dataForm.photo = ''; + this.photoFileList = []; + }, handlereset() { // console.log('关闭了') this.$refs['dataForm'].resetFields() this.dataForm.password = '' - this.fileList = [], - this.visible = false + this.fileList = [] + this.photoFileList = [] + this.photoDialogVisible = false + this.visible = false }, } } diff --git a/src/views/modules/user/user.vue b/src/views/modules/user/user.vue index c80b88b..1e0d04d 100644 --- a/src/views/modules/user/user.vue +++ b/src/views/modules/user/user.vue @@ -154,6 +154,7 @@ +