<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>流程列表</title>
|
<link href="../../../css/common.css" rel="stylesheet" type="text/css">
|
<link href="../../../css/control.css" rel="stylesheet" type="text/css"/>
|
<link href="../../../css/grid.css" rel="stylesheet" type="text/css">
|
|
<script src="../../../js/jquery-1.7.2.min.js"></script>
|
<script src="../../../js/foundation-2.0.js"></script>
|
<script src="../../../js/grid.js"></script>
|
|
<style>
|
.div_coming_label{ margin:30px; color:#808080; text-align:center;font-size: 22px;font-family: STHupo; }
|
.img_coming_icon{ display:block; margin:10px auto; width:128px; height:128px; }
|
</style>
|
|
<script type="text/javascript">
|
var grid;
|
|
function uploadModel(){
|
$("#input_file").click();
|
$("#input_commit").commit();
|
|
}
|
|
function collectFile(e){
|
var files = e.target.files || e.dataTransfer.files;
|
if(!files){return;}
|
fileUploader.uploadOneFile(files[0],0,1);
|
}
|
|
function downlad(){
|
var line = grid.getSelected();
|
var modelId = line.id;
|
if(modelId){
|
download_file("root/process/repository/getModelXml?modleId="+modelId);
|
}
|
}
|
|
function download_file(url) {
|
var iframe = document.createElement("iframe");
|
download_file.iframe = iframe;
|
document.body.appendChild(download_file.iframe);
|
download_file.iframe.src = url;
|
download_file.iframe.style.display = "none";
|
}
|
|
function suspensionModel(){
|
var line = grid.getSelected();
|
var modelId = line.id;
|
var issuspension = line.issuspension;
|
var type;
|
if(issuspension == "false"){
|
type = "suspend";
|
}else {
|
type = "active";
|
}
|
|
if (modelId){
|
var params = "modelId="+modelId+"&type="+type;
|
Server.call("root/process/repository/updateProcessDefStatus",params,function(callback){
|
alert(JSON.stringify(callback));
|
if(callback.success){
|
alert(callback.string);
|
grid.refresh();
|
}
|
});
|
}
|
else{
|
alert("当前model不存在");
|
}
|
}
|
|
function deployModel() {
|
var line = grid.getSelected();
|
var modelId = line.id;
|
if (modelId){
|
Server.call("root/process/repository/deployModel","modelId="+modelId,function(callback){
|
alert(JSON.stringify(callback));
|
if(callback.success){
|
alert(callback.string);
|
grid.refresh();
|
}
|
});
|
}
|
else{
|
alert("当前model不存在");
|
}
|
|
}
|
|
function startprocess(){
|
var line = grid.getSelected();
|
var isdeploymented = line.isdeploymented;
|
if (isdeploymented == "true"){
|
var deploymentid = line.category;
|
setLocalData("deploymentid",deploymentid);
|
setLocalData("modelid",line.id);
|
location.href = "../form.html?" + new Date().getTime();
|
}
|
else {
|
alert("model未部署请先部署model");
|
}
|
}
|
|
function upload(){
|
var file = document.getElementById("input_file").files[0];
|
var fileName = file.name.toLowerCase();
|
// only upload zip,bar,bpmn
|
if(fileName.indexOf('zip')== -1 && fileName.indexOf('bar')== -1 && fileName.indexOf('bpmn')== -1){
|
alert("仅能上传zip,bar,bpmn文件");
|
}
|
|
uploadFlow(file);
|
}
|
|
function uploadFlow(data){
|
var fileName = data.name.toLowerCase();
|
Dialog.confirm("信息提示", "确定上载[" + fileName + "]中的数据?",function(result){
|
if(result){
|
var formData = new FormData();
|
formData.append("file",data);
|
$.ajax({
|
url : "root/process/repository/uploadProcess",
|
type : "POST",
|
data : $( '#postForm').serialize(),
|
success : function(data) {
|
$( '#serverResponse').html(data);
|
},
|
error : function(data) {
|
$( '#serverResponse').html(data.status + " : " + data.statusText + " : " + data.responseText);
|
}
|
});
|
}
|
});
|
}
|
|
function Query(){
|
param = filter.toFilter();
|
var url = "root/data/procedure/getSalesflow/pageno=1&pagesize=10&" + param;
|
grid.setURL(url);
|
}
|
|
$(document).ready(function() {
|
|
fileUploader = new FileUploader({
|
sendData: function(xhr, formdata, file, index, count){
|
formdata.append("fileList", file);
|
var url = "";
|
xhr.open("POST", url, true);
|
xhr.send(formdata);
|
},
|
onSuccess: function(success, dataline, result, callNext){
|
}
|
|
});
|
$("#input_file").bind("input",function(e){
|
|
});
|
|
//Server.call("root/process/repository/uploadProcess",null,function(callback){});
|
|
grid = new $.fm.Grid({
|
element: "sheet",
|
url: "root/process/repository/getProcessList?pageno=1&pagesize=10",
|
showPage: true,
|
limit: 12,
|
columns: [
|
{field: "id", caption: "编号", width: 100},
|
{field: "name", caption: "名称", width: 100},
|
{field: "category", caption: "类别", width: 100},
|
{field: "version", caption: "版本", width: 100},
|
{field: "createtime", caption: "创建时间", width: 180, align: "left"},
|
{field: "lastupdatetime", caption: "最后更新时间", width: 180, align: "left"},
|
{field: "isdeploymented", caption: "是否部署", width: 100, align: "left"},
|
{field: "deploymenttime", caption: "部署时间", width: 180, align: "right"},
|
{field: "description", caption: "描述", width: 100, align: "right"},
|
{field: "issuspension", caption: "挂起", width: 100, align: "right"}
|
],
|
onSelect:function(allSelect,SelectedInfo){
|
if(!SelectedInfo){
|
$("#suspension_model").html("挂起");
|
return;
|
}
|
|
if(SelectedInfo.issuspension == "true"){
|
$("#suspension_model").html("激活");
|
}else{
|
$("#suspension_model").html("挂起");
|
}
|
|
}
|
});
|
});
|
</script>
|
</head>
|
|
<body>
|
|
<div id="sheet" style="margin: 0px 15px"></div>
|
|
<div style="height: 30px; line-height: 30px; margin-top: 15px;" align="center">
|
<div class="btn btn-green" onclick="startprocess();">启动</div>
|
<div class="btn btn-green" onclick="deployModel();">部署</div>
|
<div class="btn btn-green" onclick="suspensionModel();" id="suspension_model">挂起</div>
|
<div class="btn btn-green" onclick="downlad();" >下载</div>
|
<div class="btn btn-green" onclick="upload();" style="margin-left: 30px;">上载</div>
|
<div id="fileUploader" >
|
|
<input id="input_file" type="file" size="30" >
|
</div>
|
|
</div>
|
</body>
|
</html>
|