|
@@ -190,12 +190,14 @@ export default {
|
|
|
var courseList = res.data[2];
|
|
|
var sWorksList = res.data[3];
|
|
|
var studyAllTime = res.data[4];
|
|
|
- var loginAllTime = parseInt(res.data[5][0].text);
|
|
|
+ var loginAllTime = res.data[5];
|
|
|
+ var courseRateList = res.data[6];
|
|
|
var sWorksCList = [];
|
|
|
var cList = [];
|
|
|
var cTypeList = [];
|
|
|
var tool = 0;
|
|
|
var isFinish = 0;
|
|
|
+ var scoreXarray = [];
|
|
|
for (var i = 0; i < this.evaList.length; i++) {
|
|
|
this.evaList[i].course = [];
|
|
|
this.evaList[i].isChoose = [];
|
|
@@ -207,15 +209,18 @@ export default {
|
|
|
}
|
|
|
for (var i = 0; i < courseList.length; i++) {
|
|
|
cList.push(JSON.parse(courseList[i].chapters));
|
|
|
- sWorksCList.push({
|
|
|
- courseid: courseList[i].courseid,
|
|
|
- title: courseList[i].title,
|
|
|
- rate: courseList[i].rate,
|
|
|
- });
|
|
|
+ scoreXarray.push(courseList[i].title);
|
|
|
if (courseList[i].typename != null) {
|
|
|
cTypeList.push(courseList[i].typename.split("/"));
|
|
|
}
|
|
|
}
|
|
|
+ for (var i = 0; i < courseRateList.length; i++) {
|
|
|
+ sWorksCList.push({
|
|
|
+ courseid: courseRateList[i].courseId,
|
|
|
+ title: courseRateList[i].title,
|
|
|
+ rate: courseRateList[i].rate,
|
|
|
+ });
|
|
|
+ }
|
|
|
var count = 0;
|
|
|
for (var i = 0; i < this.evaList.length; i++) {
|
|
|
count += this.evaList[i].course.length;
|
|
@@ -308,45 +313,47 @@ export default {
|
|
|
let overPer = {};
|
|
|
overPer.toolSubRate =
|
|
|
(this.stuMessage.isFinishTaskWorks / allToolWorks).toFixed(2) * 100;
|
|
|
- var array = [];
|
|
|
var xArray = [];
|
|
|
for (var i = 0; i < sWorksCList.length; i++) {
|
|
|
if (xArray.length == 0) {
|
|
|
- xArray.push(sWorksCList[i].title);
|
|
|
+ xArray.push({ name: sWorksCList[i].title, value: 0 });
|
|
|
} else {
|
|
|
if (xArray.indexOf(sWorksCList[i].title) == -1) {
|
|
|
- xArray.push(sWorksCList[i].title);
|
|
|
+ xArray.push({ name: sWorksCList[i].title, value: 0 });
|
|
|
}
|
|
|
}
|
|
|
- var courseCount = 0;
|
|
|
- if (
|
|
|
- sWorksCList[i].rate &&
|
|
|
- sWorksCList[i].rate != null &&
|
|
|
- Object.keys(JSON.parse(sWorksCList[i].rate)).length > 0
|
|
|
- ) {
|
|
|
- var rateList = JSON.parse(sWorksCList[i].rate);
|
|
|
- var a = Object.keys(rateList);
|
|
|
- for (var k = 0; k < a.length; k++) {
|
|
|
- if (a[k] == "content") {
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- courseCount += rateList[a[k]];
|
|
|
+ }
|
|
|
+ for (var i = 0; i < xArray.length; i++) {
|
|
|
+ for (var j = 0; j < sWorksCList.length; j++) {
|
|
|
+ if (xArray[i].name == sWorksCList[j].title) {
|
|
|
+ var rateList = JSON.parse(sWorksCList[j].rate);
|
|
|
+ var a = Object.keys(rateList);
|
|
|
+ var courseCount = 0;
|
|
|
+ for (var k = 0; k < a.length; k++) {
|
|
|
+ if (a[k] == "content") {
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ courseCount += rateList[a[k]];
|
|
|
+ }
|
|
|
}
|
|
|
+ xArray[j].value = Math.round(courseCount / (a.length - 1));
|
|
|
}
|
|
|
- array.push(courseCount);
|
|
|
- } else {
|
|
|
- array.push(courseCount);
|
|
|
}
|
|
|
}
|
|
|
- var tuples = xArray.map((label, index) => [label, array[index]]);
|
|
|
- // 根据数据降序排序二元组
|
|
|
- tuples.sort((a, b) => b[1] - a[1]);
|
|
|
- // 提取已排序的标签
|
|
|
- var xArrayNew = tuples.map((tuple) => tuple[0]);
|
|
|
- var arrayNew = tuples.map((tuple) => tuple[1]);
|
|
|
- for (var i = 0; i < xArrayNew.length; i++) {
|
|
|
- this.cEvaScore.push({ name: xArrayNew[i], value: arrayNew[i] });
|
|
|
+ var yzArray = [];
|
|
|
+ for (var i = 0; i < scoreXarray.length; i++) {
|
|
|
+ var yCount = 0;
|
|
|
+ for (var j = 0; j < xArray.length; j++) {
|
|
|
+ if (scoreXarray[i] == xArray[j].name) {
|
|
|
+ yCount += xArray[j].value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ yzArray.push({ name: scoreXarray[i], value: yCount });
|
|
|
}
|
|
|
+ yzArray.sort(function (a, b) {
|
|
|
+ return b.value - a.value;
|
|
|
+ });
|
|
|
+ this.cEvaScore = yzArray;
|
|
|
var ctArray = [];
|
|
|
var cxtArray = [];
|
|
|
for (var i = 0; i < cTypeList.length; i++) {
|
|
@@ -361,7 +368,6 @@ export default {
|
|
|
cxtArray.push(cTypeList[i][j]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
const result = ctArray
|
|
|
.filter((item) => cxtArray.includes(item))
|
|
|
.map((item) => ({
|
|
@@ -377,19 +383,41 @@ export default {
|
|
|
// 提取已排序的标签
|
|
|
var txArrayNew = tuples1.map((tuple) => tuple[0]);
|
|
|
var tarrayNew = tuples1.map((tuple) => tuple[1]);
|
|
|
+ var subjectList = [
|
|
|
+ "语文",
|
|
|
+ "数学",
|
|
|
+ "英语",
|
|
|
+ "科学",
|
|
|
+ "信息技术",
|
|
|
+ "物理",
|
|
|
+ "化学",
|
|
|
+ "生物",
|
|
|
+ "历史",
|
|
|
+ "地理",
|
|
|
+ "通用技术",
|
|
|
+ "政治",
|
|
|
+ "STEM",
|
|
|
+ "美术",
|
|
|
+ "其他",
|
|
|
+ ];
|
|
|
for (var i = 0; i < txArrayNew.length; i++) {
|
|
|
- this.cTypeAnaList.push({
|
|
|
- name: txArrayNew[i],
|
|
|
- value: tarrayNew[i],
|
|
|
- });
|
|
|
+ if (subjectList.indexOf(txArrayNew[i]) != -1) {
|
|
|
+ this.cTypeAnaList.push({
|
|
|
+ name: txArrayNew[i],
|
|
|
+ value: tarrayNew[i],
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- var days = Math.floor(loginAllTime / (3600 * 24));
|
|
|
- loginAllTime %= 3600 * 24;
|
|
|
- var hours = Math.floor(loginAllTime / 3600);
|
|
|
- loginAllTime %= 3600;
|
|
|
- var minutes = Math.floor(loginAllTime / 60);
|
|
|
- loginAllTime %= 60;
|
|
|
+ var lTime = 0;
|
|
|
+ for (var i = 0; i < loginAllTime.length; i++) {
|
|
|
+ lTime += parseInt(loginAllTime[i].text);
|
|
|
+ }
|
|
|
+ var days = Math.floor(lTime / (3600 * 24));
|
|
|
+ lTime %= 3600 * 24;
|
|
|
+ var hours = Math.floor(lTime / 3600);
|
|
|
+ lTime %= 3600;
|
|
|
+ var minutes = Math.floor(lTime / 60);
|
|
|
+ lTime %= 60;
|
|
|
if (days > 0) {
|
|
|
overPer.loginTime = `${days}天${hours}小时`;
|
|
|
} else if (days < 0 && hours > 0) {
|