From a3eeca08bcc9fcfbfff8ad3962cb0edff26fee79 Mon Sep 17 00:00:00 2001 From: gongdi <410827992@qq.com> Date: Mon, 14 Nov 2022 13:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=98=E6=BD=AD=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=20=E7=BB=9F=E8=AE=A1=E5=B9=B4=E6=8A=A5=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boardersInfo.html | 1 + classesOf.html | 1 + fulltimeTeachersAge.html | 1 + fulltimeTeachersRecord.html | 1 + fulltimeTeachersTitle.html | 1 + js/behindChildrenInfo.js | 50 +++++++++++++++++++++--- js/boardersInfo.js | 8 ++++ js/classesOf.js | 9 +++++ js/fulltimeTeachersAge.js | 8 ++++ js/fulltimeTeachersNum.js | 52 +++++++++++++++++++------ js/fulltimeTeachersRecord.js | 7 ++++ js/fulltimeTeachersTitle.js | 8 ++++ js/menu.js | 2 +- js/schoolArea.js | 57 ++++++++++++++++++++++++---- js/schoolAssistants.js | 61 +++++++++++++++++++++++++----- js/schoolCovers.js | 60 +++++++++++++++++++++++------ js/schoolSizeInfo.js | 9 +++++ js/schoolSports.js | 61 +++++++++++++++++++++++++----- js/teachingStaffRecent3Years.js | 7 ---- js/teachingStaffRecentUaR3Years.js | 20 +--------- js/trailingChildrenInfo.js | 8 ++++ schoolArea.html | 4 +- schoolAssistants.html | 4 +- schoolCovers.html | 4 +- schoolSizeInfo.html | 1 + schoolSports.html | 4 +- trailingChildrenInfo.html | 1 + 27 files changed, 361 insertions(+), 89 deletions(-) diff --git a/boardersInfo.html b/boardersInfo.html index 1da2987..9e9fc76 100644 --- a/boardersInfo.html +++ b/boardersInfo.html @@ -113,6 +113,7 @@
+ diff --git a/classesOf.html b/classesOf.html index dfc4089..17e7e09 100644 --- a/classesOf.html +++ b/classesOf.html @@ -94,6 +94,7 @@
+ diff --git a/fulltimeTeachersAge.html b/fulltimeTeachersAge.html index 4a2424f..dd4e42d 100644 --- a/fulltimeTeachersAge.html +++ b/fulltimeTeachersAge.html @@ -91,6 +91,7 @@
+ diff --git a/fulltimeTeachersRecord.html b/fulltimeTeachersRecord.html index a88b070..be16e57 100644 --- a/fulltimeTeachersRecord.html +++ b/fulltimeTeachersRecord.html @@ -91,6 +91,7 @@
+ diff --git a/fulltimeTeachersTitle.html b/fulltimeTeachersTitle.html index 04dd9de..db21de1 100644 --- a/fulltimeTeachersTitle.html +++ b/fulltimeTeachersTitle.html @@ -91,6 +91,7 @@
+ diff --git a/js/behindChildrenInfo.js b/js/behindChildrenInfo.js index 65341a8..eddbd5c 100644 --- a/js/behindChildrenInfo.js +++ b/js/behindChildrenInfo.js @@ -71,14 +71,30 @@ $(function () { var data = resport.result; var indata = JSON.parse(data); var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; indata.forEach((item, index) => { + + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + if (item.studentno == 0) { + childClasses.push(0); + } else { + childClasses.push(Math.ceil(((item.total / item.studentno).toFixed(4)) * 100)); + } + + } + if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.studentno == 0) { smallClasses.push(0); } else { @@ -87,6 +103,9 @@ $(function () { } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.studentno == 0) { bigClasses.push(0); } else { @@ -102,8 +121,9 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: `${smallClasses[index]}%`, - bigClasses: `${bigClasses[index]}%`, + childClasses:`${childClasses[index]?childClasses[index]:0}%`, + smallClasses: `${smallClasses[index]?smallClasses[index]:0}%`, + bigClasses: `${bigClasses[index]?bigClasses[index]:0}%`, }) }); @@ -124,7 +144,7 @@ $(function () { }, legend: { - data: ['小学', '初中'], + data: ['幼儿园','小学', '初中'], textStyle: { color: '#fff' } @@ -191,6 +211,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -244,13 +282,13 @@ $(function () { $('#behindTable').empty(); $('#behindTable').append( - '序号县域名称小学初中' + '序号县域名称幼儿园小学初中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#behindTable').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" ) }) diff --git a/js/boardersInfo.js b/js/boardersInfo.js index 1ef9baf..8e27b36 100644 --- a/js/boardersInfo.js +++ b/js/boardersInfo.js @@ -46,6 +46,14 @@ $(function () { var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/js/classesOf.js b/js/classesOf.js index f5f5a1d..3e6ba2a 100644 --- a/js/classesOf.js +++ b/js/classesOf.js @@ -28,6 +28,14 @@ $(function () { var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); @@ -78,6 +86,7 @@ $(function () { var data = resport.result; var indata = JSON.parse(data); + console.log(indata) var nameData = []; var smallClasses = []; var bigClasses = []; diff --git a/js/fulltimeTeachersAge.js b/js/fulltimeTeachersAge.js index 6302a97..21d4434 100644 --- a/js/fulltimeTeachersAge.js +++ b/js/fulltimeTeachersAge.js @@ -44,6 +44,14 @@ $(function () { var tableData = []; var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableData = []; + echartSizeInfo(config_now_year); + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/js/fulltimeTeachersNum.js b/js/fulltimeTeachersNum.js index 96318e3..e2843ef 100644 --- a/js/fulltimeTeachersNum.js +++ b/js/fulltimeTeachersNum.js @@ -68,23 +68,36 @@ $(function () { var data = resport.result; var indata = JSON.parse(data); - var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; var sbigClasser = []; indata.forEach((item, index) => { - + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + childClasses.push(item.total); + } if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } smallClasses.push(item.total); } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } bigClasses.push(item.total); } if (item.stage === '高中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } sbigClasser.push(item.total) } @@ -94,14 +107,13 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: smallClasses[index], - bigClasses: bigClasses[index], - sbigClasser: sbigClasser[index], + childClasses:childClasses[index]?childClasses[index]:0, + smallClasses: smallClasses[index]?smallClasses[index]:0, + bigClasses: bigClasses[index]?bigClasses[index]:0, + sbigClasser: sbigClasser[index]?sbigClasser[index]:0, }) }); - - // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echartTeacherNum')); // 专任教师数量情况柱状图 @@ -116,7 +128,7 @@ $(function () { }, legend: { - data: ['小学', '初中', '高中'], + data: ['幼儿园','小学', '初中', '高中'], textStyle: { color: '#fff' } @@ -183,6 +195,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -254,13 +284,13 @@ $(function () { $('#teacherNumTable').empty(); $('#teacherNumTable').append( - '序号县域名称小学初中高中' + '序号县域名称幼儿园小学初中高中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#teacherNumTable').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" ) }) diff --git a/js/fulltimeTeachersRecord.js b/js/fulltimeTeachersRecord.js index 0ab96ed..15071e9 100644 --- a/js/fulltimeTeachersRecord.js +++ b/js/fulltimeTeachersRecord.js @@ -44,6 +44,13 @@ $(function () { var tableDate = []; var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + }) $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/js/fulltimeTeachersTitle.js b/js/fulltimeTeachersTitle.js index 2257e96..b025954 100644 --- a/js/fulltimeTeachersTitle.js +++ b/js/fulltimeTeachersTitle.js @@ -44,6 +44,14 @@ $(function () { var tableDate = []; var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/js/menu.js b/js/menu.js index b519a58..45d6f4f 100644 --- a/js/menu.js +++ b/js/menu.js @@ -5,7 +5,7 @@ $(function () { var school_id = GetQueryString('school_id') var school_name = GetQueryString('school_name') var year = GetQueryString('year') ? "year=" + GetQueryString('year') : "" - console.log(area_name, school_id, school_name, pageIndex) + var menu_list = document.querySelector('#menu_list'); diff --git a/js/schoolArea.js b/js/schoolArea.js index db86cca..af820ba 100644 --- a/js/schoolArea.js +++ b/js/schoolArea.js @@ -65,15 +65,31 @@ $(function () { var data = resport.result; var indata = JSON.parse(data); - + console.log(indata) var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; var sbigClasser = []; indata.forEach((item, index) => { + + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + if (item.total == 0) { + childClasses.push(0); + } else { + // smallClasses.push(Math.round(((item.studentno / item.total).toFixed(4)) * 100)); + childClasses.push((item.total / item.studentno).toFixed(1)); + } + + } if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { smallClasses.push(0); } else { @@ -83,6 +99,9 @@ $(function () { } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { bigClasses.push(0); } else { @@ -92,6 +111,9 @@ $(function () { } if (item.stage === '高中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { sbigClasser.push(0); } else { @@ -112,9 +134,10 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: `${smallClasses[index]}`, - bigClasses: `${bigClasses[index]}`, - sbigClasser: `${sbigClasser[index]}`, + childClasses:`${childClasses[index]?childClasses[index]:0}`, + smallClasses: `${smallClasses[index]?smallClasses[index]:0}`, + bigClasses: `${bigClasses[index]?bigClasses[index]:0}`, + sbigClasser: `${sbigClasser[index]?sbigClasser[index]:0}`, }) }); @@ -132,7 +155,7 @@ $(function () { }, legend: { - data: ['小学', '初中', '高中'], + data: ['幼儿园', '小学', '初中', '高中'], textStyle: { color: '#fff' } @@ -199,6 +222,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -270,13 +311,13 @@ $(function () { $('#schoolAreaTable').empty(); $('#schoolAreaTable').append( - '序号县域名称小学初中高中' + '序号县域名称幼儿园小学初中高中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#schoolAreaTable').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" ) }) diff --git a/js/schoolAssistants.js b/js/schoolAssistants.js index 331356d..459c54c 100644 --- a/js/schoolAssistants.js +++ b/js/schoolAssistants.js @@ -64,16 +64,34 @@ $(function () { }), function (resport) { var data = resport.result; - var indata = JSON.parse(data); - + var indata = []; + if(data && data !== ""){ + indata = JSON.parse(data); + } var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; var sbigClasser = []; indata.forEach((item, index) => { + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + if (item.total == 0) { + childClasses.push(0); + } else { + // smallClasses.push(Math.round(((item.studentno / item.total).toFixed(4)) * 100)); + childClasses.push((item.total / item.studentno).toFixed(1)); + } + + } + if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { smallClasses.push(0); } else { @@ -83,6 +101,9 @@ $(function () { } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { bigClasses.push(0); } else { @@ -92,6 +113,9 @@ $(function () { } if (item.stage === '高中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { sbigClasser.push(0); } else { @@ -113,9 +137,10 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: `${smallClasses[index]}`, - bigClasses: `${bigClasses[index]}`, - sbigClasser: `${sbigClasser[index]}`, + childClasses:`${childClasses[index]?childClasses[index]:0}`, + smallClasses: `${smallClasses[index]?smallClasses[index]:0}`, + bigClasses: `${bigClasses[index]?bigClasses[index]:0}`, + sbigClasser: `${sbigClasser[index]?sbigClasser[index]:0}`, }) }); @@ -133,7 +158,7 @@ $(function () { }, legend: { - data: ['小学', '初中', '高中'], + data: ['幼儿园', '小学', '初中', '高中'], textStyle: { color: '#fff' } @@ -201,6 +226,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -274,13 +317,13 @@ $(function () { $('#schoolSportsAssistants').empty(); $('#schoolSportsAssistants').append( - '序号县域名称小学初中高中' + '序号县域名称幼儿园小学初中高中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#schoolSportsAssistants').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" ) }) diff --git a/js/schoolCovers.js b/js/schoolCovers.js index 471fd51..90b3892 100644 --- a/js/schoolCovers.js +++ b/js/schoolCovers.js @@ -67,16 +67,31 @@ $(function () { }), function (resport) { var data = resport.result; var indata = JSON.parse(data); - console.log(indata) - var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; var sbigClasser = []; indata.forEach((item, index) => { + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + if (item.total == 0) { + childClasses.push(0); + } else { + // smallClasses.push(Math.round(((item.studentno / item.total).toFixed(4)) * 100)); + + childClasses.push((item.total / item.studentno).toFixed(1)); + } + + } + if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { smallClasses.push(0); } else { @@ -87,6 +102,9 @@ $(function () { } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { bigClasses.push(0); } else { @@ -96,7 +114,9 @@ $(function () { } if (item.stage === '高中') { - console.log(item.gatherregionc, item.total) + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { sbigClasser.push(0); } else { @@ -119,9 +139,10 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: `${smallClasses[index]}`, - bigClasses: `${bigClasses[index]}`, - sbigClasser: `${sbigClasser[index]}`, + childClasses:`${childClasses[index]?childClasses[index]:0}`, + smallClasses: `${smallClasses[index]?smallClasses[index]:0}`, + bigClasses: `${bigClasses[index]?bigClasses[index]:0}`, + sbigClasser: `${sbigClasser[index]?sbigClasser[index]:0}`, }) }); @@ -130,7 +151,6 @@ $(function () { // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echartSchoolCovers')); // 专任教师数量情况柱状图 - console.log(smallClasses, bigClasses, sbigClasser) option = { // backgroundColor: '#00265f', @@ -142,7 +162,7 @@ $(function () { }, legend: { - data: ['小学', '初中', '高中'], + data: ['幼儿园','小学', '初中', '高中'], textStyle: { color: '#fff' } @@ -210,6 +230,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -281,13 +319,13 @@ $(function () { $('#schoolCoversTable').empty(); $('#schoolCoversTable').append( - '序号县域名称小学初中高中' + '序号县域名称幼儿园小学初中高中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#schoolCoversTable').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" ) }) diff --git a/js/schoolSizeInfo.js b/js/schoolSizeInfo.js index 9ea99a5..aa27416 100644 --- a/js/schoolSizeInfo.js +++ b/js/schoolSizeInfo.js @@ -46,6 +46,15 @@ $(function () { var tableDate = []; var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/js/schoolSports.js b/js/schoolSports.js index 1509c08..64c41cc 100644 --- a/js/schoolSports.js +++ b/js/schoolSports.js @@ -64,17 +64,35 @@ $(function () { }), function (resport) { var data = resport.result; - var indata = JSON.parse(data); - + var indata = [] + if(data && data !== ""){ + indata = JSON.parse(data); + } var nameData = []; + var childClasses = []; var smallClasses = []; var bigClasses = []; var sbigClasser = []; indata.forEach((item, index) => { + if (item.stage === '幼儿园') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } + if (item.total == 0) { + childClasses.push(0); + } else { + // smallClasses.push(Math.round(((item.studentno / item.total).toFixed(4)) * 100)); + + childClasses.push((item.total / item.studentno).toFixed(1)); + } + + } if (item.stage === '小学') { - nameData.push(item.gatherregionc); + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { smallClasses.push(0); } else { @@ -85,6 +103,9 @@ $(function () { } if (item.stage === '初中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { bigClasses.push(0); } else { @@ -94,6 +115,9 @@ $(function () { } if (item.stage === '高中') { + if(nameData.indexOf(item.gatherregionc) < 0){ + nameData.push(item.gatherregionc); + } if (item.total == 0) { sbigClasser.push(0); } else { @@ -115,9 +139,10 @@ $(function () { nameData.forEach((item, index) => { tableDate.push({ name: item, - smallClasses: `${smallClasses[index]}`, - bigClasses: `${bigClasses[index]}`, - sbigClasser: `${sbigClasser[index]}`, + childClasses:`${childClasses[index]?childClasses[index]:0}`, + smallClasses: `${smallClasses[index]?smallClasses[index]:0}`, + bigClasses: `${bigClasses[index]?bigClasses[index]:0}`, + sbigClasser: `${sbigClasser[index]?sbigClasser[index]:0}`, }) }); @@ -135,7 +160,7 @@ $(function () { }, legend: { - data: ['小学', '初中', '高中'], + data: ['幼儿园','小学', '初中', '高中'], textStyle: { color: '#fff' } @@ -204,6 +229,24 @@ $(function () { } }], series: [ + { + name: '幼儿园', + type: 'bar', + data: childClasses, + barWidth: '15%', //柱子宽度 + // barGap: 1, //柱子之间间距 + label: { + show: true, + position: 'top' + }, + itemStyle: { + normal: { + color: '#168EFE', + opacity: 1, + barBorderRadius: 5, + } + } + }, { name: '小学', type: 'bar', @@ -275,13 +318,13 @@ $(function () { $('#schoolSportsTable').empty(); $('#schoolSportsTable').append( - '序号县域名称小学初中高中' + '序号县域名称幼儿园小学初中高中' ) tableDate.forEach((item, index) => { var newIndex = index + 1; $('#schoolSportsTable').append( - "" + newIndex + "" + item.name + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" + "" + newIndex + "" + item.name + "" + item.childClasses + "" + item.smallClasses + "" + item.bigClasses + "" + item.sbigClasser + "" ) }) diff --git a/js/teachingStaffRecent3Years.js b/js/teachingStaffRecent3Years.js index ca36ead..0da5e99 100644 --- a/js/teachingStaffRecent3Years.js +++ b/js/teachingStaffRecent3Years.js @@ -648,16 +648,11 @@ $(function () { getData('A013', '2021', 'json') ).done(function (a1, a2, a3) { - console.log(JSON.parse(a1[0].result), 'test 2018') - console.log(JSON.parse(a2[0].result), 'test 2019') - console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) - console.log(data2018, data2019, data2020) - const year = config_years const product = ['product'] year.map((e, i) => { @@ -701,8 +696,6 @@ $(function () { gzjdyxby ] - - console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart4')); // 城乡专任教师师生比 diff --git a/js/teachingStaffRecentUaR3Years.js b/js/teachingStaffRecentUaR3Years.js index 90a7d38..11d2610 100644 --- a/js/teachingStaffRecentUaR3Years.js +++ b/js/teachingStaffRecentUaR3Years.js @@ -1020,15 +1020,11 @@ $(function () { getData('A013', '2021', 'json') ).done(function (a1, a2, a3) { - console.log(JSON.parse(a1[0].result), 'test 2018') - console.log(JSON.parse(a2[0].result), 'test 2019') - console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) - console.log(data2018, data2019, data2020) const year = ['2019', '2020', '2021'] const product = ['product'] @@ -1073,8 +1069,6 @@ $(function () { gzjdyxby ] - - console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart4')); // 城乡专任教师师生比 @@ -1222,15 +1216,12 @@ $(function () { getData('A013', '2021', 'json') ).done(function (a1, a2, a3) { - console.log(JSON.parse(a1[0].result), 'test 2018') - console.log(JSON.parse(a2[0].result), 'test 2019') - console.log(JSON.parse(a3[0].result), 'test 2020') + data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) - console.log(data2018, data2019, data2020) const year = ['2019', '2020', '2021'] const product = ['product'] @@ -1275,8 +1266,6 @@ $(function () { gzjdyxby ] - - console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart4')); // 城乡专任教师师生比 @@ -1424,16 +1413,11 @@ $(function () { getData('A013', '2021', 'json') ).done(function (a1, a2, a3) { - console.log(JSON.parse(a1[0].result), 'test 2018') - console.log(JSON.parse(a2[0].result), 'test 2019') - console.log(JSON.parse(a3[0].result), 'test 2020') data2018 = JSON.parse(a1[0].result) data2019 = JSON.parse(a2[0].result) data2020 = JSON.parse(a3[0].result) - console.log(data2018, data2019, data2020) - const year = ['2018', '2019', '2020'] const product = ['product'] year.map((e, i) => { @@ -1477,8 +1461,6 @@ $(function () { gzjdyxby ] - - console.log(datatest, 'datatest') // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('echart4')); // 城乡专任教师师生比 diff --git a/js/trailingChildrenInfo.js b/js/trailingChildrenInfo.js index 5eb560d..aa8aa43 100644 --- a/js/trailingChildrenInfo.js +++ b/js/trailingChildrenInfo.js @@ -46,6 +46,14 @@ $(function () { var tableDate = []; var typeOfBe = '小学'; + $('#Syoueryuan').click(function (event) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + typeOfBe = '幼儿园'; + tableDate = []; + echartSizeInfo(config_now_year); + }) + $('#Sxiaoxue').click(function (event) { $(this).addClass('active'); $(this).siblings().removeClass('active'); diff --git a/schoolArea.html b/schoolArea.html index 1be0e38..a44ac3e 100644 --- a/schoolArea.html +++ b/schoolArea.html @@ -89,12 +89,12 @@
    -
    +
    -
    +
    diff --git a/schoolAssistants.html b/schoolAssistants.html index a43fb28..2bde928 100644 --- a/schoolAssistants.html +++ b/schoolAssistants.html @@ -88,12 +88,12 @@
      -
      +
      -
      +
    序号
    diff --git a/schoolCovers.html b/schoolCovers.html index 732c11f..9cfc83d 100644 --- a/schoolCovers.html +++ b/schoolCovers.html @@ -90,12 +90,12 @@
      -
      +
      -
      +
    序号
    diff --git a/schoolSizeInfo.html b/schoolSizeInfo.html index a03eecd..395f9fe 100644 --- a/schoolSizeInfo.html +++ b/schoolSizeInfo.html @@ -95,6 +95,7 @@
    + diff --git a/schoolSports.html b/schoolSports.html index db5783a..e8c6cbc 100644 --- a/schoolSports.html +++ b/schoolSports.html @@ -90,12 +90,12 @@
      -
      +
      -
      +
    序号
    diff --git a/trailingChildrenInfo.html b/trailingChildrenInfo.html index e660c17..f7f9c88 100644 --- a/trailingChildrenInfo.html +++ b/trailingChildrenInfo.html @@ -90,6 +90,7 @@
    +
    序号