|
@@ -33,7 +33,7 @@
|
|
|
<div class="title">学生行为数据</div>
|
|
|
</div>
|
|
|
<div class="dataBox">
|
|
|
- <stuAct style="height: calc(100% - 20px)"></stuAct>
|
|
|
+ <stuAct style="height: calc(100% - 20px)" :courseClass="courseClass"></stuAct>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,9 +139,12 @@
|
|
|
<div class="top">
|
|
|
<div class="titleBox">
|
|
|
<div class="title">学生综合评价</div>
|
|
|
+ <el-select v-model="eva" @change="typeChange2" @focus="setMinWidth" class="selectBox" style="width: 150px;">
|
|
|
+ <el-option v-for="item in evArray" :key="item.id" :label="item.title" :value="item.id" :style="{'width': minWidth + 2 + 'px'}"></el-option>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<div class="dataBox">
|
|
|
- <studentInfo2></studentInfo2>
|
|
|
+ <studentInfo2 :evCourseArray="evCourseArray" :eva="eva"></studentInfo2>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
@@ -197,13 +200,21 @@ export default {
|
|
|
loginCountMonthArray:[],
|
|
|
weekCount:0,
|
|
|
classList:[],
|
|
|
- scoreJun:0
|
|
|
+ scoreJun:0,
|
|
|
+ evArray:[],
|
|
|
+ eva:'',
|
|
|
+ evCourseArray:[],
|
|
|
+ minWidth:0,
|
|
|
+ courseClass:[]
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ setMinWidth (val) {
|
|
|
+ this.minWidth = val.srcElement.clientWidth
|
|
|
+ },
|
|
|
getData() {
|
|
|
this.isLoading = true;
|
|
|
let params = [
|
|
@@ -269,6 +280,93 @@ export default {
|
|
|
_sumScore += _score.wScore
|
|
|
}
|
|
|
this.scoreJun = (_sumScore / _scoreArray.length).toFixed(0)
|
|
|
+
|
|
|
+
|
|
|
+ let _evArray = res.data[7] //目标数组
|
|
|
+ let _evWorkArray = res.data[8] //目标课程的作业
|
|
|
+ let _evCourseArray = [] //计算总分
|
|
|
+ let _evCourse = [] //筛选有目标的数组
|
|
|
+ for(var i = 0;i<_evWorkArray.length;i++){
|
|
|
+ let courseJson = JSON.parse(_evWorkArray[i].chapters)
|
|
|
+ let _rate = JSON.parse(_evWorkArray[i].rate)
|
|
|
+ delete _rate.content
|
|
|
+ if(courseJson[_evWorkArray[i].stage] &&
|
|
|
+ courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task] &&
|
|
|
+ courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList &&
|
|
|
+ courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList.length){
|
|
|
+ let _elist = courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList
|
|
|
+ let _rateC = Object.keys(_rate)
|
|
|
+ let json = {}
|
|
|
+ for(var j = 0;j<_rateC.length;j++){
|
|
|
+ for(var k = 0;k<_elist.length;k++){
|
|
|
+ if(_elist[k].value == _rateC[j] && _elist[k].target){
|
|
|
+ json[_elist[k].target[0]] = _rate[_rateC[j]]
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Object.keys(json).length){
|
|
|
+ _evCourse.push({
|
|
|
+ evid:_evWorkArray[i].evaId,
|
|
|
+ rateJson:json
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(var i = 0;i<_evArray.length;i++){
|
|
|
+ _evCourseArray.push({
|
|
|
+ title:_evArray[i].title,
|
|
|
+ evid:_evArray[i].id,
|
|
|
+ evJson:{}
|
|
|
+ })
|
|
|
+ for(var j = 0;j<_evCourse.length;j++){
|
|
|
+ if(_evArray[i].id == _evCourse[j].evid){
|
|
|
+ let _rate = Object.keys(_evCourse[j].rateJson)
|
|
|
+ for(var k = 0;k<_rate.length;k++){
|
|
|
+ if(_evCourseArray[i].evJson[_rate[k]]){
|
|
|
+ _evCourseArray[i].evJson[_rate[k]].push(_evCourse[j].rateJson[_rate[k]])
|
|
|
+ }else{
|
|
|
+ _evCourseArray[i].evJson[_rate[k]] = [_evCourse[j].rateJson[_rate[k]]]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(var i = 0;i < _evCourseArray.length; i++){
|
|
|
+ _evCourseArray[i].indicator = []
|
|
|
+ _evCourseArray[i].value = []
|
|
|
+ let evJson = Object.keys(_evCourseArray[i].evJson)
|
|
|
+ for(var j = 0;j < evJson.length;j++){
|
|
|
+ _evCourseArray[i].indicator.push({
|
|
|
+ name:evJson[j],
|
|
|
+ max: 5
|
|
|
+ })
|
|
|
+ let sum = 0
|
|
|
+ _evCourseArray[i].evJson[evJson[j]].forEach((value)=>{
|
|
|
+ sum+=value
|
|
|
+ })
|
|
|
+ _evCourseArray[i].value.push((sum / _evCourseArray[i].evJson[evJson[j]].length).toFixed(1))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.evArray = _evArray
|
|
|
+ this.eva = _evArray[0].id
|
|
|
+ this.evCourseArray = _evCourseArray
|
|
|
+
|
|
|
+ let _courseClassArray = res.data[9] //作业带课程
|
|
|
+ let _courseClass = []
|
|
|
+ for(var i = 0;i<_classList.length;i++){
|
|
|
+ _courseClass.push({
|
|
|
+ name:_classList[i].name,
|
|
|
+ works:0,
|
|
|
+ id:_classList[i].id
|
|
|
+ })
|
|
|
+ for(var j = 0;j<_courseClassArray.length;j++){
|
|
|
+ if(_courseClassArray[j].classid.indexOf(_classList[i].id) != -1){
|
|
|
+ _courseClass[i].works++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.courseClass = _courseClass
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.isLoading = false;
|
|
@@ -474,4 +572,18 @@ export default {
|
|
|
}
|
|
|
.depth > div:nth-child(1) {
|
|
|
}
|
|
|
+
|
|
|
+.selectBox {
|
|
|
+ width: 80px;
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.selectBox>>>.el-input__inner {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+}
|
|
|
+
|
|
|
+.selectBox>>>.el-input__icon {
|
|
|
+ line-height: 30px;
|
|
|
+}
|
|
|
</style>
|