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