提交 bfb17fe3 编写于 作者: Skyeye云's avatar Skyeye云

工作流加载信息详情完成

上级 804e2ad1
// 以下两个参数开启团队权限时有值
var objectId = '', objectKey = '';
var pageMation;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'flow'], function (exports) {
}).define(['window', 'jquery', 'winui', 'flow'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
......@@ -14,35 +18,31 @@ layui.config({
// 时间线审批历史列表模板
var timeTreeApprovalHistory = $("#timeTreeApprovalHistory").html();
AjaxPostUtil.request({url: flowableBasePath + "queryBusinessData", params: {processInstanceId: processInstanceId}, type: 'json', method: 'POST', callback: function(json) {
AjaxPostUtil.request({url: flowableBasePath + "queryProcessInstance", params: {processInstanceId: processInstanceId}, type: 'json', method: 'POST', callback: function(data) {
// 加载业务数据
dsFormUtil.initSequenceDataDetails('showForm', json.rows);
activitiUtil.loadBusiness(data.bean.objectId, data.bean.objectKey, data.bean.actFlowId, 'details');
// 加载流程图片
$("#processInstanceIdImg").attr("src", fileBasePath + 'images/upload/activiti/' + processInstanceId + ".png?cdnversion=" + Math.ceil(new Date()/3600000));
// 加载审批历史
inboxTimeTreeApprovalHistory();
matchingLanguage();
}});
}, async: false});
// 加载审批历史
function inboxTimeTreeApprovalHistory(){
flow.load({
elem: '#timeTreeApprovalHistoryList',
scrollElem: '#timeTreeApprovalHistoryList',
isAuto: true,
done: function(page, next) {
var lis = [];
AjaxPostUtil.request({url: flowableBasePath + "activitimode017", params: {processInstanceId: parent.processInstanceId}, type: 'json', callback: function (json) {
$.each(json.rows, function(index, bean) {
bean.showClass = 'date02';
lis.push(getDataUseHandlebars(timeTreeApprovalHistory, {bean: bean}));
});
next(lis.join(''), (page * 1000) < json.total);
}});
}
});
}
flow.load({
elem: '#timeTreeApprovalHistoryList',
scrollElem: '#timeTreeApprovalHistoryList',
isAuto: true,
done: function(page, next) {
var lis = [];
AjaxPostUtil.request({url: flowableBasePath + "activitimode017", params: {processInstanceId: parent.processInstanceId}, type: 'json', callback: function (json) {
$.each(json.rows, function(index, bean) {
bean.showClass = 'date02';
lis.push(getDataUseHandlebars(timeTreeApprovalHistory, {bean: bean}));
});
next(lis.join(''), (page * 1000) < json.total);
}});
}
});
// 图片查看
$("body").on("click", "#processInstanceIdImg, .photo-img", function() {
systemCommonUtil.showPicImg($(this).attr("src"));
......
var layedit, form;
// 以下两个参数开启团队权限时有值
var objectId = '', objectKey = '';
var pageMation;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'layedit', 'colorpicker', 'slider', 'fileUpload', 'codemirror', 'xml', 'clike',
'css', 'htmlmixed', 'javascript', 'nginx', 'solr', 'sql', 'vue', 'form', "table", 'flow'], function (exports) {
}).define(['window', 'jquery', 'winui', 'flow'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
flow = layui.flow;
form = layui.form,
layedit = layui.layedit;
flow = layui.flow,
form = layui.form;
var taskId = parent.taskId;
var processInstanceId = parent.processInstanceId;
var taskType = parent.taskType;
$("#activitiTitle").html(taskType);
// 时间线审批历史列表模板
var timeTreeApprovalHistory = $("#timeTreeApprovalHistory").html();
AjaxPostUtil.request({url: flowableBasePath + "queryBusinessData", params: {processInstanceId: processInstanceId}, type: 'json', method: 'POST', callback: function(data) {
AjaxPostUtil.request({url: flowableBasePath + "queryProcessInstance", params: {processInstanceId: processInstanceId}, type: 'json', method: 'POST', callback: function(data) {
// 加载业务数据
dsFormUtil.initSequenceDataDetails('showForm', data.rows);
activitiUtil.loadBusiness(data.bean.objectId, data.bean.objectKey, data.bean.actFlowId, 'edit');
}, async: false});
AjaxPostUtil.request({url: flowableBasePath + "activitimode016", params: {taskId: taskId, processInstanceId: processInstanceId}, type: 'json', method: 'GET', callback: function(j){
......@@ -34,8 +32,6 @@ layui.config({
var editableNodeId = j.bean.taskKey;
var editableNodeName = j.bean.taskKeyName;
$("#activitiTitle").html(j.bean.title);
// 加载流程图片
$("#processInstanceIdImg").attr("src", fileBasePath + 'images/upload/activiti/' + processInstanceId + ".png?cdnversion=" + Math.ceil(new Date() / 3600000));
......
......@@ -6,7 +6,6 @@
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/timeaxis/timeaxis.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/customer/voucherUtil.css" rel="stylesheet" />
<style type="text/css">
.history-date h2{
margin-bottom: 0px;
......@@ -63,8 +62,6 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script src="../../assets/lib/layui/customer/voucher/spinbox.js"></script>
<script src="../../assets/lib/layui/customer/voucher/voucherUtil.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/activitiCommon/'}).use('processInstanceDetails');
</script>
......
......@@ -6,7 +6,6 @@
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/timeaxis/timeaxis.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/customer/voucherUtil.css" rel="stylesheet" />
<style type="text/css">
.history-date h2{
margin-bottom: 0px;
......@@ -33,9 +32,6 @@
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title" id="activitiTitle"></span><hr>
</div>
<div id="showForm" style="height: auto; width: 100%; float: left;">
</div>
......@@ -138,8 +134,6 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script src="../../assets/lib/layui/customer/voucher/spinbox.js"></script>
<script src="../../assets/lib/layui/customer/voucher/voucherUtil.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/approvalActiviti/'}).use('approvalProcessTask');
</script>
......
......@@ -224,12 +224,11 @@ layui.config({
$("body").on("click", "#attrTransformTableListConfig", function() {
parent._openNewWindows({
url: "../../tpl/dsFormPage/editPageContentIsTable.html?pageType=" + pageType,
url: "../../tpl/dsFormPage/editPageContentIsTable.html?attrKey=" + $("#attrKey").val() + '&className=' + parent.className + '&pageType=' + pageType,
title: '表格属性配置',
pageId: "editPageContentIsTable",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
});
......
......@@ -16,6 +16,21 @@ layui.config({
var alignmentData = skyeyeClassEnumUtil.getEnumDataListByClassName("alignment");
var rowNum = 1;
var pageType = GetUrlParam("pageType");
var parentAttrKey = GetUrlParam("attrKey");
var parentClassName = GetUrlParam("className");
var params = {
className: parentClassName,
attrKey: parentAttrKey
};
var childAttr = [];
AjaxPostUtil.request({url: reqBasePath + "queryChildAttrDefinitionList", params: params, type: 'json', method: "POST", callback: function (json) {
childAttr = [].concat(json.rows);
if (childAttr.length > 0) {
childServiceClassName = childAttr[0].className;
}
}, async: false});
var cols = [];
if (pageType == 'processAttr') {
// 流程属性布局
......@@ -23,8 +38,16 @@ layui.config({
{ type: 'checkbox', align: 'center' },
{ field: 'test', title: '', align: 'left', width: 40, templet: function (d) {return '<i class="fa fa-arrows drag-row" />';}},
{ field: 'attrKey', title: '属性<i class="red">*</i>', align: 'left', width: 150, templet: function (d) {
return `<input type="text" id="attrKey${d.id}" placeholder="请填写属性Key" cus-id="${d.id}" win-verify="required" class="layui-input tableInput" ` +
`value="` + (isNull(d.attrKey) ? "" : d.attrKey) + `"/>`;
var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(childAttr, function (i, item) {
if (item.attrKey == d.attrKey) {
_html += `<option value="${item.attrKey}" selected="selected">${item.name}</option>`;
} else {
_html += `<option value="${item.attrKey}">${item.name}</option>`;
}
});
_html += `</select>`;
return _html;
}},
{ field: 'name', title: '名称', align: 'left', width: 120, templet: function (d) {
return `<input type="text" id="name${d.id}" placeholder="请填写名称" cus-id="${d.id}" win-verify="required" class="layui-input tableInput" ` +
......@@ -56,8 +79,16 @@ layui.config({
{ type: 'checkbox', align: 'center' },
{ field: 'test', title: '', align: 'left', width: 40, templet: function (d) {return '<i class="fa fa-arrows drag-row" />';}},
{ field: 'attrKey', title: '属性<i class="red">*</i>', align: 'left', width: 150, templet: function (d) {
return `<input type="text" id="attrKey${d.id}" placeholder="请填写属性Key" cus-id="${d.id}" win-verify="required" class="layui-input tableInput" ` +
`value="` + (isNull(d.attrKey) ? "" : d.attrKey) + `"/>`;
var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(childAttr, function (i, item) {
if (item.attrKey == d.attrKey) {
_html += `<option value="${item.attrKey}" selected="selected">${item.name}</option>`;
} else {
_html += `<option value="${item.attrKey}">${item.name}</option>`;
}
});
_html += `</select>`;
return _html;
}},
{ field: 'name', title: '名称', align: 'left', width: 120, templet: function (d) {
return `<input type="text" id="name${d.id}" placeholder="请填写名称" cus-id="${d.id}" win-verify="required" class="layui-input tableInput" ` +
......
......@@ -89,17 +89,19 @@ layui.config({
}
function initPage() {
var businessId = GetUrlParam("id");
var serviceClassName = pageMation.className;
if (pageMation.type == 'create') {
// 创建布局
dsFormUtil.initCreatePage('content', pageMation);
} else if (pageMation.type == 'edit') {
// 编辑布局
getBusinessData(function (data) {
dsFormUtil.getBusinessData(businessId, serviceClassName, function (data) {
dsFormUtil.initEditPage('content', pageMation, data);
});
} else if (pageMation.type == 'details') {
// 详情布局
getBusinessData(function (data) {
dsFormUtil.getBusinessData(businessId, serviceClassName, function (data) {
dsFormUtil.initDetailsPage('content', pageMation, data);
});
} else if (pageMation.type == 'simpleTable') {
......@@ -117,21 +119,5 @@ layui.config({
}
}
function getBusinessData(callback) {
if (isNull(GetUrlParam("id"))) {
winui.window.msg("业务数据id为空", {icon: 2, time: 2000});
return false;
}
var params = {
objectId: GetUrlParam("id"),
objectKey: pageMation.className
};
AjaxPostUtil.request({url: reqBasePath + "queryBusinessDataByObject", params: params, type: 'json', method: 'POST', callback: function (json) {
if(typeof(callback) == "function") {
callback(json.bean);
}
}});
}
exports('pageShow', {});
});
......@@ -49,6 +49,47 @@ var activitiUtil = {
});
},
/**
* 根据业务对象的serviceClassName和流程模型id加载表单布局
*
* @param businessId 业务数据id
* @param serviceClassName 业务对象的serviceClassName
* @param actFlowId 流程模型id
* @param showType 展示类型 details: 详情 edit: 编辑
*/
loadBusiness: function (businessId, serviceClassName, actFlowId, showType) {
var params = {
serviceClassName: serviceClassName,
actFlowId: actFlowId
};
AjaxPostUtil.request({url: reqBasePath + "queryDsFormPageForProcess", params: params, type: 'json', method: 'GET', callback: function (json) {
pageMation = json.bean;
if (isNull(pageMation)) {
winui.window.msg("该布局信息不存在", {icon: 2, time: 2000});
return false;
} else {
// 这里为什么要给objectId和objectKey赋值,因为表单组件中有用到该值
if (showType == 'details') {
dsFormUtil.getBusinessData(businessId, serviceClassName, function (data) {
if (pageMation.serviceBeanCustom.serviceBean.teamAuth) {
objectId = data.objectId;
objectKey = data.objectKey;
}
dsFormUtil.initDetailsPage('showForm', pageMation, data);
});
} else if (showType == 'edit') {
dsFormUtil.getBusinessData(businessId, serviceClassName, function (data) {
if (pageMation.serviceBeanCustom.serviceBean.teamAuth) {
objectId = data.objectId;
objectKey = data.objectKey;
}
dsFormUtil.initEditPage('showForm', pageMation, data);
});
}
}
}});
},
/**
* 加载审批人选择项
*
......
......@@ -57,6 +57,22 @@ var dsFormUtil = {
pageMation: {},
getBusinessData: function (businessId, serviceClassName, callback) {
if (isNull(businessId)) {
winui.window.msg("业务数据id为空", {icon: 2, time: 2000});
return false;
}
var params = {
objectId: businessId,
objectKey: serviceClassName
};
AjaxPostUtil.request({url: reqBasePath + "queryBusinessDataByObject", params: params, type: 'json', method: 'POST', callback: function (json) {
if(typeof(callback) == "function") {
callback(json.bean);
}
}});
},
/**
* 动态表单选择页面
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册