import T from"./BaseForm-7eb50330-1782572373740v=1.0.0.js";import{u as _,b}from"./eventTypeApi-155a5531-1782572373740v=1.0.0.js";import{u as C}from"./useFormEdit-e67d5b61-1782572373740v=1.0.0.js";import{a as E}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as r}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as c,r as i,m as I,al as w,z as B,I as F,J as k,R as L,u,k as p}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./auditSettingApi-48a02122-1782572373740v=1.0.0.js";import"./keepAlive-0ac97bbd-1782572373740v=1.0.0.js";const M=c({name:"eventTypeEdit"}),Z=c({...M,setup(U){const{closeCurrent:d}=C(),f=i(null),o=i({type:"",name:"",dictTypeSign:"",status:"",creatorOrganUnitType:""}),a=i(!1),n=E(),y=()=>{d()},g=async l=>{a.value=!0;try{let e=_,s="\u66F4\u65B0\u6210\u529F",t=await e(l);t.code==0?r({type:"success",message:`${s}!`}):r.warning(t.msg),a.value=!1,d()}catch{a.value=!1}},v=async l=>{var s,t,m;let e=await b(l);if(e.code!=0){r.warning(e.msg);return}e.data.eventApplyModes=(s=e.data.eventApplyModes)==null?void 0:s.split(","),e.data.eventApplyUnitTypeLimit?e.data.unitType="limited":e.data.unitType="all",e.data.roleIds?e.data.roleIds=(t=e.data.roleIds)==null?void 0:t.split(",").map(Number):e.data.roleIds=[-1],e.data.dynamicTags=(m=e.data.tags)==null?void 0:m.split(","),o.value=e.data};return I(()=>{n.query.id&&(f.value=n.query.id,v(n.query.id))}),(l,e)=>{const s=w("HZPageLayout");return B(),F(s,{isBack:!0,title:u(n).meta.title},{default:k(()=>[L(T,{value:u(o),"onUpdate:value":e[0]||(e[0]=t=>p(o)?o.value=t:null),loading:u(a),"onUpdate:loading":e[1]||(e[1]=t=>p(a)?a.value=t:null),onCancel:y,onSubmit:g},null,8,["value","loading"])]),_:1},8,["title"])}}});export{Z as default};
