Sfoglia il codice sorgente

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

lsc 2 anni fa
parent
commit
422a0b5a46

+ 2 - 1
src/components/pages/components/stReport.vue

@@ -125,7 +125,7 @@
 
 <script>
 export default {
-  props: ["ooid"],
+  props: ["ooid", "ccid"],
   data() {
     return {
       sName: "",
@@ -220,6 +220,7 @@ export default {
       let params = {
         uid: this.isChooseStudent,
         oid: this.ooid,
+        cid: this.ccid,
       };
       this.ajax
         .get(this.$store.state.api + "selectMrEva", params)

+ 42 - 0
src/components/pages/learnAnalysis/components/lookModel.vue

@@ -151,6 +151,7 @@ export default {
       userid: this.$route.query.userid,
       org: this.$route.query.org,
       oid: this.$route.query.oid,
+      cid: this.$route.query.classid,
       reportVisible: false,
       checkStudent: "",
       checkCourse: [],
@@ -188,6 +189,7 @@ export default {
       let params = {
         uid: this.userid,
         oid: this.oid,
+        cid: this.cid,
       };
       this.ajax
         .get(this.$store.state.api + "selectMrEva", params)
@@ -199,6 +201,7 @@ export default {
           var studyAllTime = res.data[4];
           var loginAllTime = res.data[5];
           var courseRateList = res.data[6];
+          var classSAllWorkList = res.data[7];
           var sWorksCList = [];
           var cList = [];
           var cTypeList = [];
@@ -347,6 +350,40 @@ export default {
               }
             }
           }
+          var nameArray = [];
+          for (var i = 0; i < classSAllWorkList.length; i++) {
+            if (nameArray.length == 0) {
+              nameArray.push({ name: classSAllWorkList[i].userid, value: 0 });
+            } else {
+              if (nameArray.indexOf(classSAllWorkList[i].userid) == -1) {
+                nameArray.push({ name: classSAllWorkList[i].userid, value: 0 });
+              }
+            }
+          }
+          for (var i = 0; i < classSAllWorkList.length; i++) {
+            if (nameArray[i].name == classSAllWorkList[i].userid) {
+              var rateList = JSON.parse(classSAllWorkList[i].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]];
+                }
+              }
+              nameArray[i].value = Math.round(courseCount / (a.length - 1));
+            }
+          }
+          var c = xArray[0];
+          var d = nameArray.concat(c).filter((item) => item);
+          d.sort(function (x, y) {
+            return y.value - x.value;
+          });
+          var classIndex = d.findIndex(function (item) {
+            return item.name === c.name && item.value === c.value;
+          });
+          overPer.classIndex = classIndex + 1;
           var yzArray = [];
           for (var i = 0; i < scoreXarray.length; i++) {
             var yCount = 0;
@@ -454,6 +491,11 @@ export default {
             overPer.studyTime = `${sTime}秒`;
           }
           overPer.sName = this.stuMessage.name;
+          var courseNum = 0;
+          for (var i = 0; i < yzArray.length; i++) {
+            courseNum += yzArray[i].value;
+          }
+          overPer.courseaScore = Math.floor(courseNum / yzArray.length);
           this.overPer = overPer;
           this.$forceUpdate();
         })

+ 1 - 1
src/components/pages/learnAnalysis/components/modelBase.vue

@@ -67,7 +67,7 @@
           class="modelBottom"
           @click="
             goTo(
-              '/lookModel?userid=a77e9404-efec-11e9-96f9-028edca3b798&oid=45facc0a-1211-11ec-80ad-005056b86db5'
+              '/lookModel??userid=2e7428aa-a5c9-11ed-b13d-005056b86db5&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=null&classid=f6b9d2a5-a5c8-11ed-b13d-005056b86db5,6a09cc92-bf38-11ed-8d51-005056b86db5,01bb15bb-d519-11ed-b81c-005056b86db5'
             )
           "
         >

+ 16 - 2
src/components/pages/myReport/components/mrOverPer.vue

@@ -41,7 +41,7 @@
               </el-tooltip>
             </div>
           </div>
-          <!-- <div class="perItem">
+          <div class="perItem">
             <div>课堂平均得分</div>
             <div>
               <el-tooltip
@@ -54,7 +54,21 @@
                 </div>
               </el-tooltip>
             </div>
-          </div> -->
+          </div>
+          <div class="perItem">
+            <div>课堂平均得分班级排名</div>
+            <div>
+              <el-tooltip
+                effect="light"
+                :content="'第' + data.classIndex + '名'"
+                placement="top"
+              >
+                <div>
+                  {{ "第" + data.classIndex + "名" }}
+                </div>
+              </el-tooltip>
+            </div>
+          </div>
         </div>
         <!-- <div class="allPerBoottom">
           <div class="avaImg">

+ 38 - 1
src/components/pages/myReport/myReport.vue

@@ -144,6 +144,7 @@ export default {
       userid: this.$route.query.userid,
       org: this.$route.query.org,
       oid: this.$route.query.oid,
+      cid: this.$route.query.classid,
       reportVisible: false,
       checkStudent: "",
       checkCourse: [],
@@ -181,6 +182,7 @@ export default {
       let params = {
         uid: this.userid,
         oid: this.oid,
+        cid: this.cid,
       };
       this.ajax
         .get(this.$store.state.api + "selectMrEva", params)
@@ -192,6 +194,7 @@ export default {
           var studyAllTime = res.data[4];
           var loginAllTime = res.data[5];
           var courseRateList = res.data[6];
+          var classSAllWorkList = res.data[7];
           var sWorksCList = [];
           var cList = [];
           var cTypeList = [];
@@ -340,6 +343,40 @@ export default {
               }
             }
           }
+          var nameArray = [];
+          for (var i = 0; i < classSAllWorkList.length; i++) {
+            if (nameArray.length == 0) {
+              nameArray.push({ name: classSAllWorkList[i].userid, value: 0 });
+            } else {
+              if (nameArray.indexOf(classSAllWorkList[i].userid) == -1) {
+                nameArray.push({ name: classSAllWorkList[i].userid, value: 0 });
+              }
+            }
+          }
+          for (var i = 0; i < classSAllWorkList.length; i++) {
+            if (nameArray[i].name == classSAllWorkList[i].userid) {
+              var rateList = JSON.parse(classSAllWorkList[i].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]];
+                }
+              }
+              nameArray[i].value = Math.round(courseCount / (a.length - 1));
+            }
+          }
+          var c = xArray[0];
+          var d = nameArray.concat(c).filter(item => item);;
+          d.sort(function (x, y) {
+            return y.value - x.value;
+          });
+          var classIndex = d.findIndex(function (item) {
+            return item.name === c.name && item.value === c.value;
+          });
+          overPer.classIndex = classIndex + 1;
           var yzArray = [];
           for (var i = 0; i < scoreXarray.length; i++) {
             var yCount = 0;
@@ -354,7 +391,7 @@ export default {
             return b.value - a.value;
           });
           this.cEvaScore = yzArray;
-          
+
           var ctArray = [];
           var cxtArray = [];
           for (var i = 0; i < cTypeList.length; i++) {

+ 2 - 1
src/components/pages/worksReport.vue

@@ -54,7 +54,7 @@
           </div>
         </div>
         <div>
-          <StReport v-if="wrType == 0" :uuid="userid" :ooid="oid"></StReport>
+          <StReport v-if="wrType == 0" :uuid="userid" :ooid="oid" :ccid="cid"></StReport>
           <ClassReport v-if="wrType == 1" :ooid="oid"></ClassReport>
           <CourseReport v-if="wrType == 2" :ooid="oid"></CourseReport>
           <EvaReport v-if="wrType == 3" :ooid="oid"></EvaReport>
@@ -81,6 +81,7 @@ export default {
       userid: this.$route.query.userid,
       org: this.$route.query.org,
       oid: this.$route.query.oid,
+      cid: this.$route.query.classid,
       wrType: 0,
     };
   },