Kaynağa Gözat

日常开发

林旭祥 1 hafta önce
ebeveyn
işleme
acd8f0f959

+ 14 - 3
src/components/ReportList/index.vue

@@ -5,7 +5,8 @@
       <li v-for="(item, index) in reportList" :key="index" @click="openReport(item)">
         <div class="left">
           <div class="pic">
-            <img v-if="item.face_pic || item.logo_url || item.student_icon_url" :src="item.face_pic || item.logo_url || item.student_icon_url" />
+            <img v-if="item.face_pic || item.logo_url || item.student_icon_url"
+              :src="item.face_pic || item.logo_url || item.student_icon_url" />
             <img v-else src="@/assets/images/common/noImg.png" />
           </div>
           <div class="txt">
@@ -19,6 +20,11 @@
           <div class="score">{{ proxy?.$utils.runTime(item.result, true, false) }}
           </div>
         </div>
+        <div class="right"
+          v-else-if="['run50', 'run60', 'run70', 'run100', 'run200', 'run400', 'run800', 'run1000', 'run15x4', 'run50x8', 'run10x4'].includes(parameter.project)">
+          <div class="score">{{ proxy?.$utils.runTime(item.result, false, isLongRun) }}
+          </div>
+        </div>
         <div class="right" v-else>
           <div class="score">{{ item.result }}
           </div>
@@ -62,10 +68,11 @@ const data = reactive<any>({
   }, //学生分页
   debounceTime: '', //加载状态
   unit: '',//单位
-  erweima: ""
+  erweima: "",
+  isLongRun: false,
 });
 
-const { reportList, studentPage, debounceTime, unit, erweima } = toRefs(data);
+const { reportList, studentPage, debounceTime, unit, erweima, isLongRun } = toRefs(data);
 
 /**
  * 成绩列表
@@ -183,6 +190,10 @@ const getMobile = () => {
 onBeforeMount(() => {
   let project = props.parameter.project;
   unit.value = dic.unit[project];
+  //是否长跑
+  if (project.replace('run', '') > 799) {
+    isLongRun.value = true;
+  }
 })
 
 onMounted(() => {

+ 7 - 0
src/types/components.d.ts

@@ -8,9 +8,16 @@ export {}
 declare module 'vue' {
   export interface GlobalComponents {
     ChooseStudent: typeof import('./../components/ChooseStudent/index.vue')['default']
+    ElAvatar: typeof import('element-plus/es')['ElAvatar']
+    ElButton: typeof import('element-plus/es')['ElButton']
     ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElInput: typeof import('element-plus/es')['ElInput']
     ElOption: typeof import('element-plus/es')['ElOption']
+    ElPagination: typeof import('element-plus/es')['ElPagination']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTable: typeof import('element-plus/es')['ElTable']
+    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     FaceWindow: typeof import('./../components/FaceWindow/index.vue')['default']
     Header: typeof import('./../components/Header/index.vue')['default']
     JumpRopeGame: typeof import('./../components/JumpRopeGame/index.vue')['default']

+ 1 - 1
src/views/train/run.vue

@@ -256,7 +256,7 @@ const getMessage = (e: any) => {
     examState.value = e.data;
     if (e.data === 3) {
       initProject();
-      if (!isLongRun && showTestAgain.value) {
+      if (!isLongRun.value && showTestAgain.value) {
         reportListRef.value.getIniReportList();
       }
     }