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 13284d53..bcfd6f8b 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/SubProcessController.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java index 0daadb2d..f15a771b 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java @@ -169,4 +169,17 @@ public class SubProcessController { return processWeb.shapeOneClick(action, repositoryId, define); } + /** + * 判断一键展开与闭合的快捷操作按钮是否显示 + * @param uc + * @param repositoryId + * @param elements + * @return + */ + @Mapping("com.actionsoft.apps.coe.method.process.subprocess.shape_expand_and_close_icon_show") + public String shapeExpandAndCloseIconShow(UserContext uc, String repositoryId, String elements){ + SubProcessWeb processWeb = new SubProcessWeb(uc); + return processWeb.shapeExpandAndCloseIconShow(repositoryId, elements); + } + } diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java index 29d4816c..c318ede8 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java @@ -347,6 +347,13 @@ public class SubProcessWeb extends ActionWeb { } } + /** + * 节点一键展开或者关闭 + * @param action + * @param repositoryId + * @param define + * @return + */ public String shapeOneClick(String action, String repositoryId, String define){ // 1、收集子流程节点 @@ -380,4 +387,39 @@ public class SubProcessWeb extends ActionWeb { return ro.toString(); } + // 判断一键展开与闭合的快捷操作按钮是否显示 + public String shapeExpandAndCloseIconShow(String repositoryId, String elements){ + + boolean showExpandFlag = false; + boolean showCloseFlag = false; + if (UtilString.isNotEmpty(elements)){ + JSONObject elementsObj = JSONObject.parseObject(elements); + // 将连线以及内部没有元素的子流程节点过滤掉 + Set filterKeySet = elementsObj.keySet().stream() + .filter(key -> { + JSONObject ele = elementsObj.getJSONObject(key); + if ("linker".equals(ele.getString("name"))) return false; + try { + SubProcessNodeDefineUtil.readSubProcessNodeDefine(repositoryId, key); + } catch (AWSException e) { + return false; + } + return true; + }).collect(Collectors.toSet()); + + for (String key : filterKeySet) { + JSONObject shape = elementsObj.getJSONObject(key); + if ("subProcess".equals(shape.getString("name"))){ + showExpandFlag = true; + }else if ("scopeLimitation".equals(shape.getString("name"))){ + showCloseFlag = true; + } + } + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("showExpandFlag", showExpandFlag); + ro.put("showCloseFlag", showCloseFlag); + return ro.toString(); + } + } diff --git a/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml b/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml index 954fcdeb..f7526d7f 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml +++ b/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml @@ -42,4 +42,8 @@ + + + + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.core.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.core.js index 89797cfb..52a90e14 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.core.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.core.js @@ -15,13 +15,7 @@ Designer.contextMenu.show = function(x, y) { menu.children("li[ac=processAttribute]").show(); var clipLen = Designer.clipboard.elements.length; if (methodId == 'process.subprocess') { // 当前建模为端到端 - let iconShow = window.subProcess.oneClickExpandAndCloseIconShow(); - if (iconShow.showExpandIcon){ - menu.children("li[ac=oneClickExpand]").show(); - } - if (iconShow.showCloseIcon){ - menu.children("li[ac=oneClickClose]").show(); - } + window.subProcess.oneClickExpandAndCloseIconShow(); } if (currentFocus == null) { // 画布 @@ -189,10 +183,8 @@ Designer.contextMenu.execAction = function(item) { } else if (action == 'addRearProcess') {// 关联至后置流程 showLeadAndRearProcessDlg('rear'); }else if (action == 'oneClickExpand'){ // 子流程节点一键展开 - $.simpleAlert('一键展开了'); window.subProcess.oneClickOperate('expand'); }else if (action == 'oneClickClose'){ // 子流程节点一键闭合 - $.simpleAlert('一键闭合了'); window.subProcess.oneClickOperate('close'); } }; 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 d4b4128e..d0be9366 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 @@ -179,7 +179,7 @@ class SubProcess { // 节点关闭事件 shapeClose(event){ - console.log('sss'); + // console.log('sss'); let param = event.data; awsui.ajax.request({ url: './jd', @@ -210,7 +210,7 @@ class SubProcess { // 一键展开或闭合 oneClickOperate(action){ - console.log('oneClickExpand',this); + // console.log('oneClickExpand',this); awsui.ajax.request({ url: './jd', method: 'POST', @@ -243,17 +243,29 @@ class SubProcess { let showExpandFlag = false; let showCloseFlag = false; let elements = this.Model.define.elements; - for (let key in elements) { - let shape = elements[key]; - if (shape.name == 'linker') continue; - if (shape.name == 'subProcess'){ - showExpandFlag = true; - }else if (shape.name == 'scopeLimitation'){ - showCloseFlag = true; + awsui.ajax.request({ + url: './jd', + method: 'POST', + async: false, + data: { + cmd: 'com.actionsoft.apps.coe.method.process.subprocess.shape_expand_and_close_icon_show', + sid: this.sid, + repositoryId: this.repositoryId, + elements: JSON.stringify(elements) + }, + ok: function (r) { + let menu = $("#designer_contextmenu"); + if (r.data.showExpandFlag){ + menu.children("li[ac=oneClickExpand]").show(); + } + if (r.data.showCloseFlag){ + menu.children("li[ac=oneClickClose]").show(); + } + }, + err: function (r) { + $.simpleAlert(r.msg); } - if (showExpandFlag && showCloseFlag) break; - } - return {showExpandIcon: showExpandFlag, showCloseIcon: showCloseFlag}; + }); } // 文件修改提示