import{d as L,a as j,az as B,a2 as K,r as N,w as T,K as i,aq as c,e as u,y as n,L as s,u as e,t as b,m as g,f as Y,am as v,n as x,j as t,i as A,G,ac as w,C as k,ae as S}from"./vue-A59npLRR.js";import{b as p,r as M}from"./validate-_EUdkMt3.js";import{F as _}from"./index-r6iTpmP6.js";import{v as W,r as R,_ as H}from"./index-EwE51S_X.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";import"./echarts-cxb9vJr1.js";const J={class:"title"},O=L({__name:"popupForm",setup(Q){const U=W(),V=j(),l=B("baTable"),{t:o}=K(),P=N({username:[p({name:"required",title:o("user.user.User name")}),p({name:"account"})],nickname:[p({name:"required",title:o("user.user.nickname")})],group_id:[p({name:"required",message:o("Please select field",{field:o("user.user.grouping")})})],email:[p({name:"email",title:o("user.user.email")})],mobile:[p({name:"mobile"})],password:[{validator:(f,r,m)=>{if(l.form.operate=="Add"){if(!r)return m(new Error(o("Please input field",{field:o("user.user.password")})))}else if(!r)return m();return M(r)?m():m(new Error(o("validate.Please enter the correct password")))},trigger:"blur"}]}),C=f=>{l.toggleForm(),R.push({name:f=="money"?"user/moneyLog":"user/scoreLog",query:{user_id:l.form.items.id}})};return T(()=>l.form.operate,f=>{P.password[0].required=f=="Add"}),(f,r)=>{const m=i("el-input"),d=i("el-form-item"),h=i("el-date-picker"),y=i("el-button"),q=i("el-form"),D=i("el-scrollbar"),E=i("el-dialog"),F=c("drag"),$=c("zoom"),z=c("loading"),I=c("blur");return u(),n(E,{class:"ba-operate-dialog","close-on-click-modal":!1,"destroy-on-close":!0,"model-value":["Add","Edit"].includes(e(l).form.operate),onClose:e(l).toggleForm},{header:s(()=>[v((u(),Y("div",J,[g(b(e(l).form.operate?e(o)(e(l).form.operate):""),1)])),[[F,[".ba-operate-dialog",".el-dialog__header"]],[$,".ba-operate-dialog"]])]),footer:s(()=>[A("div",{style:x("width: calc(100% - "+e(l).form.labelWidth/1.8+"px)")},[t(y,{onClick:r[18]||(r[18]=a=>e(l).toggleForm(""))},{default:s(()=>[g(b(e(o)("Cancel")),1)]),_:1}),v((u(),n(y,{loading:e(l).form.submitLoading,onClick:r[19]||(r[19]=a=>e(l).onSubmit(V.value)),type:"primary"},{default:s(()=>[g(b(e(l).form.operateIds&&e(l).form.operateIds.length>1?e(o)("Save and edit next item"):e(o)("Save")),1)]),_:1},8,["loading"])),[[I]])],4)]),default:s(()=>[v((u(),n(D,{class:"ba-table-form-scrollbar"},{default:s(()=>[A("div",{class:G(["ba-operate-form","ba-"+e(l).form.operate+"-form"]),style:x(e(U).layout.shrink?"":"width: calc(100% - "+e(l).form.labelWidth/2+"px)")},[e(l).form.loading?k("",!0):(u(),n(q,{key:0,ref_key:"formRef",ref:V,onKeyup:r[17]||(r[17]=w(a=>e(l).onSubmit(V.value),["enter"])),model:e(l).form.items,"label-position":e(U).layout.shrink?"top":"right","label-width":e(l).form.labelWidth+"px",rules:P},{default:s(()=>[t(d,{prop:"username",label:e(o)("user.user.User name")},{default:s(()=>[t(m,{modelValue:e(l).form.items.username,"onUpdate:modelValue":r[0]||(r[0]=a=>e(l).form.items.username=a),type:"string",placeholder:e(o)("Please input field",{field:e(o)("user.user.User name")+"("+e(o)("user.user.Login account")+")"})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{prop:"nickname",label:e(o)("user.user.nickname")},{default:s(()=>[t(m,{modelValue:e(l).form.items.nickname,"onUpdate:modelValue":r[1]||(r[1]=a=>e(l).form.items.nickname=a),type:"string",placeholder:e(o)("Please input field",{field:e(o)("user.user.nickname")})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(_,{type:"remoteSelect",label:e(o)("user.user.grouping"),modelValue:e(l).form.items.group_id,"onUpdate:modelValue":r[2]||(r[2]=a=>e(l).form.items.group_id=a),prop:"group_id",placeholder:e(o)("user.user.grouping"),"input-attr":{params:{isTree:!0,search:[{field:"status",val:"1",operator:"eq"}]},field:"name","remote-url":"/admin/user.Group/index"}},null,8,["label","modelValue","placeholder","input-attr"]),t(_,{label:e(o)("user.user.head portrait"),type:"image",modelValue:e(l).form.items.avatar,"onUpdate:modelValue":r[3]||(r[3]=a=>e(l).form.items.avatar=a)},null,8,["label","modelValue"]),t(d,{prop:"email",label:e(o)("user.user.email")},{default:s(()=>[t(m,{modelValue:e(l).form.items.email,"onUpdate:modelValue":r[4]||(r[4]=a=>e(l).form.items.email=a),type:"string",placeholder:e(o)("Please input field",{field:e(o)("user.user.email")})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{prop:"mobile",label:e(o)("user.user.mobile")},{default:s(()=>[t(m,{modelValue:e(l).form.items.mobile,"onUpdate:modelValue":r[5]||(r[5]=a=>e(l).form.items.mobile=a),type:"string",placeholder:e(o)("Please input field",{field:e(o)("user.user.mobile")})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(_,{label:e(o)("user.user.Gender"),modelValue:e(l).form.items.gender,"onUpdate:modelValue":r[6]||(r[6]=a=>e(l).form.items.gender=a),type:"radio",data:{content:{0:e(o)("Unknown"),1:e(o)("user.user.male"),2:e(o)("user.user.female")},childrenAttr:{border:!0}}},null,8,["label","modelValue","data"]),t(d,{label:e(o)("user.user.birthday")},{default:s(()=>[t(h,{class:"w100","value-format":"YYYY-MM-DD",modelValue:e(l).form.items.birthday,"onUpdate:modelValue":r[7]||(r[7]=a=>e(l).form.items.birthday=a),type:"date",placeholder:e(o)("Please select field",{field:e(o)("user.user.birthday")})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(l).form.operate=="Edit"?(u(),n(d,{key:0,label:e(o)("user.user.balance")},{default:s(()=>[t(m,{modelValue:e(l).form.items.money,"onUpdate:modelValue":r[9]||(r[9]=a=>e(l).form.items.money=a),readonly:""},{append:s(()=>[t(y,{onClick:r[8]||(r[8]=a=>C("money"))},{default:s(()=>[g(b(e(o)("user.user.Adjustment balance")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])):k("",!0),e(l).form.operate=="Edit"?(u(),n(d,{key:1,label:e(o)("user.user.integral")},{default:s(()=>[t(m,{modelValue:e(l).form.items.score,"onUpdate:modelValue":r[11]||(r[11]=a=>e(l).form.items.score=a),readonly:""},{append:s(()=>[t(y,{onClick:r[10]||(r[10]=a=>C("score"))},{default:s(()=>[g(b(e(o)("user.user.Adjust integral")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])):k("",!0),t(d,{prop:"password",label:e(o)("user.user.password")},{default:s(()=>[t(m,{modelValue:e(l).form.items.password,"onUpdate:modelValue":r[12]||(r[12]=a=>e(l).form.items.password=a),type:"password",placeholder:e(l).form.operate=="Add"?e(o)("Please input field",{field:e(o)("user.user.password")}):e(o)("user.user.Please leave blank if not modified")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{prop:"motto",label:e(o)("user.user.Personal signature")},{default:s(()=>[t(m,{onKeyup:[r[13]||(r[13]=w(S(()=>{},["stop"]),["enter"])),r[14]||(r[14]=w(S(a=>e(l).onSubmit(V.value),["ctrl"]),["enter"]))],modelValue:e(l).form.items.motto,"onUpdate:modelValue":r[15]||(r[15]=a=>e(l).form.items.motto=a),type:"textarea",placeholder:e(o)("Please input field",{field:e(o)("user.user.Personal signature")})},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(_,{label:e(o)("State"),modelValue:e(l).form.items.status,"onUpdate:modelValue":r[16]||(r[16]=a=>e(l).form.items.status=a),type:"radio",data:{content:{disable:e(o)("Disable"),enable:e(o)("Enable")},childrenAttr:{border:!0}}},null,8,["label","modelValue","data"])]),_:1},8,["model","label-position","label-width","rules"]))],6)]),_:1})),[[z,e(l).form.loading]])]),_:1},8,["model-value","onClose"])}}}),se=H(O,[["__scopeId","data-v-d52d9de4"]]);export{se as default};