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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
| /**
| * 流程模板
| * @author weidy
| * @date 2020-09-15
| */
| layui.define(['layer','element','tree','table','upload','dynamicCondition' ,'platform/process/designer/VciProcessDesigner'],function(exports){
| var webUtil = $webUtil;
| var Class = function(){
| this.MODELNAME = "platform/process/VciProcessTemplate";
| this.moduleKey = "VciProcessTemplate";
| this.backPath = configData.compatibility?path:configData.processServicePath;
| this.url = {
| treeTemplateClassify:'workflowTemplateClassifyController/refDataGrid',
| gridTemplate:'workflowDefineController/gridTemplate'
|
| };
| this.getContent=function(){
| var that = this;
| var html ;
| html = [
| '<div class="layui-layout" style="display:block;overflow-y: hidden">',
| '<div class="layui-layout-border" style="display:block;margin-top:0px; " id="border_',that.id,'">',
| '<div class="layui-center" style="overflow-y:auto;">',
| '<div style="padding: 5px;" >',
| '<span>流程模板类型:</span>',
| '<select name="processTemplateClassify" style="width:260px;">',
| ' <option value=""></option>',
| '</select>',
| '</div>',
| that.getToolbarHtml(),
| '<table id="table_', that.id , '" lay-filter="',that.id , '" style="overflow-x:auto;"></table>',
| '<div id="toolbar_column_',that.id ,'" style="display:none;"></div>',
| '</div>',
| '</div>',
| '</div>'
| ].join("");
| return html;
| };
| this.getToolbarHtml =function(){
| var that = this;
| var html = [
| '<div layui-filter="toolbar_',that.id,'" class="layui-btn-container layui-buttons">',
| '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADD"><i class="layui-icon layui-icon-add-1"></i>添加</button>',
| '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_EDIT"><i class="layui-icon layui-icon-edit"></i>修改</button>',
| '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_DEL"><i class="layui-icon layui-icon-delete"></i>删除</button>',
| '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADVQUERY"><i class="layui-icon layui-icon-search"></i>查询</button>',
| '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_refresh"><i class="layui-icon layui-icon-refresh"></i>刷新</button>',
| '</div>'
| ].join("");
| return html;
| };
| this.init = function(){
| var that = this;
| $webUtil.copyConfig(that,that.moduleKey);
|
| var table = layui.table;
| that.checkColumns();
| var tableWidth = $("#border_" + that.id).width()-225;
| var options = {
| elem: '#table_' + that.id,
| id: 'table_' + that.id,
| backPath:that.backPath,
| url: that.url.gridTemplate,
| page: {
| limit: 20,
| page: 1
| },
| width:tableWidth,
| selectMode:table.selectMode.muti,
| cols: [that.columns],
| done:function(res,cur,total){
| if(!that.fristMainLoad ){
| table.on('tool(' + that.id + ')',function(obj){
| var data = obj.data;//当前选择行的数据
| var layEvent = obj.event;//点的是什么按钮
| if(layEvent == 'DESIGN'){
| that.DESIGN(data.oid);
| }else if(layEvent == 'DEPLOY'){
|
| }
| });
| }else{
| if(total>0) {
| table.selectRecord('table_' + that.id, {index:0});
| }
| }
| that.fristMainLoad = true;
| }
| };
| table.render(options);
| document.getElementById("toolbar_column_" + that.id).innerHTML =
| '<a class="layui-btn layui-btn-intable" lay-event="DESIGN">设计流程</a>' +
| '<a class="layui-btn layui-btn-intable" lay-event="DEPLOY">发布</a>' +
| '<a class="layui-btn layui-btn-intable" lay-event="UPLOADPROCESS">上传</a>' +
| '<a class="layui-btn layui-btn-intable" lay-event="CLONE">克隆</a>'
| ;
| that.createSearchHtml();
| };
| this.createSearchHtml = function () {
| var that = this;
| webUtil.bindDefultButtonLisenter(that, that.id);
| webUtil.createSearchHtml({name:"流程模板名称",id:"流程模板编号"} ,$("[layui-filter='toolbar_" + that.id + "']"), "table_" + that.id);
| };
| this.checkColumns = function(){
| var that = this;
| var table = layui.table;
| if(that.columns==null || that.columns.length==0){
| that.columns = [table.getIndexColumn(),table.getCheckColumn(),
| {
| title: '流程模板编号',
| field: 'id',
| sort:true,
| width: 150
| }, {
| title: '流程模板名称',
| field: 'name',
| sort:true,
| width: 150
| },{
| title:'所属分类',
| field:'processTemplateClassifyName',
| width:150
| },{
| title:'状态',
| field:'lcStatusText',
| width:90
| },{
| title: '描述',
| field: 'description',
| width: 150
| },{
| title:'创建人',
| field:'creator',
| width:90
| },{
| title:'创建时间',
| field:'createTime',
| width:135,
| template:function (d) {
| return $webUtil.formateDateTimeNoSecond(d.createTime);
| }
| },{
| title:'操作',
| field:'options',
| width:300,
| toolbar:('#toolbar_column_' + that.id)
| }];
| }
| };
| this.DESIGN = function (oid) {
| var that = this;
| var designer = layui['platform/process/designer/VciProcessDesigner'];
| $webUtil.dialog({
| title:'流程设计器',
| skin:'layui-layer-lan liucs',
| btn:[],
| content:'<div id="design_' + that.id + '"></div>',
| fullScreen:true,
| resize:false,
| shadeClose: false,
| success:function(layero) {
| designer.id = that.id;
| $("#design_" + that.id).html(designer.getContent());
| designer.init();
| }
| });
| };
| };
| var cs = new Class();
| exports(cs.MODELNAME,cs);
| });
|
|