global.js 1.23 KB
//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;
}