puzhibing
2024-03-01 c85b23cb867d4a0cebf2f22f3dd3211566cde2ea
cloud-server-management/src/main/webapp/static/modular/system/tHonor/THonor.js
@@ -21,6 +21,12 @@
    },type4:{
        type:null,
        condition:[]
    },type5:{
        type:null,
        condition:[]
    },type6:{
        type:null,
        condition:[]
    }
};
THonor.edit = function(){
@@ -70,6 +76,28 @@
        }
    }
    var input5 = document.querySelectorAll('#input5');
    for (let i = 0; i < input5.length-1; i++) {
        data1.type5.condition.push(input5[i].value);
        if (Number(input5[i].value)>Number(input5[i+1].value)){
            return Feng.error("赢家等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1));
        }
        if (i === input5.length-1-1){
            data1.type5.condition.push(input5[i+1].value);
        }
    }
    var input6 = document.querySelectorAll('#input6');
    for (let i = 0; i < input6.length-1; i++) {
        data1.type6.condition.push(input6[i].value);
        if (Number(input6[i].value)>Number(input6[i+1].value)){
            return Feng.error("次数等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1));
        }
        if (i === input6.length-1-1){
            data1.type6.condition.push(input6[i+1].value);
        }
    }
    $.ajax({
        url: Feng.ctxPath + "/tHonor/edit",
        type: "POST",
@@ -80,6 +108,8 @@
            data1.type2.condition= [];
            data1.type3.condition= [];
            data1.type4.condition= [];
            data1.type5.condition= [];
            data1.type6.condition= [];
            Feng.success("修改成功!");
        },
        error: function(xhr, status, error) {
@@ -87,6 +117,8 @@
            data1.type2.condition= [];
            data1.type3.condition= [];
            data1.type4.condition= [];
            data1.type5.condition= [];
            data1.type6.condition= [];
            var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!";
            Feng.error(errorMessage);
        }
@@ -99,12 +131,16 @@
    var tableContainer2 = document.getElementById('table2');
    var tableContainer3 = document.getElementById('table3');
    var tableContainer4 = document.getElementById('table4');
    var tableContainer5 = document.getElementById('table5');
    var tableContainer6 = document.getElementById('table6');
// 初始化四个表格
    var table1 = createTable(['等级', '上课打卡次数'], tableContainer1);
    var table2 = createTable(['等级', '赛事报名次数'], tableContainer2);
    var table3 = createTable(['等级', '预约场地次数'], tableContainer3);
    var table4 = createTable(['等级', '作业、任务完成次数'], tableContainer4);
    var table5 = createTable(['等级', '社区世界杯胜利场次'], tableContainer5);
    var table6 = createTable(['等级', '社区世界杯参与场次'], tableContainer6);
    var ajax = new $ax(Feng.ctxPath + "/tHonor/list", function(data){
        populateTable(table1, data[1],1);
@@ -115,6 +151,10 @@
        data1.type3.type = data[3][1].type;
        populateTable(table4, data[4],4);
        data1.type4.type = data[4][1].type;
        populateTable(table5, data[5],5);
        data1.type5.type = data[5][1].type;
        populateTable(table6, data[6],6);
        data1.type6.type = data[6][1].type;
    },function(data){
        Feng.error("获取失败!" + data.responseJSON.message + "!");
    });