xiatian 4 anos atrás
pai
commit
b8c78d7fca

+ 48 - 46
src/modules/reports/views/ExamStudentOnline.vue

@@ -10,36 +10,38 @@
         <div class="left-div">
           <div class="row-div">
             <div class="total-div">
-              <span style="width: 85px;height: 85px;display:block;">
-                <img
-                  src="../assets/img/u316.png"
-                  style="height: 50px;width: 50px;"
+              <span style="width: 85px; height: 85px; display: block;">
+                <v-icon
+                  name="users"
+                  style="height: 50px; width: 50px;"
                 /> </span
-              ><span style="display:block;margin-left: 10px;">
-                <span style="display:block;font-weight:bold;font-size:40px">{{
-                  totalStudent
-                }}</span>
-                <span style="display:block;">注册学生</span>
+              ><span style="display: block; margin-left: 10px;">
+                <span
+                  style="display: block; font-weight: bold; font-size: 40px;"
+                  >{{ totalStudent }}</span
+                >
+                <span style="display: block;">注册学生</span>
               </span>
             </div>
             <div class="online-div">
-              <span style="width: 85px;height: 85px;display:block;">
-                <img
-                  src="../assets/img/u326.png"
-                  style="height: 50px;width: 50px;"
+              <span style="width: 85px; height: 85px; display: block;">
+                <v-icon
+                  name="user-check"
+                  style="height: 50px; width: 50px;"
                 /> </span
-              ><span style="display:block;margin-left: 10px;">
-                <span style="display:block;font-weight:bold;font-size:40px">{{
-                  totalOnlineStudent
-                }}</span>
-                <span style="display:block;">在线学生</span>
+              ><span style="display: block; margin-left: 10px;">
+                <span
+                  style="display: block; font-weight: bold; font-size: 40px;"
+                  >{{ totalOnlineStudent }}</span
+                >
+                <span style="display: block;">在线学生</span>
               </span>
             </div>
           </div>
           <div class="tb-div">
             <div class="row-div">
-              <span style="float:left;"> 学校在线学生</span
-              ><span style="float:right;"
+              <span style="float: left;"> 学校在线学生</span
+              ><span style="float: right;"
                 ><el-button
                   size="small"
                   type="primary"
@@ -49,7 +51,7 @@
                   详情
                 </el-button></span
               >
-              <span style="float:right;margin-right: 10px;"
+              <span style="float: right; margin-right: 10px;"
                 ><el-button
                   size="small"
                   type="primary"
@@ -103,7 +105,7 @@
         <div class="right-div">
           <div class="row-div">近5日在线学生</div>
           <div class="row-div">
-            <v-charts style="width:500px;" :options="lastNdayData"></v-charts>
+            <v-charts style="width: 500px;" :options="lastNdayData"></v-charts>
           </div>
         </div>
       </div>
@@ -116,32 +118,32 @@ import { mapState } from "vuex";
 import ECharts from "vue-echarts/components/ECharts";
 export default {
   components: {
-    "v-charts": ECharts
+    "v-charts": ECharts,
   },
   name: "ExamStudentOnline",
   data() {
     return {
       lastNdayData: {
         tooltip: {
-          trigger: "axis"
+          trigger: "axis",
         },
         xAxis: {
           axisLabel: {
             interval: 0,
-            rotate: 20
+            rotate: 20,
           },
           type: "category",
-          data: []
+          data: [],
         },
         yAxis: {
-          type: "value"
+          type: "value",
         },
         series: [
           {
             data: [],
-            type: "line"
-          }
-        ]
+            type: "line",
+          },
+        ],
       },
       totalStudent: 0,
       totalOnlineStudent: 0,
@@ -150,19 +152,19 @@ export default {
       tableData: [],
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    }
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
   },
   methods: {
     toInfoPage() {
       this.$router.push({
-        path: "/reports/online-detail"
+        path: "/reports/online-detail",
       });
     },
     refresh() {
@@ -195,12 +197,12 @@ export default {
         this.pageSize;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
@@ -208,34 +210,34 @@ export default {
     },
     async searchTotalStudent() {
       var url = REPORTS_API + "/studentTotalCount/getSumTotalCount";
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         this.totalStudent = response.data;
       });
     },
     async searchTotalOnlineStudent() {
       var url = REPORTS_API + "/studentCount/getSumOnlineCount";
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         this.totalOnlineStudent = response.data;
       });
     },
     async searchLastNDayData() {
       var url =
         REPORTS_API + "/studentCumulativeCount/getLastNdayOnlineCount?nday=5";
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         let xdata = [];
-        response.data.forEach(e => {
+        response.data.forEach((e) => {
           xdata.push(e.reportDay);
         });
         this.lastNdayData.xAxis.data = xdata;
         let ydata = [];
-        response.data.forEach(e => {
+        response.data.forEach((e) => {
           ydata.push(e.totalCount);
         });
         this.lastNdayData.series = [
           {
             data: ydata,
-            type: "line"
-          }
+            type: "line",
+          },
         ];
       });
     },
@@ -244,12 +246,12 @@ export default {
       this.searchLastNDayData();
       this.searchTotalOnlineStudent();
       this.searchForm();
-    }
+    },
   },
   //初始化查询
   created() {
     this.init();
-  }
+  },
 };
 </script>
 

+ 1 - 0
src/plugins/vueAwesome.js

@@ -8,5 +8,6 @@ import "vue-awesome/icons/users";
 import "vue-awesome/icons/sign-out-alt";
 import "vue-awesome/icons/lock";
 import "vue-awesome/icons/bars";
+import "vue-awesome/icons/user-check";
 
 Vue.component("v-icon", Icon);