123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- function toggleHide() {
- $(".hidable").toggle(1000);
- };
- var postKnownExams = '3129,3096,3132,3101,3104,3087,3111,3092,3116,3067,3061,3121,3122,3123,3124,3125,3126,3127,3128,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146'
- var knownExams = ''
- for (let i = 3000; i < 3200; i++)knownExams += i.toString() + ','
- knownExams = knownExams.slice(0, knownExams.length - 1)
- // AV.init({
- // appId: "BmologYYnRqCv0SLHDeDdA17-gzGzoHsz",
- // appKey: "w9mVebFMdCmY6Nh9vfcBGaGt",
- // serverURL: "https://bmologyy.lc-cn-n1-shared.com/",
- // });
- console.log("温馨提示:*成绩*一定不会上传到网络,但为了保证使用范围,可能会对其他信息进行记录。")
- function decimal(x, n) {
- x = Math.round(x * 10 ** n) / 10 ** n;
- return x.toFixed(n);
- }
- var fileCount = 0, cur = 0, files = {};
- function prevFile() {
- cur = (cur - 1 + fileCount) % fileCount;
- processFiles();
- }
- function nextFile() {
- cur = (cur + 1) % fileCount;
- processFiles();
- }
- function clearScreen() {
- $(".chart").hide()
- $("#fileOutput")[0].innerHTML = "";
- // $("#fileInfo")[0].innerHTML = "";
- $("#name")[0].innerHTML = "";
- }
- document.onkeydown = function (event) {
- var e = event || window.event || arguments.callee.caller.arguments[0];
- if (e) {
- if (e.key == "ArrowLeft") {
- prevFile();
- }
- else if (e.key == "ArrowRight") {
- nextFile();
- }
- }
- };
- function getFiles(event) {
- files[fileCount] = event.target.files[0];
- cur = fileCount;
- fileCount++;
- $("#controls").removeClass("disabled");
- $("#lbtn").removeClass("disabled");
- $("#rbtn").removeClass("disabled");
- processFiles(1);
- }
- const key = CryptoJS.enc.Utf8.parse("abcdefgabcdefg12");
- function aesDecrypt(encrypted) {
- var cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Hex.parse(encrypted) })
- var decrypted = CryptoJS.AES.decrypt(cipherParams, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
- return decrypted.toString(CryptoJS.enc.Utf8);
- }
- function aesEncrypt(encrypted) {
- return CryptoJS.AES.encrypt(encrypted, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }).ciphertext.toString();
- }
- function stringToByte(str) {
- var bytes = new Array();
- var len, c;
- len = str.length;
- for (var i = 0; i < len; i++) {
- c = str.charCodeAt(i);
- if (c >= 0x010000 && c <= 0x10FFFF) {
- bytes.push(((c >> 18) & 0x07) | 0xF0);
- bytes.push(((c >> 12) & 0x3F) | 0x80);
- bytes.push(((c >> 6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if (c >= 0x000800 && c <= 0x00FFFF) {
- bytes.push(((c >> 12) & 0x0F) | 0xE0);
- bytes.push(((c >> 6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if (c >= 0x000080 && c <= 0x0007FF) {
- bytes.push(((c >> 6) & 0x1F) | 0xC0);
- bytes.push((c & 0x3F) | 0x80);
- } else {
- bytes.push(c & 0xFF);
- }
- }
- return bytes;
- }
- $().ready(function () {
- $("#Input").keydown(function (e) {
- if (e.keyCode == 13) {
- $("#fetchBtn")[0].click();
- }
- });
- })
- var stuId = {}, examId = {}
- function fetchDo(id) {
- var bd = '{"meId":' + $('#Id').val() + ',"seIds":"' + knownExams + '","schoolId":19707,"studentId":"' + id + '"}';
- console.log(bd)
- bd = aesEncrypt(bd)
- console.log(bd)
- fetch('http://36.112.23.77/analysis/api/student/exam/getStudentReportMEVO', {
- method: 'POST',
- headers: {
- 'Content-type': 'application/json',
- },
- body: bd
- }).then(res => {
- res.text().then(resj => {
- files[fileCount] = new Blob([resj], {
- type: 'text/plain'
- });;
- cur = fileCount;
- fileCount++;
- $("#controls").removeClass("disabled");
- $("#lbtn").removeClass("disabled");
- $("#rbtn").removeClass("disabled");
- processFiles(1);
- });
- })
- }
- function fetchMe(id) {
- if (!parseInt(id)) {
- fetch('/js/e.json', {
- method: 'GET',
- headers: {
- 'Content-type': 'application/json',
- }
- }).then(res => {
- res.json().then(resj => {
- var queryData = resj.data.filter(function (e) {
- return e.name == id
- });
- fetchDo(queryData[0].no)
- });
- })
- } else fetchDo(id)
- }
- function getSe(id) {
- console.log(id)
- if (!stuId[cur]) stuId[cur] = prompt('数字校园号?')
- if (!examId[cur]) examId[cur] = prompt('考试编号?(心意答点击考试标题后,切换考试的列表里可见)')
- var bd = '{"schoolId":19707,"seId":' + id + ',"studentId":"' + stuId[cur] + '"}';
- console.log(bd)
- bd = aesEncrypt(bd)
- fetch('http://36.112.23.77/analysis/api/student/exam/getStudentReportSEVO', {
- method: 'POST',
- headers: {
- 'Content-type': 'application/json',
- },
- body: bd
- }).then(res => {
- res.json().then(resj => {
- // $('#singleDat').html(aesDecrypt(resj.data))
- });
- })
- bd = '{"schoolId":19707,"meId":' + examId[cur] + ',"seId":' + id + ',"studentId":"' + stuId[cur] + '"}';
- console.log(bd)
- bd = aesEncrypt(bd)
- fetch('http://36.112.23.77/analysis/api/student/exam/getStuExamDetailInfo', {
- method: 'POST',
- headers: {
- 'Content-type': 'application/json',
- },
- body: bd
- }).then(res => {
- res.json().then(resj => {
- $('#singleDat').html(aesDecrypt(resj.data))
- });
- })
- }
- function processFiles(isFirstTime = 0) {
- console.log("Start processing No. " + cur);
- var file = files[cur];
- var message = $("#message")[0];
- var upBtn = $("#upbtn")[0];
- var upIcon = $("#upicon")[0];
- var tableLayout = '<table class="table table-responsive" style="table-layout: fixed;">'
- message.innerHTML = (cur + 1) + "/" + (fileCount) + " - " + file.name + " - " + file.size + " 字节 - " + file.type + " - 正在读取...<br>>";
- upBtn.classList.remove('btn-danger');
- upBtn.classList.add('btn-info');
- upIcon.classList.remove('glyphicon-exclamation-sign');
- upIcon.classList.add('glyphicon-open');
- var reader = new FileReader();
- reader.onload = function (event) {
- try {
- var output = $("#fileOutput")[0];
- var info = $("#fileInfo")[0];
- var name = $("#name")[0];
- var object = eval("(" + event.target.result + ")");
- var classText = "", gradingText = "";
- $('#single').empty();
- object.data = eval("(" + aesDecrypt(object.data).toString() + ")");
- examId[cur] = object.data.meId.toString();
- stuId[cur] = object.data.studentId;
- console.log(examId[cur], stuId[cur])
- info.innerHTML = "<h3>" + object.data.multiExam.meName + "</h3>"
- console.log(object.data.multiExam.meName)
- var seIds = [], seNames = [], iter = 1;
- var datSingle = object.data.multiExamStudentScore.singleExamStudentScores, datClass = object.data.singleExamClassScores, datYs = object.data.singleExamClassYsScores, datMulti = object.data.multiExam.singleExams;
- seIds = object.data.seIds;
- for (var i = 0; i < seIds.length; i++) {
- for (var j = 0; j < seIds.length; j++) {
- if (datMulti[i].seId == seIds[j]) {
- seNames[j] = datMulti[i].seCourseName;
- }
- }
- }
- // console.log(seIds)
- // console.log(seNames)
- var seNameDic = {};
- for (var i = 0; i < seIds.length; i++) {
- seNameDic[seIds[i]] = seNames[i];
- }
- seNameDic["0"] = "总分";
- for (var i = 0; i < datYs.length; i++) {
- seNameDic[datYs[i].seId + "Ys"] = seNameDic[datYs[i].seId] + " " + datYs[i].ysClassId;
- }
- var seIdDic = {}, seIdRev = {}, hasId = {};
- for (var i = 0; i < seIds.length; i++) {
- for (var j = 0; j < seIds.length; j++) {
- if (!datSingle[j]) continue;
- if (datSingle[j].seId == seIds[i]) {
- hasId[i] = true;
- seIdDic[j] = i;
- }
- }
- }
- for (var i = 1; i < seIds.length; i++) {
- if (!hasId[i]) seIds[i] = -1
- }
- for (var i = 0; i < seIds.length; i++)seIdRev[seIdDic[i]] = i;
- var scoreP = {}, avgP = {}, rate0 = {}, rate25 = {}, rate50 = {}, rate75 = {}, rate100 = {}, rateFull = {};//表1用
- var classOrderP = {}, ysClassOrderP = {}, gradeOrderP = {};
- var classOrder = {}, ysClassOrder = {}, gradeOrder = {};
- for (var i = 0; i < seIds.length; i++) {
- if (!datSingle[i]) continue;
- var dId = datSingle[i].seId;
- scoreP[dId] = datSingle[i].essScore;
- avgP[dId] = datClass[i].secsAvgScore;
- rate0[dId] = datClass[i].secsMinScore;
- rate25[dId] = datClass[i].secsQuarterScore;
- rate50[dId] = datClass[i].secsHalfScore;
- rate75[dId] = datClass[i].secs3quatrerScore;
- rate100[dId] = datClass[i].secsMaxScore;
- rateFull[dId] = datMulti[seIdDic[i]].seFullScore;
- classOrderP[dId] = datSingle[i].essClassOrder;
- gradeOrderP[dId] = datSingle[i].essGradeOrder;
- classOrder[dId] = decimal(1 - datSingle[i].essClassOrder / datClass[i].secsStudentCount, 3);
- gradeOrder[dId] = decimal(1 - datSingle[i].essGradeOrder / datMulti[seIdDic[i]].seStudentCount, 3);
- }
- classOrder["0"] = decimal(1 - object.data.multiExamStudentScore.messClassOrder / object.data.multiExamClassScores[0].mecsStudentCount, 3); + "<br>"
- gradeOrder["0"] = decimal(1 - object.data.multiExamStudentScore.messGradeOrder / object.data.multiExamSchoolScore.mecsStudentCount, 3); + "<br>"
- classOrderP["0"] = object.data.multiExamStudentScore.messClassOrder;
- gradeOrderP["0"] = object.data.multiExamStudentScore.messGradeOrder
- for (var i = 0; i < datYs.length; i++) {
- for (var j = 0; j < seIds.length; j++) {
- if (!datSingle[j]) continue;
- if (datYs[i].seId == datSingle[j].seId) {
- ysClassOrder[datYs[i].seId + "Ys"] = decimal(1 - datSingle[j].essYsClassOrder / datYs[i].secsStudentCount, 3);
- ysClassOrderP[datYs[i].seId + "Ys"] = datSingle[j].essYsClassOrder;
- }
- }
- }
- for (var i = 0; i < seIds.length; i++) {
- // object.data.multiExamStudentScore.singleExamStudentScores[i].seId ---datSingle
- // object.data.singleExamClassScores[i].seId ---datClass
- // object.data.multiExam.singleExams[i].seId ---datMulti
- // seIds[i]
- // 前两个和后两个数据应该是能分别对上号的(1-2 3-4),用 seIdDic 连接
- // seIdDic {key(1-2): value(3-4),..}
- var g = seIdRev[i];
- if (!datSingle[g]) continue;
- $('#single').append('<button class="btn btn-danger btn-how" onclick="getSe(' + seIds[i] + ');$(\'.btn-how\').removeClass(\'active\');$(this).addClass(\'active\')">' + seNameDic[datSingle[g].seId] + '</button>')
- classText += "<h4>"
- + seNameDic[datSingle[g].seId] + "</h4>"
- + "<b>单科分数:" + datSingle[g].essScore + "</b><br><br>"
- + "单科分数班级排名:" + datSingle[g].essClassOrder + "<br>"
- + "单科班级参考人数:" + datClass[g].secsStudentCount + "<br>"
- + "单科班级年级排名:" + datClass[g].secsClassOrder + "<br>"
- + "单科班级:"
- + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
- + "<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>";
- for (var j = 0; j < datYs.length; j++) {
- if (datYs[j].seId == datSingle[g].seId) {
- classText += "<br><br>"
- + "单科分层班级名称:" + datYs[j].ysClassId + "<br>"
- + "单科分数分层班级排名:" + datSingle[g].essYsClassOrder + "<br>"
- + "单科分层班级参考人数:" + datYs[j].secsStudentCount + "<br>"
- + "单科分层班级年级排名:" + datYs[j].secsClassOrder + "<br>"
- + "单科分层班级:"
- + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
- + "<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>";
- }
- }
- classText += "<br><br>"
- + "单科分数年级排名:" + datSingle[g].essGradeOrder + "<br>"
- + "单科年级参考人数:" + datMulti[seIdDic[g]].seStudentCount + "<br>"
- + "单科年级:"
- + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
- + "<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>";
- }
- } catch (e) {
- console.log(e);
- clearScreen();
- message.innerHTML += "读取失败!";
- upBtn.classList.remove('btn-info');
- upBtn.classList.add('btn-danger');
- upIcon.classList.remove('glyphicon-open');
- upIcon.classList.add('glyphicon-exclamation-sign');
- return;
- }
- $('#single').append('<pre id="singleDat" style="word-wrap: break-word; white-space: normal"></pre><br><br><br>')
- if (isFirstTime) {
- var bd = JSON.stringify({
- content: object.data.multiExamStudentScore.studentName + ' ' + parseInt(object.data.examStudents[0].classId),
- })
- fetch('/score/log', {
- method: 'POST',
- headers: {
- 'Content-type': 'application/json',
- },
- body: bd
- })
- }
- message.innerHTML += "读取成功!"
- + " - 注:实验中学 74 桌出品,我仅做搬运修改。<br>";
- name.innerHTML = "姓名:" + object.data.multiExamStudentScore.studentName;
- info.innerHTML = "<h3>" + object.data.multiExam.meName + "</h3>"
- + "行政班级:" + object.data.examStudents[0].classId + "<br>"
- + "姓名:" + object.data.multiExamStudentScore.studentName + "<br>";
- output.innerHTML = "<br><h4>总分</h4>"
- + "<b>全科分数:" + object.data.multiExamStudentScore.messScore + "</b><br><br>"
- + "全科分数班级排名:" + object.data.multiExamStudentScore.messClassOrder + "<br>"
- + "全科班级参考人数:" + object.data.multiExamClassScores[0].mecsStudentCount + "<br>"
- + "全科班级年级排名:" + object.data.multiExamClassScores[0].mecsClassOrder + "<br>"
- + "全科班级:"
- + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
- + "<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>"
- + "<br><br>全科分数年级排名:" + object.data.multiExamStudentScore.messGradeOrder + "<br>"
- + "全科年级参考人数:" + object.data.multiExamSchoolScore.mecsStudentCount + "<br>"
- + "全科年级:"
- + tableLayout + '<tr><td>平均分</td><td>最高分</td><td>四分位数(75%)</td><td>中位数</td><td>四分位数(25%)</td><td>最低分</td></tr>'
- + "<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>"
- + classText;
- $("#fileOutput table").css("display", "inline-table");
- $("#fileOutput table").css("margin-bottom", "0px");
- $('.chart').show();
- sChart1 = echarts.init($("#score1")[0]);
- sChart2 = echarts.init($("#score2")[0]);
- oChart1 = echarts.init($("#order1")[0]);
- oChart2 = echarts.init($("#order2")[0]);
- oChart3 = echarts.init($("#order3")[0]);
- oChart4 = echarts.init($("#order4")[0]);
- seNameDicP = []; scorePP = []; avgPP = []; rate0P = []; rate25P = []; rate50P = []; rate75P = []; rate100P = []; rateFullP = [];
- scoreQ = []; avgQ = []; rate0Q = []; rate25Q = []; rate50Q = []; rate75Q = []; rate100Q = [];
- seNameDicP2 = []; classOrderPP = []; gradeOrderPP = []; classOrderQ = []; gradeOrderQ = [];
- seNameDicP3 = []; ysClassOrderPP = []; ysClassOrderQ = [];
- seIds[seIds.length] = 0
- for (var i = 0; i < seIds.length; i++) {
- var g = seIds[i];
- if (g == -1) continue;
- if (seNameDic[g].substr(0, 2) == '总分') continue;
- seNameDicP.push(seNameDic[g].substr(0, 2));
- scorePP.push(scoreP[g]);
- avgPP.push(avgP[g]);
- rate0P.push(rate0[g]);
- rate25P.push(rate25[g]);
- rate50P.push(rate50[g]);
- rate75P.push(rate75[g]);
- rate100P.push(rate100[g]);
- rateFullP.push(rateFull[g]);
- scoreQ.push(decimal(scoreP[g] / rateFull[g] * 100, 1));
- avgQ.push(decimal(avgP[g] / rateFull[g] * 100, 1));
- rate0Q.push(decimal(rate0[g] / rateFull[g] * 100, 1));
- rate25Q.push(decimal(rate25[g] / rateFull[g] * 100, 1));
- rate50Q.push(decimal(rate50[g] / rateFull[g] * 100, 1));
- rate75Q.push(decimal(rate75[g] / rateFull[g] * 100, 1));
- rate100Q.push(decimal(rate100[g] / rateFull[g] * 100, 1));
- }
- for (var i = 0; i < seIds.length; i++) {
- var g = seIds[i];
- if (g == -1) continue;
- seNameDicP2.push(seNameDic[g].substr(0, 2));
- classOrderPP.push(classOrderP[g]);
- gradeOrderPP.push(gradeOrderP[g]);
- classOrderQ.push(decimal(classOrder[g] * 100, 1));
- gradeOrderQ.push(decimal(gradeOrder[g] * 100, 1));
- }
- for (var i in ysClassOrderP) {
- seNameDicP3.push(seNameDic[i]);
- ysClassOrderPP.push(ysClassOrderP[i]);
- ysClassOrderQ.push(decimal(ysClassOrder[i] * 100, 1));
- }
- var opBase = {
- textStyle: { fontFamily: 'Noto Serif SC' },
- tooltip: { trigger: 'axis' },
- toolbox: {
- show: true,
- feature: {
- saveAsImage: { show: true },
- dataView: {
- show: true,
- readOnly: false
- }
- },
- padding: 25,
- orient: 'vertical'
- },
- calculable: true,
- }
- var sOp1 = { ...opBase }, sOp2 = { ...opBase }, oOp1 = { ...opBase }, oOp2 = { ...opBase }, oOp3 = { ...opBase }, oOp4 = { ...opBase };
- sOp1.title = {
- text: '分数',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- sOp1.legend = { data: ['0%', '25%', '50%', '75%', '100%', '满分', '平均分', '我的分数'] }
- sOp1.xAxis = [{
- type: 'category', data: seNameDicP,
- name: '科目',
- position: 'left'
- }]
- sOp1.yAxis = [{
- type: 'value', name: '分数', position: 'left'
- }]
- sOp1.series = [
- { name: '0%', type: 'line', data: rate0P, color: '#5cb85c' },
- { name: '25%', type: 'line', data: rate25P, color: '#c7dc68' },
- { name: '50%', type: 'line', data: rate50P, color: '#c7dc68' },
- { name: '75%', type: 'line', data: rate75P, color: '#c7dc68' },
- { name: '100%', type: 'line', data: rate100P, color: '#5cb85c' },
- { name: '满分', type: 'line', data: rateFullP, color: '#f0ad4e' },
- { name: '平均分', type: 'line', data: avgPP, color: '#337ab7' },
- { name: '我的分数', type: 'line', data: scorePP, color: '#e2041b' }
- ]
- sOp2.title = {
- text: '得分率',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- sOp2.legend = { data: ['0%', '25%', '50%', '75%', '100%', '平均得分率', '我的得分率'] }
- sOp2.xAxis = [{
- type: 'category',
- data: seNameDicP,
- name: '科目',
- position: 'left'
- }]
- sOp2.yAxis = [{
- type: 'value',
- name: '得分率(%)',
- position: 'left'
- }]
- sOp2.series = [
- { name: '0%', type: 'line', data: rate0Q, color: '#5cb85c' },
- { name: '25%', type: 'line', data: rate25Q, color: '#c7dc68' },
- { name: '50%', type: 'line', data: rate50Q, color: '#c7dc68' },
- { name: '75%', type: 'line', data: rate75Q, color: '#c7dc68' },
- { name: '100%', type: 'line', data: rate100Q, color: '#5cb85c' },
- { name: '平均得分率', type: 'line', data: avgQ, color: '#337ab7' },
- { name: '我的得分率', type: 'line', data: scoreQ, color: '#d9534f' }
- ]
- oOp1.title = {
- text: '行政排名位次',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- oOp1.legend = { data: ['班级排名', '年级排名'] }
- oOp1.xAxis = [{
- type: 'category', data: seNameDicP2,
- name: '科目',
- position: 'left'
- }]
- oOp1.yAxis = [{
- type: 'value',
- name: '排名',
- position: 'left'
- }]
- oOp1.series = [
- { name: '班级排名', type: 'bar', data: classOrderPP, color: '#5bc0de' },
- { name: '年级排名', type: 'bar', data: gradeOrderPP, color: '#337ab7' }
- ]
- oOp2.title = {
- text: '行政排名比例',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- oOp2.legend = { data: ['班级排名(%)', '年级排名(%)'] }
- oOp2.xAxis = [{
- type: 'category', data: seNameDicP2,
- name: '科目',
- position: 'left'
- }]
- oOp2.yAxis = [{
- type: 'value',
- name: '排名(%)',
- position: 'left'
- }]
- oOp2.series = [
- { name: '班级排名(%)', type: 'bar', data: classOrderQ, color: '#5bc0de' },
- { name: '年级排名(%)', type: 'bar', data: gradeOrderQ, color: '#337ab7' }
- ]
- oOp3.title = {
- text: '分班排名位次',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- oOp3.legend = { data: ['分班排名'] }
- oOp3.xAxis = [{
- type: 'category', data: seNameDicP3,
- name: '科目',
- position: 'left'
- }]
- oOp3.yAxis = [{
- type: 'value',
- name: '排名',
- position: 'left'
- }]
- oOp3.series = [{
- name: '分班排名', type: 'bar', data: ysClassOrderPP, color: '#5cb85c'
- }]
- oOp4.title = {
- text: '分班排名比例',
- textStyle: {
- fontSize: 14,
- fontStyle: 'normal',
- fontWeight: 'bold',
- },
- }
- oOp4.legend = { data: ['分班排名(%)'] }
- oOp4.xAxis = [{
- type: 'category', data: seNameDicP3,
- name: '科目',
- position: 'left'
- }]
- oOp4.yAxis = [{
- type: 'value',
- name: '排名(%)',
- position: 'left'
- }]
- oOp4.series = [{
- name: '分班排名(%)', type: 'bar', data: ysClassOrderQ, color: '#5cb85c'
- }]
- // 为echarts对象加载数据
- sChart1.setOption(sOp1);
- sChart2.setOption(sOp2);
- oChart1.setOption(oOp1);
- oChart2.setOption(oOp2);
- oChart3.setOption(oOp3);
- oChart4.setOption(oOp4);
- window.onresize = function () {
- setTimeout(function () {
- sChart1.resize()
- sChart2.resize()
- oChart1.resize()
- oChart2.resize()
- oChart3.resize()
- oChart4.resize()
- }, 300)
- }
- }
- reader.readAsText(file);
- }
- $().ready(function () {
- $(".chart").hide()
- $(function () { $("[data-toggle='tooltip']").tooltip(); });
- })
|