端到端功能 节点展开后 相关交互的部分代码提交

This commit is contained in:
qinoy 2023-06-06 09:38:57 +08:00
parent 803e142b59
commit acd3a86f5d
6 changed files with 103 additions and 29 deletions

View File

@ -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<String, List<IndependentNodeVo>> collectIndependentNode(List<String> processIdList) throws AWSException{
public Map<String, Object> collectIndependentNode(List<String> processIdList) throws AWSException{
List<IndependentNodeVo> nodeVoList = new ArrayList<>();
List<String> attrIdList = new ArrayList<>();
@ -71,13 +74,12 @@ public class VertexPreHandle {
independentNodeVo.setBeReference(true);
};
// 3. 收集独立节点信息返回给前台
nodeVoList.add(independentNodeVo);
}
Map<String, List<IndependentNodeVo>> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
List<IndependentNodeVo> independentNodeVos = new ArrayList<>();
List<IndependentNodeVo> leadAndRearNotInRange = new ArrayList<>();
List<LeadAndRearNotInRangeNodeVo> 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<IndependentNodeVo> leadNodeVos = nodeVo.getLeadNodeVo();
if (leadNodeVos != null && leadNodeVos.size() > 0){
List<String> 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<IndependentNodeVo> rearNodeVos = nodeVo.getRearNodeVo();
if (rearNodeVos != null && rearNodeVos.size() > 0){
List<String> 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);

View File

@ -13,8 +13,6 @@ public class IndependentNodeVo {
private List<IndependentNodeVo> leadNodeVo;
private List<IndependentNodeVo> rearNodeVo;
private boolean isBeReference;
private String leadNodeNames;
private String rearNodeNames;
public IndependentNodeVo(String id, String name) {
this.id = id;

View File

@ -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;
}
}

View File

@ -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];

View File

@ -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("范围选择框内的元素发生移动")
// 移动的范围
}
}
}
}
});
}