|
|
|
@ -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(
|
|
|
|
|
'<tr style="line-height: 0.35rem;"><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 10%; background: #0044bb;">序号</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 20%; background: #0044bb;">县域名称</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 23%; background: #0044bb;">小学</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 23%; background: #0044bb;">初中</th><th style="text-align: center; color: #fff; width: 23%; background: #0044bb;">高中</th></tr>'
|
|
|
|
|
'<tr style="line-height: 0.35rem;"><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 10%; background: #0044bb;">序号</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 20%; background: #0044bb;">县域名称</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 17%; background: #0044bb;">幼儿园</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 17%; background: #0044bb;">小学</th><th style="text-align: center; color: #fff; border-right: 1px solid rgba(255,255,255,.2); width: 17%; background: #0044bb;">初中</th><th style="text-align: center; color: #fff; width: 17%; background: #0044bb;">高中</th></tr>'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
tableDate.forEach((item, index) => {
|
|
|
|
|
var newIndex = index + 1;
|
|
|
|
|
$('#schoolCoversTable').append(
|
|
|
|
|
"<tr style='line-height: 0.35rem; border-bottom: 1px solid rgba(255,255,255,.2)'><td style='text-align: center; color: rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.2); width: 10%;'>" + newIndex + "</td><td style='text-align: center; color: rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.2); width: 20%;'>" + item.name + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 23%; border-right: 1px solid rgba(255,255,255,.2);'>" + item.smallClasses + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 23%; border-right: 1px solid rgba(255,255,255,.2);'>" + item.bigClasses + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 23%;'>" + item.sbigClasser + "</td></tr>"
|
|
|
|
|
"<tr style='line-height: 0.35rem; border-bottom: 1px solid rgba(255,255,255,.2)'><td style='text-align: center; color: rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.2); width: 10%;'>" + newIndex + "</td><td style='text-align: center; color: rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.2); width: 20%;'>" + item.name + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 17%; border-right: 1px solid rgba(255,255,255,.2);'>" + item.childClasses + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 17%; border-right: 1px solid rgba(255,255,255,.2);'>" + item.smallClasses + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 17%; border-right: 1px solid rgba(255,255,255,.2);'>" + item.bigClasses + "</td><td style='text-align: center; color: rgba(255,255,255,.6); width: 17%;'>" + item.sbigClasser + "</td></tr>"
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|