1 |
- import{h as k}from"./index.T0of0op1.js";import{createCrudOptions as g}from"./curd.D1i8X1Ia.js";import y from"./index.kbRc7IG2.js";import{w as E,D as s,O as D,ae as L,aF as c,a0 as x,y as B,a1 as h,a8 as f,Z as C,G as M}from"./vue.Bi2Y_N79.js";import"./api.DU1IZv0a.js";import"./_plugin-vue_export-helper.DlAUqK2U.js";const U=E({__name:"index",setup(R){const{crudBinding:m,crudRef:v,crudExpose:u}=k({createCrudOptions:g}),o=s(!1),r=s(null),i=s("add");let a=null;function p(){r.value=null,i.value="add",o.value=!0}function w(){o.value=!1,u.doRefresh()}function l(t){const e=t;r.value=e.detail,i.value="view",o.value=!0}function d(t){const e=t;r.value=e.detail,i.value="edit",o.value=!0}return D(()=>{u.doRefresh();function t(){const e=document.querySelector(".fs-actionbar");if(e&&!e.querySelector(".my-create-btn")){const n=document.createElement("button");n.className="el-button el-button--primary el-button--default my-create-btn",n.innerHTML="新建审批流程",n.onclick=p,e.append(n)}}t(),a=new MutationObserver(()=>{t()}),a.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("workflow-view",l),window.addEventListener("workflow-edit",d)}),L(()=>{a&&(a.disconnect(),a=null),window.removeEventListener("workflow-view",l),window.removeEventListener("workflow-edit",d)}),(t,e)=>{const n=c("fs-crud"),b=c("fs-page");return B(),x(b,null,{default:h(()=>[f(n,C({ref_key:"crudRef",ref:v},M(m)),null,16),f(y,{visible:o.value,"onUpdate:visible":e[0]||(e[0]=_=>o.value=_),editData:r.value,mode:i.value,onSuccess:w},null,8,["visible","editData","mode"])]),_:1})}}});export{U as default};
|