|
@@ -132,7 +132,7 @@
|
|
|
</div>
|
|
|
<div class="dataBox">
|
|
|
<teacherInfo v-if="courseType == 0" style="height: calc(100%)" :courseArray="courseArray"></teacherInfo>
|
|
|
- <courseNum v-if="courseType == 1" style="height: calc(100%)"></courseNum>
|
|
|
+ <courseNum v-if="courseType == 1" style="height: calc(100%)" :weekCourse2="weekCourse2"></courseNum>
|
|
|
<div style="height: calc(100%)" v-if="courseType == 2">
|
|
|
<div class="info_box" style="width: 96%;">
|
|
|
<div class="info blueBG" style="width:calc(100% / 4 - 10px)">
|
|
@@ -181,7 +181,7 @@
|
|
|
<span>上传课程</span>
|
|
|
<div>
|
|
|
<el-progress :width="80" type="circle"
|
|
|
- :percentage="this.lightJson.upCourseTeachers ? (this.lightJson.upCourseTeachers / this.lightJson.teachers * 100).toFixed(0) : 0"
|
|
|
+ :percentage="lightJson.upCourseTeachers ? parseInt((lightJson.upCourseTeachers / lightJson.teachers * 100).toFixed(0)) : 0"
|
|
|
:stroke-width="5" :format="format" color="rgb(64, 149, 229)"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -189,7 +189,7 @@
|
|
|
<span>上传项目</span>
|
|
|
<div>
|
|
|
<el-progress :width="80" type="circle"
|
|
|
- :percentage="this.lightJson.upSCourseTeachers ? (this.lightJson.upSCourseTeachers / this.lightJson.teachers * 100).toFixed(0) : 0"
|
|
|
+ :percentage="lightJson.upSCourseTeachers ? parseInt((lightJson.upSCourseTeachers / lightJson.teachers * 100).toFixed(0)) : 0"
|
|
|
:stroke-width="5" :format="format" color="rgb(64, 149, 229)"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -197,7 +197,7 @@
|
|
|
<span>使用工具</span>
|
|
|
<div>
|
|
|
<el-progress :width="80" type="circle"
|
|
|
- :percentage="this.lightJson.toolTeachers ? (this.lightJson.toolTeachers / this.lightJson.teachers * 100).toFixed(0) : 0"
|
|
|
+ :percentage="lightJson.toolTeachers ? parseInt((lightJson.toolTeachers / lightJson.teachers * 100).toFixed(0)) : 0"
|
|
|
:stroke-width="5" :format="format" color="rgb(64, 149, 229)"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -205,7 +205,7 @@
|
|
|
<span>协同合作</span>
|
|
|
<div>
|
|
|
<el-progress :width="80" type="circle"
|
|
|
- :percentage="this.lightJson.gCourseTeachers ? (this.lightJson.gCourseTeachers / this.lightJson.teachers * 100).toFixed(0) : 0"
|
|
|
+ :percentage="lightJson.gCourseTeachers ? parseInt((lightJson.gCourseTeachers / lightJson.teachers * 100).toFixed(0)) : 0"
|
|
|
:stroke-width="5" :format="format" color="rgb(64, 149, 229)"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -213,43 +213,48 @@
|
|
|
<span>互动交流</span>
|
|
|
<div>
|
|
|
<el-progress :width="80" type="circle"
|
|
|
- :percentage="this.lightJson.commentTeachers ? (this.lightJson.commentTeachers / this.lightJson.teachers * 100).toFixed(0) : 0"
|
|
|
+ :percentage="lightJson.commentTeachers ? parseInt((lightJson.commentTeachers / lightJson.teachers * 100).toFixed(0)) : 0"
|
|
|
:stroke-width="5" :format="format" color="rgb(64, 149, 229)"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>参与课程</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
- color="#106BFF"></el-progress>
|
|
|
+ <el-progress :width="80" type="circle"
|
|
|
+ :percentage="lightJson.courseStudents ? parseInt((lightJson.courseStudents / lightJson.students * 100).toFixed(0)) : 0"
|
|
|
+ :stroke-width="5" :format="format" color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>参与项目</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
- color="#106BFF"></el-progress>
|
|
|
+ <el-progress :width="80" type="circle"
|
|
|
+ :percentage="lightJson.scourseStudents ? parseInt((lightJson.scourseStudents / lightJson.students * 100).toFixed(0)) : 0"
|
|
|
+ :stroke-width="5" :format="format" color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>使用工具</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
- color="#106BFF"></el-progress>
|
|
|
+ <el-progress :width="80" type="circle"
|
|
|
+ :percentage="lightJson.toolStudents ? parseInt((lightJson.toolStudents / lightJson.students * 100).toFixed(0)) : 0"
|
|
|
+ :stroke-width="5" :format="format" color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>协同合作</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
- color="#106BFF"></el-progress>
|
|
|
+ <el-progress :width="80" type="circle"
|
|
|
+ :percentage="lightJson.gsCourseStudents ? parseInt((lightJson.gsCourseStudents / lightJson.students * 100).toFixed(0)) : 0"
|
|
|
+ :stroke-width="5" :format="format" color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>互动交流</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
- color="#106BFF"></el-progress>
|
|
|
+ <el-progress :width="80" type="circle"
|
|
|
+ :percentage="lightJson.commentStudents ? parseInt((lightJson.commentStudents / lightJson.students * 100).toFixed(0)) : 0"
|
|
|
+ :stroke-width="5" :format="format" color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -377,8 +382,14 @@ export default {
|
|
|
upSCourseTeachers: 0,//上传项目
|
|
|
gCourseTeachers: 0,//协同课程
|
|
|
toolTeachers: 0,//使用工具
|
|
|
- commentTeachers: 0,//协同交流
|
|
|
+ commentTeachers: 0,//交流
|
|
|
+ courseStudents: 0,//参与课程
|
|
|
+ scourseStudents: 0,//参与项目
|
|
|
+ toolStudents: 0,//使用工具
|
|
|
+ gsCourseStudents: 0,//协同课程
|
|
|
+ commentStudents: 0,//协同交流
|
|
|
},
|
|
|
+ weekCourse2: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -659,15 +670,7 @@ export default {
|
|
|
this.themeArray = _themeArray
|
|
|
this.allArray = [..._gradeArray, ..._subjectArray, ..._themeArray]
|
|
|
this.typeChange();
|
|
|
- // lightJson: {
|
|
|
- // teachers: 0,
|
|
|
- // students: 0,
|
|
|
- // upCourseTeachers: 0,//上传课程
|
|
|
- // upSCourseTeachers: 0,//上传项目
|
|
|
- // gCourseTeachers: 0,//协同课程
|
|
|
- // toolUsers: 0,//使用工具
|
|
|
- // commentTeachers: 0,//协同交流
|
|
|
- // },
|
|
|
+
|
|
|
this.lightJson.teachers = res.data[14][0].count; //教师总数
|
|
|
this.lightJson.students = res.data[15][0].count; //学生总数
|
|
|
this.lightJson.upCourseTeachers = res.data[16][0].count; //上传课程老师数量
|
|
@@ -675,6 +678,86 @@ export default {
|
|
|
this.lightJson.toolTeachers = res.data[18][0].count; //使用工具老师数量
|
|
|
this.lightJson.gCourseTeachers = res.data[19][0].count; //协同课程老师数量
|
|
|
this.lightJson.commentTeachers = res.data[20][0].count; //协同交流老师数量
|
|
|
+ this.lightJson.courseStudents = res.data[21][0].count; //参与课程学生数量
|
|
|
+ this.lightJson.scourseStudents = res.data[22][0].count; //参与项目学生数量
|
|
|
+ this.lightJson.toolStudents = res.data[23][0].count; //使用工具数量
|
|
|
+ this.lightJson.gsCourseStudents = res.data[24][0].count; //获取协同项目数量
|
|
|
+ this.lightJson.commentStudents = res.data[25][0].count; //互动交流学生数量
|
|
|
+
|
|
|
+ var today = new Date();
|
|
|
+ var lastDayOfWeek = new Date(today.setDate(today.getDate() - today.getDay() + 7));;//本周周日
|
|
|
+
|
|
|
+ let weekArray = {
|
|
|
+ lastWeek: [],//上周
|
|
|
+ toWeek: [] //本周
|
|
|
+ }
|
|
|
+ for (var i = 0; i < 14; i++) {
|
|
|
+ let time = JSON.parse(JSON.stringify(lastDayOfWeek))
|
|
|
+ let time2 = new Date(time)
|
|
|
+ var a = new Date(time2.setDate(time2.getDate() - i));
|
|
|
+ if (i > 6) {
|
|
|
+ weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
|
|
|
+ } else {
|
|
|
+ weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(weekArray);
|
|
|
+ let weekCourse = [];
|
|
|
+ let weekCourse2 = [];
|
|
|
+ let lastWeekCouseCount = 0
|
|
|
+ let toWeekCouseCount = 0
|
|
|
+ for (var z = 0; z < _course.length; z++) {
|
|
|
+ let _date = new Date(weekArray.lastWeek[weekArray.lastWeek.length - 1])
|
|
|
+ console.log(_date)
|
|
|
+ if (new Date(_course[z].create_at) > _date && _course[z].pid == '34628934-d02f-11ec-8c78-005056b86db5') {
|
|
|
+ weekCourse.push(_course[z])
|
|
|
+ var a = new Date(_course[z].create_at)
|
|
|
+ var string = a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate()
|
|
|
+ if (weekArray.lastWeek.indexOf(string) != -1) {
|
|
|
+ lastWeekCouseCount++
|
|
|
+ } else {
|
|
|
+ toWeekCouseCount++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let lastCourseidWeek = []
|
|
|
+ let toCourseidWeek = []
|
|
|
+ for (var i = 0; i < _grade.length; i++) {
|
|
|
+ weekCourse2.push({
|
|
|
+ name: _grade[i].name,
|
|
|
+ id: _grade[i].id,
|
|
|
+ lastCourse: 0,
|
|
|
+ toCourse: 0,
|
|
|
+ })
|
|
|
+ for (var z = 0; z < weekCourse.length; z++) {
|
|
|
+ if (weekCourse[z].typeid == _grade[i].id) {
|
|
|
+ var a = new Date(weekCourse[z].create_at)
|
|
|
+ var string = a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate()
|
|
|
+ if (weekArray.lastWeek.indexOf(string) != -1) {
|
|
|
+ weekCourse2[i].lastCourse++
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ weekCourse2.push({
|
|
|
+ name: '其他',
|
|
|
+ id: '',
|
|
|
+ lastCourse: (lastWeekCouseCount - lastCourseidWeek.length) > 0 ? (lastWeekCouseCount - lastCourseidWeek.length) : 0,
|
|
|
+ toCourse: (toWeekCouseCount - toCourseidWeek.length) > 0 ? (toWeekCouseCount - toCourseidWeek.length) : 0,
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(weekCourse2);
|
|
|
+ this.weekCourse2 = weekCourse2
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
.catch((err) => {
|