端到端功能 节点展开后内外节点连线处理 阶段提交
This commit is contained in:
parent
84d9ffb931
commit
8c894e7c51
Binary file not shown.
@ -6116,6 +6116,75 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 维护节点连线信息
|
||||||
|
List<JSONObject> 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<JSONObject> 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")){
|
}else if (repositoryModel.getMethodId().equals("process.epc") || repositoryModel.getMethodId().equals("process.flowchart")){
|
||||||
// 判断当前模型是否被某一个总图引用
|
// 判断当前模型是否被某一个总图引用
|
||||||
DesignerShapeRelationDao shapeRelationDao = new DesignerShapeRelationDao();
|
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)) {
|
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);
|
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE);
|
||||||
}
|
}
|
||||||
|
ro.put("define", definition);
|
||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -143,6 +143,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Model.define.nodeLinkerRecord = msg.data.define.nodeLinkerRecord;
|
||||||
$.simpleAlert("保存成功", "ok");
|
$.simpleAlert("保存成功", "ok");
|
||||||
//保存结束时间戳
|
//保存结束时间戳
|
||||||
//var saveEndTime = new Date().getTime();
|
//var saveEndTime = new Date().getTime();
|
||||||
|
|||||||
@ -2180,7 +2180,7 @@ var Designer = {
|
|||||||
if (from.id != null && to.id != null){
|
if (from.id != null && to.id != null){
|
||||||
let fromObj = Model.getShapeById(from.id);
|
let fromObj = Model.getShapeById(from.id);
|
||||||
let toObj = Model.getShapeById(to.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";
|
d.elementType = "OUTER_LINKER";
|
||||||
window.subProcess.outerNodeExtendAttrHandle(d);
|
window.subProcess.outerNodeExtendAttrHandle(d);
|
||||||
}else if (fromObj.elementType == "INNER_NODE" && toObj.elementType == "INNER_NODE"){
|
}else if (fromObj.elementType == "INNER_NODE" && toObj.elementType == "INNER_NODE"){
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class SubProcess {
|
|||||||
Utils.unselect();
|
Utils.unselect();
|
||||||
Utils.selectShape(e);
|
Utils.selectShape(e);
|
||||||
});
|
});
|
||||||
}else {
|
}else if (j.shape.elementType == 'INNER_NODE') {
|
||||||
// console.log('范围标注框的图形是否存了下来', window.subProcess.scopeEle);
|
// console.log('范围标注框的图形是否存了下来', window.subProcess.scopeEle);
|
||||||
let scopeEle = window.subProcess.scopeEle;
|
let scopeEle = window.subProcess.scopeEle;
|
||||||
for (const scopeShapeId in scopeEle) {
|
for (const scopeShapeId in scopeEle) {
|
||||||
@ -116,6 +116,9 @@ class SubProcess {
|
|||||||
window.subProcess.movingEle = Model.getShapeById(j.shape.id);
|
window.subProcess.movingEle = Model.getShapeById(j.shape.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
window.subProcess.movingEle = null;
|
||||||
|
window.subProcess.scopeRang = null;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
window.subProcess.movingEle = null;
|
window.subProcess.movingEle = null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user