Browse Source

日常开发

林旭祥 9 months ago
parent
commit
828d4e9e9e
2 changed files with 27 additions and 4 deletions
  1. 4 1
      src/utils/ws.ts
  2. 23 3
      src/views/train/run.vue

+ 4 - 1
src/utils/ws.ts

@@ -15,6 +15,9 @@ let testList: any = []; //区列表
 let wkList: any = []; //工作站列表
 
 export const initWs = (data: any, callback: any) => {
+  examStateList = []; //当前状态码
+  testList = []; //区列表
+  wkList = []; //工作站列表
   loading = ElLoading.service({ text: '正在初始化,请稍候', background: 'rgba(0, 0, 0, 0.8)', customClass: `sports ${data.parameter.project}` });
   parameter = data.parameter;
   testTime = data.testTime;
@@ -46,7 +49,7 @@ export const initWs = (data: any, callback: any) => {
       clearTimeout(loadingTime);
       callback({ cmd: 'disconnect_request', data: { message: 'WS连接超时' } });
     }
-  }, 30000);
+  }, 20000);
   socket.on('connect', (e: any) => {
     if (testList.length > 1) {
       //单WS多区

+ 23 - 3
src/views/train/run.vue

@@ -4,7 +4,7 @@
     <transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
       <div class="time" v-show="[42].includes(examState)">{{
         countdownNumFormat
-      }}</div>
+        }}</div>
     </transition>
     <div class="main">
       <div class="main-left">
@@ -63,8 +63,8 @@
         <div class="btn startBtn" @click="getStartOneTest" v-if="examState == 43">开始测试</div>
       </template>
       <template v-else> </template>
-      <div class="btn" @click="getRetestFace" v-if="examState == 43">重新识别</div>
       <div class="btn" @click="getAgain" v-if="examState == 42 || showTestAgain">再测一次</div>
+      <div class="btn" @click="getRetestFace" v-if="examState == 43">重新识别</div>
     </div>
     <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
   </div>
@@ -600,14 +600,34 @@ $waiPadding: 6.51rem;
 
     .trackItem {
       width: 100%;
-      overflow-y: hidden;
+      overflow-y: scroll;
       padding: 0px 10px;
 
+      &::-webkit-scrollbar {
+        width: 10px;
+      }
+
+      &::-webkit-scrollbar-thumb {
+        border-width: 2px;
+        border-radius: 4px;
+        border-style: dashed;
+        border-color: transparent;
+        background-color: rgba(26, 62, 78, 0.9);
+        background-clip: padding-box;
+      }
+
+      &::-webkit-scrollbar-button:hover {
+        border-radius: 6px;
+        background: rgba(26, 62, 78, 1);
+      }
+
       .li {
         display: flex;
         align-items: center;
         justify-content: space-between;
         border-bottom: 1px solid #475557;
+        height: calc(100%/8);
+        box-sizing: border-box;
 
         .track {
           color: #13ED84;