global.js
1.23 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
//html页面之间用来传递参数的对象
var paramObject = {};
/**
* 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;
}
function addHead(title1, title2) {
var str = "<div class='pageheader'>";
str += "<div class='media'>";
str += "<div class='pageicon pull-left'>";
str += "<i class='fa fa-th-list'></i>";
str += "</div>";
str += "<div class='media-body' style=\"font-family: 'microsoft yahei'\">";
str += "<ul class='breadcrumb'>";
str += "<li><a href=''><i class='glyphicon glyphicon-home'></i></a></li>";
str += "<li><a href=''>"+ title1 +"</a></li>";
str += "<li>"+ title2 +"</li>";
str += "</ul>";
str += "<div style='margin-top: 4px'>";
str += "<h4 style='line-height: 30px;font-size: 24px'>";
str += title2;
str += "</h4>";
str += "</div>";
str += "</div>";
str += "</div>";
str += "</div>";
return str;
}