2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
|
import{a as e}from"./user.cbff96c4.js";import{r as l,d as a,o as r,k as u,w as s,e as t,n as o,f as m,v as n}from"./index.e5c8b0d6.js";const d={__name:"userInfo",props:{user:{type:Object}},setup(d){const i=d,{proxy:p}=n(),f=l({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 g(){p.$refs.userRef.validate((l=>{l&&e(i.user).then((e=>{p.$modal.msgSuccess("修改成功")}))}))}function b(){p.$tab.closePage()}return(e,l)=>{const n=a("el-input"),i=a("el-form-item"),p=a("el-radio"),c=a("el-radio-group"),_=a("el-button"),V=a("el-form");return r(),u(V,{ref:"userRef",model:d.user,rules:m(f),"label-width":"80px"},{default:s((()=>[t(i,{label:"用户昵称",prop:"nickName"},{default:s((()=>[t(n,{modelValue:d.user.nickName,"onUpdate:modelValue":l[0]||(l[0]=e=>d.user.nickName=e),maxlength:"30"},null,8,["modelValue"])])),_:1}),t(i,{label:"手机号码",prop:"phonenumber"},{default:s((()=>[t(n,{modelValue:d.user.phonenumber,"onUpdate:modelValue":l[1]||(l[1]=e=>d.user.phonenumber=e),maxlength:"11"},null,8,["modelValue"])])),_:1}),t(i,{label:"邮箱",prop:"email"},{default:s((()=>[t(n,{modelValue:d.user.email,"onUpdate:modelValue":l[2]||(l[2]=e=>d.user.email=e),maxlength:"50"},null,8,["modelValue"])])),_:1}),t(i,{label:"性别"},{default:s((()=>[t(c,{modelValue:d.user.sex,"onUpdate:modelValue":l[3]||(l[3]=e=>d.user.sex=e)},{default:s((()=>[t(p,{label:"0"},{default:s((()=>[o("男")])),_:1}),t(p,{label:"1"},{default:s((()=>[o("女")])),_:1})])),_:1},8,["modelValue"])])),_:1}),t(i,null,{default:s((()=>[t(_,{type:"primary",onClick:g},{default:s((()=>[o("保存")])),_:1}),t(_,{type:"danger",onClick:b},{default:s((()=>[o("关闭")])),_:1})])),_:1})])),_:1},8,["model","rules"])}}};export{d as default};
|