This commit is contained in:
zhal 2022-07-15 02:10:14 +08:00
parent 4f4b7ec6c3
commit 4fa5b2df07
4 changed files with 332 additions and 338 deletions

View File

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

View File

@ -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<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels("6f4e292c-1b90-4dd2-8c20-7da159cb20a5", model.getMethodId());
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, model.getMethodId());
for (PALMethodAttributeModel attributeModel : attributeModels) {
//todo根据importProperty的类型获取具体保存数据值
@ -8390,7 +8391,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
/************************************************文件属性*********************************************************/
//图形的数据属性配置
List<PALMethodAttributeModel> attrLists=PALRepositoryAPIManager.getInstance().getValidAndUseAttributeModels("6f4e292c-1b90-4dd2-8c20-7da159cb20a5", methodId);
List<PALMethodAttributeModel> attrLists=PALRepositoryAPIManager.getInstance().getValidAndUseAttributeModels(wsId, methodId);

View File

@ -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") {

View File

@ -7,12 +7,12 @@ $(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);
});
/**
@ -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");
}
}
@ -49,42 +49,42 @@ function showPainting() {
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);
}
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();
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();
}
});
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,
@ -232,15 +232,15 @@ function showRelevanceShapesContent() {
}
var content = '<tr ' + mouseout + mouseover + ' objid="'
+ shapesObj[i].id
+ '" class="tagContentTableTr"><td style="' + style + '" onclick="' + onclick + '">'
+ '<div style="line-height:22px;height:22px;overflow:hidden;" class="attribute_td_div_css">'
+ shapesObj[i].fileName
+ '(V ' + shapesObj[i].fileVersion + '.0)'
+ '</div>'
+ '</td><td><div style="line-height:22px;height:22px;overflow:hidden;" class="attribute_td_div_css">'
+ shapesObj[i].shapeText
+ '</div></td></tr>';
+ shapesObj[i].id
+ '" class="tagContentTableTr"><td style="' + style + '" onclick="' + onclick + '">'
+ '<div style="line-height:22px;height:22px;overflow:hidden;" class="attribute_td_div_css">'
+ shapesObj[i].fileName
+ '(V ' + shapesObj[i].fileVersion + '.0)'
+ '</div>'
+ '</td><td><div style="line-height:22px;height:22px;overflow:hidden;" class="attribute_td_div_css">'
+ shapesObj[i].shapeText
+ '</div></td></tr>';
$("#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 = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td colspan="2" class="tableContent">' + obj.value + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td class="tableContent">' + obj.name +':'+ obj.value + '</td>';
constr += '</tr>';
if ((!obj.readonly && obj.type == "string")
|| (!obj.readonly && obj.type == "list")) {
|| (!obj.readonly && obj.type == "list")) {
// 目前支持到文本的输入 ,需求定下了再改
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + obj.value + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ obj.value + '</td>';
constr += '</tr>';
} else if(!obj.readonly && obj.type == "link") {
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
// constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + obj.value + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + '<a href="' + obj.value + '" target="_blank">' + obj.value + '</a>' + '</td>';
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ '<a href="' + obj.value + '" target="_blank">' + obj.value + '</a>' + '</td>';
constr += '</tr>';
} else if (!obj.readonly && obj.type == "number") {
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + obj.value + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ obj.value + '</td>';
constr += '</tr>';
} else if (!obj.readonly && obj.type == "boolean") {
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent"></td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">'+ obj.name +':'+'</td>';
constr += '</tr>';
} else if (!obj.readonly && obj.type == "textarea") {
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
if (obj.value == undefined) {
obj.value = '';
}
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + obj.value.replace(/\n/g,'<br>') + '</td>';
constr += '<td id="' + shape.id + obj.id + '"class="tableContent">' + obj.name +':'+ obj.value.replace(/\n/g,'<br>') + '</td>';
constr += '</tr>';
} 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 = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + relationValue + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ relationValue + '</td>';
constr += '</tr>';
} else if (obj.type == "select" || obj.type == "select_m") {
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + obj.value + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ obj.value + '</td>';
constr += '</tr>';
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 = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + relationValue + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ relationValue + '</td>';
constr += '</tr>';
} 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 = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + relationValue + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ relationValue + '</td>';
constr += '</tr>';
} 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 = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + relationValue + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ relationValue + '</td>';
constr += '</tr>';
} else if (obj.readonly && obj.type == "hidden") {
constr = '<tr ' + mouseout + mouseover + ' objid="' + obj.id + '" class="tagContentTableTr" style="display:none;">'
+ ' <td>' + obj.name + '</td>'
+ ' <td class="tagContentTableTrTd">'
+ ' <input objid="' + obj.id + '" class="attribute_input_css" name="attribute_name_input_' + obj.id + '" value="'+obj.value +'" scope="' + obj.groupPath + '" readonly="'+obj.readonly+'" />'
//+ '<div objid="' + obj.id + '" onclick="removeTrAttribute(this)" id= "ico_attribute_delete_"' + obj.id + ' class="ico_attribute_delete"></div>'
+ '</td></tr>';
+ ' <td>' + obj.name + '</td>'
+ ' <td class="tagContentTableTrTd">'
+ ' <input objid="' + obj.id + '" class="attribute_input_css" name="attribute_name_input_' + obj.id + '" value="'+obj.value +'" scope="' + obj.groupPath + '" readonly="'+obj.readonly+'" />'
//+ '<div objid="' + obj.id + '" onclick="removeTrAttribute(this)" id= "ico_attribute_delete_"' + obj.id + ' class="ico_attribute_delete"></div>'
+ '</td></tr>';
} else if (obj.type == "table") {
let tableInput = '请输入'
if(obj.value.table.length > 1) {
tableInput = '请查看'
}
constr = '<tr>';
constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
constr += '<td id="' + shape.id + obj.id + '" colspan="2" class="tableContent">' + '<span id="'+ obj.id +' " onclick="openDialog(' + JSON.stringify(obj.value).replace(/\"/g,"'") +')"> ' + tableInput + '</span>' + '</td>';
/*constr += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';*/
constr += '<td id="' + shape.id + obj.id + '" class="tableContent">' + obj.name +':'+ '<span id="'+ obj.id +' " onclick="openDialog(' + JSON.stringify(obj.value).replace(/\"/g,"'") +')"> ' + tableInput + '</span>' + '</td>';
constr += '</tr>';
}
$('#' + tbodyId + ' table[name=' + shape.id + ']').append(constr);
@ -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,47 +1164,47 @@ 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) {
@ -1214,7 +1214,7 @@ function initPrivateAttribute(newShape, type) {
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 = '<tr onmouseout="hideRemoveTrAttribute(this);" onmouseover="showRemoveTrAttribute(this);" class="tagContentTableTr"><td>'
// + shape1.text
+ str
+ '</td><td><div class="attribute_td_div_css">'
+ obj.text
+ '</div> </td></tr>';
// + shape1.text
+ str
+ '</td><td><div class="attribute_td_div_css">'
+ obj.text
+ '</div> </td></tr>';
$("#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 += '<tr>';
t += '<td style="padding-left:20px;" class="tableContent">' + obj.name + '</td>';
t += '<tr><td>';
t += '<div class="tableContent">' + obj.name + '</div>';
var value = obj.value;
if (value == undefined) {
value = '';
t += '<td colspan="2" class="tableContent">' + value + '</td>';
t += '</tr>';
t += '<div class="tableContent">'+ value + '</div>';
t += '</td></tr>';
} else if(obj.type == 'table') {
if(value == '') {
t += '<td colspan="2" class="tableContent">' + value + '</td>';
t += '</tr>';
t += '<div class="tableContent">' + value + '</div>';
t += '</td></tr>';
} else {
let tableValue = JSON.parse(value.replace(/&quot;/g,'\"'))
let tableFlag = '请输入'
if (tableValue.table.length > 1) {
tableFlag = '请查看'
}
t += '<td colspan="2" class="tableContent" onclick="openDialog(' + JSON.stringify(tableValue).replace(/\"/g,"'") +')">' + tableFlag + '</td>';
t += '</tr>';
t += '<div class="tableContent" onclick="openDialog(' + JSON.stringify(tableValue).replace(/\"/g,"'") +')">' + tableFlag + '</div>';
t += '</td></tr>';
}
}
else {
value = value.replace(/\n/g,'<br>')
t += '<td colspan="2" class="tableContent">' + value + '</td>';
t += '</tr>';
t += '<div class="tableContent">' + value + '</div>';
t += '</td></tr>';
}
// t += '<td colspan="2" class="tableContent">' + value + '</td>';
// t += '</tr>';
@ -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');
}
@ -1564,25 +1565,20 @@ function initUpfileData(obj) {
var processFile = upfileData['file'];
if(processFile.length > 0) {
t += '<table name="file" class="awsui-table">';
t += '<tr>';
t += '<td class="tableHeader">流程相关</td>';
t += '</tr>';
t += '<tr><td>';
t += '<div class="filetableHeader">相关文件:</div>';
for(var i = 0; i < processFile.length; i++) {
var obj = processFile[i];
t += '<tr>';
t += '<td class="tableContent" style="padding-left:20px;"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></td>';
t += '</tr>';
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
}
t += '</table>';
t += '</td></tr></table>';
}
//流程手册附件展示
//流程手册附件展示
t += '<table class="awsui-table">';
t += '<tr>';
t += '<td class="tableHeader">流程手册</td>';
t += '</tr>';
t += '<tr>';
t += '<td class="tableContent" style="padding-left:20px;"><a href="javascript:void(0);" onclick="openOutputFile(\''+ ruuid +'\')">'+ fileName +'</a></td>';
t += '</tr>';
t += '<tr><td>';
t += '<div class="filetableHeader">流程手册:</div>';
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ ruuid +'\')">'+ fileName +'</a></div>';
t += '</td></tr>';
t += '</table>';
var elements = Model.define.elements;
@ -1594,14 +1590,12 @@ function initUpfileData(obj) {
var processShape = upfileData[ele.id];
if(processShape != null && processShape.length > 0) {
t += '<table name="' + ele.id + '" class="awsui-table">';
t += '<tr>';
t += '<td class="tableHeader">' + ele.text + '</td>';
t += '</tr>';
t += '<tr><td>';
t += '<div class="filetableHeader">' + ele.text + '</div>';
for(var i = 0; i < processShape.length; i++) {
var obj = processShape[i];
t += '<tr>';
t += '<td class="tableContent" style="padding-left:20px;"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></td>';
t += '</tr>';
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
t += '</td></tr>';
}
t += '</table>';
}
@ -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) {
@ -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 += '<table>';
t += '<tr>';
t += '<button type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm" onclick="searchChange(\''+shape.id+'\')">';
t += '<div class="task-box">'
/*t += '<button type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm" onclick="searchChange(\''+shape.id+'\')">';
t +='<i class="awsui-iconfont" id="searchChange'+shape.id+'">&#xe718;</i>';
t += '</button>';
t += '</tr>';
t += '</table>';
t += '</button>';*/
t +='<i class="awsui-iconfont newadd_up" id="searchChange'+shape.id+'" onclick="searchChange(\''+shape.id+'\')">&#xe718;</i>';
t +='<input type="hidden" name="searchChangeFlg" id="searchChangeFlg'+shape.id+'" value="0" />';
t += '<table class="awsui-table awsui-table-bordered" name="' + shape.id + '" id="' +shape.id+ 'change" >';
t += '<tr name="trHeader">';
t += '<td class="tableHeader" colspan="3">' + shape.text + '</td>';
t += '<td class="tableHeader" >' + shape.text + '</td>';
t += '</tr>';
t += '<tr>';
t += '<td style="padding-left:20px;" class="tableContent">类型</td>';
t += '<td id="' + shape.id + 'type" colspan="2" class="tableContent"></td>';
/*t += '<td style="padding-left:20px;" class="tableContent"></td>';*/
t += '<td id="' + shape.id + 'type" class="tableContent"></td>';
t += '</tr>';
t += '</table>';
t += '</table></div>';
$('#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
},
@ -1841,12 +1833,12 @@ function getSelectOptions(category, selectValues) {
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 != ''){