processBar.js
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
function processBar(){
this._index = null;
this.showBar = function(){
this._index = load(2, {time: 10*1000});
/*$('#progress').attr('style','margin-bottom:0px;');*/
}
this.hideBar = function(){
if(this._index)
layer.close(this._index);
else
layer.closeAll('loading');
}
function load(icon,options){
// return layer.open($.extend({
// type: 3,
// icon: icon || 0,
// resize: false,
// shade: 0.05
// }, options));
return layer.msg('加载中', {
icon: 16
,time:10*1000
,shade: 0.01
});
}
}
//日期加上天数后的新日期.
function AddDays(date,days,suptotaltime){
var nd = new Date(date);
nd = nd.valueOf();
if(days && days!=""){
nd = nd + days * 24 * 60 * 60 * 1000+suptotaltime * 1000;
}
nd = new Date(nd);
//alert(nd.getFullYear() + "年" + (nd.getMonth() + 1) + "月" + nd.getDate() + "日");
var y = nd.getFullYear();
var m = nd.getMonth()+1;
var d = nd.getDate();
if(m <= 9) m = "0"+m;
if(d <= 9) d = "0"+d;
var cdate = y+"-"+m+"-"+d;
return cdate;
}
/**
* 从数据库查出总时限,并取消异步,返回到界面
* @param flowrevisionid
* @returns {String}
*/
function getTimelimit(flowrevisionid){
var timelimit=0;
//从数据库获取总时限(单位天数)
if(flowrevisionid!=null&&flowrevisionid!=""){
$.ajax({
type : "post",
url : global.contextPath + global.modelctls.flow.limitTime,
data : "flowrevisionid=" + flowrevisionid,
async : false,
success : function(result) {
timelimit = result;
}
});
}
return timelimit;
}
function getLastTaskOperation(instanceId){
var operation = null;
if(instanceId!=null&&instanceId!=""){
$.ajax({
type : "post",
url : global.contextPath + global.modelctls.flowEngine.task.getLastTaskOperation,
data : "instanceId=" + instanceId,
async : false,
success : function(result) {
operation = result;
}
});
}
return operation;
}