/** * 流程模板 * @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 = [ '
' ].join(""); return html; }; this.getToolbarHtml =function(){ var that = this; var html = [ ' ' ].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 = '设计流程' + '发布' + '上传' + '克隆' ; 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:'', 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); });