/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import"./el-tooltip-4ed993c7.js";/* empty css                  *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  *//* empty css                     */import{d as e,m as a,X as l,x as r,Z as s,o,l as t,w as u,e as m,a as i,f as d,a4 as p,z as n,c,F as v,y as g,b,t as f,a7 as w,a5 as V,a6 as y,A as j,B as _,as as h,ak as x,W as k,a0 as q,a2 as U}from"./index-41bf27b7.js";import{b as I,c as P,d as z}from"./index-43bab232.js";import{g as F}from"./index-bb837113.js";/* empty css                   */const Z={class:"flex flex-row justify-between"},A={class:"w-full"},E=m("br",null,null,-1),S={class:"flex justify-end"},W=e({__name:"create",props:{primary:String|Number},emits:["close"],setup(e,{emit:W}){const X=e,$=a(),B=a([]),C=a({status:1,miniProgramIds:[]}),N=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!==C.value.password?(C.value.password,l(new Error("两次密码不匹配"))):l()},trigger:"blur"}]}),Q=a(!1);return X.primary&&I({id:X.primary}).then((e=>{C.value=e.data})),a(),r((()=>{F().then((e=>{B.value=e.data}))})),(e,a)=>{const l=V,r=y,I=j,F=_,R=h,T=x,Y=k,D=q,G=U;return s((o(),t(D,{model:C.value,"label-width":"100px",ref_key:"ruleForm",ref:$,rules:d(N),class:"pr-4"},{default:u((()=>[m("div",Z,[m("div",A,[i(r,{label:"邮箱",prop:"email"},{default:u((()=>[i(l,{modelValue:C.value.email,"onUpdate:modelValue":a[0]||(a[0]=e=>C.value.email=e),placeholder:"请填写邮箱"},null,8,["modelValue"])])),_:1}),i(r,{label:"用户名",prop:"username"},{default:u((()=>[i(l,{modelValue:C.value.username,"onUpdate:modelValue":a[1]||(a[1]=e=>C.value.username=e),placeholder:"请填写用户名"},null,8,["modelValue"])])),_:1}),X.primary?n("",!0):(o(),t(r,{key:0,label:"密码",prop:"password"},{default:u((()=>[i(l,{modelValue:C.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>C.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})),X.primary?n("",!0):(o(),t(r,{key:1,label:"确认密码",prop:"repassword"},{default:u((()=>[i(l,{modelValue:C.value.repassword,"onUpdate:modelValue":a[3]||(a[3]=e=>C.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:u((()=>[i(F,{class:"w-full",modelValue:C.value.miniProgramIds,"onUpdate:modelValue":a[4]||(a[4]=e=>C.value.miniProgramIds=e),filterable:"",multiple:"",clearable:"",placeholder:"选择小程序"},{default:u((()=>[(o(!0),c(v,null,g(B.value,(e=>(o(),t(I,{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:u((()=>[i(R,{modelValue:C.value.status,"onUpdate:modelValue":a[5]||(a[5]=e=>C.value.status=e),"active-value":1,"inactive-value":2},null,8,["modelValue"])])),_:1}),i(r,{label:"备注",prop:"remark"},{default:u((()=>[i(T,{placement:"top"},{content:u((()=>[b(" 鼠标移到账号上面显示备注内容"),E])),default:u((()=>[i(l,{modelValue:C.value.remark,"onUpdate:modelValue":a[6]||(a[6]=e=>C.value.remark=e),placeholder:"请填写备注",type:"textarea"},null,8,["modelValue"])])),_:1})])),_:1})])]),m("div",S,[i(Y,{type:"primary",onClick:a[7]||(a[7]=e=>{return a=$.value,C.value,void(a&&a.validate((e=>{if(e){let e;e=X.primary?P:z,e({...C.value}).then((e=>{w.success(e.message),W("close")}))}else Q.value=!1})).then((()=>{})));var a})},{default:u((()=>[b(f(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[G,Q.value]])}}});export{W as _};
