import{E,a as N}from"./el-form-item-BvJauXBe.js";import{d as C,b3 as R,h as U,o as q,a0 as v,p as o,m as l,t as I,e as t,y as u,A as w,T as B,r as _}from"./index-XuO881sr.js";import{a as F,E as T}from"./el-radio-uGEJ5VfY.js";/* empty css                       */import{a as $}from"./index-74tJTFsC.js";const D=C({__name:"userInfo",props:{user:R.any.isRequired},setup(b){const m=b,r=B(()=>m.user),{proxy:p}=U(),d=_(),V=_({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"}]}),c=()=>{d.value?.validate(async i=>{i&&(await $(m.user),p?.$modal.msgSuccess("修改成功"))})},x=()=>{p?.$tab.closePage()};return(i,e)=>{const s=I,n=E,f=T,y=F,g=w,k=N;return q(),v(k,{ref_key:"userRef",ref:d,model:t(r),rules:t(V),"label-width":"80px"},{default:o(()=>[l(n,{label:"用户昵称",prop:"nickName"},{default:o(()=>[l(s,{modelValue:t(r).nickName,"onUpdate:modelValue":e[0]||(e[0]=a=>t(r).nickName=a),maxlength:"30"},null,8,["modelValue"])]),_:1}),l(n,{label:"手机号码",prop:"phonenumber"},{default:o(()=>[l(s,{modelValue:t(r).phonenumber,"onUpdate:modelValue":e[1]||(e[1]=a=>t(r).phonenumber=a),maxlength:"11"},null,8,["modelValue"])]),_:1}),l(n,{label:"邮箱",prop:"email"},{default:o(()=>[l(s,{modelValue:t(r).email,"onUpdate:modelValue":e[2]||(e[2]=a=>t(r).email=a),maxlength:"50"},null,8,["modelValue"])]),_:1}),l(n,{label:"性别"},{default:o(()=>[l(y,{modelValue:t(r).sex,"onUpdate:modelValue":e[3]||(e[3]=a=>t(r).sex=a)},{default:o(()=>[l(f,{value:"0"},{default:o(()=>[...e[4]||(e[4]=[u("男",-1)])]),_:1}),l(f,{value:"1"},{default:o(()=>[...e[5]||(e[5]=[u("女",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(n,null,{default:o(()=>[l(g,{type:"primary",onClick:c},{default:o(()=>[...e[6]||(e[6]=[u("保存",-1)])]),_:1}),l(g,{type:"danger",onClick:x},{default:o(()=>[...e[7]||(e[7]=[u("关闭",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{D as _};
