Merge remote-tracking branch 'origin/apps_dev' into apps_dev

This commit is contained in:
Mr-wang 2023-06-20 13:26:30 +08:00
commit 08c0c92a9d
6 changed files with 84 additions and 21 deletions

View File

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

View File

@ -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<String> 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();
}
}

View File

@ -42,4 +42,8 @@
<param name="repositoryId"/>
<param name="define"/>
</cmd-bean>
<cmd-bean name="com.actionsoft.apps.coe.method.process.subprocess.shape_expand_and_close_icon_show">
<param name="repositoryId"/>
<param name="elements"/>
</cmd-bean>
</aws-actions>

View File

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

View File

@ -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 (showExpandFlag && showCloseFlag) break;
if (r.data.showCloseFlag){
menu.children("li[ac=oneClickClose]").show();
}
return {showExpandIcon: showExpandFlag, showCloseIcon: showCloseFlag};
},
err: function (r) {
$.simpleAlert(r.msg);
}
});
}
// 文件修改提示