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 74f9ac77..f17098cc 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/GraphNodeCloseHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java index ef3e9559..57a2de46 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java @@ -262,21 +262,23 @@ class NodeCloseAdjMatrix extends AbstractAdjMatrix { public void buildAdjMatrix(){ for (JSONObject node : nodeList) { String currentNodeId = node.getString("id"); - JSONObject extendAttr = node.getJSONObject(SubProcessConst.EXTEND_ATTR); - // 当前节点的前置节点 - JSONArray leadNodeArr = extendAttr.getJSONArray("leadNodeArr"); - if (leadNodeArr.size() > 0){ - for (Object o : leadNodeArr) { - String leadNodeId = (String) o; - addEdge(nodeIds.indexOf(leadNodeId), nodeIds.indexOf(currentNodeId)); + if (node.containsKey(SubProcessConst.EXTEND_ATTR)){ // 新拖拽到画布的节点 如果还未连线或者子流程节点还未指定关联文件信息 就不存在扩展属性 extendAttr + JSONObject extendAttr = node.getJSONObject(SubProcessConst.EXTEND_ATTR); + // 当前节点的前置节点 + JSONArray leadNodeArr = extendAttr.getJSONArray("leadNodeArr"); + if (leadNodeArr.size() > 0){ + for (Object o : leadNodeArr) { + String leadNodeId = (String) o; + addEdge(nodeIds.indexOf(leadNodeId), nodeIds.indexOf(currentNodeId)); + } } - } - // 当前节点的后置节点 - JSONArray rearNodeArr = extendAttr.getJSONArray("rearNodeArr"); - if (rearNodeArr.size() > 0){ - for (Object o : rearNodeArr) { - String rearNodeId = (String) o; - addEdge(nodeIds.indexOf(currentNodeId), nodeIds.indexOf(rearNodeId)); + // 当前节点的后置节点 + JSONArray rearNodeArr = extendAttr.getJSONArray("rearNodeArr"); + if (rearNodeArr.size() > 0){ + for (Object o : rearNodeArr) { + String rearNodeId = (String) o; + addEdge(nodeIds.indexOf(currentNodeId), nodeIds.indexOf(rearNodeId)); + } } } } 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 10ec4f51..07ffae1d 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 @@ -388,21 +388,23 @@ class NodeExpandAdjMatrix extends AbstractAdjMatrix { public void buildAdjMatrix(){ for (JSONObject node : nodeList) { String currentNodeId = node.getString("id"); - JSONObject extendAttr = node.getJSONObject(SubProcessConst.EXTEND_ATTR); - // 当前节点的前置节点 - JSONArray leadNodeArr = extendAttr.getJSONArray("leadNodeArr"); - if (leadNodeArr.size() > 0){ - for (Object o : leadNodeArr) { - String leadNodeId = (String) o; - addEdge(nodeIds.indexOf(leadNodeId), nodeIds.indexOf(currentNodeId)); + if (node.containsKey(SubProcessConst.EXTEND_ATTR)){ // 新拖拽到画布的节点 如果还未连线或者子流程节点还未指定关联文件信息 就不存在扩展属性 extendAttr + JSONObject extendAttr = node.getJSONObject(SubProcessConst.EXTEND_ATTR); + // 当前节点的前置节点 + JSONArray leadNodeArr = extendAttr.getJSONArray("leadNodeArr"); + if (leadNodeArr.size() > 0){ + for (Object o : leadNodeArr) { + String leadNodeId = (String) o; + addEdge(nodeIds.indexOf(leadNodeId), nodeIds.indexOf(currentNodeId)); + } } - } - // 当前节点的后置节点 - JSONArray rearNodeArr = extendAttr.getJSONArray("rearNodeArr"); - if (rearNodeArr.size() > 0){ - for (Object o : rearNodeArr) { - String rearNodeId = (String) o; - addEdge(nodeIds.indexOf(currentNodeId), nodeIds.indexOf(rearNodeId)); + // 当前节点的后置节点 + JSONArray rearNodeArr = extendAttr.getJSONArray("rearNodeArr"); + if (rearNodeArr.size() > 0){ + for (Object o : rearNodeArr) { + String rearNodeId = (String) o; + addEdge(nodeIds.indexOf(currentNodeId), nodeIds.indexOf(rearNodeId)); + } } } } 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 7a09958e..35af23e4 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 @@ -371,6 +371,15 @@ var Designer = { } } b.attr("class", "shape_box"); + if (methodId == "process.subprocess") { + // 如果当前拖拽到画布的图形是子流程 则渲染节点展开图标 + if (g.name == 'subProcess'){ + window.subProcess.shapeOpenIconRender(g); + } + // 判断当前图形的元素类型 ElementType.INNER_NODE ElementType.OUTER_NODE + let elementType = window.subProcess.calculateShapeElementType(g); + g.elementType = elementType; + } Designer.events.push("created", g); Model.add(g); var S = Utils.getShapeContext(g.id); @@ -458,10 +467,6 @@ 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 d1fa97b9..92efad70 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 @@ -340,5 +340,25 @@ class SubProcess { } return false } + + // 根据当前元素的坐标设置元素类型 + calculateShapeElementType(shape){ + let elementType = "OUTER_NODE"; // 默认指定外部节点 + let props = shape.props; + let elements = Model.define.elements; + for (let key in elements) { + let ele = elements[key]; + if (ele.elementType == "SCOPE_NODE"){ // 查找范围框元素 + let scopeX = ele.props.x; + let scopeY = ele.props.y; + let scopeW = ele.props.w; + let scopeH = ele.props.h; + if (scopeX < props.x && props.x < scopeX + scopeW && scopeY < props.y && props.y < scopeY + scopeH){ + elementType = "INNER_NODE"; + } + } + } + return elementType; + } }