伊利项目 模型转换功能
This commit is contained in:
parent
f4a12e158e
commit
27595d769f
Binary file not shown.
@ -475,7 +475,7 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
JSONObject startEventShapeDefinition = CoeDesignerUtil.getShapeDefinition(targetMethod, "startEvent");
|
||||
String startEventId = UUIDGener.getObjectId();
|
||||
startEventShapeDefinition.put("id",startEventId);
|
||||
double startShapeX = 10.0 + epcPagePadding;
|
||||
double startShapeX = 60.0 + epcPagePadding;
|
||||
JSONObject startEventProps = startEventShapeDefinition.getJSONObject("props");
|
||||
double startShapeH = startEventProps.getDoubleValue("h");
|
||||
startEventProps.put("x",startShapeX);
|
||||
@ -681,6 +681,7 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
// 根据封装的LinkerAdapter生成新的linker 生成事件线
|
||||
for (String key : linkerAdapterMap.keySet()) {
|
||||
EventNode eventNode = eventNodeMap.get(key);
|
||||
String text = UtilString.isEmpty(bpmnElements.getJSONObject(eventNode.getId()).getString("text")) ? "事件" : bpmnElements.getJSONObject(eventNode.getId()).getString("text");
|
||||
Position centerShapePosi = eventNode.getCenterShapePosi();
|
||||
Map<String, List<LinkerAdapter>> listMap = linkerAdapterMap.get(key);
|
||||
List<LinkerAdapter> fromLinkerList = listMap.get("from");
|
||||
@ -692,7 +693,7 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
JSONObject linkerDef = JSONObject.parseObject(LinkerDefConstant.linker);
|
||||
String linkDefId = UUIDGener.getObjectId();
|
||||
linkerDef.put("id",linkDefId);
|
||||
linkerDef.put("text","事件");
|
||||
linkerDef.put("text",text);
|
||||
linkerDef.put("points", ConvertUtil.getLinkerPoints(linkerAdapter.getPoints()));
|
||||
JSONObject from = linkerDef.getJSONObject("from");
|
||||
from.put("x",centerShapePosi.getX());
|
||||
@ -716,7 +717,7 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
JSONObject linkerDef = JSONObject.parseObject(LinkerDefConstant.linker);
|
||||
String linkDefId = UUIDGener.getObjectId();
|
||||
linkerDef.put("id",linkDefId);
|
||||
linkerDef.put("text","事件");
|
||||
linkerDef.put("text",text);
|
||||
linkerDef.put("points",ConvertUtil.getLinkerPoints(linkerAdapter.getPoints()));
|
||||
JSONObject from = linkerDef.getJSONObject("from");
|
||||
from.put("x",fromLinkPosi.getX());
|
||||
@ -742,7 +743,13 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
JSONObject linkerDef = JSONObject.parseObject(LinkerDefConstant.linker);
|
||||
String linkDefId = UUIDGener.getObjectId();
|
||||
linkerDef.put("id",linkDefId);
|
||||
linkerDef.put("text","事件");
|
||||
linkerDef.put("text",text);
|
||||
if (annotationIds.contains(fromLinkerAdapter.getId())){
|
||||
JSONObject lineStyle = linkerDef.getJSONObject("lineStyle");
|
||||
lineStyle.put("lineStyle","dashed");
|
||||
lineStyle.put("endArrowStyle","none");
|
||||
linkerDef.put("lineStyle",lineStyle);
|
||||
}
|
||||
List<Position> pointList = new ArrayList<>();
|
||||
if (fromLinkerAdapter.getPoints().size() > 0) pointList.addAll(fromLinkerAdapter.getPoints());
|
||||
// 判断当前事件节点是否要作为一个折点
|
||||
@ -776,7 +783,8 @@ public class EpcToBPMN implements ModelConvertStrategy {
|
||||
JSONObject linkerDef = JSONObject.parseObject(LinkerDefConstant.linker);
|
||||
String linkDefId = UUIDGener.getObjectId();
|
||||
linkerDef.put("id",linkDefId);
|
||||
linkerDef.put("text","事件");
|
||||
linkerDef.put("text",text);
|
||||
// System.out.println("========>>>> " + annotationIds + " " + fromLinkerAdapter.getId());
|
||||
if (annotationIds.contains(fromLinkerAdapter.getId())){
|
||||
JSONObject lineStyle = linkerDef.getJSONObject("lineStyle");
|
||||
lineStyle.put("lineStyle","dashed");
|
||||
|
||||
@ -470,6 +470,13 @@ var UI = {
|
||||
if (menuBar.hasClass("readonly")) {
|
||||
return;
|
||||
}
|
||||
if (menuId == "bar_list_file"){
|
||||
// debugger;
|
||||
if (methodId == "process.epc" && $("#bar_list_model_convert").length == 0){
|
||||
$("#bar_list_file").append("<li>模型转换<div class='extend ex_arrow'>►</div><ul id='bar_list_model_convert' class='menu list extend_menu menu_ico'></ul></li>");
|
||||
$("#bar_list_model_convert").append("<li ac='modelConvert' methodId='process.flowchart'>FlowChart</li>"+"<li ac='modelConvert' methodId='process.bpmn2'>BPMN</li>");
|
||||
}
|
||||
}
|
||||
$("#" + menuId).dropdown({
|
||||
target : menuBar,
|
||||
onSelect : function(item) {
|
||||
@ -513,20 +520,6 @@ var UI = {
|
||||
if (item.length) {
|
||||
$("#bar_list_page").dropdown("select", item);
|
||||
}
|
||||
} else if (menuId == "bar_list_file"){
|
||||
// debugger;
|
||||
if (methodId == "process.epc" && $("#bar_list_model_convert").length == 0){
|
||||
$("#bar_list_file").append("<li>模型转换<div class='extend ex_arrow'>►</div><ul id='bar_list_model_convert' class='menu list extend_menu menu_ico'></ul></li>");
|
||||
$("#bar_list_model_convert").append("<li ac='modelConvert' methodId='process.flowchart'>FlowChart</li>"+"<li ac='modelConvert' methodId='process.bpmn2'>BPMN</li>");
|
||||
$("#bar_list_model_convert > li").click(function () {
|
||||
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存" && $("#saving_tip").text() != "") {
|
||||
if (editable) {
|
||||
$.simpleAlert('页面中有未保存的内容,请先保存');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -530,6 +530,13 @@ var UI = {
|
||||
if (menuBar.hasClass("readonly")) {
|
||||
return;
|
||||
}
|
||||
if (menuId == "bar_list_file"){
|
||||
// debugger;
|
||||
if (methodId == "process.epc" && $("#bar_list_model_convert").length == 0){
|
||||
$("#bar_list_file").append("<li>模型转换<div class='extend ex_arrow'>►</div><ul id='bar_list_model_convert' class='menu list extend_menu menu_ico'></ul></li>");
|
||||
$("#bar_list_model_convert").append("<li ac='modelConvert' methodId='process.flowchart'>FlowChart</li>"+"<li ac='modelConvert' methodId='process.bpmn2'>BPMN</li>");
|
||||
}
|
||||
}
|
||||
$("#" + menuId).dropdown({
|
||||
target : menuBar,
|
||||
onSelect : function(item) {
|
||||
@ -573,20 +580,6 @@ var UI = {
|
||||
if (item.length) {
|
||||
$("#bar_list_page").dropdown("select", item);
|
||||
}
|
||||
} else if (menuId == "bar_list_file"){
|
||||
// debugger;
|
||||
if (methodId == "process.epc" && $("#bar_list_model_convert").length == 0){
|
||||
$("#bar_list_file").append("<li>模型转换<div class='extend ex_arrow'>►</div><ul id='bar_list_model_convert' class='menu list extend_menu menu_ico'></ul></li>");
|
||||
$("#bar_list_model_convert").append("<li ac='modelConvert' methodId='process.flowchart'>FlowChart</li>"+"<li ac='modelConvert' methodId='process.bpmn2'>BPMN</li>");
|
||||
$("#bar_list_model_convert > li").click(function () {
|
||||
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存" && $("#saving_tip").text() != "") {
|
||||
if (editable) {
|
||||
$.simpleAlert('页面中有未保存的内容,请先保存');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user