diff --git a/activiti/src/main/resources/template/js/actFlow/actFlowAdd.js b/activiti/src/main/resources/template/js/actFlow/actFlowAdd.js new file mode 100644 index 0000000000000000000000000000000000000000..39b0f3b0ebc478b9cdf43bc78d9605c7ec3b03b5 --- /dev/null +++ b/activiti/src/main/resources/template/js/actFlow/actFlowAdd.js @@ -0,0 +1,79 @@ + +// 关联的工作流业务模型 +var skyeyeClassFlowableMation = {}; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form; + + form.on('radio(businessLinkType)', function (data) { + var val = data.value; + if (val == '1') { + // 不关联业务数据 + $(".business").addClass("layui-hide"); + } else if (val == '2') { + // 关联业务数据 + $(".business").removeClass("layui-hide"); + } + }); + + matchingLanguage(); + form.render(); + form.on('submit(formAddBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var params = { + flowName: $("#flowName").val(), + modelKey: $("#modelKey").val(), + businessLinkType: data.field.businessLinkType + }; + if (params.businessLinkType == 2) { + params.serviceClassName = $("#serviceClassName").attr("className"); + params.businessKey = $("#businessKey").val(); + params.businessData = $("#businessData").val(); + if (isNull(params.serviceClassName)) { + winui.window.msg("请选择工作流业务模型", {icon: 2, time: 2000}); + return false; + } + if (isNull(params.businessKey)) { + winui.window.msg("请输入属性字段", {icon: 2, time: 2000}); + return false; + } + if (isNull(params.businessData)) { + winui.window.msg("请输入属性值", {icon: 2, time: 2000}); + return false; + } + params.dsFormId = ""; + } + + AjaxPostUtil.request({url: flowableBasePath + "writeActFlowMation", params: params, type: 'json', method: 'POST', callback: function (json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + + // 工作流业务模型选择 + $("body").on("click", "#serviceClassNameSel", function (e) { + _openNewWindows({ + url: "../../tpl/skyeyeClassFlowable/skyeyeClassFlowableChoose.html", + title: "工作流业务模型选择", + pageId: "skyeyeClassFlowableChoose", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + $("#serviceClassName").val(skyeyeClassFlowableMation.serviceName); + $("#serviceClassName").attr("className", skyeyeClassFlowableMation.className); + }}); + }); + + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); +}); \ No newline at end of file diff --git a/activiti/src/main/resources/template/js/actFlow/actFlowEdit.js b/activiti/src/main/resources/template/js/actFlow/actFlowEdit.js new file mode 100644 index 0000000000000000000000000000000000000000..6f958054cd6128c413a0cab9f8b6366b7bec1411 --- /dev/null +++ b/activiti/src/main/resources/template/js/actFlow/actFlowEdit.js @@ -0,0 +1,86 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form; + + showGrid({ + id: "showForm", + url: flowableBasePath + "queryActFlowMationById", + params: {id: parent.rowId}, + method: 'GET', + pagination: false, + template: $("#beanTemplate").html(), + ajaxSendAfter:function (json) { + if (json.bean.businessLinkType == 1) { + // 不关联业务数据 + $("#businessLinkType").html('否'); + $(".business").addClass("layui-hide"); + } else if (json.bean.businessLinkType == 2) { + // 关联业务数据 + $("#businessLinkType").html('是'); + $(".business").removeClass("layui-hide"); + } + + matchingLanguage(); + form.render(); + form.on('submit(formEditBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var params = { + id: parent.rowId, + flowName: $("#flowName").val(), + modelKey: $("#modelKey").val(), + businessLinkType: json.bean.businessLinkType + }; + if (params.businessLinkType == 2) { + params.serviceClassName = $("#serviceClassName").attr("className"); + params.businessKey = $("#businessKey").val(); + params.businessData = $("#businessData").val(); + if (isNull(params.serviceClassName)) { + winui.window.msg("请选择工作流业务模型", {icon: 2, time: 2000}); + return false; + } + if (isNull(params.businessKey)) { + winui.window.msg("请输入属性字段", {icon: 2, time: 2000}); + return false; + } + if (isNull(params.businessData)) { + winui.window.msg("请输入属性值", {icon: 2, time: 2000}); + return false; + } + params.dsFormId = ""; + } + + AjaxPostUtil.request({url: flowableBasePath + "writeActFlowMation", params: params, type: 'json', method: 'POST', callback: function (json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + } + }); + + // 工作流业务模型选择 + $("body").on("click", "#serviceClassNameSel", function (e) { + _openNewWindows({ + url: "../../tpl/skyeyeClassFlowable/skyeyeClassFlowableChoose.html", + title: "工作流业务模型选择", + pageId: "skyeyeClassFlowableChoose", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + $("#serviceClassName").val(skyeyeClassFlowableMation.serviceName); + $("#serviceClassName").attr("className", skyeyeClassFlowableMation.className); + }}); + }); + + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); +}); \ No newline at end of file diff --git a/activiti/src/main/resources/template/js/actFlow/actFlowList.js b/activiti/src/main/resources/template/js/actFlow/actFlowList.js new file mode 100644 index 0000000000000000000000000000000000000000..a6f1fd6b7074a298fdcd67993e8c67c9e986581c --- /dev/null +++ b/activiti/src/main/resources/template/js/actFlow/actFlowList.js @@ -0,0 +1,184 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var $ = layui.$, + form = layui.form, + table = layui.table; + + // 流程模型列表 + authBtn('1552960740348'); + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: flowableBasePath + 'queryActFlowList', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers', rowspan: '2' }, + { colspan: '4', title: '模型信息', align: 'center'}, + { colspan: '2', title: '发布信息', align: 'center'}, + { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120, rowspan: '2' }, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150, rowspan: '2' }, + { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120, rowspan: '2' }, + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150, rowspan: '2' }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 340, toolbar: '#tableBar', rowspan: '2' } + ], [ + { field: 'flowName', title: '模型名称', width: 150 }, + { field: 'modelId', title: '模型ID', width: 100 }, + { field: 'modelKey', title: '模型key', width: 250 }, + { field: 'version', title: '版本', width: 80, templet: function (d) {return d.model.version}}, + { field: 'deploymentId', title: '发布状态', align: "center", width: 80, templet: function (d) { + if (isNull(d.model.deploymentId)) { + return "未发布"; + } else { + return "已发布"; + } + }}, + { field: 'processDefinitionVersion', title: '版本', width: 100, templet: function (d) { + if (isNull(d.procdef) || isNull(d.procdef.version)) { + return ''; + } + return d.procdef.version + }} + ]], + done: function(json) { + matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称,模型key", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'del') { //删除 + del(data, obj); + } else if (layEvent === 'edit') { //编辑 + edit(data); + } else if (layEvent === 'modelDesign') { // 流程设计 + modelDesign(data); + } else if (layEvent === 'fb') { //发布 + fb(data); + } else if (layEvent === 'versionLevel') { //版本升级 + versionLevel(data); + } else if (layEvent === 'qxfb') { // 取消发布 + qxfb(data); + } else if (layEvent === 'ecportXML') { //导出xml + ecportXML(data); + } + }); + + // 删除 + function del(data, obj) { + layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { + layer.close(index); + AjaxPostUtil.request({url: flowableBasePath + "deleteActFlowMationById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) { + winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + }); + } + + // 发布 + function fb(data) { + layer.confirm('确认发布选中数据吗?', { icon: 3, title: '发布模型' }, function (index) { + layer.close(index); + AjaxPostUtil.request({url: flowableBasePath + "activitimode003", params: {modelId: data.modelId}, type: 'json', callback: function (json) { + winui.window.msg("发布成功", {icon: 1, time: 2000}); + loadTable(); + }}); + }); + } + + // 版本升级 + function versionLevel(data) { + layer.confirm('确认升级选中数据吗?', { icon: 3, title: '版本升级' }, function (index) { + layer.close(index); + AjaxPostUtil.request({url: flowableBasePath + "activitimode003", params: {modelId: data.modelId}, type: 'json', callback: function (json) { + winui.window.msg("升级成功", {icon: 1, time: 2000}); + loadTable(); + }}); + }); + } + + // 取消发布 + function qxfb(data){ + layer.confirm('确认取消发布选中数据吗?', { icon: 3, title: '取消发布' }, function (index) { + layer.close(index); + AjaxPostUtil.request({url: flowableBasePath + "activitimode007", params: {deploymentId: data.deploymentId}, type: 'json', callback: function (json) { + winui.window.msg("取消发布成功", {icon: 1, time: 2000}); + loadTable(); + }}); + }); + } + + // 导出xml + function ecportXML(data) { + window.open(flowableBasePath + "activitimode010?modelId=" + data.modelId); + } + + // 新增 + $("body").on("click", "#addBean", function() { + _openNewWindows({ + url: "../../tpl/actFlow/actFlowAdd.html", + title: systemLanguage["com.skyeye.addPageTitle"][languageType], + pageId: "actFlowAdd", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + }); + + // 编辑 + function edit(data) { + rowId = data.id; + _openNewWindows({ + url: "../../tpl/actFlow/actFlowEdit.html", + title: systemLanguage["com.skyeye.editPageTitle"][languageType], + pageId: "actFlowEdit", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + } + + // 流程设计 + function modelDesign(data) { + _openNewWindows({ + url: "../../static/modeler.html?modelId=" + data.modelId, + title: "绘制流程", + pageId: "canverActivitiModel", + area: ['100vw', '100vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + } + }); + } + + form.render(); + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); + } + + exports('actFlowList', {}); +}); diff --git a/activiti/src/main/resources/template/js/activitimodel/activitimodellist.js b/activiti/src/main/resources/template/js/activitimodel/activitimodellist.js deleted file mode 100644 index f7c97ba51f9cf19395bad4f09f1fb93d778c2ff3..0000000000000000000000000000000000000000 --- a/activiti/src/main/resources/template/js/activitimodel/activitimodellist.js +++ /dev/null @@ -1,194 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { - winui.renderColor(); - var $ = layui.$, - form = layui.form, - table = layui.table; - - // 流程设计列表 - authBtn('1552960740348'); - table.render({ - id: 'messageTable', - elem: '#messageTable', - method: 'post', - url: flowableBasePath + 'activitimode002', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'id', title: '模型编号', width: 100 }, - { field: 'name', title: '模型名称', width: 150 }, - { field: 'key', title: '编码', width: 120 }, - { field: 'processKey', title: 'key', width: 250 }, - { field: 'version', title: '版本', width: 80}, - { field: 'deploymentId', title: '发布状态', align: "center", width: 80, templet: function (d) { - if(isNull(d.deploymentId)){ - return "未发布"; - } else { - return "已发布"; - } - }}, - { field: 'deploymentId', title: '部署id', width: 100}, - { field: 'processDefinitionVersion', title: '部署版本', width: 100}, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, - { field: 'metaInfo', title: '元数据', width: 120}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 340, toolbar: '#tableBar'} - ]], - done: function(json) { - matchingLanguage(); - } - }); - - table.on('tool(messageTable)', function (obj) { - var data = obj.data; - var layEvent = obj.event; - if (layEvent === 'del') { //删除 - del(data, obj); - } else if (layEvent === 'edit') { //编辑 - edit(data); - } else if (layEvent === 'copyModel') { //模型拷贝 - copyModel(data); - } else if (layEvent === 'fb') { //发布 - fb(data); - } else if (layEvent === 'versionLevel') { //版本升级 - versionLevel(data); - } else if (layEvent === 'qxfb') { // 取消发布 - qxfb(data); - } else if (layEvent === 'ecportXML') { //导出xml - ecportXML(data); - } - }); - - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - refreshTable(); - } - return false; - }); - - // 刷新数据 - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - - //删除 - function del(data, obj) { - var msg = obj ? '确认删除模型【' + obj.data.name + '】吗?' : '确认删除选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '删除模型' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "activitimode006", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - //编辑 - function edit(data) { - rowId = data.id; - _openNewWindows({ - url: "../../static/modeler.html?modelId=" + rowId, - title: "绘制流程", - pageId: "canveractivitimodeledit", - area: ['100vw', '100vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - } - - //发布 - function fb(data) { - rowId = data.id; - var msg = data ? '确认发布模型【' + data.name + '】吗?' : '确认发布选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '发布模型' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "activitimode003", params: {modelId: rowId}, type: 'json', callback: function (json) { - winui.window.msg("发布成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - //版本升级 - function versionLevel(data) { - rowId = data.id; - var msg = data ? '确认升级模型【' + data.name + '】版本吗?' : '确认升级选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '版本升级' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "activitimode003", params: {modelId: rowId}, type: 'json', callback: function (json) { - winui.window.msg("升级成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 取消发布 - function qxfb(data, obj){ - var msg = obj ? '确认取消发布【' + obj.data.name + '】吗?' : '确认取消发布选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '取消发布' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "activitimode007", params: {deploymentId: data.deploymentId}, type: 'json', callback: function (json) { - winui.window.msg("取消发布成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 拷贝模型 - function copyModel(data) { - layer.confirm('确认拷贝选中数据吗?', { icon: 3, title: '模型拷贝' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "activitimode028", params: {modelId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("拷贝成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 导出xml - function ecportXML(data) { - window.open(flowableBasePath + "activitimode010?modelId=" + data.id); - } - - //新增 - $("body").on("click", "#addBean", function() { - AjaxPostUtil.request({url: flowableBasePath + "activitimode001", params: {}, type: 'json', callback: function (json) { - _openNewWindows({ - url: "../../static/modeler.html?modelId=" + json.bean.id, - title: "绘制流程", - pageId: "canveractivitimodel", - area: ['100vw', '100vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }}); - }); - - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } - - // 搜索 - function refreshTable(){ - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}) - } - - function getTableParams() { - return { - modelName: $("#modelName").val() - }; - } - - exports('codemodellist', {}); -}); diff --git a/activiti/src/main/resources/template/js/skyeyeClassFlowable/skyeyeClassFlowableChoose.js b/activiti/src/main/resources/template/js/skyeyeClassFlowable/skyeyeClassFlowableChoose.js new file mode 100644 index 0000000000000000000000000000000000000000..8876df18e3af46151cf8bbbc42f4c417bf4b6c44 --- /dev/null +++ b/activiti/src/main/resources/template/js/skyeyeClassFlowable/skyeyeClassFlowableChoose.js @@ -0,0 +1,70 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form, + table = layui.table; + + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: reqBasePath + 'queryClassFlowableDataList', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { type: 'radio', fixed: 'left'}, + { title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers' }, + { field: 'serviceName', title: '服务名', align: 'center', width: 150}, + { field: 'className', title: '服务', width: 400} + ]], + done: function(res) { + matchingLanguage(); + + initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入服务名", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + $('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function() { + var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover"); + dubClick.find("input[type='radio']").prop("checked", true); + form.render(); + var chooseIndex = JSON.stringify(dubClick.data('index')); + var obj = res.rows[chooseIndex]; + parent.skyeyeClassFlowableMation = obj; + + parent.refreshCode = '0'; + parent.layer.close(index); + }); + + $('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('click',function() { + var click = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover"); + click.find("input[type='radio']").prop("checked", true); + form.render(); + }); + } + }); + + form.render(); + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); + } + + exports('skyeyeClassFlowableChoose', {}); +}); \ No newline at end of file diff --git a/activiti/src/main/resources/template/tpl/actFlow/actFlowAdd.html b/activiti/src/main/resources/template/tpl/actFlow/actFlowAdd.html new file mode 100644 index 0000000000000000000000000000000000000000..f0a1c6f32ec7954f5438a652e3ff053f18d8744a --- /dev/null +++ b/activiti/src/main/resources/template/tpl/actFlow/actFlowAdd.html @@ -0,0 +1,67 @@ + + +
+ +