/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import"./el-tooltip-4ed993c7.js";/* empty css                     *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  */import{d as e,q as a,m as l,z as r,Z as s,o,l as u,w as t,e as m,a as i,f as d,a4 as p,A as n,c,F as v,p as g,b as f,t as b,a7 as w,a5 as V,a6 as y,B as h,D as _,ap as j,ak as x,X as k,a0 as q,a2 as U}from"./index-545c1a76.js";import{b as z,c as I,d as P}from"./index-a698fba0.js";import{f as A}from"./index-47a02500.js";/* empty css                   */const C={class:"flex flex-row justify-between"},E={class:"w-full"},F=m("br",null,null,-1),Z={class:"flex justify-end"},$=e({__name:"create",props:{primary:String|Number},emits:["close"],setup(e,{emit:$}){const B=e,D=a(),N=a([]),R=a({status:1,miniProgramIds:[]}),S=l({miniProgramIds:[{required:!0,message:"请选择小程序"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{type:"email",message:"邮箱格式不正确",trigger:"blur"}],remark:[{required:!1,message:"请输入备注",trigger:"blur"}],username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{pattern:/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/,message:"必须包含大小写字母和数字的组合，可以使用特殊字符，长度在6-20之间"}],repassword:[{required:!0,message:"请再次输入密码",trigger:"blur"},{validator:(e,a,l)=>{""===a?l(new Error("请再次输入密码")):a!==R.value.password?(R.value.password,l(new Error("两次密码不匹配"))):l()},trigger:"blur"}]}),X=a(!1);return B.primary&&z({id:B.primary}).then((e=>{R.value=e.data})),a(),r((()=>{A().then((e=>{N.value=e.data}))})),(e,a)=>{const l=V,r=y,z=h,A=_,G=j,H=x,J=k,K=q,L=U;return s((o(),u(K,{model:R.value,"label-width":"100px",ref_key:"ruleForm",ref:D,rules:d(S),class:"pr-4"},{default:t((()=>[m("div",C,[m("div",E,[i(r,{label:"邮箱",prop:"email"},{default:t((()=>[i(l,{modelValue:R.value.email,"onUpdate:modelValue":a[0]||(a[0]=e=>R.value.email=e),placeholder:"请填写邮箱"},null,8,["modelValue"])])),_:1}),i(r,{label:"用户名",prop:"username"},{default:t((()=>[i(l,{modelValue:R.value.username,"onUpdate:modelValue":a[1]||(a[1]=e=>R.value.username=e),placeholder:"请填写用户名"},null,8,["modelValue"])])),_:1}),B.primary?n("",!0):(o(),u(r,{key:0,label:"密码",prop:"password"},{default:t((()=>[i(l,{modelValue:R.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>R.value.password=e),clearable:"",type:"password",autocomplete:"new-password",size:"large",placeholder:"密码","show-password":"","prefix-icon":d(p),class:"h-12 text-base"},null,8,["modelValue","prefix-icon"])])),_:1})),B.primary?n("",!0):(o(),u(r,{key:1,label:"确认密码",prop:"repassword"},{default:t((()=>[i(l,{modelValue:R.value.repassword,"onUpdate:modelValue":a[3]||(a[3]=e=>R.value.repassword=e),clearable:"",type:"password",autocomplete:"new-password",size:"large",placeholder:"确认密码","show-password":"","prefix-icon":d(p),class:"h-12 text-base"},null,8,["modelValue","prefix-icon"])])),_:1})),i(r,{label:"绑定小程序",prop:"miniProgramIds"},{default:t((()=>[i(A,{class:"w-full",modelValue:R.value.miniProgramIds,"onUpdate:modelValue":a[4]||(a[4]=e=>R.value.miniProgramIds=e),filterable:"",multiple:"",clearable:"",placeholder:"选择小程序"},{default:t((()=>[(o(!0),c(v,null,g(N.value,(e=>(o(),u(z,{key:e.miniprogram_id,label:e.name,value:e.miniprogram_id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),i(r,{label:"状态",prop:"status"},{default:t((()=>[i(G,{modelValue:R.value.status,"onUpdate:modelValue":a[5]||(a[5]=e=>R.value.status=e),"active-value":1,"inactive-value":2},null,8,["modelValue"])])),_:1}),i(r,{label:"备注",prop:"remark"},{default:t((()=>[i(H,{placement:"top"},{content:t((()=>[f(" 鼠标移到账号上面显示备注内容"),F])),default:t((()=>[i(l,{modelValue:R.value.remark,"onUpdate:modelValue":a[6]||(a[6]=e=>R.value.remark=e),placeholder:"请填写备注",type:"textarea"},null,8,["modelValue"])])),_:1})])),_:1})])]),m("div",Z,[i(J,{type:"primary",onClick:a[7]||(a[7]=e=>{return a=D.value,R.value,void(a&&a.validate((e=>{if(e){let e;e=B.primary?I:P,e({...R.value}).then((e=>{w.success(e.message),$("close")}))}else X.value=!1})).then((()=>{})));var a})},{default:t((()=>[f(b(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[L,X.value]])}}});export{$ as _};
