Jelajahi Sumber

抽象 isMultiMedia

Michael Wang 3 tahun lalu
induk
melakukan
64fd31c486

+ 1 - 1
src/features/arbitrate/Arbitrate.vue

@@ -88,7 +88,7 @@ async function updateSetting() {
   });
   store.setting.selective = settingRes.data.selective;
 
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 1 - 1
src/features/library/inspect/LibraryInspect.vue

@@ -61,7 +61,7 @@ async function updateSetting() {
     splitConfig,
   });
 
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 1 - 1
src/features/library/libraryTrack/LibraryTrack.vue

@@ -39,7 +39,7 @@ async function updateSetting() {
     splitConfig,
   });
 
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 1 - 1
src/features/library/quality/Quality.vue

@@ -50,7 +50,7 @@ async function updateSetting() {
     splitConfig,
   });
 
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 2 - 2
src/features/mark/CommonMarkBody.vue

@@ -15,7 +15,7 @@
       {{ store.message }}
     </div>
     <div
-      v-else-if="store.setting.examType === 'SCAN_IMAGE'"
+      v-else-if="store.isScanImage"
       :style="{ width: answerPaperScale }"
       :class="[`rotate-board-${rotateBoard}`]"
     >
@@ -41,7 +41,7 @@
         <hr class="image-seperator" />
       </div>
     </div>
-    <div v-else-if="store.setting.examType === 'MULTI_MEDIA'">
+    <div v-else-if="store.isMultiMedia">
       <MultiMediaMarkBody />
     </div>
     <div v-else>impossible</div>

+ 1 - 1
src/features/mark/Mark.vue

@@ -94,7 +94,7 @@ async function updateSetting() {
     store.setting.subject.paperUrl =
       store.setting.fileServer + store.setting.subject?.paperUrl;
   }
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 0 - 1
src/features/student/importInspect/ImportInspect.vue

@@ -31,7 +31,6 @@ import { message } from "ant-design-vue";
 import { addFileServerPrefixToTask } from "@/utils/utils";
 
 const route = useRoute();
-let isSingleStudent = !!route.query.studentId;
 const { studentId } = route.query as {
   studentId: string;
 };

+ 1 - 1
src/features/student/inspect/Inspect.vue

@@ -77,7 +77,7 @@ async function updateSetting() {
     userName,
     splitConfig,
   });
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 2 - 5
src/features/student/studentTrack/StudentTrack.vue

@@ -2,10 +2,7 @@
   <div class="my-container">
     <mark-header />
     <div class="tw-flex tw-gap-1">
-      <mark-body
-        v-if="store.setting.examType === 'SCAN_IMAGE'"
-        @error="renderError"
-      />
+      <mark-body v-if="store.isScanImage" @error="renderError" />
       <CommonMarkBody
         v-else
         :useMarkResult="false"
@@ -46,7 +43,7 @@ async function updateSetting() {
     userName,
     splitConfig,
   });
-  if (store.setting.subject?.paperUrl && !store.isScanImage) {
+  if (store.setting.subject?.paperUrl && store.isMultiMedia) {
     await getPaper(store);
   }
 }

+ 3 - 0
src/store/store.ts

@@ -64,6 +64,9 @@ export const useMarkStore = defineStore("mark", {
     isScanImage(): boolean {
       return this.setting.examType === "SCAN_IMAGE";
     },
+    isMultiMedia(): boolean {
+      return this.setting.examType === "MULTI_MEDIA";
+    },
     /* 返回正在评卷的状态 '' | 回评 | 打回 */
     getMarkStatus(): string {
       if (!this.currentTask) return "";