$(function () { const axiosConf = { url: config_serverIp + "/dataex/report/QuerySimpleGP", method: 'post' }; // 标题增加年份 l1() function l1() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "stage_interact_num_month_all", "query_param": [ "1", "1", "2021", "10", "1", "1", "1", "1", "2021", "10", "1", "1", "1", "1", "2021", "10", "1", "1", "1", "1", "2021", "10", "1", "1", "1", "1", "2021", "10", "1", "1" ] }, "query_cache": 0, "query_count": [ "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: $("#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() function l2() { axios({ ...axiosConf, data: { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { "query_id": "stage_res_grand_total_all", "query_param": [ "4", "4", "2021", "10", "4", "4" ] }, "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); let nowTotal = 0; let total = 0 resData.map((e, i) => { console.log(e); 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) console.log(nowTotal, 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) let html = "" resData.map((e, i) => { html += `
${e.total}
${e.item}
` }) $("#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; } }) // console.log(resData[0]["no"]==3); // $("#r1total").html(resData["no"][0].total) // $("#dayMax").html(resData[0].total) // $("#monthMax").html(resData[1].total) // $("#dayAverage").html(resData[2].total) // $("#monthAverage").html(resData[3].total) }) } 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 = []; 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 == "教师") { const w = (item.total / allNum[0] * 100).toFixed(2) + "%" $("#wenzhangTNum").html(item.total); $("#wenzhangTAcc").html(w); $("#wenzhangTloading").animate({ width: w }); } if (item.social_type == 1 && item.social_name == "学生") { const w = (item.total / allNum[0] * 100).toFixed(2) + "%" $("#wenzhangSNum").html(item.total) $("#wenzhangSAcc").html((item.total / allNum[0] * 100).toFixed(2) + "%"); $("#wenzhangSloading").animate({ width: w }); } if (item.social_type == 2 && item.social_name == "教师") { const w = (item.total / allNum[1] * 100).toFixed(2) + "%" $("#xiangceTNum").html(item.total); $("#xiangceTAcc").html(w); $("#xiangceTloading").animate({ width: w }); } if (item.social_type == 2 && item.social_name == "学生") { const w = (item.total / allNum[1] * 100).toFixed(2) + "%" $("#xiangceSNum").html(item.total) $("#xiangceSAcc").html((item.total / allNum[0] * 100).toFixed(2) + "%"); $("#xiangceSloading").animate({ width: w }); } if (item.social_type == 4 && item.social_name == "教师") { const w = (item.total / allNum[2] * 100).toFixed(2) + "%" $("#liuyanTNum").html(item.total); $("#liuyanTAcc").html(w); $("#liuyanTloading").animate({ width: w }); } if (item.social_type == 4 && item.social_name == "学生") { const w = (item.total / allNum[2] * 100).toFixed(2) + "%" $("#liuyanSNum").html(item.total) $("#liuyanSAcc").html((item.total / allNum[0] * 100).toFixed(2) + "%"); $("#liuyanSloading").animate({ width: w }); } if (item.social_type == 5 && item.social_name == "教师") { const w = (item.total / allNum[3] * 100).toFixed(2) + "%" $("#huodongTNum").html(item.total); $("#huodongTAcc").html(w); $("#huodongTloading").animate({ width: w }); } if (item.social_type == 5 && item.social_name == "学生") { const w = (item.total / allNum[3] * 100).toFixed(2) + "%" $("#huodongSNum").html(item.total) $("#huodongSAcc").html((item.total / allNum[0] * 100).toFixed(2) + "%"); $("#huodongSloading").animate({ width: w }); } }) }) } })