`;
}
else if(types==3){
//条件分支
nodeHtml = `
`;
}
else{
//条件内容
nodeHtml = `
`;
}
return nodeHtml;
},
init: function (options) {
this.settings = $.extend({}, opts, options);
let me = this;
let flowBox = $('#'+me.settings.flowBox);
let flowBar = $('#'+me.settings.flowBar);
//添加节点
flowBox.on("click",".add-node",function(e){
let that = $(this);
dropdown.render({
elem: that,
show: true, // 外部事件触发即显示
data: [{
title: '审 核 人',
id: '1',
templet: function(d){
return '
' + d.title;
}
}, {
title: '抄 送 人',
id: '2',
templet: function(d){
return '
' + d.title;
}
}, {
title: '条件分支',
id: '3',
templet: function(d){
return '
' + d.title;
}
}],
click: function(data, othis){
let timestamp = new Date().getTime();
that.parent().parent().parent().parent().after(me.nodeApend(data.id,timestamp));
}
});
});
//添加条件
flowBox.on("click",".add-branch",function(e){
let timestamp = new Date().getTime();
$(this).parent().find(".col-box").first().after(me.nodeApend(4,timestamp));
let branchWrap = $($(this).parents(".branch-wrap")[0]);
let colBbox = branchWrap.find('.col-box');
colBbox.each(function(index,item){
$(item).find('.condition-priority').html('优先级'+(index+1));
if(index
3){
layer.msg('已经是最大了');
return false;
}
me.size = size;
flowBox.css("transform","scale("+size+")");
flowBar.find('.zoom-num').html((size*100)+'%');
})
}
};
exports('oaFlow', obj);
});