diff --git a/com.actionsoft.apps.coe.method.process.subprocess/method/process.subprocess/diagram.schema.tpl b/com.actionsoft.apps.coe.method.process.subprocess/method/process.subprocess/diagram.schema.tpl index 7c15a6fa..c32b8024 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/method/process.subprocess/diagram.schema.tpl +++ b/com.actionsoft.apps.coe.method.process.subprocess/method/process.subprocess/diagram.schema.tpl @@ -537,13 +537,20 @@ Schema.addShape({name:"method_service_node4", title:"人工任务", text:"人工 ]}); Schema.addShape({name:"subProcess", title:"子流程", text:"子流程", category:"process_subprocess", groupName:"", props:{w:100, h:70}, -fillStyle:{color:"153,255,255"}, +fillStyle:{color:"153,255,255"},textBlock:{x:"Math.min(w/6,20)", y:"0", w:"w-Math.min(w/6,20)*2", h:"h"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"}, path:[ - {lineStyle:{lineWidth:"lineWidth", lineStyle:"solid"}, actions:{ref:"roundRectangle"}}, - {lineStyle:{lineWidth:1,lineStyle:"solid"},actions:[{action:"move",x:"w*0.5-9",y:"h-22"},{action:"line",x:"w*0.5+9",y:"h-22"},{action:"line",x:"w*0.5+9",y:"h-4"},{action:"line",x:"w*0.5-9",y:"h-4"},{action:"close"}]}, - {lineStyle:{lineWidth:1,lineStyle:"solid"},actions:[{action:"move",x:"w*0.5-7",y:"h-13"},{action:"line",x:"w*0.5+7",y:"h-13"}]}, - {lineStyle:{lineWidth:1,lineStyle:"solid"},actions:[{action:"move",x:"w*0.5",y:"h-20"},{action:"line",x:"w*0.5",y:"h-6"}]}, - {lineStyle:{lineWidth:0}, fillStyle:{type:"none"}, actions:{ref:"roundRectangle"}} + {actions:[ + {action:"move", x:"0", y:"0"}, + {action:"line", x:"w", y:"0"}, + {action:"line", x:"w", y:"h"}, + {action:"line", x:"0", y:"h"}, + {action:"line", x:"0", y:"0"}, + {action:"close"}, + {action:"move", x:"Math.min(w/6,20)", y:"0"}, + {action:"line", x:"Math.min(w/6,20)", y:"h"}, + {action:"move", x:"w- Math.min(w/6,20)", y:"0"}, + {action:"line", x:"w- Math.min(w/6,20)", y:"h"} + ]} ]}); Schema.addShape({name:"scopeLimitation", title:"展开范围标注", text:"", category:"process_subprocess", groupName:"", props:{w:100, h:70}, diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.debug.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.debug.js index 8b2551d6..44182c7c 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.debug.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.debug.js @@ -455,6 +455,10 @@ var Designer = { Model.update(M) } } + // 如果当前拖拽到画布的图形是子流程 则渲染节点展开图标 + if (g.name == 'subProcess') { + window.subProcess.shapeOpenIconRender(g); + } Utils.unselect(); Utils.selectShape(g.id); MessageSource.commit(); diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js index e560570a..0e03b3d6 100644 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js @@ -5,7 +5,9 @@ $(function(){ // 1. 子流程展开 事件:获取当前子流程所代表的模型文件 (function (Model, ruuid, sid) { const subProcess = new SubProcess(Model, ruuid, sid); - subProcess.shapeIconRender(); + + subProcess.init(); + window.subProcess = subProcess; // 连线框 鼠标指针样式设置 防止因为连线z-index层级较高 会导致节点展开图标点击不到 @@ -13,6 +15,7 @@ $(function(){ 'pointer-events': 'none' }); + })(Model, ruuid, sid); }); @@ -24,6 +27,11 @@ class SubProcess { this.sid = sid; } + init(){ + this.shapeIconRender(); + this.handleScopeShapeEvent(); + } + // 图形图标渲染 并绑定节点展开或者关闭事件 shapeIconRender(){ let elements = this.Model.define.elements; @@ -44,6 +52,27 @@ class SubProcess { } } + // 子流程节点拖拽到画布后 渲染展开按钮 + shapeOpenIconRender(ele){ + if (ele.name != 'subProcess'){ + return; + } + let shapeId = ele.id; + let expandIcon = ""; + $('#'+shapeId).append(expandIcon); + $('#icon_'+shapeId).on('click', '', {shapeId: shapeId, Model: this.Model, repositoryId: this.repositoryId, sid: this.sid}, this.shapeExpand); + } + + // 范围选择框的事件绑定处理 + handleScopeShapeEvent(){ + let d = $("#canvas_container"); + let c = $("#designer_canvas"); + d.unbind("mousemove.operate").bind("mousemove.operate",function (a) { + let b = Utils.getRelativePos(a.pageX, a.pageY, c); + console.log('应该是当前鼠标指针的位置 ', b); + }); + } + // 节点展开事件 shapeExpand(event){ let param = event.data;