bpmc/ebpm-process-manage/webapp/pages/procDefMgr/historyVersionProcess.jsp
2024-08-14 15:17:51 +08:00

218 lines
8.3 KiB
Plaintext

<%@page
import="com.blueland.bpm.engine.core.model.ProcessDefinitionModel"%>
<%@page import="com.blueland.bpm.engine.config.model.ProcessInfoConfig"%>
<%@page import="com.blueland.bpm.common.page.*"%>
<%@page import="com.blueland.bpm.common.util.*"%>
<%@page import="java.util.*"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<%--<title>流程配置</title>--%>
<link href="${ctx}/resource/js/plugins/loadmask/jquery.loadmask.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='${ctx}/resource/js/plugins/loadmask/jquery.loadmask.js'></script>
<link href="${ctx_js_plugins}/simpletable/simpletable.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${ctx_js_plugins}/simpletable/simpletable.js"></script>
<script type="text/javascript">
function changeImage(procDefId){
var url ="${ctx}/procDefMgr/getProcessImageWidthAndHeight.do";
//获取图片的宽高
$.ajax({
url : url,
data:{"procDefId":procDefId},
type : "POST",
dataType: "json",
success : function (data){
var imageWidth=parseInt(data.imageWidth)+20;
var imageHeight=parseInt(data.imageHeight)+30;
$("#processImage").attr("style","padding-left: 30px; display: inline; float: left; margin:20px auto 0;position: relative;background:url('${ctx}/procDefMgr/resource.do?resourceType=image&procDefId="+procDefId
+"') no-repeat;width:"+imageWidth+"px; height:"+
imageHeight+"px;");
$("#versionnumber").text(data.version);
}
});
}
function deleteDeploy(url,procDefId,deploymentId,cascode){
if(window.confirm("删除流程会级联删除该流程定义和运行数据,请谨慎操作!为了避免误操作,在删除操作的同时会要求您导出流程作为备份!")){
var downloadUrl="${ctx}/procDefMgr/exportProcessAllFile.do?resourceType=xml&procDefIds="+procDefId+"&exportall=1";
var winObj = window.open(downloadUrl);
var loop = setInterval(function() {
if(winObj.closed) {
clearInterval(loop);
setMask("main-container");
$.ajax({
url : url,
data:{"procDefId":procDefId,"deploymentId":deploymentId,"cascode":cascode},
type : "POST",
dataType: "json",
success : function (data){
//alert(data);
if(data.success){
alert("删除成功");
var procDefId1 = data.returnProcDefId;
if("" != procDefId1){
$("#procDefId").val(procDefId1);
$("#historyForm").submit();
}else{
var win = art.dialog.open.origin;
$("#procDefForm", win.document).submit();
}
}else{
alert("删除失败,原因是:"+data.reason);
}
}
});
}
}, 3000);
}
}
function exportProcessAllFile(processDefIds){
var url="${ctx}/procDefMgr/exportProcessAllFile.do?resourceType=xml&procDefIds="+processDefIds+"&exportall=1";
window.open(url);
}
function flowVersionCompare(){
var obj=getChooseProcDefId();
if(obj==false){
return;
}
var procDefName = $("#procDefName").val();
var height1 = window.parent.document.documentElement.clientHeight;
var height = (parseInt(height1)-45)+"px";
url ="${ctx}/procDefMgr/compareHistoryModel.do?procDefIdOld="+obj.procDefIdOld+"&procDefIdNew="+obj.procDefIdNew+"&nameOld="+obj.nameOld+"&nameNew="+obj.nameNew;
showFullDiaLog(url,'流程历史版本对比&nbsp;&nbsp;&nbsp;&nbsp;当前流程定义名称:'+procDefName);
}
function getChooseProcDefId(){
var appObj={};
var objOld={};
var objNew={};
var i = 0;
var procDefName = $("#procDefName").val();
var sortList = [];
$("input[name='chooseProcDefId']:checkbox:checked").each(function(item){
var list = $(this).val().split("^");
if(i==0){
objOld.procDefId=list[0];
objOld.name=procDefName+"_"+list[1];
objOld.sort = list[1];
}
if(i==1){
objNew.procDefId=list[0];
objNew.name=procDefName+"_"+list[1];
objNew.sort = list[1];
}
i++;
})
if(i<2){
alert("请选择两个需要对比的流程定义版本号!");
return false;
}else{
if(i>2){
alert("不能同时对比两个以上的历史版本");
return false;
}
}
if(objOld.sort > objNew.sort){
appObj.procDefIdOld=objNew.procDefId;
appObj.nameOld=objNew.name;
appObj.procDefIdNew=objOld.procDefId;
appObj.nameNew=objOld.name;
}else{
appObj.procDefIdOld=objOld.procDefId;
appObj.nameOld=objOld.name;
appObj.procDefIdNew=objNew.procDefId;
appObj.nameNew=objNew.name;
}
return appObj;
}
</script>
</head>
<body class="white-page">
<%@ include file="/commons/messages.jsp"%>
<form id="historyForm" name="historyForm"
action="${ctx}/procDefMgr/getHistoryProcessDefModel.do" method="post"
style="display: inline;">
<input type="hidden" name="procDefId" id="procDefId"/>
<input type="hidden" name="procDefName" id="procDefName" value="${result[0].procDefName}"/>
<div style="margin:5px;">
<button type="button" onclick="flowVersionCompare()" class="btn btn-xs btn btn-primary">流程版本对比<i class="ace-icon fa fa-search-plus bigger-110"></i></button>
</div>
<div class="main-container" id="main-container">
<div class="panel panel-primary">
<div class="panel-body" id="panel-body" style="padding:3px;">
<div class="row">
<div class="col-xs-12">
<div class="table-responsive">
<table id="sample-table-1"
class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="width: 25px;"></th>
<th>流程定义版本号</th>
<th>最后更新时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${result}" var="item"
varStatus="status">
<tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
<td><input type="checkbox" name="chooseProcDefId" id="chooseProcDefId"
value="${item.procDefId}^${item.version}"></td>
<td><a href="javascript:void(0);" onclick="changeImage('${item.procDefId}');">${item.version}</a></td>
<td><fmt:formatDate value="${item.pdCreateTime}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
<td>
<a href="javascript:void(0);" onclick="deleteDeploy('${ctx}/procDefMgr/history/delete.do','${item.procDefId}','${item.deploymentId}','true');">删除流程</a>&nbsp;&nbsp;
<c:if test="${ebpmAdmin}">
<a href="javascript:void(0)" onclick="showDiaLog('${ctx}/procDefMgr/editProcessFile.do?procDefId=${item.procDefId}','修改流程XML','1024px','600px');">修改流程XML</a>&nbsp;&nbsp;
<a onclick="showDiaLog('${ctx}/procDefMgr/config.do?procDefId=${item.procDefId}','配置','1224px','600px');" href="javascript:void(0);">配置流程</a>
<a href="javascript:void(0)" onclick="exportProcessAllFile('${item.procDefId}');">导出流程</a>&nbsp;&nbsp;
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id=con >
<span></span>
<ul id=tags>
<li class="selectTag">当前版本<span id="versionnumber">${result[0].version}</span>的流程图如下:</li>
</ul>
<div id=tagContent>
<div class="tagContent selectTag" id="tagContent0" >
<div id="processImage" style="padding-left: 30px; display: inline; float: left; margin:20px auto 0;position: relative;background:url('${ctx}/procDefMgr/resource.do?resourceType=image&procDefId=${result[0].procDefId}') no-repeat;width:${imageWidth+20}px; height:${imageHeight+30}px;">
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>