chunk-2d2080c9.ee4098d1.js 4.8 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2080c9"],{a2ac:function(t,e,r){"use strict";r.r(e),r.d(e,"startDragToGraph",(function(){return v}));var o=r("5728");class i extends o["j"]{}(function(t){function e(t){const e=[],r=o["i"].getForeignObjectMarkup();return t?e.push({tagName:t,selector:"body"},r):e.push(r),e}t.config({view:"vue-shape-view",markup:e(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(t){if(null==t.markup){const r=t.primer;if(r){t.markup=e(r);let i={};switch(r){case"circle":i={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":i={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break;default:break}t.attrs=o["l"].merge({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),o["j"].registry.register("vue-shape",t,!0)})(i||(i={}));var n=r("2b0e"),s=r("ed09");function a(t){t=t||n["default"],t&&!t["__composition_api_installed__"]&&t.use(s["b"])}a(n["default"]);var f=!0,l=!1,d=n["default"];n["default"].version;function h(t){return{setup(){throw new Error("[vue-demi] "+t+" is not supported in Vue 2. It's provided to avoid compiler errors.")}}}var p=h("Teleport");const u={};let c=!1;const g=Object(s["g"])({});function m(t,e,r,o,i){c&&(g[t]=Object(s["f"])(Object(s["c"])({render:()=>Object(s["e"])(p,{to:r},[Object(s["e"])(e,{node:o,graph:i})]),provide:()=>({getNode:()=>o,getGraph:()=>i})})))}function b(t){c&&delete g[t]}function w(){return c}class k extends o["k"]{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,k.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,r=this.graph;if(t){const{component:o}=u[e.shape];if(o)if(f){const i=d;this.vm=new i({el:t,render(t){return t(o,{node:e,graph:r})},provide(){return{getNode:()=>e,getGraph:()=>r}}})}else l&&(w()?m(this.targetId(),o,t,e,r):(this.vm=Object(s["a"])({render(){return Object(s["e"])(o,{node:e,graph:r})},provide(){return{getNode:()=>e,getGraph:()=>r}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(f&&this.vm.$destroy(),l&&this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,r){const o=t.target,i=o.tagName.toLowerCase();if("input"===i){const t=o.getAttribute("type");if(null==t||["text","password","number","email","search","tel","url"].includes(t))return}super.onMouseDown(t,e,r)}unmount(){return w()&&b(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}(function(t){t.action="vue",t.config({bootstrap:[t.action],actions:{component:t.action}}),o["k"].registry.register("vue-shape-view",t,!0)})(k||(k={}));var v=function(t,e,r){var i=new o["Dnd"]({target:t,validateNode:function(t,e){return!0}}),n="Start"===e?t.createNode({width:100,height:60,attrs:{label:{text:"开始",fill:"#1890ff",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},body:{stroke:"#1890ff",strokeWidth:1,fill:"#ffffff",rx:18,ry:18},nodeData:C(e)},ports:y}):"End"===e?t.createNode({width:100,height:60,attrs:{label:{text:"结束",fill:"#000000",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff",rx:18,ry:18},nodeData:C(e)},ports:y}):"Rect"===e?t.createNode({width:100,height:60,attrs:{label:{text:"任务节点",fill:"#000000",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff"},nodeData:C(e)},ports:y}):"Circle"===e?t.createNode({shape:"ellipse",width:100,height:100,attrs:{label:{text:"循环节点",fill:"#000000",fontSize:14,textWrap:{width:-20,height:-10,ellipsis:!0}},body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff"},nodeData:C(e)},ports:y}):t.createNode({shape:"polygon",x:40,y:40,width:120,height:120,attrs:{label:{text:"条件节点",fill:"#000000",fontSize:14,textWrap:{width:-50,height:"70%",ellipsis:!0}},body:{fill:"#ffffff",stroke:"#000000",refPoints:"0,10 10,0 20,10 10,20",strokeWidth:1},nodeData:C(e)},ports:y});i.start(n,r)},y={groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#2D8CF0",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#2D8CF0",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#2D8CF0",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#2D8CF0",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port1",group:"top"},{id:"port2",group:"bottom"},{id:"port3",group:"left"},{id:"port4",group:"right"}]},C=function(t){return{type:t,flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}}}}]);