import{C as e,D as a,Z as l,_ as r,y as u,G as s}from"./element-plus-DSMJnpwa.js";import{p as m}from"./index-mv7arXuk.js";/* empty css                     *//* empty css                 *//* empty css                       */import{a as o}from"./index-C9waQ9oZ.js";import{B as t,g as d,H as n,I as i,O as p,M as g,u as f,Y as _,c as b,d as c}from"./vue-vendor-DZekML78.js";const V=t({__name:"userInfo",props:{user:m.any.isRequired},setup(m){const t=m,V=b(()=>t.user),{proxy:x}=d(),h=c(),y=c({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[3456789][0-9]\d{8}$/,message:"请输入正确的手机号码",trigger:"blur"}]}),j=()=>{h.value?.validate(async e=>{e&&(await o(t.user),x?.$modal.msgSuccess("修改成功"))})},k=()=>{x?.$tab.closePage()};return(m,o)=>{const t=a,d=e,b=r,c=l,x=u,v=s;return n(),i(v,{ref_key:"userRef",ref:h,model:f(V),rules:f(y),"label-width":"80px"},{default:p(()=>[g(d,{label:"用户昵称",prop:"nickName"},{default:p(()=>[g(t,{modelValue:f(V).nickName,"onUpdate:modelValue":o[0]||(o[0]=e=>f(V).nickName=e),maxlength:"30"},null,8,["modelValue"])]),_:1}),g(d,{label:"手机号码",prop:"phonenumber"},{default:p(()=>[g(t,{modelValue:f(V).phonenumber,"onUpdate:modelValue":o[1]||(o[1]=e=>f(V).phonenumber=e),maxlength:"11"},null,8,["modelValue"])]),_:1}),g(d,{label:"邮箱",prop:"email"},{default:p(()=>[g(t,{modelValue:f(V).email,"onUpdate:modelValue":o[2]||(o[2]=e=>f(V).email=e),maxlength:"50"},null,8,["modelValue"])]),_:1}),g(d,{label:"性别"},{default:p(()=>[g(c,{modelValue:f(V).sex,"onUpdate:modelValue":o[3]||(o[3]=e=>f(V).sex=e)},{default:p(()=>[g(b,{value:"0"},{default:p(()=>[...o[4]||(o[4]=[_("男",-1)])]),_:1}),g(b,{value:"1"},{default:p(()=>[...o[5]||(o[5]=[_("女",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),g(d,null,{default:p(()=>[g(x,{type:"primary",onClick:j},{default:p(()=>[...o[6]||(o[6]=[_("保存",-1)])]),_:1}),g(x,{type:"danger",onClick:k},{default:p(()=>[...o[7]||(o[7]=[_("关闭",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{V as _};
