|
@@ -127,15 +127,15 @@
|
|
|
:yearArray="courseWorksCountYearArray"></ToolUse>
|
|
|
<Bar2 style="height: calc(100% - 100px)" v-if="skType == 1 && oType2" :workList="tedurArray2"></Bar2>
|
|
|
<div class="otherCss" v-if="skType == 0">
|
|
|
- <div v-if="!oType">切换为柱状图</div>
|
|
|
- <div v-if="oType">切换为热力图</div>
|
|
|
+ <div v-if="!oType">切换为热力图</div>
|
|
|
+ <div v-if="oType">切换为柱状图</div>
|
|
|
<div class="otherImg" @click="otherEchart">
|
|
|
<img src="../../../../assets/icon/other.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="otherCss" v-if="skType == 1">
|
|
|
- <div v-if="!oType2">切换为热力图</div>
|
|
|
- <div v-if="oType2">切换为柱状图</div>
|
|
|
+ <div v-if="!oType2">切换为柱状图</div>
|
|
|
+ <div v-if="oType2">切换为热力图</div>
|
|
|
<div class="otherImg" @click="otherEchart2">
|
|
|
<img src="../../../../assets/icon/other.png" alt="" />
|
|
|
</div>
|
|
@@ -537,7 +537,7 @@ export default {
|
|
|
|
|
|
for (var i = 0; i < this.courseTList.length; i++) {
|
|
|
let _date = new Date(this.courseTList[i].create_at);
|
|
|
- let _type = this.courseTList[i].typeid;
|
|
|
+ let _type = this.courseTList[i].type ? this.courseTList[i].type.split(",") : [];
|
|
|
var _month = _date.getMonth() + 1;
|
|
|
var _year = _date.getFullYear();
|
|
|
var _day = _date.getDay();
|
|
@@ -557,7 +557,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.gradeList.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.gradeList, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
break;
|
|
@@ -566,7 +566,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.subjectList2.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.subjectList2, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
break;
|
|
@@ -575,7 +575,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.thList.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.thList, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
break;
|
|
@@ -624,7 +624,7 @@ export default {
|
|
|
|
|
|
for (var i = 0; i < this.allCourseWorks.length; i++) {
|
|
|
let _date = new Date(this.allCourseWorks[i].create_at);
|
|
|
- let _type = this.allCourseWorks[i].typeid;
|
|
|
+ let _type = this.allCourseWorks[i].type ?this.allCourseWorks[i].typeid.split(",") : [];
|
|
|
var _month = _date.getMonth() + 1;
|
|
|
var _year = _date.getFullYear();
|
|
|
var _day = _date.getDay();
|
|
@@ -642,7 +642,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.gradeList.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.gradeList, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]++;
|
|
|
break;
|
|
@@ -651,7 +651,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.subjectList2.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.subjectList2, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]++;
|
|
|
break;
|
|
@@ -660,7 +660,7 @@ export default {
|
|
|
if (
|
|
|
_month == courseWorksCountYearArray[j].Month &&
|
|
|
_year == courseWorksCountYearArray[j].Year &&
|
|
|
- this.thList.indexOf(_type) != -1
|
|
|
+ this.hasCommonValue(this.thList, _type)
|
|
|
) {
|
|
|
courseWorksCountYearArray[j][dayArray[_day]]++;
|
|
|
break;
|
|
@@ -672,61 +672,66 @@ export default {
|
|
|
var worksCount = 0,
|
|
|
haveWorksCourse = [];
|
|
|
for (var i = 0; i < this.allCourseWorks.length; i++) {
|
|
|
+ if(!this.allCourseWorks[i].pcount > 0){
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ let _type = this.allCourseWorks[i].type ?this.allCourseWorks[i].typeid.split(",") : [];
|
|
|
if (this.lType1 == "all") {
|
|
|
if (this.allCourseWorks[i].id) {
|
|
|
- worksCount++;
|
|
|
+ worksCount+=this.allCourseWorks[i].pcount;
|
|
|
}
|
|
|
if (haveWorksCourse.length == 0) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
} else {
|
|
|
if (
|
|
|
- haveWorksCourse.indexOf(this.allCourseWorks[i].courseid) == -1
|
|
|
+ haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
|
|
|
) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
} else if (this.lType1 == "grade") {
|
|
|
- if (this.gradeList.indexOf(this.allCourseWorks[i].typeid) != -1) {
|
|
|
+
|
|
|
+ if (this.hasCommonValue(this.gradeList, _type)) {
|
|
|
if (this.allCourseWorks[i].id) {
|
|
|
- worksCount++;
|
|
|
+ worksCount+=this.allCourseWorks[i].pcount;
|
|
|
}
|
|
|
if (haveWorksCourse.length == 0) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
} else {
|
|
|
if (
|
|
|
- haveWorksCourse.indexOf(this.allCourseWorks[i].courseid) == -1
|
|
|
+ haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
|
|
|
) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else if (this.lType1 == "subject") {
|
|
|
- if (this.subjectList2.indexOf(this.allCourseWorks[i].typeid) != -1) {
|
|
|
+ if (this.hasCommonValue(this.subjectList2, _type)) {
|
|
|
if (this.allCourseWorks[i].id) {
|
|
|
- worksCount++;
|
|
|
+ worksCount+=this.allCourseWorks[i].pcount;
|
|
|
}
|
|
|
if (haveWorksCourse.length == 0) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
} else {
|
|
|
if (
|
|
|
- haveWorksCourse.indexOf(this.allCourseWorks[i].courseid) == -1
|
|
|
+ haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
|
|
|
) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.thList.indexOf(this.allCourseWorks[i].typeid) != -1) {
|
|
|
+ if (this.hasCommonValue(this.thList, _type)) {
|
|
|
if (this.allCourseWorks[i].id) {
|
|
|
- worksCount++;
|
|
|
+ worksCount+=this.allCourseWorks[i].pcount;
|
|
|
}
|
|
|
if (haveWorksCourse.length == 0) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
} else {
|
|
|
if (
|
|
|
- haveWorksCourse.indexOf(this.allCourseWorks[i].courseid) == -1
|
|
|
+ haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
|
|
|
) {
|
|
|
- haveWorksCourse.push(this.allCourseWorks[i].courseid);
|
|
|
+ haveWorksCourse.push(this.allCourseWorks[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -883,15 +888,22 @@ export default {
|
|
|
});
|
|
|
var courseJson = Object.values(
|
|
|
tList.reduce(function (acc, obj) {
|
|
|
- if (!acc[obj.courseid]) {
|
|
|
- acc[obj.courseid] = { ...obj };
|
|
|
- acc[obj.courseid].typeid = [acc[obj.courseid].typeid];
|
|
|
+ if (!acc[obj.courseId]) {
|
|
|
+ acc[obj.courseId] = { ...obj };
|
|
|
+ acc[obj.courseId].typeid = [acc[obj.courseId].typeid];
|
|
|
} else {
|
|
|
- if (!acc[obj.courseid].typeid.includes(obj.typeid)) {
|
|
|
- acc[obj.courseid].typeid.push(obj.typeid);
|
|
|
+ // if (!acc[obj.courseId].typeid.includes(obj.typeid)) {
|
|
|
+ // acc[obj.courseId].typeid.push(obj.typeid);
|
|
|
+ // }
|
|
|
+ let _typeA = obj.type ? obj.type.split(',') : [];
|
|
|
+ for (var i = 0; i < _typeA.length; i++) {
|
|
|
+ if (!acc[obj.courseId].typeid.includes(_typeA[i])) {
|
|
|
+ acc[obj.courseId].typeid.push(_typeA[i]);
|
|
|
+ }
|
|
|
}
|
|
|
- acc[obj.courseid].text =
|
|
|
- parseInt(acc[obj.courseid].text) + parseInt(obj.text);
|
|
|
+
|
|
|
+ acc[obj.courseId].text =
|
|
|
+ parseInt(acc[obj.courseId].text) + parseInt(obj.text);
|
|
|
}
|
|
|
return acc;
|
|
|
}, {})
|
|
@@ -966,36 +978,36 @@ export default {
|
|
|
for (var i = 0; i < _courseTypeList.length; i++) {
|
|
|
|
|
|
if (_timeList.length == 0) {
|
|
|
- _timeList.push(_courseTypeList[i].courseid);
|
|
|
+ _timeList.push(_courseTypeList[i].courseId);
|
|
|
} else {
|
|
|
- if (_timeList.indexOf(_courseTypeList[i].courseid) == -1) {
|
|
|
- _timeList.push(_courseTypeList[i].courseid);
|
|
|
+ if (_timeList.indexOf(_courseTypeList[i].courseId) == -1) {
|
|
|
+ _timeList.push(_courseTypeList[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
if (_gradeList.indexOf(_courseTypeList[i].typeid) != -1) {
|
|
|
if (_gList.length == 0) {
|
|
|
- _gList.push(_courseTypeList[i].courseid);
|
|
|
+ _gList.push(_courseTypeList[i].courseId);
|
|
|
} else {
|
|
|
- if (_gList.indexOf(_courseTypeList[i].courseid) == -1) {
|
|
|
- _gList.push(_courseTypeList[i].courseid);
|
|
|
+ if (_gList.indexOf(_courseTypeList[i].courseId) == -1) {
|
|
|
+ _gList.push(_courseTypeList[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (_subjectList.indexOf(_courseTypeList[i].typeid) != -1) {
|
|
|
if (_sList.length == 0) {
|
|
|
- _sList.push(_courseTypeList[i].courseid);
|
|
|
+ _sList.push(_courseTypeList[i].courseId);
|
|
|
} else {
|
|
|
- if (_sList.indexOf(_courseTypeList[i].courseid) == -1) {
|
|
|
- _sList.push(_courseTypeList[i].courseid);
|
|
|
+ if (_sList.indexOf(_courseTypeList[i].courseId) == -1) {
|
|
|
+ _sList.push(_courseTypeList[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (_thList.indexOf(_courseTypeList[i].typeid) != -1) {
|
|
|
if (_tList.length == 0) {
|
|
|
- _tList.push(_courseTypeList[i].courseid);
|
|
|
+ _tList.push(_courseTypeList[i].courseId);
|
|
|
} else {
|
|
|
- if (_tList.indexOf(_courseTypeList[i].courseid) == -1) {
|
|
|
- _tList.push(_courseTypeList[i].courseid);
|
|
|
+ if (_tList.indexOf(_courseTypeList[i].courseId) == -1) {
|
|
|
+ _tList.push(_courseTypeList[i].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1027,9 +1039,9 @@ export default {
|
|
|
array: [],
|
|
|
});
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
- if (_course[z].typeid == _grade[i].id) {
|
|
|
+ if (_course[z].type&& _course[z].type.indexOf(_grade[i].id) !== -1) {
|
|
|
_gradeArray[i].course++;
|
|
|
- _gradeArray[i].array.push(_course[z].courseid);
|
|
|
+ _gradeArray[i].array.push(_course[z].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1042,9 +1054,9 @@ export default {
|
|
|
array: [],
|
|
|
});
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
- if (_course[z].typeid == _subject[i].id) {
|
|
|
+ if (_course[z].typeid && _course[z].typeid.indexOf(_subject[i].id) !== -1) {
|
|
|
_subjectArray[i].course++;
|
|
|
- _subjectArray[i].array.push(_course[z].courseid);
|
|
|
+ _subjectArray[i].array.push(_course[z].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1057,9 +1069,9 @@ export default {
|
|
|
array: [],
|
|
|
});
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
- if (_course[z].typeid == _themeList[i].id) {
|
|
|
+ if (_course[z].typeid && _course[z].typeid.indexOf(_themeList[i].id) !== -1) {
|
|
|
_themeArray[i].course++;
|
|
|
- _themeArray[i].array.push(_course[z].courseid);
|
|
|
+ _themeArray[i].array.push(_course[z].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1206,9 +1218,9 @@ export default {
|
|
|
let kcourse = res.data[6]
|
|
|
let kJson = {}
|
|
|
for (let i = 0; i < kcourse.length; i++) {
|
|
|
- if (!kJson[kcourse[i].courseid] && kcourse[i].text > 0) {
|
|
|
- kJson[kcourse[i].courseid] = {
|
|
|
- cid: kcourse[i].courseid,
|
|
|
+ if (!kJson[kcourse[i].courseId] && kcourse[i].text > 0) {
|
|
|
+ kJson[kcourse[i].courseId] = {
|
|
|
+ cid: kcourse[i].courseId,
|
|
|
title: kcourse[i].title,
|
|
|
};
|
|
|
}
|
|
@@ -1232,12 +1244,12 @@ export default {
|
|
|
subject: [],
|
|
|
});
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
- if (_course[z].typeid == _grade[i].id) {
|
|
|
+ if (_course[z].type&& _course[z].type.indexOf(_grade[i].id) !== -1){
|
|
|
_gradeCourse++;
|
|
|
if (
|
|
|
- _courseArray[i].courseid.indexOf(_course[z].courseid) === -1
|
|
|
+ _courseArray[i].courseid.indexOf(_course[z].courseId) === -1
|
|
|
) {
|
|
|
- _courseArray[i].courseid.push(_course[z].courseid);
|
|
|
+ _courseArray[i].courseid.push(_course[z].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1249,8 +1261,8 @@ export default {
|
|
|
});
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
if (
|
|
|
- _course[z].typeid == _subject[j].id &&
|
|
|
- _courseArray[i].courseid.indexOf(_course[z].courseid) !== -1
|
|
|
+ _course[z].type&& _course[z].type.indexOf(_subject[j].id) !== -1 &&
|
|
|
+ _courseArray[i].courseid.indexOf(_course[z].courseId) !== -1
|
|
|
) {
|
|
|
_courseArray[i].subject[j].course++;
|
|
|
}
|
|
@@ -1267,7 +1279,7 @@ export default {
|
|
|
}
|
|
|
for (var j = 0; j < _subject.length; j++) {
|
|
|
for (var z = 0; z < _course.length; z++) {
|
|
|
- if (_course[z].typeid == _subject[j].id) {
|
|
|
+ if (_course[z].typeid && _course[z].typeid.indexOf(_subject[j].id) !== -1) {
|
|
|
_subjectCourse++;
|
|
|
}
|
|
|
}
|
|
@@ -1366,7 +1378,7 @@ export default {
|
|
|
toCourse: 0,
|
|
|
});
|
|
|
for (var z = 0; z < weekCourse.length; z++) {
|
|
|
- if (weekCourse[z].typeid == _grade[i].id) {
|
|
|
+ if (weekCourse[z].type && weekCourse[z].type.indexOf(_grade[i].id) !== -1) {
|
|
|
var a = new Date(weekCourse[z].create_at);
|
|
|
var string =
|
|
|
a.getFullYear() +
|
|
@@ -1376,13 +1388,13 @@ export default {
|
|
|
a.getDate();
|
|
|
if (weekArray.lastWeek.indexOf(string) != -1) {
|
|
|
weekCourse2[i].lastCourse++;
|
|
|
- if (lastCourseidWeek.indexOf(weekCourse[z].courseid) === -1) {
|
|
|
- lastCourseidWeek.push(weekCourse[z].courseid);
|
|
|
+ if (lastCourseidWeek.indexOf(weekCourse[z].courseId) === -1) {
|
|
|
+ lastCourseidWeek.push(weekCourse[z].courseId);
|
|
|
}
|
|
|
} else {
|
|
|
weekCourse2[i].toCourse++;
|
|
|
- if (toCourseidWeek.indexOf(weekCourse[z].courseid) === -1) {
|
|
|
- toCourseidWeek.push(weekCourse[z].courseid);
|
|
|
+ if (toCourseidWeek.indexOf(weekCourse[z].courseId) === -1) {
|
|
|
+ toCourseidWeek.push(weekCourse[z].courseId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1453,6 +1465,15 @@ export default {
|
|
|
checkArrayInclusion(arr1, arr2) {
|
|
|
return arr1.every(item => arr2.includes(item));
|
|
|
},
|
|
|
+ hasCommonValue(arr1, arr2) {
|
|
|
+ const set1 = new Set(arr1);
|
|
|
+ for (const val of arr2) {
|
|
|
+ if (set1.has(val)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|