|
@ -8,8 +8,7 @@ var GooFunc = {
|
|
|
t += dom.offsetTop;
|
|
|
l += dom.offsetLeft;
|
|
|
dom = dom.offsetParent;
|
|
|
}
|
|
|
;
|
|
|
};
|
|
|
return {top: t, left: l};
|
|
|
},
|
|
|
mousePosition: function (ev) {
|
|
@ -107,6 +106,8 @@ function GooFlow(bgDiv, property) {
|
|
|
getAllProcessorsURL = URL + "/esb/process/getAllProcessors";
|
|
|
dataPostURL = URL + "/esb/process/json";
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
* Todo: 初始化布局 【初始化】
|
|
|
* Author: LE
|
|
@ -526,8 +527,8 @@ GooFlow.prototype = {
|
|
|
|
|
|
this.$draw = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
|
this.$workArea.prepend(this.$draw);
|
|
|
this.$workArea.prepend("<div class='file-box'>Code:<input id='fileCode' value='" + this.$fileCode +
|
|
|
"'>Name:<input id='fileName' value='" + this.$fileName +
|
|
|
this.$workArea.prepend("<div class='file-box'>编码:<input id='fileCode' value='" + this.$fileCode +
|
|
|
"'>流程名称:<input id='fileName' value='" + this.$fileName +
|
|
|
"'></div>")
|
|
|
// 设置画布属性
|
|
|
this.$draw.id = id;
|
|
@ -635,7 +636,8 @@ GooFlow.prototype = {
|
|
|
var id = Dom.attr("id");
|
|
|
clearTimeout(timeId);
|
|
|
timeId = setTimeout(function () {
|
|
|
var ev = GooFunc.mousePosition(e),
|
|
|
that.focusItem(id, true);
|
|
|
var ev = GooFunc.mousePosition(e),
|
|
|
t = GooFunc.getElCoordinate(that.$workArea[0]),
|
|
|
c = GooFunc.getElCoordinate(that.$MainContener);
|
|
|
|
|
@ -769,6 +771,11 @@ GooFlow.prototype = {
|
|
|
}
|
|
|
}, ".rs_close")
|
|
|
|
|
|
|
|
|
$('.file-box input').click(function () {
|
|
|
// 编辑的时候禁止delete键删除
|
|
|
that.blurItem();
|
|
|
})
|
|
|
/*
|
|
|
* Todo: 连线链接 【 $$$】
|
|
|
* Author: LE
|
|
@ -984,8 +991,9 @@ GooFlow.prototype = {
|
|
|
* time: 9:53
|
|
|
* */
|
|
|
blurItem: function () {
|
|
|
this.$deteLineId = '';
|
|
|
this.$deteNodeId = '';
|
|
|
this.$canDelLine = false;
|
|
|
this.$deteNodeId = '';
|
|
|
this.$deteLineId = '';
|
|
|
if (this.$focus != "") {
|
|
|
// 获取被选中对象
|
|
|
var jq = $("#" + this.$focus);
|
|
@ -1150,13 +1158,10 @@ GooFlow.prototype = {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
this.$nodeDom[id] = $(" <div class='GooFlow_item node-" + json.type + "' id='" + id + "' style='top:" + json.top + "px;left:" + json.left + "px'> <div class='GooFlow_item_cont'> <i class='fa ico_" + json.type + "'></i> <span class='GooFlow_item_txt' id='type-" + json.type + "'>" + json.name + "</span></div> <div class='rs-box' style='display:none'> <div class='rs_close'><i class='fa fa-close' aria-hidden='true'></i></div> </div> </div>");
|
|
|
this.$nodeDom[id] = $("<div class='GooFlow_item node-" + json.type + "' id='" + id + "' style='top:" + json.top + "px;left:" + json.left + "px'><div class='GooFlow_item_cont'> <i class='fa ico_" + json.type + "'></i><span class='GooFlow_item_txt' id='type-" + json.type + "'>" + json.name + "</span></div> <div class='rs-box' style='display:none'><div class='rs_close'><i class='fa fa-close' aria-hidden='true'></i></div></div></div>");
|
|
|
|
|
|
}
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
if (ua.indexOf('msie') != -1 && ua.indexOf('8.0') != -1) {
|
|
|
this.$nodeDom[id].css("filter", "progid:DXImageTransform.Microsoft.Shadow(color=#94AAC2,direction=135,strength=2)");
|
|
|
}
|
|
|
|
|
|
this.$workArea.append(this.$nodeDom[id]);
|
|
|
json.width = this.$nodeDom[id].width();
|
|
|
json.height = this.$nodeDom[id].height();
|
|
@ -1852,14 +1857,29 @@ GooFlow.prototype = {
|
|
|
* Date: 2017/2/15
|
|
|
* time: 15:02
|
|
|
* */
|
|
|
loadData: function (data) {
|
|
|
this.fileMsg(data.code,data.name);
|
|
|
for (var i in data.nodes) {
|
|
|
this.addNode(i, data.nodes[i]);
|
|
|
}
|
|
|
for (var j in data.lines) {
|
|
|
this.addLine(j, data.lines[j], true);
|
|
|
}
|
|
|
loadData: function (url) {
|
|
|
var that = this;
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
type: 'GET',
|
|
|
async: true,
|
|
|
dataType: 'json',
|
|
|
success: function (data) {
|
|
|
var data = $.parseJSON(data.message);
|
|
|
that.fileMsg(data.code,data.name);
|
|
|
for (var i in data.result.nodes) {
|
|
|
that.addNode(i, data.result.nodes[i]);
|
|
|
}
|
|
|
for (var j in data.result.lines) {
|
|
|
that.addLine(j, data.result.lines[j], true);
|
|
|
}
|
|
|
},
|
|
|
error: function (data, xhr, textStatus) {
|
|
|
console.log('错误')
|
|
|
console.log(xhr)
|
|
|
console.log(textStatus)
|
|
|
},
|
|
|
})
|
|
|
},
|
|
|
|
|
|
fileMsg:function (code,name) {
|
|
@ -1906,6 +1926,8 @@ GooFlow.prototype = {
|
|
|
flowJson: JSON.stringify(data)
|
|
|
}
|
|
|
|
|
|
console.log(postData);
|
|
|
|
|
|
var nodeArr = [];
|
|
|
var specialArr = [];
|
|
|
var fromArr = [];
|
|
@ -1964,7 +1986,14 @@ GooFlow.prototype = {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
console.log(postData);
|
|
|
// 标题code和name不能为空
|
|
|
if (this.$fileCode === '' || this.$fileName === ''){
|
|
|
noError = false;
|
|
|
$('.file-box').addClass('node-error');
|
|
|
}else{
|
|
|
$('.file-box').removeClass('node-error');
|
|
|
}
|
|
|
|
|
|
// 如果没有错误则弹出保存菜单
|
|
|
if (noError) {
|
|
|
saveConfirm();
|