text: var I=(e,s,i)=>new Promise((_,h)=>{var E=l=>{try{r(i.next(l))}catch(d){h(d)}},o=l=>{try{r(i.throw(l))}catch(d){h(d)}},r=l=>l.done?_(l.value):Promise.resolve(l.value).then(E,o);r((i=i.apply(e,s)).next())});import{B as U,b as W}from"./index.df597b92.js";import{P as J}from"./index.a7d13475.js";import{A as Y,ba as Q,aO as ee,ap as te,aS as R,c2 as ne,c4 as oe,c7 as ae,c8 as se,c9 as ie,r as M,a0 as b,B as x,a1 as k,a5 as g,H as p,w as v,ad as P,J as w,X as re,D as le,ao as ue,aa as de,ac as ce,a4 as pe}from"./vendor.5eb38889.js";/* empty css               *//* empty css                *//* empty css                */import me from"./index.7772efb2.js";import{_ as fe,h as ge}from"./index.eb81839e.js";import{c as ve,a as he,t as S,b as C,V as ye}from"./Viewer.3f58b0b7.js";import{e as be,l as we,f as _e}from"./process.b4fbb99a.js";import"./useWindowSizeFn.e269959a.js";/* empty css               *//* empty css               */import"./useContentViewHeight.2add70b5.js";var Be=/^djs-cursor-.*$/;function V(e){var s=ve(document.body);s.removeMatching(Be),e&&s.add("djs-cursor-"+e)}function Ee(){V(null)}var Me=5e3;function Fe(e,s){s=s||"element.click";function i(){return!1}return e.once(s,Me,i),function(){e.off(s,i)}}function z(e,s){return{x:e.x-s.x,y:e.y-s.y}}var Ce=15;function $(e,s){var i;e.on("element.mousedown",500,function(o){return E(o.originalEvent)});function _(o){var r=i.start,l=i.button,d=S(o),m=z(d,r);if(!i.dragging&&Ae(m)>Ce&&(i.dragging=!0,l===0&&Fe(e),V("grab")),i.dragging){var B=i.last||i.start;m=z(d,B),s.scroll({dx:m.x,dy:m.y}),i.last=d}o.preventDefault()}function h(o){C.unbind(document,"mousemove",_),C.unbind(document,"mouseup",h),i=null,Ee()}function E(o){if(!he(o.target,".djs-draggable")){var r=o.button;if(!(r>=2||o.ctrlKey||o.shiftKey||o.altKey))return i={button:r,start:S(o)},C.bind(document,"mousemove",_),C.bind(document,"mouseup",h),!0}}this.isActive=function(){return!!i}}$.$inject=["eventBus","canvas"];function Ae(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var Ie={__init__:["moveCanvas"],moveCanvas:["type",$]};let c=null;const{createMessage:xe}=ge(),Pe=Y({props:{title:{type:String,default:"\u6D41\u7A0B\u9884\u89C8"}},name:"BpmnPreview",components:{BasicModal:U,PageWrapper:J,Tag:Q,Spin:ee,Popover:te,Button:R,RadioButtonGroup:R.RadioButtonGroup,FramePage:me,Space:ne,Affix:oe,PlusCircleOutlined:ae,MinusCircleOutlined:se,OneToOneOutlined:ie},setup(e,{emit:s}){const i=M(),_=M(),h=M(""),E=M(!1),o=M(1);let r=[],l=[],d={};const m=M({});let B="";const[A,{changeLoading:F,setModalProps:f}]=W(a=>I(this,null,function*(){const{modelKey:n,procInstId:t}=a;B=t,F(!0);try{yield L(n,t)}finally{F(!1)}}));function L(a,n){return I(this,null,function*(){c&&c.destroy(),c=new ye({container:document.getElementById("bpmnCanvas"),width:"100%",additionalModules:[Ie]}),n?be({procInstId:n}).then(t=>{f({title:"\u6D41\u7A0B\u56FE - "+(t.modelName||"")}),l=t.highLightedFlows,r=t.activeActivityIds,c?O(t.modelXml):console.error("bpmnViewer is null or undefined!")}).finally(()=>{}):we({modelKey:a}).then(t=>{t?(f({title:"\u6D41\u7A0B\u56FE - "+(t.modelName||"")}),c?O(t.modelXml):console.error("bpmnViewer is null or undefined!")):(f({title:"\u6D41\u7A0B\u56FE - \u672A\u5B9A\u4E49"}),xe.warning("\u672A\u627E\u5230\u6D41\u7A0B\u6A21\u677F\u6570\u636E\uFF01"))}).finally(()=>{})})}function N(a,n,t){let u=[],y="<"+n+"[^<>]*?\\s"+t+`=['"]?(.*?)['"]?\\s.*?>`,j=a.match(new RegExp(y,"gi"));return j&&j.forEach(D=>{D&&u.push(D)}),u}function O(a){const n=N(a,"exclusiveGateway","id");let t=a;n&&n.length>0&&n.forEach(u=>{const y=new RegExp('id="(.+?)"').exec(u);y&&y[1]&&(t=t.replace('bpmnElement="'+y[1]+'"','bpmnElement="'+y[1]+'" isMarkerVisible="true"'))}),c.importXML(t,function(u){u?console.error(u):Z()})}function Z(){const a=c.get("canvas");a.zoom("fit-viewport","auto"),H(a),X()}function H(a){r&&r.length>0&&r.forEach(n=>{a.addMarker(n,"highlight");const t=document.querySelector(".highlight").querySelector(".djs-visual rect");t&&t.setAttribute("stroke-dasharray","4,4")}),l&&l.length>0&&l.forEach(n=>{a.addMarker(n,"highlight-line")})}function T(a,n,t){const u=document.createElement("div");m.value=a;const y=document.querySelector(".flowMsgPopover");u.innerHTML=y.innerHTML,u.className="tipBox",u.style.width="260px",u.style.background="rgba(255, 255, 255, .6)",t.add(a.id,{position:{top:n.element.height,left:0},html:u})}function X(){const a=c.get("eventBus"),n=c.get("overlays");a.on("element.hover",t=>{t.element.type==="bpmn:UserTask"&&B&&(d[t.element.id]?T(d[t.element.id],t,n):_e({procInstId:B,elementId:t.element.id}).then(u=>{d[t.element.id]=u,T(u,t,n)}))}),a.on("element.out",t=>{t.element.type==="bpmn:UserTask",n.clear()})}function G(a=.1){let n=Math.floor(o.value*100+a*100)/100;if(n>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");o.value=n,c.get("canvas").zoom(o.value)}function K(a=.1){let n=Math.floor(o.value*100-a*100)/100;if(n<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");o.value=n,c.get("canvas").zoom(o.value)}function q(){o.value=1,c.get("canvas").zoom("fit-viewport","auto")}return{defaultZoom:o,registerModal:A,flowMsgPopover:_,popoverVisible:E,triggerEl:i,detailInfo:m,previewUrl:h,processZoomIn:G,processZoomOut:K,processReZoom:q}}}),Oe={style:{position:"absolute",left:"10px",top:"10px","z-index":"999"}},Te={class:"containers",ref:"container"},je={class:"popover-title"},De=P(" \u5BA1\u6279\u4EBA\u5458\uFF1A");function Re(e,s,i,_,h,E){const o=b("MinusCircleOutlined"),r=b("Button"),l=b("PlusCircleOutlined"),d=b("OneToOneOutlined"),m=b("RadioButtonGroup"),B=b("Tag"),A=b("Popover"),F=b("BasicModal");return x(),k(F,pe({wrapClassName:"bpmn-viewer-container"},e.$attrs,{onRegister:e.registerModal}),{default:g(()=>[p("div",Oe,[v(m,{value:"center"},{default:g(()=>[v(r,{value:"small",title:"\u7F29\u5C0F\u89C6\u56FE",style:{width:"40px"},size:"small",onClick:s[0]||(s[0]=f=>e.processZoomOut())},{icon:g(()=>[v(o)]),_:1}),v(r,{value:"default",size:"small",style:{width:"50px"}},{default:g(()=>[P(w(Math.floor(e.defaultZoom*10*10)+"%"),1)]),_:1}),v(r,{value:"large",title:"\u653E\u5927\u89C6\u56FE",style:{width:"40px"},size:"small",onClick:s[1]||(s[1]=f=>e.processZoomIn())},{icon:g(()=>[v(l)]),_:1}),v(r,{value:"center",title:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D",style:{width:"40px"},size:"small",onClick:s[2]||(s[2]=f=>e.processReZoom())},{default:g(()=>[v(d)]),_:1})]),_:1})]),p("div",Te,[p("div",{id:"bpmnCanvas",class:"canvas",ref:"bpmnCanvas",style:re({width:100*e.scale+"%",height:100*e.scale+"%"})},null,4)],512),v(A,{overlayClassName:"flowMsgPopover",ref:"flowMsgPopover",visible:!0},{title:g(()=>[p("h1",je,w(e.detailInfo.name),1)]),content:g(()=>[p("p",null,[De,e.detailInfo.approver?(x(!0),le(de,{key:0},ue(e.detailInfo.approver.split(";"),f=>(x(),k(B,{color:"processing",style:{"margin-right":"4px","margin-bottom":"4px"},key:f},{default:g(()=>[P(w(f),1)]),_:2},1024))),128)):ce("",!0)]),p("p",null,"\u8282\u70B9\u7C7B\u578B\uFF1A"+w(e.detailInfo.nodeType||""),1),p("p",null,"\u8282\u70B9\u72B6\u6001\uFF1A"+w(e.detailInfo.status||""),1),p("p",null,"\u5F00\u59CB\u65F6\u95F4\uFF1A"+w(e.detailInfo.startDate||""),1),p("p",null,"\u7ED3\u675F\u65F6\u95F4\uFF1A"+w(e.detailInfo.endDate||""),1),p("p",null,"\u5BA1\u6279\u8017\u65F6\uFF1A"+w(e.detailInfo.duration||""),1)]),_:1},512)]),_:1},16,["onRegister"])}var Je=fe(Pe,[["render",Re],["__scopeId","data-v-f4ba1872"]]);export{Je as default};
  