UserGroupForm-f1a3eae5.js 3.6 KB

1
  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-54aa57d8.js";import{_ as se,__tla as te}from"./Dialog-7bb778a5.js";import{a as re,D as ue,__tla as oe}from"./dict-573b3b04.js";import{C as x}from"./constants-c811e5ff.js";import{a as de,c as ie,u as me,__tla as ne}from"./index-067a18ff.js";import{g as _e,__tla as ce}from"./index-050fcf20.js";import{u as pe,__tla as fe}from"./useMessage-f56cafbb.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}),S=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,A(),l){i.value=!0;try{s.value=await de(l)}finally{i.value=!1}}V.value=await _e()}});const q=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,q("success")}finally{i.value=!1}}},A=()=>{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,G=K,N=Q,z=X,B=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(B,{ref_key:"formRef",ref:n,model:a(s),rules:a(S),"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(G,{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(z,{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(N,{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};