Sfoglia il codice sorgente

feat: 添加成绩复核未计分标记

chenhao 2 anni fa
parent
commit
e182383394

+ 1 - 1
.gitignore

@@ -14,7 +14,7 @@ yarn-debug.log*
 yarn-error.log*
 pnpm-debug.log*
 metadata.md
-temp.json
+paper.json
 
 # Editor directories and files
 .idea

+ 1 - 0
.npmrc

@@ -0,0 +1 @@
+enable-pre-post-scripts = true

+ 2 - 2
cypress/e2e/mark-header.spec.cy.ts

@@ -18,8 +18,8 @@ describe("评卷页面", () => {
     cy.wait(1000).get(".header-container").should("contain", "王小兰");
   });
 
-  it("小助手显示", () => {
-    cy.wait(1000).get(".header-container .assistant-text").click();
+  it.only("小助手显示", () => {
+    cy.wait(9000).get(".header-container .assistant-text").click();
     cy.get(".assistant-table").should("contain", "全卷");
   });
 });

+ 3 - 2
package.json

@@ -11,7 +11,8 @@
     "typecheck": "vue-tsc --noEmit --skipLibCheck",
     "serve": "vite preview",
     "lint": "eslint --ext .js,.ts,.vue --ignore-path .gitignore --fix src",
-    "format": "prettier .  --write"
+    "format": "prettier .  --write",
+    "test": "cypress open"
   },
   "dependencies": {
     "@ant-design/icons-vue": "^6.1.0",
@@ -57,4 +58,4 @@
   "optionalDependencies": {
     "cypress": "^10.3.1"
   }
-}
+}

+ 41 - 5
src/features/student/importInspect/MarkBoardInspect.vue

@@ -26,7 +26,7 @@
 
     <div v-if="groups" class="tw-flex-grow tw-overflow-auto tw-my-5">
       <template v-for="(groupNumber, index) in groups" :key="index">
-        <div class="tw-mb-4 tw-bg-white tw-p-4">
+        <div class="tw-mb-4 tw-bg-white tw-p-4 tw-pl-5 tw-pr-3">
           <div
             class="tw-flex tw-justify-between tw-place-items-center hover:tw-bg-gray-200"
             @mouseover="addFocusTrack(groupNumber, undefined, undefined)"
@@ -39,6 +39,7 @@
               <div
                 v-if="question.groupNumber === groupNumber"
                 class="question tw-flex tw-place-items-center tw-mb-1 tw-font-bold hover:tw-bg-gray-200"
+                :class="{ uncalculate: question.uncalculate }"
                 @mouseover="
                   addFocusTrack(
                     undefined,
@@ -48,12 +49,18 @@
                 "
                 @mouseleave="removeFocusTrack"
               >
-                <span class="tw-flex-1">
+                <a-tooltip placement="left">
+                  <template #title>
+                    <span>未计入总分</span>
+                  </template>
+                  <MinusCircleFilled class="uncalculate-icon" />
+                </a-tooltip>
+                <span class="question-title">
                   {{ question.title }} {{ question.mainNumber }}-{{
                     question.subNumber
                   }}
                 </span>
-                <span class="tw-flex-1 tw-text-center">
+                <span class="tw-text-center question-score">
                   {{ question.score === -1 ? "未选做" : question.score || 0 }}
                 </span>
               </div>
@@ -91,10 +98,14 @@ import {
   addFocusTrack,
   removeFocusTrack,
 } from "@/features/mark/use/focusTracks";
+import { MinusCircleOutlined, MinusCircleFilled } from "@ant-design/icons-vue";
 
 const emit = defineEmits(["makeTag", "fetchTask"]);
-const props =
-  defineProps<{ tagged: boolean; isFirst: boolean; isLast: boolean }>();
+const props = defineProps<{
+  tagged: boolean;
+  isFirst: boolean;
+  isLast: boolean;
+}>();
 let checkedQuestions: Question[] = reactive([]);
 
 watch(
@@ -155,6 +166,31 @@ function makeTag(isTag: boolean) {
   min-width: 80px;
   background-color: var(--app-container-bg-color);
 }
+.question-title {
+  flex: 1;
+}
+.question-score {
+  flex-basis: 56px;
+  padding: 0 3px;
+}
+
+.question.uncalculate {
+  position: relative;
+}
+
+.question .uncalculate-icon {
+  display: none;
+  color: red;
+  position: absolute;
+  font-size: 15px;
+  left: -16px;
+  top: 0.3em;
+}
+
+.question.uncalculate .uncalculate-icon {
+  display: block;
+}
+
 
 .full-width-btn {
   width: 100%;

+ 36 - 3
src/features/student/studentInspect/MarkBoardInspect.vue

@@ -21,7 +21,7 @@
 
     <div v-if="groups" class="tw-flex-grow tw-overflow-auto tw-my-5">
       <template v-for="(groupNumber, index) in groups" :key="index">
-        <div class="tw-mb-4 tw-bg-white tw-p-4">
+        <div class="tw-mb-4 tw-bg-white tw-p-4 tw-pl-5 tw-pr-3">
           <div
             class="tw-flex tw-justify-between tw-place-items-center hover:tw-bg-gray-200"
             @mouseover="addFocusTrack(groupNumber, undefined, undefined)"
@@ -41,6 +41,7 @@
               <div
                 v-if="question.groupNumber === groupNumber"
                 class="question tw-flex tw-place-items-center tw-mb-1 tw-font-bold hover:tw-bg-gray-200"
+                :class="{ uncalculate: question.uncalculate }"
                 @mouseover="
                   addFocusTrack(
                     undefined,
@@ -50,12 +51,18 @@
                 "
                 @mouseleave="removeFocusTrack"
               >
-                <span class="tw-flex-1">
+                <a-tooltip placement="left">
+                  <template #title>
+                    <span>未计入总分</span>
+                  </template>
+                  <MinusCircleFilled class="uncalculate-icon" />
+                </a-tooltip>
+                <span class="question-title">
                   {{ question.title }} {{ question.mainNumber }}-{{
                     question.subNumber
                   }}
                 </span>
-                <span class="tw-flex-1 tw-text-center">
+                <span class="tw-text-center question-score">
                   {{ question.score === -1 ? "未选做" : question.score || 0 }}
                 </span>
                 <input
@@ -109,6 +116,7 @@
 <script setup lang="ts">
 import type { Question } from "@/types";
 import { message } from "ant-design-vue";
+import { MinusCircleOutlined, MinusCircleFilled } from "@ant-design/icons-vue";
 import { reactive, watch } from "vue";
 import { store } from "@/store/store";
 import {
@@ -234,6 +242,31 @@ function onConfirmReturn(reason: string) {
   min-width: 80px;
   background-color: var(--app-container-bg-color);
 }
+.question-title {
+  flex: 1;
+}
+.question-score {
+  flex-basis: 56px;
+  padding: 0 3px;
+}
+
+.question.uncalculate {
+  position: relative;
+}
+
+.question .uncalculate-icon {
+  display: none;
+  color: red;
+  position: absolute;
+  font-size: 15px;
+  left: -16px;
+  top: 0.3em;
+}
+
+.question.uncalculate .uncalculate-icon {
+  display: block;
+}
+
 .full-width-btn {
   width: 100%;
   border-radius: 20px;

+ 2 - 0
src/types/index.ts

@@ -232,6 +232,8 @@ interface RawQuestion {
   trackList: Array<Track>;
   /** 得分;null的值时是为打回时可以被评卷修改的;null也是从未评分过的情况,要通过rejected来判断 */
   score: number | null;
+  /** 未计分 */
+  uncalculate: boolean
 }
 export interface Question extends RawQuestion {
   /** question 在 task 里面的 index ,用来对应 scoreList 的 score */