global.js
1.53 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
$.ajaxSetup({
type: "POST",
complete : function(XMLHttpRequest, textStatus) {
var status = XMLHttpRequest.status;
if (status == 200) {
return;
}
if (status == 900) {
//数据库超时
$.messageAlert("错误", "查询超时了");
} else if (status == 901) {
//session超时
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
backdrop : "static",
title : "错误",
content : "登录超时了!",
buttons : [{
text : "重新登录",
className : "btn-danger",
onclick : function() {
window.location.href = contextPath + "/";
}
}]
});
} else {
$.messageAlert("错误", "操作失败");
}
}
});
//操作符
var opMap = {
"=" : "等于",
">" : "大于",
"<" : "小于",
">=" : "大于等于",
"<=" : "小于等于",
"<>" : "不等于",
"prefix" : "前缀匹配",
"postfix" : "后缀匹配",
"contain" : "包含",
"not_contain" : "不包含"
};
//全局的panel的样式
var panelStyle = "panel-primary";
//全局的按钮的样式
var btnStyle = "btn-primary";
//全局用来html传递参数使用
var paramObj = {};
/**
* html中传递参数,获取方法
* @param key
* @returns
*/
function getQueryStr(key){
var svalue = window.location.search.match(new RegExp("[\?\&]" + key + "=([^\&]*)(\&?)","i"));
var str = svalue ? svalue[1] : svalue;
return str == null ? "" : str;
}
//通用的LoadFilter
function defaultLoadFilter(data) {
if (!data || data.code != 200) {
return [];
}
return data.data;
}
var submitFileParamObj = {};