import{d as O,i as T,r as o,f as j,o as i,x as c,w as t,g as r,a,q as f,y as J,c as h,F as w,v as k,t as Q,Q as R,X,B as H,z as P,A as $,aj as K,ak as W,G as Y,D as Z,J as ee,_ as ae,__tla as le}from"./index-7d5b26d3.js";import{_ as se,__tla as te}from"./Dialog-2be588df.js";import{a as re,D as ue,__tla as oe}from"./dict-37d1dfe8.js";import{C as x}from"./constants-d55a3460.js";import{a as de,c as me,u as ie,__tla as ne}from"./index-26997956.js";import{g as _e,__tla as ce}from"./index-a25f8706.js";import{u as pe,__tla as fe}from"./useMessage-c81eaa5b.js";let I,ve=Promise.all([(()=>{try{return le}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return fe}catch{}})()]).then(async()=>{I=ae(O({name:"UserGroupForm",__name:"UserGroupForm",emits:["success"],setup(be,{expose:q,emit:A}){const{t:p}=T(),v=pe(),d=o(!1),b=o(""),m=o(!1),y=o(""),s=o({id:void 0,name:void 0,description:void 0,memberUserIds:void 0,status:x.ENABLE}),C=j({name:[{required:!0,message:"\u7EC4\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],description:[{required:!0,message:"\u63CF\u8FF0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],memberUserIds:[{required:!0,message:"\u6210\u5458\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=o(),g=o([]);q({open:async(u,l)=>{if(d.value=!0,b.value=p("action."+u),y.value=u,G(),l){m.value=!0;try{s.value=await de(l)}finally{m.value=!1}}g.value=await _e()}});const E=A,F=async()=>{if(n&&await n.value.validate()){m.value=!0;try{const u=s.value;y.value==="create"?(await me(u),v.success(p("common.createSuccess"))):(await ie(u),v.success(p("common.updateSuccess"))),d.value=!1,E("success")}finally{m.value=!1}}},G=()=>{var u;s.value={id:void 0,name:void 0,description:void 0,memberUserIds:void 0,status:x.ENABLE},(u=n.value)==null||u.resetFields()};return(u,l)=>{const U=X,_=H,D=P,S=$,z=K,B=W,M=Y,V=Z,N=se,L=ee;return i(),c(N,{modelValue:a(d),"onUpdate:modelValue":l[5]||(l[5]=e=>R(d)?d.value=e:null),title:a(b)},{footer:t(()=>[r(V,{disabled:a(m),type:"primary",onClick:F},{default:t(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),r(V,{onClick:l[4]||(l[4]=e=>d.value=!1)},{default:t(()=>[f("\u53D6 \u6D88")]),_:1})]),default:t(()=>[J((i(),c(M,{ref_key:"formRef",ref:n,model:a(s),rules:a(C),"label-width":"100px"},{default:t(()=>[r(_,{label:"\u7EC4\u540D",prop:"name"},{default:t(()=>[r(U,{modelValue:a(s).name,"onUpdate:modelValue":l[0]||(l[0]=e=>a(s).name=e),placeholder:"\u8BF7\u8F93\u5165\u7EC4\u540D"},null,8,["modelValue"])]),_:1}),r(_,{label:"\u63CF\u8FF0"},{default:t(()=>[r(U,{modelValue:a(s).description,"onUpdate:modelValue":l[1]||(l[1]=e=>a(s).description=e),placeholder:"\u8BF7\u8F93\u5165\u63CF\u8FF0",type:"textarea"},null,8,["modelValue"])]),_:1}),r(_,{label:"\u6210\u5458",prop:"memberUserIds"},{default:t(()=>[r(S,{modelValue:a(s).memberUserIds,"onUpdate:modelValue":l[2]||(l[2]=e=>a(s).memberUserIds=e),multiple:"",placeholder:"\u8BF7\u9009\u62E9\u6210\u5458"},{default:t(()=>[(i(!0),h(w,null,k(a(g),e=>(i(),c(D,{key:e.id,label:e.nickname,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(_,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[r(B,{modelValue:a(s).status,"onUpdate:modelValue":l[3]||(l[3]=e=>a(s).status=e)},{default:t(()=>[(i(!0),h(w,null,k(a(re)(a(ue).COMMON_STATUS),e=>(i(),c(z,{key:e.value,label:e.value},{default:t(()=>[f(Q(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[L,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/bpm/group/UserGroupForm.vue"]])});export{ve as __tla,I as default};
