1
zhang
2026-01-22 6876084ffc4a01c1eca6a609dec8c176efc59aae
zy-acs-cv/src/main/webapp/static/js/common.js
@@ -1,8 +1,8 @@
var baseUrl = "/xgmFlwcs";
var baseUrl = "/cv";
// 赋值
function setVal(el, val) {
    if (el.text() !== val){
    if (el.text() !== val) {
        el.html(val);
    }
}
@@ -13,7 +13,7 @@
var detailWidth = '90%';
// 非空判断
function isEmpty(obj){
function isEmpty(obj) {
    return typeof obj == "undefined" || obj == null || obj === "";
}
@@ -47,7 +47,7 @@
// 清理对象null值
function reObject(data) {
    for (var obj in data) {
        if (data[obj]===null){
        if (data[obj] === null) {
            delete data[obj];
        }
    }
@@ -64,25 +64,25 @@
}
// 权限
function limit(child){
    if (child == null){
function limit(child) {
    if (child == null) {
        child = false;
    }
    var param = (child?parent.window:window).location.href.split("?")[1];
    var param = (child ? parent.window : window).location.href.split("?")[1];
    if (null != param) {
        var resourceId = param.split("=")[1];
        $.ajax({
            url: baseUrl+"/power/menu/"+resourceId+"/auth",
            url: baseUrl + "/power/menu/" + resourceId + "/auth",
            headers: {'token': localStorage.getItem('token')},
            method: 'GET',
            async: false,
            success: function (res) {
                if (res.code === 200){
                    for(var i = 0, len = res.data.length; i < len; i++) {
                        (child?parent:window).$('#'+res.data[i].code).css("display", "inline-block");
                        (child?parent:window).$('.'+res.data[i].code).css("display", "inline-block");
                if (res.code === 200) {
                    for (var i = 0, len = res.data.length; i < len; i++) {
                        (child ? parent : window).$('#' + res.data[i].code).css("display", "inline-block");
                        (child ? parent : window).$('.' + res.data[i].code).css("display", "inline-block");
                    }
                } else if (res.code === 403){
                } else if (res.code === 403) {
                    window.location.href = baseUrl;
                } else {
                    layer.msg(res.msg)
@@ -92,7 +92,6 @@
    }
}
// http请求
@@ -137,11 +136,11 @@
                timeout: 10000,
                cache: false,
                success: function (res) {
                    if (res.code === 200){
                    if (res.code === 200) {
                        callback(res);
                    } else if (res.code === 403){
                        parent.location.href = baseUrl+"/login";
                    }  else {
                    } else if (res.code === 403) {
                        parent.location.href = baseUrl + "/login";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                },
@@ -170,11 +169,12 @@
    return null;
}
function getDateFormat(value){
function getDateFormat(value) {
    var date = new Date();// 获取当前时间
    date.setDate(date.getDate() + value);// 设置天数 -1 天
    return date.Format("MM-dd");
}
/**
 * 日期格式化
 */