|
@@ -120,19 +120,19 @@
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Bar style="height: calc(100% - 70px)" v-if="skType == 0 && !oType" :workList="tedurArray"></Bar>
|
|
|
- <!-- <ToolUse2 style="height: calc(100% - 100px)" v-if="skType == 0 && oType" :yearArray="courseWorksCountYearArray"></ToolUse2> -->
|
|
|
+ <Bar style="height: calc(100% - 100px)" v-if="skType == 0 && !oType" :workList="tedurArray"></Bar>
|
|
|
+ <ToolUse2 style="height: calc(100% - 100px)" v-if="skType == 0 && oType" :yearArray="courseWorksCountYearArray2"></ToolUse2>
|
|
|
|
|
|
<ToolUse style="height: calc(100% - 100px)" v-if="skType == 1 && !oType2"
|
|
|
: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 class="otherCss" v-if="skType == 0">
|
|
|
<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>
|
|
|
<div class="otherCss" v-if="skType == 1">
|
|
|
<div v-if="!oType2">切换为热力图</div>
|
|
|
<div v-if="oType2">切换为柱状图</div>
|
|
@@ -378,6 +378,7 @@ export default {
|
|
|
courseTList: [],
|
|
|
courseLength: 0,
|
|
|
courseWorksCountYearArray: [],
|
|
|
+ courseWorksCountYearArray2: [],
|
|
|
allCourseWorks: [],
|
|
|
gradeList: [],
|
|
|
subjectList2: [],
|
|
@@ -500,6 +501,90 @@ export default {
|
|
|
}
|
|
|
this.allTime = time;
|
|
|
|
|
|
+ const date = new Date();
|
|
|
+ var Month = date.getMonth() + 1;
|
|
|
+ var Year = date.getFullYear();
|
|
|
+ let courseWorksCountYearArray = [];
|
|
|
+ for (var i = Month; i > Month - 12; i--) {
|
|
|
+ if (i <= 0) {
|
|
|
+ courseWorksCountYearArray.push({
|
|
|
+ Year: Year - 1,
|
|
|
+ Month: 12 + i,
|
|
|
+ mon: 0,
|
|
|
+ tue: 0,
|
|
|
+ wed: 0,
|
|
|
+ thur: 0,
|
|
|
+ fri: 0,
|
|
|
+ sat: 0,
|
|
|
+ sun: 0,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ courseWorksCountYearArray.push({
|
|
|
+ Month: i,
|
|
|
+ Year: Year,
|
|
|
+ mon: 0,
|
|
|
+ tue: 0,
|
|
|
+ wed: 0,
|
|
|
+ thur: 0,
|
|
|
+ fri: 0,
|
|
|
+ sat: 0,
|
|
|
+ sun: 0,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ courseWorksCountYearArray = courseWorksCountYearArray.reverse();
|
|
|
+
|
|
|
+ for (var i = 0; i < this.courseTList.length; i++) {
|
|
|
+ let _date = new Date(this.courseTList[i].create_at);
|
|
|
+ let _type = this.courseTList[i].typeid;
|
|
|
+ var _month = _date.getMonth() + 1;
|
|
|
+ var _year = _date.getFullYear();
|
|
|
+ var _day = _date.getDay();
|
|
|
+ let dayArray = ["sun", "mon", "tue", "wed", "thur", "fri", "sat"];
|
|
|
+ for (var j = 0; j < courseWorksCountYearArray.length; j++) {
|
|
|
+ let time = (this.courseTList[i].text / 3600).toFixed(0)
|
|
|
+ time = parseInt(time) ? parseInt(time) : 0
|
|
|
+ if (this.lType1 == "all") {
|
|
|
+ if (
|
|
|
+ _month == courseWorksCountYearArray[j].Month &&
|
|
|
+ _year == courseWorksCountYearArray[j].Year
|
|
|
+ ) {
|
|
|
+ courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else if (this.lType1 == "grade") {
|
|
|
+ if (
|
|
|
+ _month == courseWorksCountYearArray[j].Month &&
|
|
|
+ _year == courseWorksCountYearArray[j].Year &&
|
|
|
+ this.gradeList.indexOf(_type) != -1
|
|
|
+ ) {
|
|
|
+ courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else if (this.lType1 == "subject") {
|
|
|
+ if (
|
|
|
+ _month == courseWorksCountYearArray[j].Month &&
|
|
|
+ _year == courseWorksCountYearArray[j].Year &&
|
|
|
+ this.subjectList2.indexOf(_type) != -1
|
|
|
+ ) {
|
|
|
+ courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ _month == courseWorksCountYearArray[j].Month &&
|
|
|
+ _year == courseWorksCountYearArray[j].Year &&
|
|
|
+ this.thList.indexOf(_type) != -1
|
|
|
+ ) {
|
|
|
+ courseWorksCountYearArray[j][dayArray[_day]]+=time;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.courseWorksCountYearArray2 = courseWorksCountYearArray;
|
|
|
+
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
typeChange2() {
|
|
@@ -918,36 +1003,13 @@ export default {
|
|
|
this.subjectLength = _sList.length;
|
|
|
this.themeLength = _tList.length;
|
|
|
|
|
|
- var a = [];
|
|
|
- if (this.lType == "all") {
|
|
|
- this.tedurArray = _allTime;
|
|
|
- this.courseLength = _timeList.length;
|
|
|
- } else if (this.lType == "grade") {
|
|
|
- this.tedurArray = _grade;
|
|
|
- this.courseLength = _gList.length;
|
|
|
- } else if (this.lType == "subject") {
|
|
|
- this.tedurArray = _subject;
|
|
|
- this.courseLength = _sList.length;
|
|
|
- } else {
|
|
|
- this.tedurArray = _themeList;
|
|
|
- this.courseLength = _tList.length;
|
|
|
- }
|
|
|
-
|
|
|
- var time = 0;
|
|
|
- a = this.tedurArray;
|
|
|
- for (var i = 0; i < a.length; i++) {
|
|
|
- if (a[i].time) {
|
|
|
- time += a[i].time;
|
|
|
- }
|
|
|
- }
|
|
|
- this.allTime = time;
|
|
|
-
|
|
|
let allCourseWorks = res.data[7]; //作业总数量
|
|
|
this.allCourseWorks = allCourseWorks;
|
|
|
this.gradeList = _gradeList;
|
|
|
this.subjectList2 = _subjectList;
|
|
|
this.thList = _thList;
|
|
|
this.typeChange2();
|
|
|
+ this.typeChange1();
|
|
|
|
|
|
let _course = res.data[8]; //课程
|
|
|
let _gradeArray = [];
|