$(function () { const axiosConf = { url: config_serverIp + "/dataex/report/QuerySimpleGP", method: 'post' }; let l1_xueduan = "0" let l2_xueduan = "0" let l1xueduan = "0" // 标题增加年份 //学段切换 $('#l1_xueduan').on('change', function () { l1xueduan = $(this).val() + "" l1(l1xueduan) }) l1(l1xueduan) function l1(xueduan) { time = "day" if (time == "all" || time == "month") { query_id = "student_use_num_year" query_param = [xueduan, xueduan, nowYear, xueduan, xueduan, xueduan, xueduan, nowYear, xueduan, xueduan, xueduan, xueduan, nowYear, xueduan, xueduan, xueduan, xueduan, nowYear, xueduan, xueduan, xueduan, xueduan, nowYear, xueduan, xueduan] } else if (time == "day") { query_id = "student_use_num_month" query_param = [xueduan, xueduan, nowYear, nowMonth, xueduan, xueduan, xueduan, xueduan, nowYear, nowMonth, xueduan, xueduan, xueduan, xueduan, nowYear, nowMonth, xueduan, xueduan, xueduan, xueduan, nowYear, nowMonth, xueduan, xueduan, xueduan, xueduan, nowYear, nowMonth, xueduan, xueduan] } axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": query_id, "query_param": query_param }, "query_cache": 0, "query_count": [ "total" ], "query_format": "json", "query_group": [ "subname", "item" ] } }).then((response) => { const resData = JSON.parse(response.data.result) console.log(resData, 'l1'); resData.map((e, index) => { switch (e.no) { case 1: $("#kttiwenmonth").html(e.total) break; case 2: $("#kttiwentotal").html(e.total) break; case 3: $("#ktqiangdamonth").html(e.total) break; case 4: $("#ktqiangdatotal").html(e.total) break; case 5: $("#kttoupiaomonth").html(e.total) break; case 6: $("#kttoupiaototal").html(e.total) break; case 7: $("#kttupianmonth").html(e.total) break; case 8: $("#kttupiantotal").html(e.total) break; case 9: $("#ktnowtotal").html(e.total) break; case 10: $("#kttotal").html(e.total) break; default: break; } }) }) } $('#l2_xueduan').on('change', function () { l2_xueduan = $(this).val() + "" l2(l2_xueduan) }) l2(l2_xueduan) function l2(xueduan) { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "stage_res_grand_total_all", "query_param": [ xueduan, xueduan, "2021", "10", xueduan, xueduan ] }, "query_cache": 0, "query_count": [ "sub_total", "total" ], "query_format": "json", "query_group": [ "type_name" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) console.log(resData, 'l2'); let nowTotal = 0; let total = 0 resData.map((e, i) => { nowTotal += Number(e.sub_total) total += Number(e.total) if (e.type_name == "教学资源") { $("#zyjxtotalmonth").html(e.sub_total) $("#zyjxtotal").html(e.total) } if (e.type_name == "微课资源") { $("#zywktotalmonth").html(e.sub_total) $("#zywktotal").html(e.total) } }) // 总数 $("#zynowtotal").html(nowTotal) $("#zytotal").html(total) }) } l3(); function l3() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "social_general_num_all", "query_param": [ ] }, "query_cache": 0, "query_count": [ "total" ], "query_format": "json", "query_group": [ "topic_name" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) $("#l3Hot").html(resData[6].total) $("#l3Total").html(resData[7].total) let html = "" const total = resData[resData.length - 1].total arr = resData.filter((value, index, resData) => { return index < 6 }) arr.map((res, index) => { // tobal = resData[resData.length-1] let percen = (res.total / total).toFixed(2) * 100 * 0.024 let percen1 = (res.total / total).toFixed(2) * 100 + "%" html += `
${res.topic_name}
${res.total} / ${percen1}
` if (index > 3) { return; } }) $("#zthdjcNr").html(html) }) } c1() function c1() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "platform_general_num_all", "query_param": [ "2021", "10" ] }, "query_cache": 0, "query_count": [ "total" ], "query_format": "json", "query_group": [ "item" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) console.log(resData, 'c1'); let html = "" resData.map((e, i) => { // html += `
// ${e.total}
${e.item} //
` switch (e.no) { case 1: $("#c1dqxxzs").html(e.total) break; case 2: $("#c1dqxszs").html(e.total) break; case 3: $("#c1dqjszs").html(e.total) break; case 4: $("#c1byfwzrs").html(e.total) break; default: break; } }) // $("#c1").html(html) }) } c2() function c2() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "liveness_today_all", "query_param": [ "2021", "10", "2021", "10", "2021", "10", "2021", "10" ] }, "query_cache": 0, "query_count": [ "sub_total", "total" ], "query_format": "json", "query_group": [ "item" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) $("#mapLogin").html(resData[0].total) $("#mapUpload").html(resData[1].total) $("#mapActivity").html(resData[2].total) $("#mapBrowse").html(resData[3].total) }) } c3() function c3() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "res_class_social_num_all", "query_param": [ "2021", "10", "2021", "10", "2021", "10", "2021", "10", "2021", "10", "2021", "10" ] }, "query_cache": 0, "query_count": [ "sub_total", "total" ], "query_format": "json", "query_group": [ "subname", "item" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) resData.map((e, index) => { switch (e.no) { case 1: $("#zyupload_monthnum").html(e.total) break; case 2: $("#zyupload_total").html(e.total) break; case 3: $("#ketang_monthnum").html(e.total) break; case 4: $("#ketang_total").html(e.total) break; case 5: $("#kongjian_monthnum").html(e.total) break; case 6: $("#kongjian_total").html(e.total) break; case 7: $("#zydown_monthnum").html(e.total) break; case 8: $("#zydown_total").html(e.total) break; case 9: $("#xtzx_monthnum").html(e.total) break; case 10: $("#xtzx_total").html(e.total) break; case 11: $("#huodong_monthnum").html(e.total) break; case 12: $("#huodong_total").html(e.total) break; default: break; } }) }) } r1() function r1() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "pv_month_year_all", "query_param": [ ] }, "query_cache": 0, "query_count": [ "total" ], "query_format": "json", "query_group": [ "item" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) resData.map((e, index) => { switch (e.no) { case 2: $("#monthMax").html(e.total) break; case 3: $("#yearMax").html(e.total) break; case 4: $("#monthAverage").html(e.total) break; case 5: $("#yearAverage").html(e.total) break; case 7: $("#r1total").html(e.total) break; default: break; } }) }) } r2("all"); $('#r2_all').on('click', function () { $('#r2_time').children().removeClass("act") $('#r2_all').addClass("act") r2("all"); }) $('#r2_month').on('click', function () { $('#r2_time').children().removeClass("act") $('#r2_month').addClass("act") r2("month"); }) $('#r2_day').on('click', function () { $('#r2_time').children().removeClass("act") $('#r2_day').addClass("act") r2("day"); }) function r2(time) { if (time === "all") { query_id = "post_total_all" query_param = [] } else if (time === "month") { query_id = "post_total_month" query_param = [nowYear] } else if (time === "day") { query_id = "post_total_day" query_param = [nowYear, nowMonth] } axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": query_id, "query_param": query_param }, "query_cache": 0, "query_count": [ "total" ], "query_format": "json", "query_group": [ "social_typename", "social_name" ] } }) .then((response) => { const resData = JSON.parse(response.data.result) // 获取学科 const xueke = []; console.log(resData, 'resDataresData'); resData.map((item) => { xueke.push({ id: item.social_type, name: item.social_typename, total: item.total }); }) // 去重 xuekeFil = xueke.filter((item, index) => { return xueke.findIndex(_item => _item.id == item.id) == index; }) let allNum = [] xuekeFil.map((e, index) => { let num = 0 xuekeFil.children = [] resData.map((item, i) => { if (item.social_typename == e.name) { num += Number(item.total) } }) $("#" + "num" + Number(index + 1)).html(num) allNum.push(num) xuekeFil[index].total = num // $("#" + "num" + Number(index + 1)).html(num) }) resData.map((item) => { if (item.social_type == 1 && item.social_name == "教师") { let w = allNum[0] ? (item.total / allNum[0] * 100).toFixed(2) : 0 $("#wenzhangTNum").html(item.total); $("#wenzhangTAcc").html(w + "%"); $("#wenzhangTloading").animate({ width: w + "%" }); } if (item.social_type == 1 && item.social_name == "学生") { let w = allNum[0] ? (item.total / allNum[0] * 100).toFixed(2) : 0 $("#wenzhangSNum").html(item.total) $("#wenzhangSAcc").html(w + "%"); $("#wenzhangSloading").animate({ width: w + "%" }); } if (item.social_type == 2 && item.social_name == "教师") { let w = allNum[1] ? (item.total / allNum[1] * 100).toFixed(2) : 0 $("#xiangceTNum").html(item.total); $("#xiangceTAcc").html(w + "%"); $("#xiangceTloading").animate({ width: w + "%" }); } if (item.social_type == 2 && item.social_name == "学生") { let w = allNum[1] ? (item.total / allNum[1] * 100).toFixed(2) : 0 $("#xiangceSNum").html(item.total) $("#xiangceSAcc").html(w + "%"); $("#xiangceSloading").animate({ width: w + "%" }); } if (item.social_type == 4 && item.social_name == "教师") { let w = allNum[2] ? (item.total / allNum[2] * 100).toFixed(2) : 0 $("#liuyanTNum").html(item.total); $("#liuyanTAcc").html(w + "%"); $("#liuyanTloading").animate({ width: w + "%" }); } if (item.social_type == 4 && item.social_name == "学生") { let w = allNum[2] ? (item.total / allNum[2] * 100).toFixed(2) : 0 $("#liuyanSNum").html(item.total) $("#liuyanSAcc").html(w + "%"); $("#liuyanSloading").animate({ width: w + "%" }); } if (item.social_type == 5 && item.social_name == "教师") { let w = allNum[3] ? (item.total / allNum[3] * 100).toFixed(2) : 0 $("#huodongTNum").html(item.total); $("#huodongTAcc").html(w + "%"); $("#huodongTloading").animate({ width: w + "%" }); } if (item.social_type == 5 && item.social_name == "学生") { let w = allNum[3] ? (item.total / allNum[3] * 100).toFixed(2) : 0 $("#huodongSNum").html(item.total) $("#huodongSAcc").html(w + "%"); $("#huodongSloading").animate({ width: w + "%" }); } }) }) } })