|
@@ -9,24 +9,22 @@ $(function () {
|
9
|
9
|
levelrangeObj = [];
|
10
|
10
|
$.each(list, function (key, item) {
|
11
|
11
|
if ($.inArray(item.classname, xAxis_data) == -1) {
|
12
|
|
- xAxis_data.push(item.classname)
|
|
12
|
+ xAxis_data.push(item.classname);
|
13
|
13
|
}
|
14
|
14
|
if ($.inArray(item.rankname + "类", legend_data) == -1) {
|
15
|
|
- legend_data.push(item.rankname + "类")
|
|
15
|
+ legend_data.push(item.rankname + "类");
|
16
|
16
|
}
|
17
|
17
|
if ($.inArray(item.rankrange, levelrangeObj) == -1) {
|
18
|
|
- levelrangeObj.push(item.rankrange)
|
|
18
|
+ levelrangeObj.push(item.rankrange);
|
19
|
19
|
}
|
20
|
|
- if (!levelRateObj[item.rankname + '类']) {
|
21
|
|
- levelRateObj[item.rankname + '类'] = [];
|
|
20
|
+ if (!levelRateObj[item.rankname + "类"]) {
|
|
21
|
+ levelRateObj[item.rankname + "类"] = [];
|
22
|
22
|
}
|
23
|
|
- levelRateObj[item.rankname + '类'].push(item.sturate);
|
24
|
|
- if (!levelNumObj[item.rankname + '类']) {
|
25
|
|
- levelNumObj[item.rankname + '类'] = [];
|
|
23
|
+ levelRateObj[item.rankname + "类"].push(item.sturate);
|
|
24
|
+ if (!levelNumObj[item.rankname + "类"]) {
|
|
25
|
+ levelNumObj[item.rankname + "类"] = [];
|
26
|
26
|
}
|
27
|
|
- levelNumObj[item.rankname + '类'].push(
|
28
|
|
- item.stunum
|
29
|
|
- );
|
|
27
|
+ levelNumObj[item.rankname + "类"].push(item.stunum);
|
30
|
28
|
});
|
31
|
29
|
$.each(legend_data, function (key, item) {
|
32
|
30
|
series_data.push({
|
|
@@ -72,103 +70,127 @@ $(function () {
|
72
|
70
|
textStyle: {
|
73
|
71
|
color: "#5F6E82",
|
74
|
72
|
fontSize: $.UnitUtil.mm2px(3),
|
75
|
|
- fontWeight: 500,
|
76
|
|
- },
|
|
73
|
+ fontWeight: 500
|
|
74
|
+ }
|
77
|
75
|
},
|
78
|
76
|
legend: {
|
79
|
77
|
itemWidth: $.UnitUtil.mm2px(2),
|
80
|
78
|
itemHeight: $.UnitUtil.mm2px(2),
|
81
|
79
|
top: "bottom",
|
82
|
|
- data: legend_data,
|
|
80
|
+ data: legend_data
|
83
|
81
|
},
|
84
|
82
|
grid: {
|
85
|
83
|
top: $.UnitUtil.mm2px(10),
|
86
|
84
|
left: 0,
|
87
|
85
|
right: 0,
|
88
|
86
|
bottom: $.UnitUtil.mm2px(8),
|
89
|
|
- containLabel: true,
|
|
87
|
+ containLabel: true
|
90
|
88
|
},
|
91
|
|
- xAxis: [{
|
92
|
|
- type: "category",
|
93
|
|
- data: xAxis_data,
|
94
|
|
- axisLabel: {
|
95
|
|
- color: "#5F6E82", //更改坐标轴文字颜色
|
96
|
|
- interval: 0
|
97
|
|
- },
|
98
|
|
- axisTick: {
|
99
|
|
- alignWithLabel: true,
|
100
|
|
- },
|
101
|
|
- boundaryGap: true,
|
102
|
|
- triggerEvent: true,
|
103
|
|
- axisLine: {
|
104
|
|
- show: true, //是否显示轴线
|
105
|
|
- lineStyle: {
|
106
|
|
- color: "#DADADA", //刻度线的颜色
|
|
89
|
+ xAxis: [
|
|
90
|
+ {
|
|
91
|
+ type: "category",
|
|
92
|
+ data: xAxis_data,
|
|
93
|
+ axisLabel: {
|
|
94
|
+ color: "#5F6E82", //更改坐标轴文字颜色
|
|
95
|
+ interval: 0
|
107
|
96
|
},
|
108
|
|
- },
|
109
|
|
- }, ],
|
110
|
|
- yAxis: [{
|
111
|
|
- type: "value",
|
112
|
|
- axisTick: {
|
113
|
|
- show: false, //刻度
|
114
|
|
- },
|
115
|
|
- axisLine: {
|
116
|
|
- show: false, //是否显示轴线
|
117
|
|
- lineStyle: {
|
118
|
|
- color: "#DADADA", //刻度线的颜色
|
|
97
|
+ axisTick: {
|
|
98
|
+ alignWithLabel: true
|
119
|
99
|
},
|
120
|
|
- },
|
121
|
|
- splitLine: {
|
122
|
|
- //网格线
|
123
|
|
- lineStyle: {
|
124
|
|
- type: "dotted", //设置网格线类型 dotted:虚线 solid:实线
|
|
100
|
+ boundaryGap: true,
|
|
101
|
+ triggerEvent: true,
|
|
102
|
+ axisLine: {
|
|
103
|
+ show: true, //是否显示轴线
|
|
104
|
+ lineStyle: {
|
|
105
|
+ color: "#DADADA" //刻度线的颜色
|
|
106
|
+ }
|
|
107
|
+ }
|
|
108
|
+ }
|
|
109
|
+ ],
|
|
110
|
+ yAxis: [
|
|
111
|
+ {
|
|
112
|
+ type: "value",
|
|
113
|
+ axisTick: {
|
|
114
|
+ show: false //刻度
|
125
|
115
|
},
|
126
|
|
- show: true, //隐藏或显示
|
127
|
|
- },
|
128
|
|
- axisLabel: {
|
129
|
|
- color: "#5F6E82", //更改坐标轴文字颜色
|
130
|
|
- },
|
131
|
|
- }, ],
|
|
116
|
+ axisLine: {
|
|
117
|
+ show: false, //是否显示轴线
|
|
118
|
+ lineStyle: {
|
|
119
|
+ color: "#DADADA" //刻度线的颜色
|
|
120
|
+ }
|
|
121
|
+ },
|
|
122
|
+ splitLine: {
|
|
123
|
+ //网格线
|
|
124
|
+ lineStyle: {
|
|
125
|
+ type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
|
|
126
|
+ },
|
|
127
|
+ show: true //隐藏或显示
|
|
128
|
+ },
|
|
129
|
+ axisLabel: {
|
|
130
|
+ color: "#5F6E82" //更改坐标轴文字颜色
|
|
131
|
+ }
|
|
132
|
+ }
|
|
133
|
+ ],
|
132
|
134
|
series: series_data
|
133
|
135
|
};
|
134
|
|
- var myEcharts = echarts.init(document.querySelector(".section_2_level.level_" + s_index + " #classLevelEcharts"));
|
|
136
|
+ var myEcharts = echarts.init(
|
|
137
|
+ document.querySelector(
|
|
138
|
+ ".section_2_level.level_" + s_index + " #classLevelEcharts"
|
|
139
|
+ )
|
|
140
|
+ );
|
135
|
141
|
myEcharts.clear();
|
136
|
142
|
myEcharts.setOption(option);
|
137
|
143
|
}
|
138
|
144
|
//图表数据
|
139
|
|
- function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list) {
|
|
145
|
+ function showgraphicaldata(
|
|
146
|
+ xAxis_data,
|
|
147
|
+ legend_data,
|
|
148
|
+ levelrangeObj,
|
|
149
|
+ s_index,
|
|
150
|
+ list
|
|
151
|
+ ) {
|
140
|
152
|
//图表数据
|
141
|
153
|
var arr = JSON.parse(JSON.stringify(list));
|
142
|
154
|
var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
|
143
|
|
- var goodTableHeadTr2Html = '';
|
|
155
|
+ var goodTableHeadTr2Html = "";
|
144
|
156
|
var goodTableTbodyHtml = "";
|
145
|
157
|
$.each(legend_data, function (idx, item) {
|
146
|
|
- goodTableHeadTr1Html += '<th colspan="2">' + item + levelrangeObj[idx] + '</th>';
|
147
|
|
- goodTableHeadTr2Html += '<th>人数</th><th>比例</th>';
|
|
158
|
+ goodTableHeadTr1Html +=
|
|
159
|
+ '<th colspan="2">' + item + levelrangeObj[idx] + "</th>";
|
|
160
|
+ goodTableHeadTr2Html += "<th>人数</th><th>比例</th>";
|
148
|
161
|
});
|
149
|
162
|
$.each(xAxis_data, function (idx, item) {
|
150
|
|
- var trHtml = '<td><div class="my_cell">' + item + '</div></td>'
|
|
163
|
+ var trHtml = '<td><div class="my_cell">' + item + "</div></td>";
|
151
|
164
|
var classs = $.grep(arr, function (val) {
|
152
|
165
|
return val.classname == item;
|
153
|
166
|
});
|
154
|
167
|
$.each(legend_data, function (idx, item) {
|
155
|
168
|
var rank = $.grep(classs, function (val) {
|
156
|
|
- return val.rankname + '类' == item;
|
|
169
|
+ return val.rankname + "类" == item;
|
157
|
170
|
})[0];
|
158
|
|
- trHtml += '<td><div class="my_cell">' + rank.stunum +
|
159
|
|
- '</div></td><td><div class="my_cell">' + rank.sturate +
|
160
|
|
- '%</div></td>'
|
|
171
|
+ trHtml +=
|
|
172
|
+ '<td><div class="my_cell">' +
|
|
173
|
+ rank.stunum +
|
|
174
|
+ '</div></td><td><div class="my_cell">' +
|
|
175
|
+ rank.sturate +
|
|
176
|
+ "%</div></td>";
|
161
|
177
|
});
|
162
|
|
- goodTableTbodyHtml += '<tr>' + trHtml + '</tr>';
|
|
178
|
+ goodTableTbodyHtml += "<tr>" + trHtml + "</tr>";
|
163
|
179
|
});
|
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);
|
|
180
|
+ $(".section_2_level.level_" + s_index + " .goodTableHeadTr1").html(
|
|
181
|
+ goodTableHeadTr1Html
|
|
182
|
+ );
|
|
183
|
+ $(".section_2_level.level_" + s_index + " .goodTableHeadTr2").html(
|
|
184
|
+ goodTableHeadTr2Html
|
|
185
|
+ );
|
|
186
|
+ $(".section_2_level.level_" + s_index + " .goodTableTbody").html(
|
|
187
|
+ goodTableTbodyHtml
|
|
188
|
+ );
|
167
|
189
|
var totalObj = {};
|
168
|
190
|
var maxObj = {};
|
169
|
191
|
var minObj = {};
|
170
|
192
|
var classObj = {};
|
171
|
|
- $.each(list, function(index, listItem) {
|
|
193
|
+ $.each(list, function (index, listItem) {
|
172
|
194
|
if (!totalObj[listItem.rankname]) {
|
173
|
195
|
totalObj[listItem.rankname] = {};
|
174
|
196
|
}
|
|
@@ -185,13 +207,13 @@ $(function () {
|
185
|
207
|
classObj[listItem.classid] = listItem.classname;
|
186
|
208
|
if (maxObj[listItem.rankname].stunum < listItem.stunum) {
|
187
|
209
|
maxObj[listItem.rankname].stunum = listItem.stunum;
|
188
|
|
- maxObj[listItem.rankname].classidArr = [ listItem.classid ];
|
|
210
|
+ maxObj[listItem.rankname].classidArr = [listItem.classid];
|
189
|
211
|
} else if (maxObj[listItem.rankname].stunum === listItem.stunum) {
|
190
|
212
|
maxObj[listItem.rankname].classidArr.push(listItem.classid);
|
191
|
213
|
}
|
192
|
214
|
}
|
193
|
215
|
});
|
194
|
|
- $.each(list, function(index, listItem) {
|
|
216
|
+ $.each(list, function (index, listItem) {
|
195
|
217
|
if (!minObj[listItem.rankname]) {
|
196
|
218
|
minObj[listItem.rankname] = {
|
197
|
219
|
stunum: maxObj[listItem.rankname].stunum,
|
|
@@ -201,44 +223,93 @@ $(function () {
|
201
|
223
|
if (listItem.classid !== 0) {
|
202
|
224
|
if (minObj[listItem.rankname].stunum > listItem.stunum) {
|
203
|
225
|
minObj[listItem.rankname].stunum = listItem.stunum;
|
204
|
|
- minObj[listItem.rankname].classidArr = [ listItem.classid ];
|
|
226
|
+ minObj[listItem.rankname].classidArr = [listItem.classid];
|
205
|
227
|
} else if (minObj[listItem.rankname].stunum === listItem.stunum) {
|
206
|
228
|
minObj[listItem.rankname].classidArr.push(listItem.classid);
|
207
|
229
|
}
|
208
|
230
|
}
|
209
|
231
|
});
|
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
|
|
- return classObj[classid];
|
213
|
|
- }).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
|
214
|
|
- return classObj[classid];
|
215
|
|
- }).join('、'));
|
|
232
|
+ $(".section_2_level.level_" + s_index + " .result_collect").text(
|
|
233
|
+ "A类" +
|
|
234
|
+ totalObj["A"].stunum +
|
|
235
|
+ "人(" +
|
|
236
|
+ totalObj["A"].sturate +
|
|
237
|
+ "%),B类" +
|
|
238
|
+ totalObj["B"].stunum +
|
|
239
|
+ "人(" +
|
|
240
|
+ totalObj["B"].sturate +
|
|
241
|
+ "%),C类" +
|
|
242
|
+ totalObj["C"].stunum +
|
|
243
|
+ "人(" +
|
|
244
|
+ totalObj["C"].sturate +
|
|
245
|
+ "%),D类" +
|
|
246
|
+ totalObj["D"].stunum +
|
|
247
|
+ "人(" +
|
|
248
|
+ totalObj["D"].sturate +
|
|
249
|
+ "%),E类" +
|
|
250
|
+ totalObj["E"].stunum +
|
|
251
|
+ "人(" +
|
|
252
|
+ totalObj["E"].sturate +
|
|
253
|
+ "%)"
|
|
254
|
+ );
|
|
255
|
+ $(".section_2_level.level_" + s_index + " .A_collect").text(
|
|
256
|
+ "A类上线率最高的班级:" +
|
|
257
|
+ $.map(maxObj["A"].classidArr, function (classid) {
|
|
258
|
+ return classObj[classid];
|
|
259
|
+ }).join("、") +
|
|
260
|
+ ",A类上线率最低的班级:" +
|
|
261
|
+ $.map(minObj["A"].classidArr, function (classid) {
|
|
262
|
+ return classObj[classid];
|
|
263
|
+ }).join("、")
|
|
264
|
+ );
|
216
|
265
|
|
217
|
|
- $(".section_2_level.level_" + s_index + " .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
|
218
|
|
- return classObj[classid];
|
219
|
|
- }).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
|
220
|
|
- return classObj[classid];
|
221
|
|
- }).join('、'));
|
|
266
|
+ $(".section_2_level.level_" + s_index + " .B_collect").text(
|
|
267
|
+ "B类上线率最高的班级:" +
|
|
268
|
+ $.map(maxObj["B"].classidArr, function (classid) {
|
|
269
|
+ return classObj[classid];
|
|
270
|
+ }).join("、") +
|
|
271
|
+ ",B类上线率最低的班级:" +
|
|
272
|
+ $.map(minObj["B"].classidArr, function (classid) {
|
|
273
|
+ return classObj[classid];
|
|
274
|
+ }).join("、")
|
|
275
|
+ );
|
222
|
276
|
|
223
|
|
- $(".section_2_level.level_" + s_index + " .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
|
224
|
|
- return classObj[classid];
|
225
|
|
- }).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
|
226
|
|
- return classObj[classid];
|
227
|
|
- }).join('、'));
|
|
277
|
+ $(".section_2_level.level_" + s_index + " .C_collect").text(
|
|
278
|
+ "C类上线率最高的班级:" +
|
|
279
|
+ $.map(maxObj["C"].classidArr, function (classid) {
|
|
280
|
+ return classObj[classid];
|
|
281
|
+ }).join("、") +
|
|
282
|
+ ",C类上线率最低的班级:" +
|
|
283
|
+ $.map(minObj["C"].classidArr, function (classid) {
|
|
284
|
+ return classObj[classid];
|
|
285
|
+ }).join("、")
|
|
286
|
+ );
|
228
|
287
|
|
229
|
|
- $(".section_2_level.level_" + s_index + " .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
|
230
|
|
- return classObj[classid];
|
231
|
|
- }).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
|
232
|
|
- return classObj[classid];
|
233
|
|
- }).join('、'));
|
|
288
|
+ $(".section_2_level.level_" + s_index + " .D_collect").text(
|
|
289
|
+ "D类上线率最高的班级:" +
|
|
290
|
+ $.map(maxObj["D"].classidArr, function (classid) {
|
|
291
|
+ return classObj[classid];
|
|
292
|
+ }).join("、") +
|
|
293
|
+ ",D类上线率最低的班级:" +
|
|
294
|
+ $.map(minObj["D"].classidArr, function (classid) {
|
|
295
|
+ return classObj[classid];
|
|
296
|
+ }).join("、")
|
|
297
|
+ );
|
234
|
298
|
|
235
|
|
- $(".section_2_level.level_" + s_index + " .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
|
236
|
|
- return classObj[classid];
|
237
|
|
- }).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
|
238
|
|
- return classObj[classid];
|
239
|
|
- }).join('、'));
|
|
299
|
+ $(".section_2_level.level_" + s_index + " .E_collect").text(
|
|
300
|
+ "E类上线率最高的班级:" +
|
|
301
|
+ $.map(maxObj["E"].classidArr, function (classid) {
|
|
302
|
+ return classObj[classid];
|
|
303
|
+ }).join("、") +
|
|
304
|
+ ",E类上线率最低的班级:" +
|
|
305
|
+ $.map(minObj["E"].classidArr, function (classid) {
|
|
306
|
+ return classObj[classid];
|
|
307
|
+ }).join("、")
|
|
308
|
+ );
|
240
|
309
|
}
|
241
|
|
- var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
|
|
310
|
+ var parameter = $(".section_2_html_root .section_2_level_html_root").data(
|
|
311
|
+ "page-params"
|
|
312
|
+ );
|
242
|
313
|
parameter = JSON.parse(parameter);
|
243
|
314
|
// console.log(parameter);
|
244
|
315
|
var subjectInfo = [];
|
|
@@ -259,10 +330,23 @@ $(function () {
|
259
|
330
|
}
|
260
|
331
|
var singleRootHtml = "";
|
261
|
332
|
$.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>';
|
|
333
|
+ singleRootHtml +=
|
|
334
|
+ '<div class="page_root section_2_level level_' +
|
|
335
|
+ s_index +
|
|
336
|
+ '">' +
|
|
337
|
+ (s_index === 0 ? '<h2 class="section_title_2">2.分数等级对比</h2>' : "") +
|
|
338
|
+ '<h3 class="section_title_3">2.' +
|
|
339
|
+ (s_index + 1) +
|
|
340
|
+ " " +
|
|
341
|
+ s_item.subjectname +
|
|
342
|
+ '等级对比</h3><h4 class="section_title_4">2.' +
|
|
343
|
+ (s_index + 1) +
|
|
344
|
+ '.1 各班等级分析</h4><div id="classLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div><h4 class="section_title_4">2.' +
|
|
345
|
+ (s_index + 1) +
|
|
346
|
+ '.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
|
347
|
});
|
264
|
348
|
$(".section_2_level_root").html(singleRootHtml);
|
265
|
349
|
$.each(subjectInfo, function (s_index, s_item) {
|
266
|
350
|
initclassLevelEcharts(s_index, s_item.ranks);
|
267
|
351
|
});
|
268
|
|
-});
|
|
352
|
+});
|