|
@@ -1,6 +1,6 @@
|
1
|
1
|
$(function () {
|
2
|
2
|
//各班等级分析
|
3
|
|
- function initclassLevelEcharts(list) {
|
|
3
|
+ function initclassLevelEcharts(s_index, list) {
|
4
|
4
|
var xAxis_data = [],
|
5
|
5
|
series_data = [],
|
6
|
6
|
legend_data = [],
|
|
@@ -61,7 +61,7 @@ $(function () {
|
61
|
61
|
data: levelNumObj[item]
|
62
|
62
|
});
|
63
|
63
|
});
|
64
|
|
- showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list);
|
|
64
|
+ showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list);
|
65
|
65
|
var option = {
|
66
|
66
|
color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
|
67
|
67
|
animation: false,
|
|
@@ -131,12 +131,12 @@ $(function () {
|
131
|
131
|
}, ],
|
132
|
132
|
series: series_data
|
133
|
133
|
};
|
134
|
|
- var myEcharts = echarts.init(document.querySelector(".section_2_level #classLevelEcharts"));
|
|
134
|
+ var myEcharts = echarts.init(document.querySelector(".section_2_level.level_" + s_index + " #classLevelEcharts"));
|
135
|
135
|
myEcharts.clear();
|
136
|
136
|
myEcharts.setOption(option);
|
137
|
137
|
}
|
138
|
138
|
//图表数据
|
139
|
|
- function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list) {
|
|
139
|
+ function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list) {
|
140
|
140
|
//图表数据
|
141
|
141
|
var arr = JSON.parse(JSON.stringify(list));
|
142
|
142
|
var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
|
|
@@ -161,9 +161,9 @@ $(function () {
|
161
|
161
|
});
|
162
|
162
|
goodTableTbodyHtml += '<tr>' + trHtml + '</tr>';
|
163
|
163
|
});
|
164
|
|
- $(".section_2_level .goodTableHeadTr1").html(goodTableHeadTr1Html);
|
165
|
|
- $(".section_2_level .goodTableHeadTr2").html(goodTableHeadTr2Html);
|
166
|
|
- $(".section_2_level .goodTableTbody").html(goodTableTbodyHtml);
|
|
164
|
+ $(".section_2_level.level_" + s_index + " .goodTableHeadTr1").html(goodTableHeadTr1Html);
|
|
165
|
+ $(".section_2_level.level_" + s_index + " .goodTableHeadTr2").html(goodTableHeadTr2Html);
|
|
166
|
+ $(".section_2_level.level_" + s_index + " .goodTableTbody").html(goodTableTbodyHtml);
|
167
|
167
|
var totalObj = {};
|
168
|
168
|
var maxObj = {};
|
169
|
169
|
var minObj = {};
|
|
@@ -207,32 +207,32 @@ $(function () {
|
207
|
207
|
}
|
208
|
208
|
}
|
209
|
209
|
});
|
210
|
|
- $(".section_2_level.level_0 .result_collect").text("A类" + totalObj['A'].stunum + "人(" + totalObj['A'].sturate + "%),B类" + totalObj['B'].stunum + "人(" + totalObj['B'].sturate + "%),C类" + totalObj['C'].stunum + "人(" + totalObj['C'].sturate + "%),D类" + totalObj['D'].stunum + "人(" + totalObj['D'].sturate + "%),E类" + totalObj['E'].stunum + "人(" + totalObj['E'].sturate + "%)");
|
211
|
|
- $(".section_2_level.level_0 .A_collect").text("A类上线率最高的班级:" + $.map(maxObj['A'].classidArr, function (classid) {
|
|
210
|
+ $(".section_2_level.level_" + s_index + " .result_collect").text("A类" + totalObj['A'].stunum + "人(" + totalObj['A'].sturate + "%),B类" + totalObj['B'].stunum + "人(" + totalObj['B'].sturate + "%),C类" + totalObj['C'].stunum + "人(" + totalObj['C'].sturate + "%),D类" + totalObj['D'].stunum + "人(" + totalObj['D'].sturate + "%),E类" + totalObj['E'].stunum + "人(" + totalObj['E'].sturate + "%)");
|
|
211
|
+ $(".section_2_level.level_" + s_index + " .A_collect").text("A类上线率最高的班级:" + $.map(maxObj['A'].classidArr, function (classid) {
|
212
|
212
|
return classObj[classid];
|
213
|
213
|
}).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
|
214
|
214
|
return classObj[classid];
|
215
|
215
|
}).join('、'));
|
216
|
216
|
|
217
|
|
- $(".section_2_level.level_0 .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
|
|
217
|
+ $(".section_2_level.level_" + s_index + " .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
|
218
|
218
|
return classObj[classid];
|
219
|
219
|
}).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
|
220
|
220
|
return classObj[classid];
|
221
|
221
|
}).join('、'));
|
222
|
222
|
|
223
|
|
- $(".section_2_level.level_0 .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
|
|
223
|
+ $(".section_2_level.level_" + s_index + " .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
|
224
|
224
|
return classObj[classid];
|
225
|
225
|
}).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
|
226
|
226
|
return classObj[classid];
|
227
|
227
|
}).join('、'));
|
228
|
228
|
|
229
|
|
- $(".section_2_level.level_0 .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
|
|
229
|
+ $(".section_2_level.level_" + s_index + " .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
|
230
|
230
|
return classObj[classid];
|
231
|
231
|
}).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
|
232
|
232
|
return classObj[classid];
|
233
|
233
|
}).join('、'));
|
234
|
234
|
|
235
|
|
- $(".section_2_level.level_0 .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
|
|
235
|
+ $(".section_2_level.level_" + s_index + " .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
|
236
|
236
|
return classObj[classid];
|
237
|
237
|
}).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
|
238
|
238
|
return classObj[classid];
|
|
@@ -240,8 +240,29 @@ $(function () {
|
240
|
240
|
}
|
241
|
241
|
var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
|
242
|
242
|
parameter = JSON.parse(parameter);
|
243
|
|
- var list = $.grep(parameter.djfx, function (item) {
|
244
|
|
- return item.ranktype == 1 && item.subjectid == 'zf';
|
245
|
|
- })[0].ranks;
|
246
|
|
- initclassLevelEcharts(list);
|
|
243
|
+ // console.log(parameter);
|
|
244
|
+ var subjectInfo = [];
|
|
245
|
+ for (var sid in parameter) {
|
|
246
|
+ if (sid === "zf") {
|
|
247
|
+ subjectInfo.unshift({
|
|
248
|
+ subjectid: sid,
|
|
249
|
+ subjectname: "全科",
|
|
250
|
+ ranks: parameter[sid].ranks
|
|
251
|
+ });
|
|
252
|
+ } else {
|
|
253
|
+ subjectInfo.push({
|
|
254
|
+ subjectid: sid,
|
|
255
|
+ subjectname: parameter[sid].subjectname,
|
|
256
|
+ ranks: parameter[sid].ranks
|
|
257
|
+ });
|
|
258
|
+ }
|
|
259
|
+ }
|
|
260
|
+ var singleRootHtml = "";
|
|
261
|
+ $.each(subjectInfo, function (s_index, s_item) {
|
|
262
|
+ singleRootHtml += '<div class="page_root section_2_level level_' + s_index + '">' + (s_index === 0 ? '<h2 class="section_title_2">2.分数等级对比</h2>' : '') + '<h3 class="section_title_3">2.' + (s_index + 1) + ' ' + s_item.subjectname + '等级对比</h3><h4 class="section_title_4">2.' + (s_index + 1) + '.1 各班等级分析</h4><div id="classLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div><h4 class="section_title_4">2.' + (s_index + 1) + '.2 各班等级比例分布</h4><table border="1" class="my_table"><thead><tr class="goodTableHeadTr1"></tr><tr class="goodTableHeadTr2"></tr></thead><tbody class="goodTableTbody"></tbody></table><div class="echarts_result"><div>上图各等级上线统计结果为:<span class="result_collect"></span>:</div><div class="echarts_result_content"><div><span class="bg_5699FF"></span><i class="A_collect"></i></div><div><span class="bg_FF5F56"></span><i class="B_collect"></i></div><div><span class="bg_5EC5C8"></span><i class="C_collect"></i></div><div><span class="bg_F1982B"></span><i class="D_collect"></i></div><div><span class="bg_F1982B"></span><i class="E_collect"></i></div></div></div></div>';
|
|
263
|
+ });
|
|
264
|
+ $(".section_2_level_root").html(singleRootHtml);
|
|
265
|
+ $.each(subjectInfo, function (s_index, s_item) {
|
|
266
|
+ initclassLevelEcharts(s_index, s_item.ranks);
|
|
267
|
+ });
|
247
|
268
|
});
|