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 e834f98c..7cfcaca6 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/VertexPreHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java index eb6377af..a9fb508e 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java @@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.method.process.subprocess.graph; import com.actionsoft.apps.coe.method.process.subprocess.constant.SubProcessConst; import com.actionsoft.apps.coe.method.process.subprocess.mode.Node; import com.actionsoft.apps.coe.method.process.subprocess.mode.vo.IndependentNodeVo; +import com.actionsoft.apps.coe.method.process.subprocess.mode.vo.LeadAndRearNotInRangeNodeVo; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; @@ -10,6 +11,8 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.Designer import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.exception.AWSException; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import java.util.*; import java.util.stream.Collectors; @@ -35,7 +38,7 @@ public class VertexPreHandle { * @return * @throws AWSException */ - public Map> collectIndependentNode(List processIdList) throws AWSException{ + public Map collectIndependentNode(List processIdList) throws AWSException{ List nodeVoList = new ArrayList<>(); List attrIdList = new ArrayList<>(); @@ -71,13 +74,12 @@ public class VertexPreHandle { independentNodeVo.setBeReference(true); }; - // 3. 收集独立节点信息返回给前台 nodeVoList.add(independentNodeVo); } - Map> map = new HashMap<>(); + Map map = new HashMap<>(); List independentNodeVos = new ArrayList<>(); - List leadAndRearNotInRange = new ArrayList<>(); + List leadAndRearNotInRange = new ArrayList<>(); for (IndependentNodeVo nodeVo : nodeVoList) { if (nodeVo.isBeReference()) continue; // 被引用了 不管有没有前置或后置 都保留 if (nodeVo.getLeadNodeVo() == null && nodeVo.getRearNodeVo() == null && !nodeVo.isBeReference()){ // 完全独立 @@ -87,19 +89,21 @@ public class VertexPreHandle { List leadNodeVos = nodeVo.getLeadNodeVo(); if (leadNodeVos != null && leadNodeVos.size() > 0){ - List nodeIds = leadNodeVos.stream().map(leadNodeVo -> leadNodeVo.getId()).collect(Collectors.toList()); - if (!processIdList.containsAll(nodeIds)){ - leadAndRearNotInRange.add(nodeVo); - continue; - } + leadNodeVos.stream().forEach(leadNodeVo -> { + if (!processIdList.contains(leadNodeVo.getId())){ + LeadAndRearNotInRangeNodeVo notInRangeNodeVo = new LeadAndRearNotInRangeNodeVo(leadNodeVo.getId(), leadNodeVo.getName(), nodeVo.getName(), SubProcessConst.LEAD_PROCESS_ATTR_ID, "上游流程"); + leadAndRearNotInRange.add(notInRangeNodeVo); + } + }); } List rearNodeVos = nodeVo.getRearNodeVo(); if (rearNodeVos != null && rearNodeVos.size() > 0){ - List nodeIds = rearNodeVos.stream().map(rearNodeVo -> rearNodeVo.getId()).collect(Collectors.toList()); - if (!processIdList.containsAll(nodeIds)){ - leadAndRearNotInRange.add(nodeVo); - continue; - } + rearNodeVos.stream().forEach(rearNodeVo -> { + if (!processIdList.contains(rearNodeVo.getId())){ + LeadAndRearNotInRangeNodeVo notInRangeNodeVo = new LeadAndRearNotInRangeNodeVo(rearNodeVo.getId(), rearNodeVo.getName(), nodeVo.getName(), SubProcessConst.REAR_PROCESS_ATTR_ID, "下游流程"); + leadAndRearNotInRange.add(notInRangeNodeVo); + } + }); } } map.put("independentNodeVos", independentNodeVos); diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/IndependentNodeVo.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/IndependentNodeVo.java index 3fae9606..99e6eb85 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/IndependentNodeVo.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/IndependentNodeVo.java @@ -13,8 +13,6 @@ public class IndependentNodeVo { private List leadNodeVo; private List rearNodeVo; private boolean isBeReference; - private String leadNodeNames; - private String rearNodeNames; public IndependentNodeVo(String id, String name) { this.id = id; diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/LeadAndRearNotInRangeNodeVo.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/LeadAndRearNotInRangeNodeVo.java new file mode 100644 index 00000000..14a4d239 --- /dev/null +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/vo/LeadAndRearNotInRangeNodeVo.java @@ -0,0 +1,58 @@ +package com.actionsoft.apps.coe.method.process.subprocess.mode.vo; + +public class LeadAndRearNotInRangeNodeVo { + + private String id; + private String name; + private String relationName; + private String type; + private String typeName; + + public LeadAndRearNotInRangeNodeVo(String id, String name, String relationName, String type, String typeName) { + this.id = id; + this.name = name; + this.relationName = relationName; + this.type = type; + this.typeName = typeName; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRelationName() { + return relationName; + } + + public void setRelationName(String relationName) { + this.relationName = relationName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } +} 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 44182c7c..2e12adbd 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 @@ -4900,7 +4900,6 @@ var Designer = { b.fillText(y, 0, a / 2); } if (x != "") { - debugger; if (x.indexOf("&#x") >= 0) { var icon = x.split("|")[0]; var iconColor = x.split("|")[1]; 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 63c0bfdf..ef2244b6 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 @@ -25,6 +25,7 @@ class SubProcess { this.Model = Model; this.repositoryId = ruuid; this.sid = sid; + this.scopeEle = {}; } init(){ @@ -69,20 +70,34 @@ class SubProcess { c.off("mousemove").on("mousemove",function (a) { let b = Utils.getRelativePos(a.pageX, a.pageY, c); // 实时获取鼠标移动的坐标 let j = Utils.getShapeByPosition(b.x, b.y); // 根据鼠标当前移动的位置获取当前图形 如果有的话 - if (j != null && j.shape.name == 'scopeLimitation') { // 当前鼠标所在位置为范围选择框范围内 - console.log('当前图形 ', j.shape.name); - let range = { - x: j.shape.props.x, - y: j.shape.props.y, - w: j.shape.props.w, - h: j.shape.props.h - }; - let e = Utils.getShapesByRange(range); - c.off("mousedown").on("mousedown", function (f) { + // console.log("当前图形", j); + if (j != null && j.shape.name != 'subProcess') { // 当前鼠标所在位置为范围选择框范围内 + if (j.shape.name == 'scopeLimitation'){ + let range = { + x: j.shape.props.x, + y: j.shape.props.y, + w: j.shape.props.w, + h: j.shape.props.h + }; + let e = Utils.getShapesByRange(range); + window.subProcess.scopeEle[j.shape.id] = e; + $('#'+j.shape.id).off("mousedown").on("mousedown", function (f) { + Utils.unselect(); + Utils.selectShape(e); + }); + }else { // 范围选择框内的元素 Utils.unselect(); - Utils.selectShape(e); - }); + // console.log('范围标注框的图形是否存了下来', window.subProcess.scopeEle); + let scopeEle = window.subProcess.scopeEle; + for (const scopeShapeId in scopeEle) { + let eles = scopeEle[scopeShapeId]; + if (eles.indexOf(j.shape.id) != -1){ + console.log("范围选择框内的元素发生移动") + // 移动的范围 + } + } + } } }); }