flowSchemePreview.js
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
layui.config({
base: "/js/"
}).use(['form', 'vue', 'ztree', 'layer', 'element', 'jquery', 'slimscroll', 'flow/gooflow', 'flowlayout'], function () {
var form = layui.form, element = layui.element,
layer = layui.layer,
$ = layui.jquery;
var index = layer.getFrameIndex(window.name); //获取窗口索引
var id = $.getUrlParam("id"); //ID
/*=========流程设计(begin)======================*/
var flowDesignPanel = $('#flowPanel').flowdesign({
height: 300,
widht: 300,
haveTool: false,
OpenNode: function (object) {
FlowDesignObject = object; //为NodeInfo窗口提供调用
$("[name='NodeName']").val(object.setInfo.NodeName),
$("[name='NodeCode']").val(object.setInfo.NodeCode),
$("[name='SortCode']").val(object.setInfo.SortCode),
layer.open({
type: 1,
area: ['550px', '450px'], //宽高
maxmin: true, //开启最大化最小化按钮
title: '节点设置【' + object.name + '】',
content: $('#nodeForm'),
btn: ['确定', '取消'],
yes: function (index, layero) {
layer.close(index);
},
cancel: function (index) {
layer.close(index);
}
});
},
OpenLine: function (id, object) {
lay.msg("暂不能设置分支条件");
return;
}
});
/*=========流程设计(end)=====================*/
$.getJSON('/flow/flowschemes/get?id=' + id,
function (data) {
var obj = data.Result;
flowDesignPanel.loadData(JSON.parse(obj.SchemeContent));
$("[name='SchemeCode']").val(obj.SchemeCode);
$("[name='SchemeName']").val(obj.SchemeName);
$("[name='SchemeType']").val(obj.SchemeType);
$("[name='ProductId']").val(obj.ProductId);
$("[name='MachineType']").val(obj.MachineType);
if (obj.Disabled == 0) {
$('input:checkbox[name="Disabled"]').prop('checked', false);
form.render();
} else {
$("[name=Disabled]:checkbox").prop('checked', true);
form.render();
}
$("[name='Description']").val(obj.Description);
});
flowDesignPanel.reinitSize($(window).width() - 30, $(window).height() - 100);
$(window).resize(function () {
flowDesignPanel.reinitSize($(window).width() - 30, $(window).height() - 100);
});
//让层自适应iframe
layer.iframeAuto(index);
$(".GooFlow_work").slimScroll({
height: 'auto'
});
})