From 4fa5b2df0756f9963f1304b7e51814cd94b65754 Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Fri, 15 Jul 2022 02:10:14 +0800 Subject: [PATCH] WSID --- .../apps/coe/pal/CoEPALController.java | 4 +- .../repository/web/CoeProcessLevelWeb.java | 9 +- .../js/coe.pal.processlevel.create.js | 5 +- .../js/designer.extend.link.view.portal.js | 652 +++++++++--------- 4 files changed, 332 insertions(+), 338 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index 1525dd46..589eba00 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -2966,9 +2966,9 @@ public class CoEPALController { * @return */ @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel") - public String createDialogModel(UserContext me,String uuid,String methodId) { + public String createDialogModel(UserContext me,String uuid,String methodId,String wsId) { CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.createDialogModel(uuid,methodId); + return web.createDialogModel(uuid,methodId,wsId); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index 20f67c33..7da308d0 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -8274,7 +8274,7 @@ public class CoeProcessLevelWeb extends ActionWeb { * @return * by zhaolei */ - public String createDialogModel(String uuid,String methodId){ + public String createDialogModel(String uuid,String methodId,String wsId){ ResponseObject ro = ResponseObject.newOkResponse(); try { @@ -8317,8 +8317,9 @@ public class CoeProcessLevelWeb extends ActionWeb { String plRid = UUIDGener.getUUID(); String id = UUIDGener.getUUID(); + Timestamp nowTime = new Timestamp(System.currentTimeMillis()); - PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + titleName, + PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, wsId, plname + titleName, "", 1, parentId, category, true, 1, id, false, methodId, "0", 1, null, null, "admin", "admin", nowTime, null, uuid, @@ -8354,7 +8355,7 @@ public class CoeProcessLevelWeb extends ActionWeb { /************************************************数据属性*********************************************************/ //图形的数据属性配置 - List attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels("6f4e292c-1b90-4dd2-8c20-7da159cb20a5", model.getMethodId()); + List attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, model.getMethodId()); for (PALMethodAttributeModel attributeModel : attributeModels) { //todo:根据importProperty的类型获取具体保存数据值 @@ -8390,7 +8391,7 @@ public class CoeProcessLevelWeb extends ActionWeb { /************************************************文件属性*********************************************************/ //图形的数据属性配置 - List attrLists=PALRepositoryAPIManager.getInstance().getValidAndUseAttributeModels("6f4e292c-1b90-4dd2-8c20-7da159cb20a5", methodId); + List attrLists=PALRepositoryAPIManager.getInstance().getValidAndUseAttributeModels(wsId, methodId); diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.pal.processlevel.create.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.pal.processlevel.create.js index 25cdfd1b..35f150dd 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.pal.processlevel.create.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.pal.processlevel.create.js @@ -967,7 +967,7 @@ function removeTr(obj) { //打开对象关联Dialog function openRelationDialog(obj, callback) { - debugger; + ; var title = obj.closest('tr').find('td:first').text(); if (title == undefined || title == '') { title = '选择模型对象'; @@ -1020,7 +1020,8 @@ function openRelationDialog(obj, callback) { + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel", data : { uuid:uuid, - methodId:method + methodId:method, + wsId:$("#wsid").val() }, success : function(msg) { if (msg.result == "ok") { diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js index ae27f209..cc8534b5 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js @@ -7,19 +7,19 @@ $(document).ready(function() { showPainting(); setTimeout(function() { - Designer.hotkey.init();// 解决快捷健绑定不成功 - DesignerCopyPaste.changeTitleListen(); - if (selectedElementId && selectedElementId != "") { - Utils.selectShape(selectedElementId); - }// 复制粘贴形状内容同步的监听 - }, 1000); + Designer.hotkey.init();// 解决快捷健绑定不成功 + DesignerCopyPaste.changeTitleListen(); + if (selectedElementId && selectedElementId != "") { + Utils.selectShape(selectedElementId); + }// 复制粘贴形状内容同步的监听 + }, 1000); }); /** * 兼容1024*768画布显示 - * + * * @param {} - * + * */ function showPainting() { @@ -28,12 +28,12 @@ function showPainting() { $("#toolbar_wfversion_info").addClass("showPainting"); if (parent.getWidthToolbar() > 750) { $(".toolbar").removeClass("heightCssToolbar") - .addClass("toolbarExtend"); + .addClass("toolbarExtend"); $("#bar_back").removeClass("cssToolbar"); } else { $(".toolbar").addClass("heightCssToolbar") - .removeClass("toolbarExtend"); + .removeClass("toolbarExtend"); $("#bar_back").addClass("cssToolbar"); } } @@ -41,50 +41,50 @@ function showPainting() { /** * 重写单击图形时的触发的事件 - * + * * @param {} - * + * * @returns {} */ Designer.op.shapeSelectable = function(a) { var b = $("#designer_canvas"); b.bind("mousedown.select", function(d) { - Designer.op.changeState("seelcting_shapes"); - var e = a.id; - var c = []; - if (d.ctrlKey) { - var c = Utils.getSelectedIds(); - if (Utils.isSelected(e)) { - Utils.removeFromArray(c, e); - } else { - c.push(e); - } - - Utils.unselect(); - if (c.length > 0) { - Utils.selectShape(c); - } - } else { - if (Utils.selectIds.indexOf(e) < 0) { - - Utils.unselect(); - Utils.selectShape(e); - } - } - $(document).bind("mouseup.select", function() { - Designer.op.resetState(); - b.unbind("mousedown.select"); - $(document).unbind("mouseup.select"); - }); - // selectedShapes - DesignerCopyPaste.selectedShapeId = Utils.getSelected()[0].id; - if ($("div.dock_view_attribute").is(":visible")) { - showShapeRelationTab(null); - attributeShowTabContent(null); - shapeCopyAndPasteCount(null); - showRelevanceShapesContent(); - } - }); + Designer.op.changeState("seelcting_shapes"); + var e = a.id; + var c = []; + if (d.ctrlKey) { + var c = Utils.getSelectedIds(); + if (Utils.isSelected(e)) { + Utils.removeFromArray(c, e); + } else { + c.push(e); + } + + Utils.unselect(); + if (c.length > 0) { + Utils.selectShape(c); + } + } else { + if (Utils.selectIds.indexOf(e) < 0) { + + Utils.unselect(); + Utils.selectShape(e); + } + } + $(document).bind("mouseup.select", function() { + Designer.op.resetState(); + b.unbind("mousedown.select"); + $(document).unbind("mouseup.select"); + }); + // selectedShapes + DesignerCopyPaste.selectedShapeId = Utils.getSelected()[0].id; + if ($("div.dock_view_attribute").is(":visible")) { + showShapeRelationTab(null); + attributeShowTabContent(null); + shapeCopyAndPasteCount(null); + showRelevanceShapesContent(); + } + }); }; var myshapeLink = ""; var linkIndex = 0; @@ -121,10 +121,10 @@ UI.showRiskDlg = function(){ return; } var riskDlg = FrmDialog.open({ - width:800, - height:700, - url:"./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.risk_pal_designer_risk", - data:{"plId":ruuid, "taskId": shape.id, "taskNum": number} + width:800, + height:700, + url:"./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.risk_pal_designer_risk", + data:{"plId":ruuid, "taskId": shape.id, "taskNum": number} }); } @@ -183,7 +183,7 @@ function shapeCopyAndPasteCount(shape) { } } var data = "shapeGroupId=" + shapeGroupId + "&shapeId=" + shapeId - + "&isCopy=" + isCopy; + + "&isCopy=" + isCopy; } function showRelevanceShapesContent() { @@ -193,8 +193,8 @@ function showRelevanceShapesContent() { $.ajax({ type : "POST", url : "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_show", + + CLB.sid + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_show", data : { shapeId : Utils.getSelected()[0].id, fileId: ruuid @@ -216,12 +216,12 @@ function showRelevanceShapesContent() { style = "cursor:pointer;color:blue;"; if (parent.openDesginerFromAttr) { onclick = 'parent.openDesginerFromAttr(\'' - + shapesObj[i].fileId - + '\',0,\'' - + shapesObj[i].fileName - + '\',\'\',\'\',false,\'' - + shapesObj[i].shapeId - + '\')'; + + shapesObj[i].fileId + + '\',0,\'' + + shapesObj[i].fileName + + '\',\'\',\'\',false,\'' + + shapesObj[i].shapeId + + '\')'; } else if (window.opener.openDesginer) { var obj = { id: shapesObj[i].fileId, @@ -229,19 +229,19 @@ function showRelevanceShapesContent() { } onclick = 'window.opener.openDesginer({id:\'' + shapesObj[i].fileId + '\', processDefId:\'\'})'; } - + } var content = '' - + '
' - + shapesObj[i].fileName - + '(V ' + shapesObj[i].fileVersion + '.0)' - + '
' - + '
' - + shapesObj[i].shapeText - + '
'; - + + shapesObj[i].id + + '" class="tagContentTableTr">' + + '
' + + shapesObj[i].fileName + + '(V ' + shapesObj[i].fileVersion + '.0)' + + '
' + + '
' + + shapesObj[i].shapeText + + '
'; + $("#tagContentTableTitleContent3").append(content); } } @@ -267,13 +267,13 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { } } //取新添加的属性 - if (tempAttrArray.length > 0) { - var newAttrArray = []; - newAttrArray = tempAttrArray.concat(attributesJsonArray).filter(function(v, i, arr) { - return arr.indexOf(v) === arr.lastIndexOf(v); - });; - attributesJsonArray = tempAttrArray.concat(newAttrArray); - } + if (tempAttrArray.length > 0) { + var newAttrArray = []; + newAttrArray = tempAttrArray.concat(attributesJsonArray).filter(function(v, i, arr) { + return arr.indexOf(v) === arr.lastIndexOf(v); + });; + attributesJsonArray = tempAttrArray.concat(newAttrArray); + } } var flag = false; var objIds = []; @@ -294,39 +294,39 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { var obj = attributesJsonArray[index]; if (obj != null && obj != undefined && obj.value != undefined) { var constr = ''; - constr += '' + obj.name + ''; - constr += '' + obj.value + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ obj.value + ''; constr += ''; if ((!obj.readonly && obj.type == "string") - || (!obj.readonly && obj.type == "list")) { + || (!obj.readonly && obj.type == "list")) { // 目前支持到文本的输入 ,需求定下了再改 constr = ''; - constr += '' + obj.name + ''; - constr += '' + obj.value + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ obj.value + ''; constr += ''; } else if(!obj.readonly && obj.type == "link") { constr = ''; - constr += '' + obj.name + ''; + /*constr += '' + obj.name + '';*/ // constr += '' + obj.value + ''; - constr += '' + '' + obj.value + '' + ''; + constr += '' + obj.name +':'+ '' + obj.value + '' + ''; constr += ''; } else if (!obj.readonly && obj.type == "number") { constr = ''; - constr += '' + obj.name + ''; - constr += '' + obj.value + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ obj.value + ''; constr += ''; } else if (!obj.readonly && obj.type == "boolean") { constr = ''; - constr += '' + obj.name + ''; - constr += ''; + /*constr += '' + obj.name + '';*/ + constr += ''+ obj.name +':'+''; constr += ''; } else if (!obj.readonly && obj.type == "textarea") { constr = ''; - constr += '' + obj.name + ''; + /*constr += '' + obj.name + '';*/ if (obj.value == undefined) { obj.value = ''; } - constr += '' + obj.value.replace(/\n/g,'
') + ''; + constr += '' + obj.name +':'+ obj.value.replace(/\n/g,'
') + ''; constr += ''; } else if (obj.readonly && obj.type == "relation") { var relationValue = ""; @@ -334,19 +334,19 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { relationValue = relationShapesData[shape.id][obj.id]; } constr = ''; - constr += '' + obj.name + ''; - constr += '' + relationValue + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ relationValue + ''; constr += ''; } else if (obj.type == "select" || obj.type == "select_m") { constr = ''; - constr += '' + obj.name + ''; - constr += '' + obj.value + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ obj.value + ''; constr += ''; - + selectFlag = true; var selectValue = { "objId" : obj.id, - "objValue" : obj.value, - "objType": obj.type}; + "objValue" : obj.value, + "objType": obj.type}; selectValues.push(selectValue); }else if (obj.readonly && obj.type == "userAddress") { userAddress = true; @@ -356,8 +356,8 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { relationValue = relationShapesData[shape.id][obj.id]; } constr = ''; - constr += '' + obj.name + ''; - constr += '' + relationValue + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ relationValue + ''; constr += ''; } else if (obj.readonly && obj.type == "deptAddress") { deptAddress = true; @@ -368,8 +368,8 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { relationValue = relationShapesData[shape.id][obj.id]; } constr = ''; - constr += '' + obj.name + ''; - constr += '' + relationValue + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ relationValue + ''; constr += ''; } else if (obj.readonly && obj.type == "awsorg") { var relationValue = ""; @@ -377,24 +377,24 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { relationValue = relationShapesData[shape.id][obj.id]; } constr = ''; - constr += '' + obj.name + ''; - constr += '' + relationValue + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ relationValue + ''; constr += ''; } else if (obj.readonly && obj.type == "hidden") { - constr = '' - + ' ' + obj.name + '' - + ' ' - + ' ' - //+ '
' - + ''; + constr = '' + + ' ' + obj.name + '' + + ' ' + + ' ' + //+ '
' + + ''; } else if (obj.type == "table") { let tableInput = '请输入' if(obj.value.table.length > 1) { tableInput = '请查看' } constr = ''; - constr += '' + obj.name + ''; - constr += '' + ' ' + tableInput + '' + ''; + /*constr += '' + obj.name + '';*/ + constr += '' + obj.name +':'+ ' ' + tableInput + '' + ''; constr += ''; } $('#' + tbodyId + ' table[name=' + shape.id + ']').append(constr); @@ -453,9 +453,9 @@ Array.prototype.unique = function(){ } } return res; -} +} + - // 得到不同属性值关联的形状 function getAttributeByAttrId(shape, objId, relationShapes) { //objId 属性的key值 @@ -553,8 +553,8 @@ function removeTrRelevanceShapes(obj) { $.ajax({ type : "POST", url : "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove", + + CLB.sid + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove", data : { uuid : $(obj).attr("objid"), }, @@ -666,22 +666,22 @@ function updateModelElementsAttribute(selectedShape, nodes) { } } awsui.ajax.request({ - url : "./jd", - method : "POST", - data : { - sid:sid, - cmd:"com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_check", - fileId: ruuid, - shapeId: shape.id, - attrIds: attrIds - }, - ok : function(r) { - }, - err:function(r){ - } + url : "./jd", + method : "POST", + data : { + sid:sid, + cmd:"com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_check", + fileId: ruuid, + shapeId: shape.id, + attrIds: attrIds + }, + ok : function(r) { + }, + err:function(r){ + } }); } - } + } } } @@ -820,10 +820,10 @@ function showSelectOption(obj) { $(obj).children("span").hide(); } else { updateAttributeById($(obj).attr("objid"), $(obj) - .find("option:selected").text()); + .find("option:selected").text()); $(obj).hide(); $(obj).siblings("span").text($(obj).find("option:selected").text()) - .show(); + .show(); } } @@ -862,34 +862,34 @@ function showAttributedEditWindow(obj) { } } $("#attribute-edit-window").dialog({ - draggable: false, - buttons : [{ - text : '确定', - cls : "blue", - handler : function() { - var str = $("#attribute-edit-content").val(); - if (objId == "desc") { - for (var i = 0; i < shape.dataAttributes.length; i++) { - var attr = shape.dataAttributes[i]; - if (attr.shapeDesc != undefined) { - shape.dataAttributes[i].shapeDesc = str; - break; - } - } - Model.update(shape); - } else { - updateAttributeById($(obj).attr("objid"), str); - } - $(obj).val(str); - $("#attribute-edit-window").dialog('close'); - } - }, { - text : '关闭', - handler : function() { - $("#attribute-edit-window").dialog('close'); - } - }] - }); + draggable: false, + buttons : [{ + text : '确定', + cls : "blue", + handler : function() { + var str = $("#attribute-edit-content").val(); + if (objId == "desc") { + for (var i = 0; i < shape.dataAttributes.length; i++) { + var attr = shape.dataAttributes[i]; + if (attr.shapeDesc != undefined) { + shape.dataAttributes[i].shapeDesc = str; + break; + } + } + Model.update(shape); + } else { + updateAttributeById($(obj).attr("objid"), str); + } + $(obj).val(str); + $("#attribute-edit-window").dialog('close'); + } + }, { + text : '关闭', + handler : function() { + $("#attribute-edit-window").dialog('close'); + } + }] + }); } // 对单个属性的更新操作 @@ -936,9 +936,9 @@ function updateAttributeById(objId, va) { } if ("isAutoSave" == 1) { CLB.cmdList = [{ - "type" : "message", - "cmd" : "com.actionsoft.apps.coe.pal_pl_repository_designer_message" - }]; + "type" : "message", + "cmd" : "com.actionsoft.apps.coe.pal_pl_repository_designer_message" + }]; } Model.update(shape); } @@ -990,8 +990,8 @@ function removeTrAttribute(obj) { $.ajax({ type : "POST", url : "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove", + + CLB.sid + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove", data : { uuid : $(obj).attr("objid"), shapeId : Utils.getSelected()[0].id, @@ -1009,9 +1009,9 @@ function removeTrAttribute(obj) { function showRemoveTrAttribute(obj) { $(obj).addClass("attr_bg_color_tr"); $("input[name=attribute_name_input_" + $(obj).attr("objid") + "]") - .addClass("attr_bg_color_tr"); + .addClass("attr_bg_color_tr"); $("input[name=attribute_name_input_" + $(obj).attr("objid") + "]").parent() - .addClass("attr_bg_color_tr"); + .addClass("attr_bg_color_tr"); $(obj).children("td").children(".ico_attribute_delete").show(); if ($(obj).attr("ty") == "sel") { $(obj).children("td").children("select").show(); @@ -1023,9 +1023,9 @@ function showRemoveTrAttribute(obj) { function hideRemoveTrAttribute(obj) { $(obj).removeClass("attr_bg_color_tr"); $("input[name=attribute_name_input_" + $(obj).attr("objid") + "]") - .removeClass("attr_bg_color_tr"); + .removeClass("attr_bg_color_tr"); $("input[name=attribute_name_input_" + $(obj).attr("objid") + "]").parent() - .removeClass("attr_bg_color_tr"); + .removeClass("attr_bg_color_tr"); $(obj).children("td").children(".ico_attribute_delete").hide(); if ($(obj).attr("ty") == "sel") { $(obj).children("td").children("select").hide(); @@ -1080,32 +1080,32 @@ Array.prototype.getIndexByValueById = function(value) { }; // 重写链接创建后的事件 Designer.events.addEventListener("linkerCreated", function(linker) { - /** - * var toId = linker.to.id; //当前选中的图形 var fromShape = - * Utils.getSelected()[0]; //目标图形 var toShape = - * Model.getShapeById(toId); var toShapeTemp = []; for (var index = - * 0; index < linkerRelationship.length; index++) { var shapes = - * linkerRelationship[index]; var fromShapeId = shapes.fromShapeId; - * var toShapeIds = shapes.toShapeId; if (fromShape.name == - * fromShapeId) { if (toShapeIds != "*") { //判断是针对哪些图形有效 if - * (toShapeIds.indexOf(",") > 0) { toShapeTemp = - * toShapeIds.split(","); } else { toShapeTemp.push(toShapeIds); } } } } - * if (toShapeTemp.length != 0) { for (var index = 0; index < - * toShapeTemp.length; index++) { var tempShapeId = - * toShapeTemp[index]; //删除这条线 if (toShape.name != tempShapeId) { - * $.simpleAlert("不支持所选对象与目标对象的这种关系", "error", 2500); //待续未完 - * deleteLinkerSelected(linker); } } } // if (toShape.name == "xxx") { // - * linker.to.id = null; //} //获取选中的链接线 var outlinkers = - * Utils.getOutlinkers(fromShape); var l = linker; // - * consloe.log(l); - */ - // 判断是不是支持这种关系类型 - // isObjectRelationshipModel(linker, true); - // showShapeRelationTab(null); - // attributeShowTabContent(null); - // showRelevanceShapesContent(); - // shapeCopyAndPasteCount(null); - }); + /** + * var toId = linker.to.id; //当前选中的图形 var fromShape = + * Utils.getSelected()[0]; //目标图形 var toShape = + * Model.getShapeById(toId); var toShapeTemp = []; for (var index = + * 0; index < linkerRelationship.length; index++) { var shapes = + * linkerRelationship[index]; var fromShapeId = shapes.fromShapeId; + * var toShapeIds = shapes.toShapeId; if (fromShape.name == + * fromShapeId) { if (toShapeIds != "*") { //判断是针对哪些图形有效 if + * (toShapeIds.indexOf(",") > 0) { toShapeTemp = + * toShapeIds.split(","); } else { toShapeTemp.push(toShapeIds); } } } } + * if (toShapeTemp.length != 0) { for (var index = 0; index < + * toShapeTemp.length; index++) { var tempShapeId = + * toShapeTemp[index]; //删除这条线 if (toShape.name != tempShapeId) { + * $.simpleAlert("不支持所选对象与目标对象的这种关系", "error", 2500); //待续未完 + * deleteLinkerSelected(linker); } } } // if (toShape.name == "xxx") { // + * linker.to.id = null; //} //获取选中的链接线 var outlinkers = + * Utils.getOutlinkers(fromShape); var l = linker; // + * consloe.log(l); + */ + // 判断是不是支持这种关系类型 + // isObjectRelationshipModel(linker, true); + // showShapeRelationTab(null); + // attributeShowTabContent(null); + // showRelevanceShapesContent(); + // shapeCopyAndPasteCount(null); +}); /** * 图形创建后重写 @@ -1139,8 +1139,8 @@ Designer.events.addEventListener("created", function(shape) { } } attributeShowTabContent(shape); - // shapeCopyAndPasteCount(shape); - }); + // shapeCopyAndPasteCount(shape); +}); // 设置编号属性默认值 function initPrivateAttribute(newShape, type) { @@ -1164,57 +1164,57 @@ function initPrivateAttribute(newShape, type) { for (var shapeId in shapes) { var shape = shapes[shapeId]; if (shape.dataAttributes != undefined) { - for (var i = 0; i < shape.dataAttributes.length; i++) { - if (shape.dataAttributes[i].privateAttributeContent != null) { - var privateAttributeContent = shape.dataAttributes[i].privateAttributeContent; - if (typeof(privateAttributeContent) == "string") { - privateAttributeContent = eval("(" + privateAttributeContent + ")"); - } - var number = privateAttributeContent.number; - if(number != undefined && number != null && number != "") { - if(typeof number == 'string') number = number.replace(/^\s+|\s+$/g,""); - if(!isNaN(number)) if(parseInt(number) > parseInt(max)) max = number; - } - } - } - } + for (var i = 0; i < shape.dataAttributes.length; i++) { + if (shape.dataAttributes[i].privateAttributeContent != null) { + var privateAttributeContent = shape.dataAttributes[i].privateAttributeContent; + if (typeof(privateAttributeContent) == "string") { + privateAttributeContent = eval("(" + privateAttributeContent + ")"); + } + var number = privateAttributeContent.number; + if(number != undefined && number != null && number != "") { + if(typeof number == 'string') number = number.replace(/^\s+|\s+$/g,""); + if(!isNaN(number)) if(parseInt(number) > parseInt(max)) max = number; + } + } + } + } } // 设置最大编号为max+1 var json = "{'number':'编号'}"; // var json2 = "{'number':'" + (parseInt(max)+1) + "'}"; String.prototype.padLeft = Number.prototype.padLeft = function(total, pad) { - return (Array(total).join(pad || 0) + this).slice(-total); + return (Array(total).join(pad || 0) + this).slice(-total); } var no = ((parseInt(parseInt(max)/10) + 1)*10); if(no < 1000) { - no = no.padLeft(3); - } + no = no.padLeft(3); + } var json2 = "{'number':'" + no + "'}"; var shapeName = newShape.name; if (shapeName.indexOf("_custom") > -1) { shapeName = shapeName.substring(0, shapeName.indexOf("_")); } if (shapeName == "control" || shapeName == "risk" || shapeName == "item" - || shapeName == "regulation" || shapeName == "procedure" - || shapeName == "method" || shapeName == "manualOperation" - || shapeName == "predefinedProcess" - || shapeName == "callActivityCallingProcess" - || shapeName == "businessRuleTask" || shapeName == "scriptTask" - || shapeName == "sendTask" || shapeName == "userTask" - || shapeName == "serviceTask" || shapeName == "manualTask" - || shapeName == "receiveTask" || shapeName == "process" - || shapeName == "decision" || shapeName == "group") { + || shapeName == "regulation" || shapeName == "procedure" + || shapeName == "method" || shapeName == "manualOperation" + || shapeName == "predefinedProcess" + || shapeName == "callActivityCallingProcess" + || shapeName == "businessRuleTask" || shapeName == "scriptTask" + || shapeName == "sendTask" || shapeName == "userTask" + || shapeName == "serviceTask" || shapeName == "manualTask" + || shapeName == "receiveTask" || shapeName == "process" + || shapeName == "decision" || shapeName == "group") { for (var i = 0; i < newShape.dataAttributes.length; i++) { var attr = newShape.dataAttributes[i]; if (attr.privateAttribute) { attr.privateAttribute = json; } if(attr.privateAttributeContent) { - attr.privateAttributeContent = json2; + attr.privateAttributeContent = json2; } } - } + } } } @@ -1310,21 +1310,21 @@ function showShapeRelationTab(currentShape) { var josnShapeId = toShapeTemp[c]; if (josnShapeId == toShape.name) { addtagContentTableContent( - fromShape, - shapes.outcomingName, - toShape); + fromShape, + shapes.outcomingName, + toShape); } } } else { if (toShapeIds == toShape.name) { addtagContentTableContent(fromShape, - shapes.outcomingName, toShape); + shapes.outcomingName, toShape); } } } else { // 当没有限制的时候 addtagContentTableContent(fromShape, - shapes.outcomingName, toShape); + shapes.outcomingName, toShape); } } } @@ -1350,20 +1350,20 @@ function showShapeRelationTab(currentShape) { var josnShapeId = toShapeTemp[c]; if (josnShapeId == selectedShape.name) { addtagContentTableContent(toShape, - shapes.incomingName, - fromShape); + shapes.incomingName, + fromShape); } } } else { if (toShapeIds == selectedShape.name) { addtagContentTableContent(toShape, - shapes.incomingName, fromShape); + shapes.incomingName, fromShape); } } } else { // 当没有限制的时候 addtagContentTableContent(toShape, - shapes.incomingName, fromShape); + shapes.incomingName, fromShape); } } @@ -1383,11 +1383,11 @@ function addtagContentTableContent(shape1, str, obj) { obj.text = obj.title; } var constr = '' - // + shape1.text - + str - + '
' - + obj.text - + '
'; + // + shape1.text + + str + + '
' + + obj.text + + '
'; $("#tagContentTable1").append(constr); } // 判断是不是支持对象的关系类型 @@ -1445,36 +1445,37 @@ function isObjectRelationshipModel(linker, isAlert) { // 文件属性的处理 function initProcessDesc() { + console.log(processDesc) var length = Object.keys(processDesc).length; var t = ''; for(var i = 1; i <= length; i++) { var obj = processDesc[i]; - t += ''; - t += '' + obj.name + ''; + t += ''; + t += '
' + obj.name + ':
'; var value = obj.value; if (value == undefined) { value = ''; - t += '' + value + ''; - t += ''; + t += '
'+ value + '
'; + t += ''; } else if(obj.type == 'table') { if(value == '') { - t += '' + value + ''; - t += ''; + t += '
' + value + '
'; + t += ''; } else { let tableValue = JSON.parse(value.replace(/"/g,'\"')) let tableFlag = '请输入' if (tableValue.table.length > 1) { tableFlag = '请查看' } - t += '' + tableFlag + ''; - t += ''; + t += '
' + tableFlag + '
'; + t += ''; } } else { value = value.replace(/\n/g,'
') - t += '' + value + ''; - t += ''; + t += '
' + value + '
'; + t += ''; } // t += '' + value + ''; // t += ''; @@ -1492,12 +1493,12 @@ function autoClickAttr() { } else { name = 'processAttr'; } - $('#tab').find('div').removeClass('selected'); - $('#' + name).addClass('selected'); - $('.portalAttr').hide(); - if(name == "processDesc") { - dockShowView('portalDescShow'); - } + $('#tab').find('div').removeClass('selected'); + $('#' + name).addClass('selected'); + $('.newadd_portalAttr').hide(); + if(name == "processDesc") { + dockShowView('portalDescShow'); + } if(name == "processAttr") { dockShowView('portalAttrShow'); } @@ -1532,7 +1533,7 @@ function changeArributeByShape() { if (Utils.getSelected()[0] == null) { initShapeAttribute('0'); initUpfileData('0'); - + $('table[name=lastTable]').remove(); if($('#portalAttrDock').children('table').length > 0) { // $('#portalAttrDock').append(lastTable); @@ -1544,7 +1545,7 @@ function changeArributeByShape() { selectShape = Utils.getSelected()[0]; initShapeAttribute(Utils.getSelected()[0].id); initUpfileData(Utils.getSelected()[0].id); - + $('table[name=lastTable]').remove(); if ($('#portalAttrDock table[name=' + Utils.getSelected()[0].id + ']').length > 0) { // $('#portalAttrDock').append(lastTable); @@ -1564,25 +1565,20 @@ function initUpfileData(obj) { var processFile = upfileData['file']; if(processFile.length > 0) { t += ''; - t += ''; - t += ''; - t += ''; + t += ''; - t += ''; - t += ''; + t += ''; } - t += '
流程相关
'; + t += '
相关文件:
'; for(var i = 0; i < processFile.length; i++) { var obj = processFile[i]; - t += '
'+ obj.name +'
'; + t += ''; } - //流程手册附件展示 + //流程手册附件展示 t += ''; - t += ''; - t += ''; - t += ''; - t += ''; - t += ''; - t += ''; + t += ''; t += '
流程手册
'+ fileName +'
'; + t += '
流程手册:
'; + t += ''; + t += '
'; var elements = Model.define.elements; @@ -1594,14 +1590,12 @@ function initUpfileData(obj) { var processShape = upfileData[ele.id]; if(processShape != null && processShape.length > 0) { t += ''; - t += ''; - t += ''; - t += ''; + t += ''; - t += ''; - t += ''; + t += ''; + t += ''; } t += '
' + ele.text + '
'; + t += '
' + ele.text + ':
'; for(var i = 0; i < processShape.length; i++) { var obj = processShape[i]; - t += '
'+ obj.name +'
'; } @@ -1630,21 +1624,21 @@ function initUpfileData(obj) { function readFile(uuid) { $.simpleAlert("文件正在处理", "loading"); awsui.ajax.request({ - type: "POST", - url: "./jd?sid=" + encodeURIComponent(sid) + "&cmd=com.actionsoft.apps.coe.pal_processlevel_upfile_read", - data: {uuid: uuid}, - ok: function(msg) { - $.simpleAlert("close"); - var url = msg.data.url; - if (msg.data.noSupport) { - window.location.href = url; - } else { - window.open(url); - } - }, - err: function(msg) { - } - }); + type: "POST", + url: "./jd?sid=" + encodeURIComponent(sid) + "&cmd=com.actionsoft.apps.coe.pal_processlevel_upfile_read", + data: {uuid: uuid}, + ok: function(msg) { + $.simpleAlert("close"); + var url = msg.data.url; + if (msg.data.noSupport) { + window.location.href = url; + } else { + window.open(url); + } + }, + err: function(msg) { + } + }); } function sortModelByNumber() { @@ -1680,15 +1674,15 @@ function sortModelByNumber() { } // 有序号的元素升序排序 var compare = function (obj1, obj2) { - var val1 = obj1.orderIndex; - var val2 = obj2.orderIndex; - if (val1 < val2) { - return -1; - } else if (val1 > val2) { - return 1; - } else { - return 0; - } + var val1 = obj1.orderIndex; + var val2 = obj2.orderIndex; + if (val1 < val2) { + return -1; + } else if (val1 > val2) { + return 1; + } else { + return 0; + } } hasNumArr.sort(compare); for (var shapeId in Model.define.elements) { @@ -1716,7 +1710,7 @@ function initShapeAttribute(obj) { if(shape.name == 'linker') { continue; } - + // 属性弹出层显示的内容 var attributesJsonArray = ""; var attributesJsonArrayT = []; @@ -1743,32 +1737,30 @@ function initShapeAttribute(obj) { } } //取新添加的属性 - if (tempAttrArray.length > 0) { - var newAttrArray = []; - newAttrArray = tempAttrArray.concat(attributesJsonArrayT).filter(function(v, i, arr) { - return arr.indexOf(v) === arr.lastIndexOf(v); - });; - attributesJsonArrayT = tempAttrArray.concat(newAttrArray); - } + if (tempAttrArray.length > 0) { + var newAttrArray = []; + newAttrArray = tempAttrArray.concat(attributesJsonArrayT).filter(function(v, i, arr) { + return arr.indexOf(v) === arr.lastIndexOf(v); + });; + attributesJsonArrayT = tempAttrArray.concat(newAttrArray); + } } var t = ''; - t += ''; - t += ''; - t += ''; - t += ''; - t += '
'; + t += '';*/ + t +=''; t +=''; t += ''; t += ''; - t += ''; + t += ''; t += ''; t += ''; - t += ''; - t += ''; + /*t += '';*/ + t += ''; t += ''; - t += '
' + shape.text + '' + shape.text + '
类型
'; + t += ''; $('#portalAttrDock').append(t); if (shape && attributesJsonArrayT) { // {}函数,改为图形创建时增加私有属性 @@ -1815,8 +1807,8 @@ function getSelectOptions(category, selectValues) { $.ajax({ type : "POST", url : "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_pl_attribute_option", + + CLB.sid + + "&cmd=com.actionsoft.apps.coe.pal_pl_attribute_option", data : { category : category }, @@ -1835,18 +1827,18 @@ function getSelectOptions(category, selectValues) { } var optionsData = data[objId]; if (optionsData) { - optionsData = optionsData.split(","); + optionsData = optionsData.split(","); var selectData = []; var selectedData = []; if(objValue != null && objValue != ''){ var selectedArr = objValue.split(','); } - var y = 0; + var y = 0; if (optionsData.length > 0) { for (var j = 0, len = optionsData.length; j < len; j++) { var dataObj = { - id : j, - text : optionsData[j] + id : j, + text : optionsData[j] }; selectData.push(dataObj); if(objValue != null && objValue != ''){ @@ -1855,7 +1847,7 @@ function getSelectOptions(category, selectValues) { selectedData[y] = j; y++; } - } + } } } } @@ -1872,10 +1864,10 @@ function getSelectOptions(category, selectValues) { $("#attribute_name_input_" + objId).parent().css("padding-left", "0px"); var $obj = $("#attribute_name_input_" + objId).select2(opt1); if(multiple){//多选 - $("#attribute_name_input_" + objId).val(selectedData).trigger("change"); + $("#attribute_name_input_" + objId).val(selectedData).trigger("change"); } else {//单选 if(selectedData != null && selectedData != ''){ - $("#attribute_name_input_" + objId).val(selectedData[0]).trigger("change"); + $("#attribute_name_input_" + objId).val(selectedData[0]).trigger("change"); } } $obj.off("select2:close").on("select2:close", function(e){//只能在关闭多选框时触发事件,close与unselect事件冲突,待完善 @@ -1956,4 +1948,4 @@ function openLinkUrlRewrite(type, url, target, uuid, obj, fileName, inspected) { } }) } -} \ No newline at end of file +}