Bladeren bron

invigilation bug md

zhangjie 4 jaren geleden
bovenliggende
commit
eed696a0c8

+ 5 - 0
src/constant/constants.js

@@ -23,6 +23,11 @@ export const BOOLEAN_TYPE = {
   0: "否",
   1: "是",
 };
+// 是 / 否
+export const BOOLEAN_INVERSE_TYPE = {
+  1: "否",
+  0: "是",
+};
 // 考生在线状态
 export const STUDENT_ONLINE_STATUS = {
   FIRST_PREPARE: "待考",

+ 1 - 0
src/features/Login/Login.vue

@@ -111,6 +111,7 @@ export default {
   async created() {
     const res = await getLogo(ORG_CODE);
     this.schoolLogo = res.data.data.logo;
+    this.$store.commit("setSchoolLogo", this.schoolLogo);
   },
   methods: {
     async submitBtn() {

+ 32 - 24
src/features/examwork/ActivityManagement/ActivityEdit.vue

@@ -1,21 +1,27 @@
 <template>
-  <div>
-    <h2>{{ "新增" + "场次" }}</h2>
+  <div class="activity-edit">
+    <div class="part-box-head">
+      <div class="part-box-head-left">
+        <h1>{{ "新增" + "场次" }}</h1>
+      </div>
+    </div>
 
-    <el-row>
-      <el-col :span="3"> 考试名称: </el-col>
-      <el-col :span="21">
-        {{ exam.name }}
-      </el-col>
-    </el-row>
-    <el-row>
-      <el-col :span="3"> 考试时间段: </el-col>
-      <el-col :span="21">
-        {{ exam.startTime | datetimeFilter }} ~
-        {{ exam.endTime | datetimeFilter }}
-      </el-col>
-    </el-row>
-    <el-row>
+    <div class="part-filter">
+      <div class="part-filter-form">
+        <el-form inline>
+          <el-form-item label="考试名称:">
+            <span> {{ exam.name }}</span>
+          </el-form-item>
+          <el-form-item label="考试时间段:" label-width="140px">
+            <span>
+              {{ exam.startTime | datetimeFilter }} ~
+              {{ exam.endTime | datetimeFilter }}</span
+            >
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+    <div class="part-box">
       <el-form
         :model="item"
         :ref="'form' + index"
@@ -65,14 +71,16 @@
           </el-form-item>
         </div>
       </el-form>
-    </el-row>
-    <el-row class="d-flex justify-content-center">
-      <el-button type="primary" @click="submitForm" :loading="loading"
-        >保 存</el-button
-      >
-      <el-button type="primary" @click="addActivity">新 增</el-button>
-      <el-button @click="() => this.$router.back()">取 消</el-button>
-    </el-row>
+      <div class="d-flex justify-content-center">
+        <el-button type="primary" @click="submitForm" :loading="loading"
+          >保 存</el-button
+        >
+        <el-button type="primary" @click="addActivity">新 增</el-button>
+        <el-button type="danger" @click="() => this.$router.back()"
+          >取 消</el-button
+        >
+      </div>
+    </div>
   </div>
 </template>
 

+ 24 - 11
src/features/examwork/ActivityManagement/ActivityManagement.vue

@@ -1,15 +1,28 @@
 <template>
-  <div>
-    <el-form :model="form" inline>
-      <el-form-item label="场次代码">
-        <el-input v-model.trim="form.code"></el-input>
-      </el-form-item>
-      <el-button @click="handleCurrentChange(0)">查询</el-button>
-      <el-button @click="add">新增</el-button>
-      <!-- <el-button>导入</el-button> -->
-    </el-form>
+  <div class="activity-management">
+    <div class="part-box-head">
+      <div class="part-box-head-left"><h1>场次设置</h1></div>
+    </div>
+    <div class="part-filter">
+      <div class="part-filter-form">
+        <el-form :model="form" inline>
+          <el-form-item label="场次代码">
+            <el-input v-model.trim="form.code"></el-input>
+          </el-form-item>
+          <el-button type="primary" @click="handleCurrentChange(0)"
+            >查询</el-button
+          >
+        </el-form>
+        <div class="part-filter-form-action">
+          <el-button type="primary" icon="icon icon-add" @click="add"
+            >新增</el-button
+          >
+          <!-- <el-button>导入</el-button> -->
+        </div>
+      </div>
+    </div>
 
-    <el-table :data="tableData" stripe style="width: 100%;">
+    <el-table :data="tableData">
       <el-table-column type="selection" width="42" />
       <el-table-column width="100" label="ID">
         <span slot-scope="scope">{{ scope.row.id }}</span>
@@ -59,7 +72,7 @@
         </div>
       </el-table-column>
     </el-table>
-    <div class="page float-right">
+    <div class="part-page">
       <el-pagination
         background
         @current-change="handleCurrentChange"

+ 4 - 1
src/features/invigilation/ExamInvigilation/ExamInvigilation.vue

@@ -369,7 +369,10 @@ export default {
     },
     async getVideoList() {
       const res = await examInvigilationVideoRandomList({ randomNum: 4 });
-      this.students = res.data.data;
+      this.students = res.data.data.map((item) => {
+        item.liveUrl = `http://live.qmth.com.cn/live/${item.monitorLiveUrl.toLowerCase()}.flv`;
+        return item;
+      });
     },
     async getMessageList() {
       const res = await examInvigilationWarnMessage();

+ 2 - 0
src/features/invigilation/ExamReport/ReportOverview.vue

@@ -29,6 +29,7 @@
             <span>考试总体进度</span>
             <el-popover
               placement="top-start"
+              popper-class="warning-popover"
               width="200"
               trigger="hover"
               content="批次下的实时考试进度。"
@@ -48,6 +49,7 @@
         <span>考试科次时间分布</span>
         <el-popover
           placement="top-start"
+          popper-class="warning-popover"
           width="200"
           trigger="hover"
           content="按时间维度呈现已完成的科次数量分布。"

+ 8 - 3
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoring.vue

@@ -75,7 +75,7 @@
               clearable
             >
               <el-option
-                v-for="(val, key) in BOOLEAN_TYPE"
+                v-for="(val, key) in BOOLEAN_INVERSE_TYPE"
                 :key="key"
                 :value="key * 1"
                 :label="val"
@@ -185,7 +185,7 @@
       <el-table-column prop="remainTime" label="剩余时间"></el-table-column>
       <el-table-column prop="paperDownload" label="试题下载">
         <span slot-scope="scope">
-          {{ BOOLEAN_TYPE[scope.row.paperDownload] }}
+          {{ BOOLEAN_INVERSE_TYPE[scope.row.paperDownload] }}
         </span>
       </el-table-column>
       <el-table-column prop="status" label="考试状态"></el-table-column>
@@ -283,6 +283,7 @@ import handleRollupDialog from "./handleRollupDialog";
 import TextClock from "../common/TextClock";
 import {
   BOOLEAN_TYPE,
+  BOOLEAN_INVERSE_TYPE,
   STUDENT_ONLINE_STATUS,
   CLIENT_WEBSOCKET_STATUS,
   MONITOR_STATUS_SOURCE,
@@ -312,6 +313,7 @@ export default {
         minWarningCount: undefined,
       },
       BOOLEAN_TYPE,
+      BOOLEAN_INVERSE_TYPE,
       STUDENT_ONLINE_STATUS,
       CLIENT_WEBSOCKET_STATUS,
       MONITOR_STATUS_SOURCE,
@@ -378,7 +380,10 @@ export default {
         });
       } else {
         res = await invigilateVideoList(datas);
-        this.videoList = res.data.data.records;
+        this.videoList = res.data.data.records.map((item) => {
+          item.liveUrl = `http://live.qmth.com.cn/live/${item.monitorLiveUrl.toLowerCase()}.flv`;
+          return item;
+        });
       }
 
       this.total = res.data.data.total;

+ 6 - 0
src/features/invigilation/RealtimeMonitoring/WarningDetail.vue

@@ -422,6 +422,12 @@ export default {
             ? [info.remark["FACE_VERIFY_PHOTO"]]
             : "";
           info.photos = info.remark["PHOTOS"] || facePhoto;
+        } else if (info.updateTime) {
+          info.startTime = formatDate("HH:mm:ss", new Date(info.createTime));
+          info.endTime = formatDate("HH:mm:ss", new Date(info.updateTime));
+          info.durationTime = timeNumberToText(
+            info.updateTime - info.createTime
+          );
         }
         return info;
       });

+ 2 - 2
src/features/invigilation/common/InvigilationStudent.vue

@@ -3,8 +3,8 @@
     <div class="student-video">
       <flv-media
         ref="ThirdViewVideo"
-        :live-url="data.monitorLiveUrl"
-        v-if="data.monitorLiveUrl"
+        :live-url="data.liveUrl"
+        v-if="data.liveUrl"
       ></flv-media>
     </div>
     <div class="student-info">

+ 4 - 0
src/store/index.js

@@ -14,11 +14,15 @@ export default new Vuex.Store({
   },
   state: {
     isFullScreen: false,
+    schoolLogo: "",
   },
   mutations: {
     setIsFullScreen(state, isFullScreen) {
       state.isFullScreen = isFullScreen;
     },
+    setSchoolLogo(state, schoolLogo) {
+      state.schoolLogo = schoolLogo;
+    },
   },
   actions: {},
 });

+ 1 - 1
src/styles/base.scss

@@ -87,7 +87,7 @@ body {
     background-color: #fff;
     border-radius: 6px;
 
-    div:nth-of-type(2) {
+    > div[class^="part-filter"]:nth-of-type(2) {
       border-top: 1px solid #f0f4f9;
     }
     .line-split {

+ 11 - 7
src/views/Layout/Layout.vue

@@ -55,13 +55,8 @@ export default {
 
       const curRouterName = this.$route.meta.relate || this.$route.name;
       if (curRouterName === "Home") {
-        const firstRoute =
-          this.navs[0] &&
-          this.navs[0].children[0] &&
-          this.navs[0].children[0].children[0] &&
-          this.navs[0].children[0].children[0].name;
         this.$router.replace({
-          name: firstRoute,
+          name: this.navs[0].redirect,
         });
       } else {
         if (!this.validRoutes.includes(curRouterName)) {
@@ -113,7 +108,16 @@ export default {
 
       this.validRoutes = validRoutes;
       this.validRoutes.push("Home");
-      return clearNoFixed(localNavs);
+      let navs = clearNoFixed(localNavs);
+      navs.map((item) => {
+        if (
+          item.children[0] &&
+          item.children[0].children[0] &&
+          item.children[0].children[0].name
+        )
+          item.redirect = item.children[0].children[0].name;
+      });
+      return navs;
     },
     initNavTips() {
       let validNav = {

+ 13 - 10
src/views/Layout/components/NavBar.vue

@@ -1,10 +1,7 @@
 <template>
   <div class="nav-bar">
     <div class="nav-bar-logo">
-      <img
-        src="https://img.alicdn.com/tfs/TB13UQpnYGYBuNjy0FoXXciBFXa-242-134.png"
-        width="40"
-      />
+      <img :src="schoolLogo" />
       <!-- <span class="site-name">ADMIN LITE</span> -->
     </div>
     <div class="nav-bar-menu menu-list">
@@ -64,6 +61,9 @@ export default {
     },
   },
   computed: {
+    schoolLogo() {
+      return this.$store.state.schoolLogo;
+    },
     username() {
       return this.$store.state.user.name;
     },
@@ -95,6 +95,7 @@ export default {
   methods: {
     actCurNav() {
       const curRouterName = this.$route.meta.relate || this.$route.name;
+      this.curNav = null;
       this.navs.forEach((nav) => {
         if (this.curNav) return;
         let curRouter = null;
@@ -104,12 +105,14 @@ export default {
           });
         });
 
-        if (curRouter) this.toPage(nav);
+        if (curRouter) {
+          this.curNav = nav.name;
+          this.$emit("on-nav-change", nav.name);
+        }
       });
     },
     toPage(nav) {
-      this.curNav = nav.name;
-      this.$emit("on-nav-change", nav.name);
+      this.$router.push({ name: nav.redirect });
     },
     async toLogout() {
       const result = await this.$confirm("确定要退出登录吗?", "退出确认", {
@@ -209,13 +212,13 @@ export default {
   &-logo {
     width: 220px;
     float: left;
-    padding: 14px 30px;
+    padding: 10px 30px;
     font-size: 20px;
-    line-height: 32px;
+    line-height: 40px;
     > img {
       display: block;
       max-width: 160px;
-      height: 32px;
+      height: 40px;
     }
   }
   &-menu {

+ 4 - 4
vue.config.js

@@ -1,13 +1,13 @@
 let proxy = {
   "/api": {
-    target: "http://192.168.10.26:6001/",
-    // target: "http://192.168.10.36:6001/",
+    // target: "http://192.168.10.26:6001/",
+    target: "http://192.168.10.36:9222/",
     // target: "http://192.168.10.86:6001/",
     changeOrigin: true,
   },
   "/file": {
-    target: "http://192.168.10.26:6001/",
-    // target: "http://192.168.10.36:6001/",
+    // target: "http://192.168.10.26:6001/",
+    target: "http://192.168.10.36:9222/",
     // target: "http://192.168.10.86:6001/",
     changeOrigin: true,
   },