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 8c6c9989..ab83e6c4 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.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index e0c2e038..5935dea7 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -6116,6 +6116,75 @@ public class CoeProcessLevelWeb extends ActionWeb { } } } + + // 维护节点连线信息 + List linkers = elements.keySet() + .stream() + .filter(key -> "OUTER_LINKER".equals(elements.getJSONObject(key).getString("elementType")) || "CROSS_LINKER".equals(elements.getJSONObject(key).getString("elementType"))) + .map(key -> elements.getJSONObject(key)) + .collect(Collectors.toList()); + List nodeList = elements.keySet() + .stream().filter(key -> "OUTER_NODE".equals(elements.getJSONObject(key).getString("elementType")) || "SCOPE_NODE".equals(elements.getJSONObject(key).getString("elementType"))) + .map(key -> elements.getJSONObject(key)) + .collect(Collectors.toList()); + + JSONObject nodeLinkerRecord = new JSONObject(); + if (definition.containsKey("nodeLinkerRecord")){ + nodeLinkerRecord = definition.getJSONObject("nodeLinkerRecord"); + } + for (JSONObject shape : nodeList) { + String shapeId = shape.getString("id"); + JSONObject recordContent = new JSONObject(); + JSONArray leadLinkerInfo = new JSONArray(); // 前置连线信息 + JSONArray rearLinkerInfo = new JSONArray(); // 后置连线信息 + + for (JSONObject linker : linkers) { + JSONObject from = linker.getJSONObject("from"); + JSONObject to = linker.getJSONObject("to"); + JSONObject fromNode = elements.getJSONObject(from.getString("id")); + JSONObject toNode = elements.getJSONObject(to.getString("id")); + + JSONObject linkerInfo = new JSONObject(); + linkerInfo.put("linker", JSONObject.parse(linker.toString())); + linkerInfo.put("fromNodeType", fromNode.getString("elementType").equals("OUTER_NODE") ? "close" : "expand"); + linkerInfo.put("toNodeType", toNode.getString("elementType").equals("OUTER_NODE") ? "close" : "expand"); + if ("OUTER_NODE".equals(shape.getString("elementType"))){ // 当前节点闭合 + if (shapeId.equals(to.getString("id"))){ // 当前节点的前置连线信息 + linkerInfo.put("leadNodeId", "OUTER_NODE".equals(fromNode.getString("elementType")) ? from.getString("id") : fromNode.getString("scopeShapeId")); + leadLinkerInfo.add(linkerInfo); + }else if (shapeId.equals(from.getString("id"))){ // 当前节点的后置连线信息 + linkerInfo.put("rearNodeId", "OUTER_NODE".equals(toNode.getString("elementType")) ? to.getString("id") : toNode.getString("scopeShapeId")); + rearLinkerInfo.add(linkerInfo); + } + }else { + if (shapeId.equals(toNode.getString("scopeShapeId"))){ + linkerInfo.put("leadNodeId", "OUTER_NODE".equals(fromNode.getString("elementType")) ? from.getString("id") : fromNode.getString("scopeShapeId")); + leadLinkerInfo.add(linkerInfo); + }else if (shapeId.equals(fromNode.getString("scopeShapeId"))){ + linkerInfo.put("rearNodeId", "OUTER_NODE".equals(toNode.getString("elementType")) ? to.getString("id") : toNode.getString("scopeShapeId")); + rearLinkerInfo.add(linkerInfo); + } + } + } + recordContent.put("leadLinkerInfo", leadLinkerInfo); + recordContent.put("rearLinkerInfo", rearLinkerInfo); + + + JSONObject status = new JSONObject(); + if (nodeLinkerRecord.containsKey(shapeId)){ + status = nodeLinkerRecord.getJSONObject(shapeId); + } + if ("OUTER_NODE".equals(shape.getString("elementType"))){ // 当前状态为闭合 + status.put("close", recordContent); + }else { // 当前状态为展开 + status.put("expand", recordContent); + } + + nodeLinkerRecord.put(shapeId, status); + } + definition.put("nodeLinkerRecord", nodeLinkerRecord); + + }else if (repositoryModel.getMethodId().equals("process.epc") || repositoryModel.getMethodId().equals("process.flowchart")){ // 判断当前模型是否被某一个总图引用 DesignerShapeRelationDao shapeRelationDao = new DesignerShapeRelationDao(); @@ -6259,6 +6328,7 @@ public class CoeProcessLevelWeb extends ActionWeb { if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE); } + ro.put("define", definition); return ro.toString(); } diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js index ef69d7f2..096b1c3d 100644 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js @@ -143,6 +143,7 @@ $(function() { } }); } + Model.define.nodeLinkerRecord = msg.data.define.nodeLinkerRecord; $.simpleAlert("保存成功", "ok"); //保存结束时间戳 //var saveEndTime = new Date().getTime(); 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 079c1b8e..91ae6168 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 @@ -2180,7 +2180,7 @@ var Designer = { if (from.id != null && to.id != null){ let fromObj = Model.getShapeById(from.id); let toObj = Model.getShapeById(to.id); - if (fromObj.elementType == "OUTER_NODE" && toObj.elementType == "OUTER_NODE"){ + if ((fromObj.elementType == "OUTER_NODE" && toObj.elementType == "OUTER_NODE") || (fromObj.elementType == "SCOPE_NODE" && toObj.elementType == "SCOPE_NODE")){ d.elementType = "OUTER_LINKER"; window.subProcess.outerNodeExtendAttrHandle(d); }else if (fromObj.elementType == "INNER_NODE" && toObj.elementType == "INNER_NODE"){ 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 0fd0b94b..7a1bc1f6 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 @@ -91,7 +91,7 @@ class SubProcess { Utils.unselect(); Utils.selectShape(e); }); - }else { + }else if (j.shape.elementType == 'INNER_NODE') { // console.log('范围标注框的图形是否存了下来', window.subProcess.scopeEle); let scopeEle = window.subProcess.scopeEle; for (const scopeShapeId in scopeEle) { @@ -116,6 +116,9 @@ class SubProcess { window.subProcess.movingEle = Model.getShapeById(j.shape.id); } } + }else { + window.subProcess.movingEle = null; + window.subProcess.scopeRang = null; } }else { window.subProcess.movingEle = null;