chunk-84203e1e.3ccf202f.js 31 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-84203e1e","chunk-f945a824","chunk-2d21dfd9","chunk-2d2080c9"],{"32ef":function(t,e,o){"use strict";o("d3be")},"7a1e":function(t,e,o){"use strict";o("81e7")},"81e7":function(t,e,o){},a2ac:function(t,e,o){"use strict";o.r(e),o.d(e,"startDragToGraph",(function(){return v}));var i=o("5728");class r extends i["j"]{}(function(t){function e(t){const e=[],o=i["i"].getForeignObjectMarkup();return t?e.push({tagName:t,selector:"body"},o):e.push(o),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 o=t.primer;if(o){t.markup=e(o);let r={};switch(o){case"circle":r={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":r={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break;default:break}t.attrs=i["l"].merge({},{body:Object.assign({refWidth:null,refHeight:null},r)},t.attrs||{})}}return t}}),i["j"].registry.register("vue-shape",t,!0)})(r||(r={}));var n=o("2b0e"),a=o("ed09");function s(t){t=t||n["default"],t&&!t["__composition_api_installed__"]&&t.use(a["b"])}s(n["default"]);var d=!0,l=!1,h=n["default"];n["default"].version;function c(t){return{setup(){throw new Error("[vue-demi] "+t+" is not supported in Vue 2. It's provided to avoid compiler errors.")}}}var g=c("Teleport");const p={};let f=!1;const u=Object(a["g"])({});function m(t,e,o,i,r){f&&(u[t]=Object(a["f"])(Object(a["c"])({render:()=>Object(a["e"])(g,{to:o},[Object(a["e"])(e,{node:i,graph:r})]),provide:()=>({getNode:()=>i,getGraph:()=>r})})))}function b(t){f&&delete u[t]}function y(){return f}class w extends i["k"]{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,w.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,o=this.graph;if(t){const{component:i}=p[e.shape];if(i)if(d){const r=h;this.vm=new r({el:t,render(t){return t(i,{node:e,graph:o})},provide(){return{getNode:()=>e,getGraph:()=>o}}})}else l&&(y()?m(this.targetId(),i,t,e,o):(this.vm=Object(a["a"])({render(){return Object(a["e"])(i,{node:e,graph:o})},provide(){return{getNode:()=>e,getGraph:()=>o}}}),this.vm.mount(t)))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(d&&this.vm.$destroy(),l&&this.vm.unmount(),this.vm=null),t&&(t.innerHTML=""),t}onMouseDown(t,e,o){const i=t.target,r=i.tagName.toLowerCase();if("input"===r){const t=i.getAttribute("type");if(null==t||["text","password","number","email","search","tel","url"].includes(t))return}super.onMouseDown(t,e,o)}unmount(){return y()&&b(this.targetId()),this.unmountVueComponent(),super.unmount(),this}}(function(t){t.action="vue",t.config({bootstrap:[t.action],actions:{component:t.action}}),i["k"].registry.register("vue-shape-view",t,!0)})(w||(w={}));var v=function(t,e,o){var r=new i["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:k(e)},ports:x}):"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:k(e)},ports:x}):"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:k(e)},ports:x}):"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:k(e)},ports:x}):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:k(e)},ports:x});r.start(n,o)},x={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"}]},k=function(t){return{type:t,flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}}},ba65:function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("button",{on:{mousedown:function(e){return t.startDrag("Start",e)}}},[t._v("开始节点")]),o("button",{on:{mousedown:function(e){return t.startDrag("End",e)}}},[t._v("结束节点")]),o("button",{on:{mousedown:function(e){return t.startDrag("Circle",e)}}},[t._v("循环节点")]),o("button",{on:{mousedown:function(e){return t.startDrag("Rect",e)}}},[t._v("任务节点")]),o("button",{on:{mousedown:function(e){return t.startDrag("polygon",e)}}},[t._v("条件节点")]),o("button",{on:{click:function(e){return t.deleteNode()}}},[t._v("删除")]),o("button",{on:{click:t.onUndo}},[t._v("撤销")]),o("button",{on:{click:t.onRedo}},[t._v("重做")]),o("button",{on:{click:t.savePic}},[t._v("生成图片")]),o("button",{on:{click:t.saveFlow}},[t._v("保存流程图并生成java代码")]),o("button",{on:{click:t.getJson}},[t._v("getJson")]),o("div",{staticClass:"graph-drawer-box"},[o("div",{ref:"graphContainer"}),o("RightDrawer",{ref:"rightDrawer",attrs:{drawerType:t.type,selectCellNum:t.selectCellNum,selectCell:t.selectCell,graph:t.graph,grid:t.grid},on:{deleteNode:t.deleteNode}})],1)])},r=[],n=o("ade3"),a=(o("4de4"),o("14d9"),o("b0c0"),o("d3b7"),o("0643"),o("2382"),o("4e3e"),o("159b"),o("5728"));const s=".x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n";var d=function(t,e,o,i){var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,o,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class l extends a["o"]{get targetScroller(){const t=this.options.target,e=t.getPlugin("scroller");return e}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){const t=this.options.target,e=t.getPlugin("snapline");return e}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},l.defaults),t),this.init()}init(){a["b"].ensure(this.name,s),this.container=document.createElement("div"),a["e"].addClass(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new a["h"](Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),a["e"].append(this.container,this.draggingGraph.container)}start(t,e){const o=e;o.preventDefault(),this.targetModel.startBatch("dnd"),a["e"].addClass(this.container,"dragging"),a["e"].appendTo(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,o.clientX,o.clientY);const i=this.updateNodePosition(o.clientX,o.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:o,node:t,cell:t,view:this.draggingView,x:i.x,y:i.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(l.documentEvents,o.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(t,e,o){const i=this.draggingGraph,r=i.model,n=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});n.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const t=this.targetGraph.transform.getScale();i.scale(t.sx,t.sy),a*=Math.max(t.sx,t.sy)}else i.scale(1,1);this.clearDragging(),r.resetCells([n]);const s=i.findViewByCell(n);s.undelegateEvents(),s.cell.off("changed"),i.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const d=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(d.getTopLeft()),this.draggingNode=n,this.draggingView=s,this.draggingBBox=n.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(e,o)}updateGraphPosition(t,e){const o=document.body.scrollTop||document.documentElement.scrollTop,i=document.body.scrollLeft||document.documentElement.scrollLeft,r=this.delta,n=this.geometryBBox,s=this.padding||5,d={left:t-r.x-n.width/2-s+i,top:e-r.y-n.height/2-s+o};return this.draggingGraph&&a["e"].css(this.container,{left:d.left+"px",top:d.top+"px"}),d}updateNodePosition(t,e){const o=this.targetGraph.clientToLocal(t,e),i=this.draggingBBox;return o.x-=i.width/2,o.y-=i.height/2,this.draggingNode.position(o.x,o.y),o}snap({cell:t,current:e,options:o}){const i=t;if(o.snapped){const t=this.draggingBBox;i.position(t.x+o.tx,t.y+o.ty,{silent:!0}),this.draggingView.translate(),i.position(e.x,e.y,{silent:!0}),this.snapOffset={x:o.tx,y:o.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const o=this.normalizeEvent(t),i=o.clientX,r=o.clientY;this.updateGraphPosition(i,r);const n=this.updateNodePosition(i,r),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:r});if(a){e.setEventData(o,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const t=e.getEventData(o);s?e.processEmbedding(o,t):e.clearEmbedding(t),this.candidateEmbedView=t.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:o,view:e,x:n.x,y:n.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const o=this.normalizeEvent(t),i=this.draggingView,r=this.draggingBBox,n=this.snapOffset;let s=r.x,d=r.y;n&&(s+=n.x,d+=n.y),e.position(s,d,{silent:!0});const l=this.drop(e,{x:o.clientX,y:o.clientY}),h=t=>{t?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&i&&(i.setEventData(o,{cell:t,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),i.finalizeEmbedding(o,i.getEventData(o)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};a["f"].isAsync(l)?(this.undelegateDocumentEvents(),l.then(h)):h(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),a["e"].removeClass(this.container,"dragging"),a["e"].remove(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,o=null;const i=this.targetGraph,r=this.targetScroller;this.options.dndContainer&&(o=this.getDropArea(this.options.dndContainer));const n=o&&o.containsPoint(t);if(r)if(r.options.autoResize)e=this.getDropArea(r.container);else{const t=this.getDropArea(r.container);e=this.getDropArea(i.container).intersectsWithRect(t)}else e=this.getDropArea(i.container);return!n&&e&&e.containsPoint(t)}getDropArea(t){const e=a["e"].offset(t),o=document.body.scrollTop||document.documentElement.scrollTop,i=document.body.scrollLeft||document.documentElement.scrollLeft;return a["m"].create({x:e.left+parseInt(a["e"].css(t,"border-left-width"),10)-i,y:e.top+parseInt(a["e"].css(t,"border-top-width"),10)-o,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const o=this.targetGraph,i=o.model,r=o.clientToLocal(e),n=this.sourceNode,s=this.options.getDropNode(t,{sourceNode:n,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),d=s.getBBox();r.x+=d.x-d.width/2,r.y+=d.y-d.height/2;const l=this.snapOffset?1:o.getGridSize();s.position(a["g"].snapToGrid(r.x,l),a["g"].snapToGrid(r.y,l)),s.removeZIndex();const h=this.options.validateNode,c=!h||h(s,{sourceNode:n,draggingNode:t,droppingNode:s,targetGraph:o,draggingGraph:this.draggingGraph});return"boolean"===typeof c?c?(i.addCell(s,{stencil:this.cid}),s):null:a["f"].toDeferredBoolean(c).then(t=>t?(i.addCell(s,{stencil:this.cid}),s):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),a["b"].clean(this.name)}}d([a["o"].dispose()],l.prototype,"dispose",null),function(t){t.defaults={getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(l||(l={}));var h=o("d43f"),c=o("a2ac"),g=o("eb6f"),p={name:"index2Page",components:{RightDrawer:g["default"]},data:function(){return{selectCellNum:0,contentWidth:0,contentHeight:0,graph:null,type:"grid",selectCell:"",connectEdgeType:{connector:"normal",router:{name:"normal"}},grid:{showGrid:!0,size:10,visible:!0,type:"mesh",args:{color:"#D0D0D0",thickness:1,factor:10}},canUndo:!1,canRedo:!1,haveStart:!1,haveEnd:!1}},mounted:function(){a["h"].use(["dnd"]),this.initX6()},methods:{getMainHeight:function(t){this.contentWidth=this.$refs["graphContainer"].parentNode.offsetWidth,this.contentHeight=910},initX6:function(){var t=this;this.type="grid",this.selectCell="";var e=this;this.graph=new a["h"](Object(n["a"])({container:this.$refs["graphContainer"],width:1200,height:600,grid:this.grid,panning:{enabled:!0,modifiers:"shift"},resizing:{enabled:!0,orthogonal:!1},selecting:!0,snapline:!0,interacting:{edgeLabelMovable:!0},connecting:{anchor:"center",connectionPoint:"anchor",allowBlank:!1,snap:!0,createEdge:function(){return new a["n"].Edge({attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},label:{text:""},connector:e.connectEdgeType.connector,router:{name:e.connectEdgeType.router.name||""},zIndex:0})}},highlighting:{magnetAvailable:{name:"stroke",args:{padding:4,attrs:{strokeWidth:4,stroke:"#6a6c8a"}}}},scroller:{enabled:!1},minimap:{enabled:!this.readonly,container:this.readonly?"":this.$refs["rightDrawer"].$refs["miniMap"],width:300,height:150,padding:5},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},history:{enabled:!0}},"selecting",{enabled:!0,rubberband:!0})),this.graph.fromJSON(h["default"]),this.graph.history.redo(),this.graph.history.undo(),this.graph.on("node:mouseenter",a["f"].debounce((function(){var e=t.$refs["graphContainer"],o=e.querySelectorAll(".x6-port-body");t.showPorts(o,!0)})),500),this.graph.on("node:mouseleave",(function(){var e=t.$refs["graphContainer"],o=e.querySelectorAll(".x6-port-body");t.showPorts(o,!1)})),this.graph.on("blank:click",(function(){t.type="grid",t.selectCell="",console.log("blank:click")})),this.graph.on("cell:click",(function(e){var o=e.cell;t.type=o.isNode()?"node":"edge",t.$emit("cellClick",o),console.log("cell:click",o,o.isNode(),o.attrs.nodeData,o)})),this.graph.on("selection:changed",(function(e){t.selectCellNum=e.selected.length,t.selectCellNum>1?(t.type="grid",t.selectCell=""):t.selectCell=e.added[0],e.added.forEach((function(t){t.isEdge()&&(t.isEdge()&&t.attr("line/strokeDasharray",5),t.addTools([{name:"vertices",args:{padding:4,attrs:{strokeWidth:.1,stroke:"#2d8cf0",fill:"#ffffff"}}}]))})),e.removed.forEach((function(t){t.isEdge()&&t.attr("line/strokeDasharray",0),t.removeTools()}))})),this.graph.history.on("undo",(function(e){t.$emit("historyUndo",e)})),this.graph.history.on("redo",(function(e){t.$emit("historyRedo",e)})),this.graph.history.on("change",(function(){t.historyChange()})),this.graph.on("node:added",(function(e){var o=e.cell;t.checkNode(),t.graph.resetSelection(o),t.type="node";var i=o.store.data;switch(i.attrs.nodeData.type){case"Start":t.haveStart=!0;break;case"End":t.haveEnd=!0;break}})),this.graph.on("node:removed",(function(e){var o=e.cell,i=o.store.data;switch(t.checkNode(),i.attrs.nodeData.type){case"Start":t.haveStart=!1;break;case"End":t.haveEnd=!1;break}})),this.graph.on("edge:connected",(function(e){t.graph.resetSelection(e.edge),t.type="edge",console.log("edge:connected",e.edge)}))},showPorts:function(t,e){for(var o=0,i=t.length;o<i;o+=1)t[o].style.visibility=e?"visible":"hidden"},startDrag:function(t,e){if(!this.disabled){if("Start"===t){if(this.haveStart)return}else if("End"===t&&this.haveEnd)return;Object(c["startDragToGraph"])(this.graph,t,e)}},deleteNode:function(){if(!this.disabled){var t=this.graph.getSelectedCells();this.graph.removeCells(t),this.type="grid"}},savePic:function(){var t=this;this.$nextTick((function(){t.graph.toPNG((function(e){a["c"].downloadDataUri(e,t.title+".png")}),{backgroundColor:"white",padding:{top:50,right:50,bottom:50,left:50},quality:1,copyStyles:!1})}))},checkNode:function(t){var e=this.graph.getNodes(),o=["Start","End"],i=!1;console.log("node",e);for(var r=e.length-1;r>-1;r--)if(o.indexOf(e[r].attrs.nodeData.type)<0){if(i=!0,!t)break}else t&&("Start"===e[r].attrs.nodeData.type?this.haveStart=!0:this.haveEnd=!0);this.diabledEntity=i},checkFlow:function(){var t=this,e=this.graph.toJSON(),o=e.cells,i=[],r=[],n=[],a=0,s=0,d=o.length,l=[],h=[];if(0===d)i.push("画布不能为空");else{for(var c=function(){if("edge"!==o[g].shape){var e=o[g].attrs.nodeData,d=o[g].attrs.label.text,c=e.flowNode;if("Start"===e.type)a++;else if("End"===e.type)s++;else if("Rect"===e.type){var p="任务节点【"+d+"】";switch(c.flowNodeType){case"":i.push(p+"未选择节点类型");break;case"2":""===c.groupIdentify&&i.push(p+"未选择执行规则组");break;case"6":""===c.childFlowIdentify&&i.push(p+"未选择子流程");break;case"7":""===c.methodName?i.push(p+"未选择方法"):c.hasMethodParams&&""===c.methodParams&&i.push(p+"方法未输入参数");break}}else if("polygon"===e.type){var f="条件节点【"+d+"】",u=t.graph.getOutgoingEdges(o[g].id);if(console.log("conditionEdges",u),u){u=u.filter((function(t){return t.source.cell!==t.target.cell}));var m=0,b=0;u.forEach((function(t){console.log("item",t);var e=t.store.data.labels?void 0!=t.store.data.labels[0].text?t.store.data.labels[0].text:t.store.data.labels[0].attrs.label.text:"";"是"===e?m++:"否"===e&&b++})),m<1?i.push(f+"缺少是判断的连线"):m>1&&i.push(f+"过多是判断的连线"),b<1?i.push(f+"缺少否判断的连线"):b>1&&i.push(f+"过多否判断的连线")}c.flowJudges.length<1&&i.push(f+"未选择判断条件")}l.push({id:o[g].id,type:o[g].attrs.nodeData.type}),r.push(o[g])}else o[g].source.cell!==o[g].target.cell&&h.push({source:o[g].source.cell,target:o[g].target.cell}),n.push(o[g])},g=0;g<d;g++)c();1!==a&&i.push("开始节点必需存在,且仅有一个"),1!==s&&i.push("结束节点必需存在,且仅有一个");var p=!1,f=!1,u=!1;l.forEach((function(t){for(var e=!1,o=0,r=h.length;o<r;o++)t.id!==h[o].source&&t.id!==h[o].target||(e=!0),"Start"===t.type?t.id!==h[o].target||p||(p=!0,i.push("开始节点不能为连线终点")):"End"===t.type&&(t.id!==h[o].source||f||(f=!0,i.push("结束节点不能为连线起点")));e||u||(u=!0,i.push("节点间必需有连接线关联"))}))}return{graphToJson:e,nodeList:r,edgeList:n,errs:i}},saveFlow:function(){this.graph.cleanSelection();var t=this.checkFlow(),e=(t.errs,t.nodeList),o=t.edgeList;t.graphToJson;console.log("nodeList",e),console.log("edgeList",o),console.log("saveData",{nodes:e,edges:o})},historyChange:function(){this.canUndo=this.graph.history.canUndo(),this.canRedo=this.graph.history.canRedo()},onUndo:function(){this.disabled||this.graph.history.undo()},onRedo:function(){this.disabled||this.graph.history.redo()},getJson:function(){console.log(this.graph.toJSON())}}},f=p,u=(o("7a1e"),o("2877")),m=Object(u["a"])(f,i,r,!1,null,"5e993917",null);e["default"]=m.exports},d3be:function(t,e,o){},d43f:function(t,e,o){"use strict";o.r(e);var i={nodes:[{position:{x:80,y:240},size:{width:100,height:60},attrs:{body:{stroke:"#1890ff",strokeWidth:1,fill:"#ffffff",rx:18,ry:18},label:{text:"开始",fill:"#1890ff",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},nodeData:{type:"Start",flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}},visible:!0,shape:"rect",id:"a08519e5-4fe4-4cce-ad9f-fe8d0e08c27c",zIndex:1,ports:{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"}]}},{position:{x:643,y:240},size:{width:100,height:60},attrs:{body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff",rx:18,ry:18},label:{text:"结束",fill:"#000000",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},nodeData:{type:"End",flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}},visible:!0,shape:"rect",id:"1e580ed2-a3ae-4c6a-99b0-5362a641349a",zIndex:2,ports:{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"}]}},{position:{x:263,y:210},size:{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:{type:"polygon",flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}},visible:!0,shape:"polygon",id:"4a5786b9-d792-4fca-ab6e-1ef3ca66cd8c",zIndex:3,ports:{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"}]}},{position:{x:460,y:100},size:{width:100,height:60},attrs:{body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff"},label:{text:"任务节点1",fill:"#000000",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},nodeData:{type:"Rect",flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}},visible:!0,shape:"rect",id:"0541c729-89e2-4b69-8987-4c46bf392291",zIndex:4,ports:{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"}]}},{position:{x:460,y:375},size:{width:100,height:60},attrs:{body:{stroke:"#000000",strokeWidth:1,fill:"#ffffff"},label:{text:"任务节点2",fill:"#000000",fontSize:14,textWrap:{width:-10,height:-10,ellipsis:!0}},nodeData:{type:"Rect",flowNode:{entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]}}},visible:!0,shape:"rect",id:"1ae306ed-4995-4c5c-a3d1-4b9d279a7be2",zIndex:5,ports:{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"}]}}],edges:[{shape:"edge",attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},id:"d4aa73ba-9c33-451a-a1c6-03ce1132b41b",connector:"normal",router:{name:"normal"},zIndex:0,labels:[{text:""}],source:{cell:"a08519e5-4fe4-4cce-ad9f-fe8d0e08c27c",port:"port4"},target:{cell:"4a5786b9-d792-4fca-ab6e-1ef3ca66cd8c",port:"port3"}},{shape:"edge",attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},id:"0b46c457-2d25-4b2b-932f-e5d494faa1a5",connector:"normal",router:{name:"normal"},zIndex:0,labels:[{text:""}],source:{cell:"4a5786b9-d792-4fca-ab6e-1ef3ca66cd8c",port:"port4"},target:{cell:"0541c729-89e2-4b69-8987-4c46bf392291",port:"port3"},vertices:[{x:420,y:270},{x:420,y:130}]},{shape:"edge",attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},id:"f619ac70-3ba8-4d65-8115-b17f32ec8bf8",connector:"normal",router:{name:"normal"},zIndex:0,labels:[{attrs:{label:{text:"是"}}}],source:{cell:"4a5786b9-d792-4fca-ab6e-1ef3ca66cd8c",port:"port4"},target:{cell:"1ae306ed-4995-4c5c-a3d1-4b9d279a7be2",port:"port3"},vertices:[{x:420,y:270},{x:420,y:405}]},{shape:"edge",attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},id:"52e9c9ed-6b93-4acc-b9ee-0494e6b4af5c",connector:"normal",router:{name:"normal"},zIndex:0,labels:[{text:""}],source:{cell:"1ae306ed-4995-4c5c-a3d1-4b9d279a7be2",port:"port4"},target:{cell:"1e580ed2-a3ae-4c6a-99b0-5362a641349a",port:"port3"},vertices:[{x:600,y:405},{x:600,y:270}]},{shape:"edge",attrs:{line:{stroke:"#1890ff",strokeWidth:1,targetMarker:{name:"classic",size:8},strokeDasharray:0,style:{animation:"ant-line 30s infinite linear"}}},id:"8a546bda-00ca-4d39-bc90-7e4c1cbdc7a1",connector:"normal",router:{name:"normal"},zIndex:0,labels:[{attrs:{label:{text:"任务节点1到结束"}}}],source:{cell:"0541c729-89e2-4b69-8987-4c46bf392291",port:"port4"},target:{cell:"1e580ed2-a3ae-4c6a-99b0-5362a641349a",port:"port3"},vertices:[{x:600,y:130},{x:600,y:270}]}]};e["default"]=i},eb6f:function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{ref:"rightDrawer",staticClass:"right-drawer"},[o("div",{ref:"miniMap",staticClass:"drawer-map"}),o("div",{staticClass:"right-drawer-content"},[o("div",{staticClass:"right-drawer-title"},[t._v("属性面板")]),o("div",{staticClass:"right-drawer-body"},[o("div",{staticClass:"right-drawer-body-item"},[o("div",{staticClass:"right-drawer-body-item-title"},[t._v("节点名称")]),o("div",{staticClass:"right-drawer-body-item-content"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.drawerNode.nodeText,expression:"drawerNode.nodeText"}],staticClass:"normal-input",attrs:{type:"text"},domProps:{value:t.drawerNode.nodeText},on:{change:t.changeNodeText,input:function(e){e.target.composing||t.$set(t.drawerNode,"nodeText",e.target.value)}}})])]),o("div",{staticClass:"right-drawer-body-item"},[o("div",{staticClass:"right-drawer-body-item-title"},[t._v("线条文本")]),o("div",{staticClass:"right-drawer-body-item-content"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.drawerEdge.edgeText,expression:"drawerEdge.edgeText"}],staticClass:"normal-input",attrs:{type:"text"},domProps:{value:t.drawerEdge.edgeText},on:{change:t.changeEdgeText,input:function(e){e.target.composing||t.$set(t.drawerEdge,"edgeText",e.target.value)}}})])])])])])},r=[],n=(o("cb29"),o("a9e3"),{props:{drawerType:{type:String,default:"grid"},selectCell:{type:Object|String,default:function(){}},graph:{type:Object|String,default:function(){}},grid:{type:Object}},data:function(){return{drawerNode:{fill:"",nodeText:"",fontSize:null,fontFill:"",strokeWidth:null,stroke:"",nodeType:"",entityId:"",itemId:"",flowNodeType:"",groupIdentify:"",childFlowIdentify:"",methodName:"",methodParams:"",methodType:"",hasMethodParams:!1,methodExp:"",flowJudges:[]},drawerEdge:{isCondition:!1,edgeText:"",edgeSelect:!0,edgeWidth:null,edgeColor:""}}},watch:{selectCell:{handler:function(t){if(t)if(t.isNode()){this.drawerNode.fill=t.store.data.attrs.body.fill,this.drawerNode.nodeText=t.store.data.attrs.label.text,this.drawerNode.fontFill=t.store.data.attrs.label.fill,this.drawerNode.fontSize=Number(t.store.data.attrs.label.fontSize),this.drawerNode.strokeWidth=Number(t.store.data.attrs.body.strokeWidth),this.drawerNode.stroke=t.store.data.attrs.body.stroke,this.drawerNode.nodeType=t.store.data.attrs.nodeData.type;var e=t.store.data.attrs.nodeData.flowNode;this.drawerNode.entityId=e.entityId,this.drawerNode.itemId=e.itemId,this.drawerNode.flowNodeType=e.flowNodeType,this.drawerNode.groupIdentify=e.groupIdentify,this.drawerNode.childFlowIdentify=e.childFlowIdentify,this.drawerNode.methodExp=e.methodExp,this.drawerNode.methodType=e.methodType,this.drawerNode.flowJudges=e.flowJudges}else{this.drawerEdge.edgeText=t.store.data.labels?void 0!=t.store.data.labels[0].text?t.store.data.labels[0].text:t.store.data.labels[0].attrs.label.text:"",console.log("his.drawerEdge.edgeText",this.drawerEdge.edgeText),this.drawerEdge.edgeWidth=Number(t.store.data.attrs.line.strokeWidth),this.drawerEdge.edgeColor=t.store.data.attrs.line.stroke;this.graph.getCellById(t.store.data.source.cell)}},immediate:!0,deep:!1}},methods:{changeNodeText:function(){this.selectCell.attr("label/text",this.drawerNode.nodeText)},changeEdgeText:function(){this.selectCell.setLabels([{attrs:{label:{text:this.drawerEdge.edgeText}}}])}}}),a=n,s=(o("32ef"),o("2877")),d=Object(s["a"])(a,i,r,!1,null,"2d8b57bc",null);e["default"]=d.exports}}]);