import T from"./BaseForm-490aec6a-1782729249161v=1.0.0.js";import{u as _,b}from"./eventTypeApi-be275193-1782729249161v=1.0.0.js";import{u as C}from"./useFormEdit-fb8b8504-1782729249161v=1.0.0.js";import{a as E}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{E as r}from"./eleVendor-5008d1ec-1782729249161v=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-1e24e3ad-1782729249161v=1.0.0.js";import"./auditSettingApi-3eb5bec3-1782729249161v=1.0.0.js";import"./keepAlive-20a782c5-1782729249161v=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};
