(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c18a6874","chunk-f945a824","chunk-2d21dfd9","chunk-2d2080c9"],{"32ef":function(t,e,o){"use strict";o("d3be")},"7b11":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-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