import{k as N}from"./user-Bof7mRmn.js";import{I as y,r as b,w as C,d as u,o as U,e as w,f as t,k as o,l as n,n as s}from"./index-Yv4yXRHK.js";const I={__name:"userInfo",props:{user:{type:Object}},setup(_){const i=_,{proxy:d}=y(),l=b({}),V=b({nickName:[{required:!0,message:"用户昵称不能为空",trigger:"blur"}],email:[{required:!0,message:"邮箱地址不能为空",trigger:"blur"},{type:"email",message:"请输入正确的邮箱地址",trigger:["blur","change"]}],phonenumber:[{required:!0,message:"手机号码不能为空",trigger:"blur"},{pattern:/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message:"请输入正确的手机号码",trigger:"blur"}]});function x(){d.$refs.userRef.validate(r=>{r&&N(l.value).then(()=>{d.$modal.msgSuccess("修改成功"),i.user.phonenumber=l.value.phonenumber,i.user.email=l.value.email})})}function c(){d.$tab.closePage()}return C(()=>i.user,r=>{r&&(l.value={nickName:r.nickName,phonenumber:r.phonenumber,email:r.email,sex:r.sex})},{immediate:!0}),(r,e)=>{const p=u("el-input"),m=u("el-form-item"),f=u("el-radio"),k=u("el-radio-group"),g=u("el-button"),v=u("el-form");return U(),w(v,{ref:"userRef",model:n(l),rules:n(V),"label-width":"80px"},{default:t(()=>[o(m,{label:"用户昵称",prop:"nickName"},{default:t(()=>[o(p,{modelValue:n(l).nickName,"onUpdate:modelValue":e[0]||(e[0]=a=>n(l).nickName=a),maxlength:"30"},null,8,["modelValue"])]),_:1}),o(m,{label:"手机号码",prop:"phonenumber"},{default:t(()=>[o(p,{modelValue:n(l).phonenumber,"onUpdate:modelValue":e[1]||(e[1]=a=>n(l).phonenumber=a),maxlength:"11"},null,8,["modelValue"])]),_:1}),o(m,{label:"邮箱",prop:"email"},{default:t(()=>[o(p,{modelValue:n(l).email,"onUpdate:modelValue":e[2]||(e[2]=a=>n(l).email=a),maxlength:"50"},null,8,["modelValue"])]),_:1}),o(m,{label:"性别"},{default:t(()=>[o(k,{modelValue:n(l).sex,"onUpdate:modelValue":e[3]||(e[3]=a=>n(l).sex=a)},{default:t(()=>[o(f,{value:"0"},{default:t(()=>[...e[4]||(e[4]=[s("男",-1)])]),_:1}),o(f,{value:"1"},{default:t(()=>[...e[5]||(e[5]=[s("女",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,null,{default:t(()=>[o(g,{type:"primary",onClick:x},{default:t(()=>[...e[6]||(e[6]=[s("保存",-1)])]),_:1}),o(g,{type:"danger",onClick:c},{default:t(()=>[...e[7]||(e[7]=[s("关闭",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])}}};export{I as default};
