diff --git a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar index 7eb41992..67cce7ac 100644 Binary files a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar and b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar differ diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java index 76286a0b..26d3bc4e 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java @@ -274,6 +274,8 @@ public class GraphNodeExpandHandle { */ private void handleEndToEndGraphNodeExcluedExpandNode(){ JSONObject elements = endToEndProcessDefine.getJSONObject("elements"); + JSONObject processProperties = endToEndProcessDefine.getJSONObject("processProperties"); + String direction = processProperties.getString("direction"); // 范围标注框 大小 位置 JSONObject scopeShapeProps = scopeLimitationShape.getJSONObject("props"); double scopeShapeX = scopeShapeProps.getDoubleValue("x"); @@ -285,11 +287,23 @@ public class GraphNodeExpandHandle { JSONObject ele = elements.getJSONObject(key); if ("linker".equals(ele.getString("name"))) continue; // 连线先不处理 JSONObject props = ele.getJSONObject("props"); - if (props.getDoubleValue("x") > scopeShapeX) { // 当前元素在待展开节点的右侧 - props.put("x", props.getDoubleValue("x") + scopeShapeW - SubProcessConst.SUB_PROCESS_SHAPE_W); - } - if (props.getDoubleValue("y") > scopeShapeY) { // 当前元素在待展开节点的下侧 - props.put("y", props.getDoubleValue("y") + scopeShapeH - SubProcessConst.SUB_PROCESS_SHAPE_H); + if (ele.getString("id").equals(scopeLimitationShape.getString("id"))) continue; + if ("vertically".equals(direction)){ + if (props.getDoubleValue("x") > scopeShapeX) { // 当前元素在待展开节点的右侧 + props.put("x", props.getDoubleValue("x") + scopeShapeW - SubProcessConst.SUB_PROCESS_SHAPE_W); + } + if (props.getDoubleValue("y") > scopeShapeY || props.getDoubleValue("y") == scopeShapeY) { // 当前元素在待展开节点的下侧 + props.put("y", props.getDoubleValue("y") + scopeShapeH - SubProcessConst.SUB_PROCESS_SHAPE_H); + } + }else { + if (props.getDoubleValue("x") > scopeShapeX) { // 当前元素在待展开节点的右侧 + props.put("x", props.getDoubleValue("x") + scopeShapeW - SubProcessConst.SUB_PROCESS_SHAPE_W); + }else if (props.getDoubleValue("x") == scopeShapeX && props.getDoubleValue("y") > scopeShapeY) { // 当前元素与待展开节点在一列上 且在下侧 + props.put("x", props.getDoubleValue("x") + scopeShapeW - SubProcessConst.SUB_PROCESS_SHAPE_W); + } + if (props.getDoubleValue("y") > scopeShapeY) { // 当前元素在待展开节点的下侧 + props.put("y", props.getDoubleValue("y") + scopeShapeH - SubProcessConst.SUB_PROCESS_SHAPE_H); + } } addEndToEndGraphElements(ele); 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 451d96cb..47200d3e 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 @@ -1163,27 +1163,29 @@ var Designer = { if (g.x == 0 && g.y == 0) { return } - // 端到端功能 如果移动的元素是子流程节点展开后 范围框中的元素 则进行移动范围限制校验 - let rang = window.subProcess.scopeRang; - let movingEle = window.subProcess.movingEle; - if (movingEle != null && rang != null){ - let flag = false; - for (let k = 0; k < u.length; k++) { - if (u[k].name == "linker") continue; - if (u[k].id == movingEle.id) flag = true; - } - if (flag){ - let movingEleBound = { - x: movingEle.props.x, - y: movingEle.props.y, - w: movingEle.props.w, - h: movingEle.props.h + if (methodId == 'process.subprocess') { // 如果当前打开的模型不是端到端总图 那么整个js也没有执行的必要 + // 端到端功能 如果移动的元素是子流程节点展开后 范围框中的元素 则进行移动范围限制校验 + let rang = window.subProcess.scopeRang; + let movingEle = window.subProcess.movingEle; + if (movingEle != null && rang != null){ + let flag = false; + for (let k = 0; k < u.length; k++) { + if (u[k].name == "linker") continue; + if (u[k].id == movingEle.id) flag = true; } - if (movingEleBound.x + g.x <= rang.x1 || movingEleBound.x + movingEleBound.w + g.x >= rang.x2 || movingEleBound.y + g.y <= rang.y1 || movingEleBound.y + movingEleBound.h + g.y >= rang.y2){ - $.simpleAlert("子流程内部节点只能在范围标识框内部移动", "warning"); - d.unbind("mousemove.drag"); - c.unbind("mousedown.drag"); - return; + if (flag){ + let movingEleBound = { + x: movingEle.props.x, + y: movingEle.props.y, + w: movingEle.props.w, + h: movingEle.props.h + } + if (movingEleBound.x + g.x <= rang.x1 || movingEleBound.x + movingEleBound.w + g.x >= rang.x2 || movingEleBound.y + g.y <= rang.y1 || movingEleBound.y + movingEleBound.h + g.y >= rang.y2){ + $.simpleAlert("子流程内部节点只能在范围标识框内部移动", "warning"); + d.unbind("mousemove.drag"); + c.unbind("mousedown.drag"); + return; + } } } } diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.js index 5c3c3bbb..dd7113db 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.core.js @@ -458,6 +458,10 @@ var Designer = { Model.update(M) } } + // 如果当前拖拽到画布的图形是子流程 则渲染节点展开图标 + if (g.name == 'subProcess') { + window.subProcess.shapeOpenIconRender(g); + } Utils.unselect(); Utils.selectShape(g.id); MessageSource.commit(); @@ -928,7 +932,6 @@ var Designer = { } }, init: function () { - debugger; this.initialize.initLayout(); this.initialize.initModel(); this.initialize.initCanvas(); @@ -1177,6 +1180,32 @@ var Designer = { if (g.x == 0 && g.y == 0) { return } + if (methodId == 'process.subprocess') { // 如果当前打开的模型不是端到端总图 那么整个js也没有执行的必要 + // 端到端功能 如果移动的元素是子流程节点展开后 范围框中的元素 则进行移动范围限制校验 + let rang = window.subProcess.scopeRang; + let movingEle = window.subProcess.movingEle; + if (movingEle != null && rang != null){ + let flag = false; + for (let k = 0; k < u.length; k++) { + if (u[k].name == "linker") continue; + if (u[k].id == movingEle.id) flag = true; + } + if (flag){ + let movingEleBound = { + x: movingEle.props.x, + y: movingEle.props.y, + w: movingEle.props.w, + h: movingEle.props.h + } + if (movingEleBound.x + g.x <= rang.x1 || movingEleBound.x + movingEleBound.w + g.x >= rang.x2 || movingEleBound.y + g.y <= rang.y1 || movingEleBound.y + movingEleBound.h + g.y >= rang.y2){ + $.simpleAlert("子流程内部节点只能在范围标识框内部移动", "warning"); + d.unbind("mousemove.drag"); + c.unbind("mousedown.drag"); + return; + } + } + } + } Designer.op.moveShape(u, g); x = f; $(document).unbind("mouseup.drop").bind("mouseup.drop",