score.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. function toggleHide() {
  2. $(".hidable").toggle();
  3. };
  4. AV.init({
  5. appId: "BmologYYnRqCv0SLHDeDdA17-gzGzoHsz",
  6. appKey: "w9mVebFMdCmY6Nh9vfcBGaGt",
  7. serverURL: "https://bmologyy.lc-cn-n1-shared.com/",
  8. });
  9. console.log("温馨提示:*成绩*一定不会上传到网络,但为了保证使用范围,可能会对其他信息进行记录。")
  10. function decimal(x, n) {
  11. x = Math.round(x * 10 ** n) / 10 ** n;
  12. return x.toFixed(n);
  13. }
  14. var fileCount = 0, cur = 0, files = {};
  15. function prevFile() {
  16. cur = (cur - 1 + fileCount) % fileCount;
  17. processFiles();
  18. }
  19. function nextFile() {
  20. cur = (cur + 1) % fileCount;
  21. processFiles();
  22. }
  23. function clearScreen() {
  24. $(".chart").hide()
  25. $("#fileOutput")[0].innerHTML = "";
  26. $("#fileInfo")[0].innerHTML = "";
  27. $("#name")[0].innerHTML = "";
  28. }
  29. function reset() {
  30. cur = 0;
  31. fileCount = 0;
  32. files = {};
  33. clearScreen();
  34. $("#message")[0].innerHTML = "";
  35. $("#controls").addClass("disabled");
  36. $("#lbtn").addClass("disabled");
  37. $("#rbtn").addClass("disabled");
  38. $("#resetbtn").addClass("disabled");
  39. $("#upbtn").removeClass('btn-danger');
  40. $("#upbtn").addClass('btn-info');
  41. $("#upicon").removeClass('glyphicon-exclamation-sign');
  42. $("#upicon").addClass('glyphicon-open');
  43. }
  44. document.onkeydown = function (event) {
  45. var e = event || window.event || arguments.callee.caller.arguments[0];
  46. if (e) {
  47. if (e.key == "ArrowLeft") {
  48. prevFile();
  49. }
  50. else if (e.key == "ArrowRight") {
  51. nextFile();
  52. } else if ('1' <= e.key && e.key <= '9') {
  53. if (parseInt(e.key) <= fileCount) {
  54. cur = parseInt(e.key) - 1;
  55. processFiles();
  56. }
  57. }
  58. }
  59. };
  60. function getFiles(event) {
  61. files[fileCount] = event.target.files[0];
  62. cur = fileCount;
  63. fileCount++;
  64. $("#controls").removeClass("disabled");
  65. $("#lbtn").removeClass("disabled");
  66. $("#rbtn").removeClass("disabled");
  67. $("#resetbtn").removeClass("disabled");
  68. processFiles(1);
  69. }
  70. const key = CryptoJS.enc.Utf8.parse("abcdefgabcdefg12");
  71. function aesDecrypt(encrypted) {
  72. var encryptedHexStr = CryptoJS.enc.Hex.parse(encrypted);
  73. var cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Hex.parse(encrypted) })
  74. var decrypted = CryptoJS.AES.decrypt(cipherParams, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
  75. var decryptedStr = decrypted.toString(CryptoJS.enc.Utf8);
  76. return decryptedStr;
  77. }
  78. function processFiles(isFirstTime = 0) {
  79. console.log("Start processing No. " + cur);
  80. var file = files[cur];
  81. var message = $("#message")[0];
  82. var upBtn = $("#upbtn")[0];
  83. var upIcon = $("#upicon")[0];
  84. var tableLayout = '<table class="table table-responsive" style="table-layout: fixed;">'
  85. message.innerHTML = (cur + 1) + "/" + (fileCount) + " - " + file.name + " - " + file.size + " 字节 - " + file.type + " - 正在读取...<br>>";
  86. upBtn.classList.remove('btn-danger');
  87. upBtn.classList.add('btn-info');
  88. upIcon.classList.remove('glyphicon-exclamation-sign');
  89. upIcon.classList.add('glyphicon-open');
  90. var reader = new FileReader();
  91. var content = "";
  92. reader.onload = function (event) {
  93. try {
  94. var output = $("#fileOutput")[0];
  95. var info = $("#fileInfo")[0];
  96. var name = $("#name")[0];
  97. var object = eval("(" + event.target.result + ")");
  98. var classText = "", gradingText = "";
  99. object.data = eval("(" + aesDecrypt(object.data).toString() + ")");
  100. var seIds = [], seNames = [], iter = 1;
  101. var datSingle = object.data.multiExamStudentScore.singleExamStudentScores, datClass = object.data.singleExamClassScores, datYs = object.data.singleExamClassYsScores, datMulti = object.data.multiExam.singleExams;
  102. seIds = object.data.seIds;
  103. for (var i = 0; i < seIds.length; i++) {
  104. console.log(datMulti[i].seId)
  105. for (var j = 0; j < seIds.length; j++) {
  106. if (datMulti[i].seId == seIds[j]) {
  107. seNames[j] = datMulti[i].seCourseName;
  108. }
  109. }
  110. }
  111. console.log(seIds)
  112. console.log(seNames)
  113. var seNameDic = {};
  114. for (var i = 0; i < seIds.length; i++) {
  115. seNameDic[seIds[i]] = seNames[i];
  116. }
  117. seNameDic["0"] = "总分";
  118. for (var i = 0; i < datYs.length; i++) {
  119. seNameDic[datYs[i].seId + "Ys"] = seNameDic[datYs[i].seId] + " " + datYs[i].ysClassId;
  120. }
  121. console.log(seNameDic)
  122. var seIdDic = {}, seIdRev = {};
  123. for (var i = 0; i < seIds.length; i++) {
  124. for (var j = 0; j < seIds.length; j++) {
  125. if (datSingle[j].seId == seIds[i]) {
  126. seIdDic[j] = i;
  127. }
  128. }
  129. }
  130. for (var i = 0; i < seIds.length; i++)seIdRev[seIdDic[i]] = i;
  131. var scoreP = {}, avgP = {}, rate0 = {}, rate25 = {}, rate50 = {}, rate75 = {}, rate100 = {}, rateFull = {};//表1用
  132. var classOrderP = {}, ysClassOrderP = {}, gradeOrderP = {};
  133. var classOrder = {}, ysClassOrder = {}, gradeOrder = {};
  134. for (var i = 0; i < seIds.length; i++) {
  135. var dId = datSingle[i].seId;
  136. scoreP[dId] = datSingle[i].essScore;
  137. avgP[dId] = datClass[i].secsAvgScore;
  138. rate0[dId] = datClass[i].secsMinScore;
  139. rate25[dId] = datClass[i].secsQuarterScore;
  140. rate50[dId] = datClass[i].secsHalfScore;
  141. rate75[dId] = datClass[i].secs3quatrerScore;
  142. rate100[dId] = datClass[i].secsMaxScore;
  143. rateFull[dId] = datMulti[seIdDic[i]].seFullScore;
  144. // scoreRate[dId] = decimal(datSingle[i].essScore / datMulti[seIdDic[i]].seFullScore, 3);
  145. classOrderP[dId] = datSingle[i].essClassOrder;
  146. gradeOrderP[dId] = datSingle[i].essGradeOrder;
  147. classOrder[dId] = decimal(1 - datSingle[i].essClassOrder / datClass[i].secsStudentCount, 3);
  148. gradeOrder[dId] = decimal(1 - datSingle[i].essGradeOrder / datMulti[seIdDic[i]].seStudentCount, 3);
  149. }
  150. // scoreRate["0"] = decimal(object.data.multiExamStudentScore.messScore / object.data.multiExam.meFullScore, 3);
  151. // classOrder["0"] = decimal(1 - object.data.multiExamStudentScore.messClassOrder / object.data.multiExamClassScores[0].mecsStudentCount, 3); + "<br>"
  152. // gradeOrder["0"] = decimal(1 - object.data.multiExamStudentScore.messGradeOrder / object.data.multiExamSchoolScore.mecsStudentCount, 3); + "<br>"
  153. classOrderP["0"] = object.data.multiExamStudentScore.messClassOrder;
  154. gradeOrderP["0"] = object.data.multiExamStudentScore.messGradeOrder
  155. for (var i = 0; i < datYs.length; i++) {
  156. for (var j = 0; j < seIds.length; j++) {
  157. if (datYs[i].seId == datSingle[j].seId) {
  158. ysClassOrder[datYs[i].seId + "Ys"] = decimal(1 - datSingle[j].essYsClassOrder / datYs[i].secsStudentCount, 3);
  159. ysClassOrderP[datYs[i].seId + "Ys"] = datSingle[j].essYsClassOrder;
  160. }
  161. }
  162. }
  163. for (var i = 0; i < seIds.length; i++) {
  164. // object.data.multiExamStudentScore.singleExamStudentScores[i].seId ---datSingle
  165. // object.data.singleExamClassScores[i].seId ---datClass
  166. // object.data.multiExam.singleExams[i].seId ---datMulti
  167. // seIds[i]
  168. // 前两个和后两个数据应该是能分别对上号的(1-2 3-4),用 seIdDic 连接
  169. // seIdDic {key(1-2): value(3-4),..}
  170. var g = seIdRev[i];
  171. classText += "<h4>"
  172. + seNameDic[datSingle[g].seId] + "</h4>"
  173. + "<b>单科分数:" + datSingle[g].essScore + "</b><br><br>"
  174. + "单科分数班级排名:" + datSingle[g].essClassOrder + "<br>"
  175. + "单科班级参考人数:" + datClass[g].secsStudentCount + "<br>"
  176. + "单科班级年级排名:" + datClass[g].secsClassOrder + "<br>"
  177. + "单科班级:"
  178. + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
  179. + "<tr><td>" + datClass[g].secsAvgScore + "</td><td>" + datClass[g].secsMaxScore + "</td><td>" + datClass[g].secs3quatrerScore + "</td><td>" + datClass[g].secsHalfScore + "</td><td>" + datClass[g].secsQuarterScore + "</td><td>" + datClass[g].secsMinScore + "</td></tr></table>";
  180. for (var j = 0; j < datYs.length; j++) {
  181. if (datYs[j].seId == datSingle[g].seId) {
  182. classText += "<br><br>"
  183. + "单科分层班级名称:" + datYs[j].ysClassId + "<br>"
  184. + "单科分数分层班级排名:" + datSingle[g].essYsClassOrder + "<br>"
  185. + "单科分层班级参考人数:" + datYs[j].secsStudentCount + "<br>"
  186. + "单科分层班级年级排名:" + datYs[j].secsClassOrder + "<br>"
  187. + "单科分层班级:"
  188. + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
  189. + "<tr><td>" + datYs[j].secsAvgScore + "</td><td>" + datYs[j].secsMaxScore + "</td><td>" + datYs[j].secs3quatrerScore + "</td><td>" + datYs[j].secsHalfScore + "</td><td>" + datYs[j].secsQuarterScore + "</td><td>" + datYs[j].secsMinScore + "</td></tr></table>";
  190. }
  191. }
  192. classText += "<br><br>"
  193. + "单科分数年级排名:" + datSingle[g].essGradeOrder + "<br>"
  194. + "单科年级参考人数:" + datMulti[seIdDic[g]].seStudentCount + "<br>"
  195. + "单科年级:"
  196. + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
  197. + "<tr><td>" + datMulti[seIdDic[g]].seAvgScore + "</td><td>" + datMulti[seIdDic[g]].seMaxScore + "</td><td>" + datMulti[seIdDic[g]].se3QuarterScore + "</td><td>" + datMulti[seIdDic[g]].seHalfScore + "</td><td>" + datMulti[seIdDic[g]].seQuarterScore + "</td><td>" + datMulti[seIdDic[g]].seMinScore + "</td></tr></table><br><br>";
  198. }
  199. } catch (e) {
  200. console.log(e);
  201. clearScreen();
  202. message.innerHTML += "读取失败!";
  203. upBtn.classList.remove('btn-info');
  204. upBtn.classList.add('btn-danger');
  205. upIcon.classList.remove('glyphicon-open');
  206. upIcon.classList.add('glyphicon-exclamation-sign');
  207. return;
  208. }
  209. // sheetOutput("各科得分比例一览表", scoreRate);
  210. // sheetOutput("各科班级排名一览表", classOrder);
  211. // sheetOutput("各科分层班级排名一览表", ysClassOrder);
  212. // sheetOutput("各科年级排名一览表", gradeOrder);
  213. if (isFirstTime) {
  214. const up = AV.Object.extend('Score');
  215. const upload = new up();
  216. upload.set('name', object.data.multiExamStudentScore.studentName);
  217. upload.set('classId', parseInt(object.data.examStudents[0].classId));
  218. upload.save().then((upload) => {
  219. console.log("success" + upload);
  220. });
  221. }
  222. message.innerHTML += "读取成功!"
  223. + " - 注:实验中学 74 桌出品,我仅做搬运修改。<br>";
  224. name.innerHTML = "姓名:" + object.data.multiExamStudentScore.studentName;
  225. info.innerHTML = "<h3>" + object.data.multiExam.meName + "</h3>"
  226. + "行政班级:" + object.data.examStudents[0].classId + "<br>"
  227. + "姓名:" + object.data.multiExamStudentScore.studentName + "<br>";
  228. output.innerHTML = "<br><h4>总分</h4>"
  229. + "<b>全科分数:" + object.data.multiExamStudentScore.messScore + "</b><br><br>"
  230. + "全科分数班级排名:" + object.data.multiExamStudentScore.messClassOrder + "<br>"
  231. + "全科班级参考人数:" + object.data.multiExamClassScores[0].mecsStudentCount + "<br>"
  232. + "全科班级年级排名:" + object.data.multiExamClassScores[0].mecsClassOrder + "<br>"
  233. + "全科班级:"
  234. + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
  235. + "<tr><td>" + object.data.multiExamClassScores[0].mecsAvgScore + "</td><td>" + object.data.multiExamClassScores[0].mecsMaxScore + "</td><td>" + object.data.multiExamClassScores[0].mecs3quatrerScore + "</td><td>" + object.data.multiExamClassScores[0].mecsHalfScore + "</td><td>" + object.data.multiExamClassScores[0].mecsQuarterScore + "</td><td>" + object.data.multiExamClassScores[0].mecsMinScore + "</td></tr></table>"
  236. + "<br><br>全科分数年级排名:" + object.data.multiExamStudentScore.messGradeOrder + "<br>"
  237. + "全科年级参考人数:" + object.data.multiExamSchoolScore.mecsStudentCount + "<br>"
  238. + "全科年级:"
  239. + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
  240. + "<tr><td>" + object.data.multiExam.meAvgScore + "</td><td>" + object.data.multiExam.meMaxScore + "</td><td>" + object.data.multiExam.me3QuatrerScore + "</td><td>" + object.data.multiExam.meHalfScore + "</td><td>" + object.data.multiExam.meQuarterScore + "</td><td>" + object.data.multiExam.meMinScore + "</td></tr></table><br><br>"
  241. + classText;
  242. $("#fileOutput table").css("display", "inline-table");
  243. $("#fileOutput table").css("margin-bottom", "0px");
  244. $('.chart').show();
  245. sChart1 = echarts.init($("#score1")[0]);
  246. sChart2 = echarts.init($("#score2")[0]);
  247. oChart1 = echarts.init($("#order1")[0]);
  248. oChart2 = echarts.init($("#order2")[0]);
  249. oChart3 = echarts.init($("#order3")[0]);
  250. oChart4 = echarts.init($("#order4")[0]);
  251. seNameDicP = []; scorePP = []; avgPP = []; rate0P = []; rate25P = []; rate50P = []; rate75P = []; rate100P = []; rateFullP = [];
  252. scoreQ = []; avgQ = []; rate0Q = []; rate25Q = []; rate50Q = []; rate75Q = []; rate100Q = [];
  253. seNameDicP2 = []; classOrderPP = []; gradeOrderPP = []; classOrderQ = []; gradeOrderQ = [];
  254. seNameDicP3 = []; ysClassOrderPP = []; ysClassOrderQ = [];
  255. console.log(scoreP)
  256. for (var i = 0; i < seIds.length; i++) {
  257. var g = seIds[i];
  258. if (seNameDic[g].substr(0, 2) == '总分') continue;
  259. seNameDicP.push(seNameDic[g].substr(0, 2));
  260. scorePP.push(scoreP[g]);
  261. avgPP.push(avgP[g]);
  262. rate0P.push(rate0[g]);
  263. rate25P.push(rate25[g]);
  264. rate50P.push(rate50[g]);
  265. rate75P.push(rate75[g]);
  266. rate100P.push(rate100[g]);
  267. rateFullP.push(rateFull[g]);
  268. scoreQ.push(decimal(scoreP[g] / rateFull[g] * 100, 1));
  269. avgQ.push(decimal(avgP[g] / rateFull[g] * 100, 1));
  270. rate0Q.push(decimal(rate0[g] / rateFull[g] * 100, 1));
  271. rate25Q.push(decimal(rate25[g] / rateFull[g] * 100, 1));
  272. rate50Q.push(decimal(rate50[g] / rateFull[g] * 100, 1));
  273. rate75Q.push(decimal(rate75[g] / rateFull[g] * 100, 1));
  274. rate100Q.push(decimal(rate100[g] / rateFull[g] * 100, 1));
  275. }
  276. for (var i = 0; i < seIds.length; i++) {
  277. var g = seIds[i];
  278. seNameDicP2.push(seNameDic[g].substr(0, 2));
  279. classOrderPP.push(classOrderP[g]);
  280. gradeOrderPP.push(gradeOrderP[g]);
  281. classOrderQ.push(decimal(classOrder[g] * 100, 1));
  282. gradeOrderQ.push(decimal(gradeOrder[g] * 100, 1));
  283. }
  284. for (var i in ysClassOrderP) {
  285. seNameDicP3.push(seNameDic[i]);
  286. ysClassOrderPP.push(ysClassOrderP[i]);
  287. ysClassOrderQ.push(decimal(ysClassOrder[i] * 100, 1));
  288. }
  289. var sOp1 = {
  290. textStyle: {
  291. fontFamily: 'Noto Serif SC'
  292. },
  293. title: {
  294. text: '分数',
  295. textStyle: {
  296. fontSize: 14,
  297. fontStyle: 'normal',
  298. fontWeight: 'bold',
  299. },
  300. },
  301. tooltip: {
  302. trigger: 'axis'
  303. },
  304. legend: {
  305. data: ['0%', '25%', '50%', '75%', '100%', '满分', '平均分', '我的分数']
  306. },
  307. toolbox: {
  308. show: true,
  309. feature: {
  310. saveAsImage: {
  311. show: true
  312. },
  313. dataView: {
  314. show: true,
  315. readOnly: false
  316. }
  317. },
  318. padding: 25,
  319. orient: 'vertical'
  320. },
  321. calculable: true,
  322. xAxis: [{
  323. type: 'category', data: seNameDicP,
  324. name: '科目',
  325. position: 'left'
  326. }],
  327. yAxis: [{
  328. type: 'value', name: '分数', position: 'left'
  329. }],
  330. series: [{
  331. name: '0%', type: 'line', data: rate0P, color: '#5cb85c'
  332. }, {
  333. name: '25%', type: 'line', data: rate25P, color: '#c7dc68'
  334. }, {
  335. name: '50%', type: 'line', data: rate50P, color: '#c7dc68'
  336. }, {
  337. name: '75%', type: 'line', data: rate75P, color: '#c7dc68'
  338. }, {
  339. name: '100%', type: 'line', data: rate100P, color: '#5cb85c'
  340. }, {
  341. name: '满分', type: 'line', data: rateFullP, color: '#f0ad4e'
  342. }, {
  343. name: '平均分', type: 'line', data: avgPP, color: '#337ab7'
  344. }, {
  345. name: '我的分数', type: 'line', data: scorePP, color: '#e2041b'
  346. }],
  347. };
  348. var sOp2 = {
  349. textStyle: {
  350. fontFamily: 'Noto Serif SC'
  351. },
  352. title: {
  353. text: '得分率',
  354. textStyle: {
  355. fontSize: 14,
  356. fontStyle: 'normal',
  357. fontWeight: 'bold',
  358. },
  359. },
  360. tooltip: {
  361. trigger: 'axis'
  362. },
  363. legend: {
  364. data: ['0%', '25%', '50%', '75%', '100%', '平均得分率', '我的得分率']
  365. },
  366. toolbox: {
  367. show: true,
  368. feature: {
  369. saveAsImage: {
  370. show: true
  371. },
  372. dataView: {
  373. show: true,
  374. readOnly: false
  375. }
  376. },
  377. padding: 25,
  378. orient: 'vertical'
  379. },
  380. calculable: true,
  381. xAxis: [{
  382. type: 'category',
  383. data: seNameDicP,
  384. name: '科目',
  385. position: 'left'
  386. }],
  387. yAxis: [{
  388. type: 'value',
  389. name: '得分率(%)',
  390. position: 'left'
  391. }],
  392. series: [{
  393. name: '0%', type: 'line', data: rate0Q, color: '#5cb85c'
  394. }, {
  395. name: '25%', type: 'line', data: rate25Q, color: '#c7dc68'
  396. }, {
  397. name: '50%', type: 'line', data: rate50Q, color: '#c7dc68'
  398. }, {
  399. name: '75%', type: 'line', data: rate75Q, color: '#c7dc68'
  400. }, {
  401. name: '100%', type: 'line', data: rate100Q, color: '#5cb85c'
  402. }, {
  403. name: '平均得分率', type: 'line', data: avgQ, color: '#337ab7'
  404. }, {
  405. name: '我的得分率', type: 'line', data: scoreQ, color: '#d9534f'
  406. }
  407. ]
  408. };
  409. var oOp1 = {
  410. textStyle: {
  411. fontFamily: 'Noto Serif SC'
  412. }, title: {
  413. text: '行政排名位次',
  414. textStyle: {
  415. fontSize: 14,
  416. fontStyle: 'normal',
  417. fontWeight: 'bold'
  418. },
  419. },
  420. tooltip: {
  421. trigger: 'axis'
  422. },
  423. legend: {
  424. data: ['班级排名', '年级排名']
  425. },
  426. toolbox: {
  427. show: true,
  428. feature: {
  429. saveAsImage: {
  430. show: true
  431. },
  432. dataView: {
  433. show: true,
  434. readOnly: false
  435. }
  436. },
  437. padding: 25,
  438. orient: 'vertical'
  439. },
  440. calculable: true,
  441. xAxis: [{
  442. type: 'category', data: seNameDicP2,
  443. name: '科目',
  444. position: 'left'
  445. }],
  446. yAxis: [{
  447. type: 'value',
  448. name: '排名',
  449. position: 'left'
  450. }],
  451. series: [{
  452. name: '班级排名', type: 'bar', data: classOrderPP, color: '#5bc0de'
  453. }, {
  454. name: '年级排名', type: 'bar', data: gradeOrderPP, color: '#337ab7'
  455. }
  456. ]
  457. };
  458. var oOp2 = {
  459. textStyle: {
  460. fontFamily: 'Noto Serif SC'
  461. }, title: {
  462. text: '行政排名比例',
  463. textStyle: {
  464. fontSize: 14,
  465. fontStyle: 'normal',
  466. fontWeight: 'bold'
  467. },
  468. },
  469. tooltip: {
  470. trigger: 'axis'
  471. },
  472. legend: {
  473. data: ['班级排名(%)', '年级排名(%)']
  474. },
  475. toolbox: {
  476. show: true,
  477. feature: {
  478. saveAsImage: {
  479. show: true
  480. },
  481. dataView: {
  482. show: true,
  483. readOnly: false
  484. }
  485. },
  486. padding: 25,
  487. orient: 'vertical'
  488. },
  489. calculable: true,
  490. xAxis: [{
  491. type: 'category', data: seNameDicP2,
  492. name: '科目',
  493. position: 'left'
  494. }],
  495. yAxis: [{
  496. type: 'value',
  497. name: '排名(%)',
  498. position: 'left'
  499. }],
  500. series: [{
  501. name: '班级排名(%)', type: 'bar', data: classOrderQ, color: '#5bc0de'
  502. }, {
  503. name: '年级排名(%)', type: 'bar', data: gradeOrderQ, color: '#337ab7'
  504. }
  505. ]
  506. };
  507. var oOp3 = {
  508. textStyle: {
  509. fontFamily: 'Noto Serif SC'
  510. }, title: {
  511. text: '分班排名位次',
  512. textStyle: {
  513. fontSize: 14,
  514. fontStyle: 'normal',
  515. fontWeight: 'bold'
  516. },
  517. },
  518. tooltip: {
  519. trigger: 'axis'
  520. },
  521. legend: {
  522. data: ['分班排名']
  523. },
  524. toolbox: {
  525. show: true,
  526. feature: {
  527. saveAsImage: {
  528. show: true
  529. },
  530. dataView: {
  531. show: true,
  532. readOnly: false
  533. }
  534. },
  535. padding: 25,
  536. orient: 'vertical'
  537. },
  538. calculable: true,
  539. xAxis: [{
  540. type: 'category', data: seNameDicP3,
  541. name: '科目',
  542. position: 'left'
  543. }],
  544. yAxis: [{
  545. type: 'value',
  546. name: '排名',
  547. position: 'left'
  548. }],
  549. series: [{
  550. name: '分班排名', type: 'bar', data: ysClassOrderPP, color: '#5cb85c'
  551. }
  552. ]
  553. };
  554. var oOp4 = {
  555. textStyle: {
  556. fontFamily: 'Noto Serif SC'
  557. }, title: {
  558. text: '分班排名比例',
  559. textStyle: {
  560. fontSize: 14,
  561. fontStyle: 'normal',
  562. fontWeight: 'bold'
  563. },
  564. },
  565. tooltip: {
  566. trigger: 'axis'
  567. },
  568. legend: {
  569. data: ['分班排名(%)']
  570. },
  571. toolbox: {
  572. show: true,
  573. feature: {
  574. saveAsImage: {
  575. show: true
  576. },
  577. dataView: {
  578. show: true,
  579. readOnly: false
  580. }
  581. },
  582. padding: 25,
  583. orient: 'vertical'
  584. },
  585. calculable: true,
  586. xAxis: [{
  587. type: 'category', data: seNameDicP3,
  588. name: '科目',
  589. position: 'left'
  590. }],
  591. yAxis: [{
  592. type: 'value',
  593. name: '排名(%)',
  594. position: 'left'
  595. }],
  596. series: [{
  597. name: '分班排名(%)', type: 'bar', data: ysClassOrderQ, color: '#5cb85c'
  598. }
  599. ]
  600. };
  601. // 为echarts对象加载数据
  602. sChart1.setOption(sOp1);
  603. sChart2.setOption(sOp2);
  604. oChart1.setOption(oOp1);
  605. oChart2.setOption(oOp2);
  606. oChart3.setOption(oOp3);
  607. oChart4.setOption(oOp4);
  608. }
  609. reader.readAsText(file);
  610. }
  611. $().ready(function () {
  612. $(".chart").hide()
  613. })