lsc 1 year ago
parent
commit
c52b0f8e96
1 changed files with 20 additions and 9 deletions
  1. 20 9
      src/components/pages/dataBoard/school/index.vue

+ 20 - 9
src/components/pages/dataBoard/school/index.vue

@@ -10,7 +10,7 @@
           <div class="info_box">
             <div class="info blueBG">
               <span>用户总数</span>
-              <span>15620</span>
+              <span>{{count}}</span>
             </div>
             <div class="info greenBG">
               <span>周使用频次</span>
@@ -18,11 +18,11 @@
             </div>
             <div class="info blueBG">
               <span>登录频次</span>
-              <span>15620</span>
+              <span>{{loginCount}}</span>
             </div>
             <div class="info greenBG">
               <span>人均使用频次</span>
-              <span>15620</span>
+              <span>{{(loginCount / count).toFixed(0)}}</span>
             </div>
           </div>
           <loginCount style="height: calc(100% - 140px);"></loginCount>
@@ -36,11 +36,11 @@
           <div class="info_box">
             <div class="info blueBG">
               <span>累计时长</span>
-              <span>15620</span>
+              <span>{{loginTime.toFixed(0)}}小时</span>
             </div>
             <div class="info greenBG">
               <span>人均时长</span>
-              <span>15620</span>
+              <span>{{(loginTime / count).toFixed(0)}}小时</span>
             </div>
           </div>
           <loginTime style="height: calc(100% - 70px);"></loginTime>
@@ -56,7 +56,7 @@
           <div class="info_box" style="width:95%">
             <div class="info2 blueBG">
               <span>上传课程总数</span>
-              <span>15620</span>
+              <span>{{courseCount}}</span>
             </div>
             <div class="info2 greenBG">
               <span>各年级平均课程数</span>
@@ -68,7 +68,7 @@
             </div>
             <div class="info2 greenBG">
               <span>教师人均课程数</span>
-              <span>15620</span>
+              <span>{{(courseCount / teacherCount).toFixed(0)}}</span>
             </div>
           </div>
           <teacherInfo style="height: calc(100% - 70px);"></teacherInfo>
@@ -134,7 +134,7 @@
             <div class="info_box">
                 <div class="info3 blueBG">
                   <span>课程总数</span>
-                  <span>1254</span>
+                  <span>{{courseCount}}</span>
                 </div>
                 <div class="info3 greenBG">
                   <span>类别总数</span>
@@ -180,7 +180,12 @@ export default {
   },
   data() {
     return {
-      isLoading: false
+      isLoading: false,
+      count:0,
+      loginCount:0,
+      loginTime:0,
+      courseCount:0,
+      teacherCount:0
     }
   },
   mounted() {
@@ -196,6 +201,12 @@ export default {
         .post(this.$store.state.api + "selectDataBoardSchool", params)
         .then((res) => {
           this.isLoading = false;
+          this.count = res.data[0][0].count
+          this.loginCount = res.data[1][0].loginCount
+          this.loginTime = parseInt(res.data[3][0].time) / 60  / 60
+          this.courseCount = res.data[5][0].courseCount
+          this.teacherCount = res.data[6][0].count
+          
         })
         .catch((err) => {
           this.isLoading = false;