import{M as i,I as C,r as R,aG as j,F as S,W as $}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897314.js";import{b as n}from"./system.1703796278973.js";import{d as q,k as p,o as L,c as B,a as m,z as M,b as c,u as t}from"./vue.1703796278973.js";const A=e=>n.post("/rule-engine/instance/_query",e),O=e=>n.post("/rule-editor/flows/_create",e),F=(e,a)=>n.put(`/rule-engine/instance/${e}`,a),D=e=>n.post(`/rule-engine/instance/${e}/_start`),E=e=>n.post(`/rule-engine/instance/${e}/_stop`),H=e=>n.remove(`/rule-engine/instance/${e}`),I={style:{"margin-top":"10px"}},K=q({__name:"index",props:{data:{type:Object}},emits:["success","closeSave"],setup(e,{emit:a}){const _=e;p([]);const u=p(!1),f=p(),s=p();s.value={..._.data};const x={name:[{required:!0,message:"请输入名称"},{max:64,message:"最多输入64个字符"}]},y=()=>{a("closeSave")},b=()=>{f.value.validate().then(async()=>{var l,o;if(u.value=!0,(l=s.value)!=null&&l.id){let r=await F((o=s.value)==null?void 0:o.id,s.value);u.value=!1,r.status===200?(i.success("操作成功！"),a("closeSave"),a("success")):i.error("操作失败！")}else{let r=await O(s.value);u.value=!1,r.status===200?(i.success("操作成功！"),a("closeSave"),a("success")):i.error("操作失败")}}).catch(l=>{console.log("error",l)})};return(l,o)=>{var g;const r=C,v=R,h=j,k=S,w=$;return L(),B(w,{maskClosable:!1,width:"650px",destroyOnClose:"",visible:"",title:(g=_.data)!=null&&g.id?"编辑":"新增",onOk:b,onCancel:y,okText:"确定",cancelText:"取消",confirmLoading:t(u)},{default:m(()=>[M("div",I,[c(k,{layout:"vertical",ref_key:"formRef",ref:f,rules:x,model:t(s)},{default:m(()=>[c(v,{label:"名称",name:"name"},{default:m(()=>[c(r,{value:t(s).name,"onUpdate:value":o[0]||(o[0]=d=>t(s).name=d),placeholder:"请输入名称"},null,8,["value"])]),_:1}),c(v,{label:"说明",name:"describe"},{default:m(()=>[c(h,{value:t(s).description,"onUpdate:value":o[1]||(o[1]=d=>t(s).description=d),placeholder:"请输入说明",showCount:"",maxlength:200,rows:4},null,8,["value"])]),_:1})]),_:1},8,["model"])])]),_:1},8,["title","confirmLoading"])}}});export{K as _,E as a,H as d,A as q,D as s};
