/**
 * tips提示功能详细用途的提示栏
 * @param _this
 * @param str
 */
function getTips(_this, str) {
    layer.tips(str, $(_this), {
        tips: [1, '#3595CC'],
        time: 0
    });
}

// 控制台输出方法
function log(object, alias) {
    var agmlen = arguments.length;
    true === alias ? layer.closeAll() : alias;
    for (var i = 0; i < agmlen; i++) {
        console.log("[type => " + typeof arguments[i] + ",content => " + arguments[i] + "]");
    }
}

// 删除节点
function remove_node(object) {
    var agmlen = arguments.length;
    for (var i = 0; i < agmlen; i++) {
        if (typeof arguments[i] == "object" && arguments[i] != "undefined") {
            arguments[i].remove();
        }
    }
}

// 阻止冒泡事件
function stopPropagation(e) {
    var ev = e || window.event;
    if (ev.stopPropagation) {
        ev.stopPropagation();
    } else if (window.event) {
        window.event.cancelBubble = true;//兼容IE
    }
};

/*初始化提示消息 例:msg("LLSL-Admin 欢迎你~");*/
function msg(str, icon, offset) {
    str = str == null ? "没有内容" : str;
    offset = offset == null ? "20px" : offset;
    if (icon == null || icon == "") {
        return layer.msg(str, {offset: offset});
    } else {
        return layer.msg(str, {icon: icon}, {offset: offset});
    }
}

// 自定义绑定事件方法
function bind_event(dom, fn, type, child,) {
    if (typeof dom == 'object' && dom != 'undefined') {
        type = type == null ? "click" : type;
        if (child != "" && child != 'object') {
            return dom.on(type, child, fn);
        } else {
            return dom.on(type, fn);
        }
    }
};

// 刷新页面
bind_event($(".refresh"), function () {
    window.location.reload();
});