zhangjie hai 1 ano
pai
achega
08e9d58fef

+ 32 - 8
src/api/markPage.ts

@@ -9,30 +9,47 @@ import {
   Task,
   CommonResponse,
 } from "@/types";
+import vls from "@/utils/storage";
+
+const getMarkInfo = () => {
+  return vls.get("mark", {});
+};
 
 /** 清除评卷任务(之前锁住的任务之类的) */
 export async function clearMarkTask() {
-  return httpApp.post<void>("/api/mark/clear");
+  return httpApp.post<void>("/api/mark/clear", {}, { params: getMarkInfo() });
 }
 
 /** 获取评卷设置 */
 export async function getSetting() {
-  return httpApp.post<Setting>("/api/mark/getSetting");
+  return httpApp.post<Setting>(
+    "/api/mark/getSetting",
+    {},
+    { params: getMarkInfo() }
+  );
 }
 
 /** 获取评卷状态 */
 export async function getStatus() {
-  return httpApp.post<MarkStore["status"]>("/api/mark/getStatus");
+  return httpApp.post<MarkStore["status"]>(
+    "/api/mark/getStatus",
+    {},
+    { params: getMarkInfo() }
+  );
 }
 
 /** 获取评卷分组 */
 export async function getGroup() {
-  return httpApp.post<Group[]>("/api/mark/getGroup");
+  return httpApp.post<Group[]>(
+    "/api/mark/getGroup",
+    {},
+    { params: getMarkInfo() }
+  );
 }
 
 /** 获取评卷任务 */
 export async function getTask() {
-  return httpApp.post<Task>("/api/mark/getTask");
+  return httpApp.post<Task>("/api/mark/getTask", {}, { params: getMarkInfo() });
 }
 
 /** 更新评卷UI */
@@ -47,6 +64,7 @@ export async function updateUISetting(
       params: {
         mode: mode || undefined,
         uiSetting: uiSetting ? JSON.stringify(uiSetting) : undefined,
+        ...getMarkInfo(),
       },
     }
   );
@@ -72,6 +90,7 @@ export async function getHistoryTask({
         sort,
         secretNumber,
         markerScore,
+        ...getMarkInfo(),
       },
     }
   );
@@ -91,6 +110,7 @@ export async function saveTask() {
 
   return httpApp.post<CommonResponse>("/api/mark/saveTask", markResult, {
     setGlobalMask: true,
+    params: getMarkInfo(),
   });
 }
 
@@ -121,7 +141,7 @@ export async function doSwitchGroup(markerId: number) {
     "/api/mark/subjectSelect",
     {},
     {
-      params: { markerId },
+      params: { markerId, ...getMarkInfo() },
     }
   );
 }
@@ -143,7 +163,9 @@ export async function doProblemType({ problemType, problemRemark }) {
   markResult.spent = Date.now() - store.currentTask.__markStartTime;
   markResult = { ...markResult };
 
-  return httpApp.post<CommonResponse>("/api/mark/saveTask", markResult);
+  return httpApp.post<CommonResponse>("/api/mark/saveTask", markResult, {
+    params: getMarkInfo(),
+  });
 }
 
 /** 评卷用户选择试卷的为未选做 */
@@ -161,5 +183,7 @@ export async function doUnselectiveType() {
   markResult.spent = Date.now() - store.currentTask.__markStartTime;
   markResult = { ...markResult };
 
-  return httpApp.post<CommonResponse>("/api/mark/saveTask", markResult);
+  return httpApp.post<CommonResponse>("/api/mark/saveTask", markResult, {
+    params: getMarkInfo(),
+  });
 }

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

@@ -120,7 +120,7 @@ async function updateTask() {
     rawTask.sliceUrls = [...rawTask.sheetUrls];
     store.currentTask = rawTask;
   } else {
-    store.message = res.data.message;
+    store.message = res.data.message || "无任务";
   }
 }
 

+ 1 - 1
src/features/check/ObjectiveAnswer.vue

@@ -211,7 +211,7 @@ const totalScore = $computed(() => {
 });
 
 const curImageUrl = $computed(() =>
-  student ? student.sheetUrls[currentImage].url : ""
+  student ? student.sheetUrls[currentImage]?.url : ""
 );
 
 let student: StudentObjectiveInfo | null = $ref(null);

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

@@ -185,6 +185,7 @@ async function updateTask() {
   } else {
     store.message = res.message || "数据错误";
   }
+  if (!res.data && store.message === "成功") store.message = "当前无评卷任务";
 }
 
 function nextTask() {

+ 61 - 113
src/features/mark/MarkBoardKeyBoard.vue

@@ -1,11 +1,11 @@
 <template>
   <div
     v-if="store.currentTask"
-    class="mark-board-track-container"
+    class="mark-board-track is-key-board"
     :class="[store.isScoreBoardCollapsed ? 'hide' : 'show']"
   >
-    <div class="tw-my-2 tw-flex">
-      <a-dropdown class="tw-self-end">
+    <div class="board-mode">
+      <a-dropdown>
         <template #overlay>
           <a-menu>
             <a-menu-item key="1" @click="toggleKeyMouse">
@@ -19,128 +19,76 @@
         </a-button>
       </a-dropdown>
     </div>
-    <div
-      class="tw-flex tw-rounded tw-justify-between tw-p-2 tw-pl-5 top-container tw-mb-4"
-    >
-      <div class="tw-flex tw-flex-col">
-        <div class="tw-flex tw-items-center tw-gap-2">
-          <img
-            src="./images/totalscore.png"
-            style="width: 13px; height: 16px"
-          />
-          总分
-        </div>
-        <div class="total-score tw-ml-5 tw-font-bold">
-          <transition-group name="score-number-animation" tag="span">
-            <span
-              :key="
-                store.currentTaskEnsured.markResult
-                  ? store.currentTaskEnsured.markResult.markerScore + ''
-                  : '0'
-              "
-              class="tw-inline-block"
-              >{{
-                store.currentTaskEnsured.markResult
-                  ? store.currentTaskEnsured.markResult.markerScore
-                  : ""
-              }}</span
-            >
-          </transition-group>
-        </div>
+    <div class="board-header">
+      <div class="board-header-info">
+        <img src="@/assets/icons/icon-star.svg" /><span>总分</span>
       </div>
-
-      <div class="tw-flex tw-place-content-center tw-items-center tw-gap-2">
-        <div class="tw-flex tw-flex-col tw-gap-1">
-          <a-popconfirm
-            v-if="store.setting.enableAllZero"
-            title="确定给全零分?"
-            :overlayStyle="{ width: '200px' }"
-            @confirm="$emit('allZeroSubmit')"
-          >
-            <a-button
-              type="primary"
-              size="middle"
-              class="all-zero-unselective-button"
-            >
-              <span>全零分</span>
-            </a-button>
-          </a-popconfirm>
-          <a-popconfirm
-            v-if="store.setting.selective"
-            title="确定是未选做?"
-            :overlayStyle="{ width: '200px' }"
-            @confirm="$emit('unselectiveSubmit')"
-          >
-            <a-button
-              type="primary"
-              size="middle"
-              class="all-zero-unselective-button"
-            >
-              <span>未选做</span>
-            </a-button>
-          </a-popconfirm>
-        </div>
-
-        <qm-button
-          type="primary"
-          shape="round"
-          size="middle"
-          style="height: 76px; border-radius: 10px; padding: 12px"
-          @click="submit"
-        >
-          提交
-        </qm-button>
+      <div class="board-header-score">
+        <transition-group name="score-number-animation" tag="span">
+          <span :key="store.currentTask.markResult?.markerScore || 0">{{
+            store.currentTask.markResult?.markerScore
+          }}</span>
+        </transition-group>
       </div>
     </div>
+    <qm-button
+      class="board-submit"
+      size="medium"
+      type="primary"
+      @click="submit"
+    >
+      提交
+    </qm-button>
 
-    <div v-if="store.currentTaskEnsured.questionList">
+    <div
+      v-if="store.currentTaskEnsured.questionList"
+      class="board-questions"
+      :style="{
+        flexGrow: 2,
+      }"
+    >
       <template
         v-for="(question, index) in store.currentTaskEnsured.questionList"
         :key="index"
       >
-        <div
-          :id="'bq-' + question.mainNumber + '-' + question.subNumber"
-          class="question tw-rounded tw-p-1 tw-mb-2 tw-cursor-pointer tw-relative"
-          :class="isCurrentQuestion(question) && 'current-question'"
-          @click="
-            () => {
-              chooseQuestion(question);
-              scrollToQuestion(question);
-            }
-          "
-        >
-          <div class="tw-flex tw-justify-between">
-            <div>
-              <div v-if="!!question.questionName">
-                {{ question.questionName }}
+        <div class="board-question-full-box">
+          <div
+            :id="'bq-' + question.mainNumber + '-' + question.subNumber"
+            :class="[
+              'board-question',
+              { 'is-current': isCurrentQuestion(question) },
+            ]"
+            @click="
+              () => {
+                chooseQuestion(question);
+                scrollToQuestion(question);
+              }
+            "
+          >
+            <div class="question-info">
+              <div class="question-title" :title="question.title">
+                {{ question.title }}
               </div>
-              <div v-else>
-                {{ question.title }} {{ question.mainNumber }}-{{
-                  question.subNumber
-                }}
+              <div class="question-no">
+                间隔{{ question.intervalScore }}分,给分区间{{
+                  question.minScore
+                }}~{{ question.maxScore }}
               </div>
-              <div
-                class="tw-text-center tw-text-3xl"
-                :class="isCurrentQuestion(question) && 'current-score'"
-              >
-                {{
-                  isCurrentQuestion(question)
-                    ? scoreStr
-                    : store.currentTask.markResult?.scoreList[index]
-                }}
+              <div class="question-no">
+                {{ question.mainNumber }}-{{ question.subNumber }}
               </div>
             </div>
-            <div>
-              <div class="tw-text-center">
-                间隔{{ question.intervalScore }}分
-              </div>
-              <div class="tw-flex tw-text-3xl" style="width: 80px">
-                <span class="tw-flex-1">{{ question.minScore }}</span>
-                <span class="tw-flex-1">~</span>
-                <span class="tw-flex-1 tw-text-center">{{
-                  question.maxScore
-                }}</span>
-              </div>
+
+            <div class="question-score">
+              <transition-group name="score-number-animation" tag="span">
+                <span
+                  :key="store.currentTask?.markResult?.scoreList[index] || 0"
+                >
+                  <!-- 特殊的空格符号 -->
+                  <!-- eslint-disable-next-line no-irregular-whitespace -->
+                  {{ store.currentTask?.markResult?.scoreList[index] ?? " " }}
+                </span>
+              </transition-group>
             </div>
           </div>
         </div>

+ 43 - 85
src/features/mark/MarkBoardMouse.vue

@@ -1,119 +1,77 @@
 <template>
   <div
     v-if="store.currentTask"
-    class="mark-board-track-container"
+    class="mark-board-track is-mouse-board"
     :class="[store.isScoreBoardCollapsed ? 'hide' : 'show']"
   >
-    <div class="tw-my-2 tw-flex">
-      <a-dropdown class="tw-self-end">
+    <div class="board-mode">
+      <a-dropdown>
         <template #overlay>
           <a-menu>
             <a-menu-item key="1" @click="toggleKeyMouse">
-              键盘给分
+              鼠标给分
             </a-menu-item>
           </a-menu>
         </template>
         <a-button>
-          鼠标给分
+          键盘给分
           <DownOutlined style="display: inline-flex" />
         </a-button>
       </a-dropdown>
     </div>
-    <div
-      class="tw-flex tw-rounded tw-justify-between tw-p-2 tw-pl-5 top-container tw-mb-4"
-    >
-      <div class="tw-flex tw-flex-col">
-        <div class="tw-flex tw-items-center tw-gap-2">
-          <img
-            src="./images/totalscore.png"
-            style="width: 13px; height: 16px"
-          />
-          总分
-        </div>
-        <div class="total-score tw-ml-5 tw-font-bold">
-          <transition-group name="score-number-animation" tag="span">
-            <span
-              :key="store.currentTaskEnsured.markResult.markerScore || 0"
-              class="tw-inline-block"
-              >{{ store.currentTaskEnsured.markResult.markerScore }}</span
-            >
-          </transition-group>
-        </div>
+    <div class="board-header">
+      <div class="board-header-info">
+        <img src="@/assets/icons/icon-star.svg" /><span>总分</span>
       </div>
-
-      <div class="tw-flex tw-place-content-center tw-items-center tw-gap-2">
-        <div class="tw-flex tw-flex-col tw-gap-1">
-          <a-popconfirm
-            v-if="store.setting.enableAllZero"
-            title="确定给全零分?"
-            :overlayStyle="{ width: '200px' }"
-            @confirm="$emit('allZeroSubmit')"
-          >
-            <a-button
-              type="primary"
-              size="middle"
-              class="all-zero-unselective-button"
-            >
-              <span>全零分</span>
-            </a-button>
-          </a-popconfirm>
-          <a-popconfirm
-            v-if="store.setting.selective"
-            title="确定是未选做?"
-            :overlayStyle="{ width: '200px' }"
-            @confirm="$emit('unselectiveSubmit')"
-          >
-            <a-button
-              type="primary"
-              size="middle"
-              class="all-zero-unselective-button"
-            >
-              <span>未选做</span>
-            </a-button>
-          </a-popconfirm>
-        </div>
-
-        <qm-button
-          type="primary"
-          shape="round"
-          size="middle"
-          style="height: 76px; border-radius: 10px; padding: 12px"
-          @click="submit"
-        >
-          提交
-        </qm-button>
+      <div class="board-header-score">
+        <transition-group name="score-number-animation" tag="span">
+          <span :key="store.currentTask.markResult?.markerScore || 0">{{
+            store.currentTask.markResult?.markerScore
+          }}</span>
+        </transition-group>
       </div>
     </div>
+    <qm-button
+      class="board-submit"
+      size="medium"
+      type="primary"
+      @click="submit"
+    >
+      提交
+    </qm-button>
 
     <div
       v-if="store.currentTask && store.currentTask.questionList"
-      style="
-        height: calc(100vh - 56px - 200px);
-        overflow: auto;
-        user-select: none;
-        position: relative;
-      "
+      class="board-questions"
+      :style="{
+        flexGrow: 2,
+      }"
     >
       <template
         v-for="(question, index) in store.currentTask.questionList"
         :key="index"
       >
-        <div class="question tw-rounded tw-mb-2">
-          <div>
-            <div v-if="!!question.questionName">
-              {{ question.questionName }}
-            </div>
-            <div v-else>
-              {{ question.title }} {{ question.mainNumber }}-{{
-                question.subNumber
-              }}
+        <div class="board-question-full-box">
+          <div
+            :id="'bq-' + question.mainNumber + '-' + question.subNumber"
+            :class="['board-question']"
+          >
+            <div class="question-info">
+              <div class="question-title" :title="question.title">
+                {{ question.title }}
+              </div>
+              <div class="question-no">
+                {{ question.mainNumber }}-{{ question.subNumber }}
+              </div>
             </div>
-            <div class="tw-flex tw-flex-wrap tw-gap-2">
+            <div class="board-scores">
               <div
                 v-for="(s, i) in questionScoreSteps(question)"
                 :key="i"
-                class="single-score tw-cursor-pointer"
-                :class="isCurrentScore(question, s) && 'current-score'"
+                :class="[
+                  'board-score',
+                  { 'is-current': isCurrentScore(question, s) },
+                ]"
                 @click="chooseScore(question, s)"
               >
                 {{ s }}

+ 16 - 16
src/features/mark/MarkBoardTrack.vue

@@ -44,7 +44,7 @@
         v-for="(question, index) in store.currentTask.questionList"
         :key="index"
       >
-        <div class="board-quesion-box">
+        <div class="board-question-box">
           <div
             :id="
               store.isScoreBoardCollapsed
@@ -54,7 +54,7 @@
                 : ['bq', question.mainNumber, question.subNumber].join('-')
             "
             :class="[
-              'board-quesion',
+              'board-question',
               { 'is-current': isCurrentQuestion(question) },
             ]"
             tabindex="0"
@@ -80,16 +80,16 @@
                 定位
               </div>
             </div>
-            <div v-if="!!question.questionName" class="quesion-title">
-              {{ question.questionName }}
-            </div>
-            <div v-else class="quesion-title">
-              {{ question.title }} {{ question.mainNumber }}-{{
-                question.subNumber
-              }}
+            <div class="question-info">
+              <div class="question-title" :title="question.title">
+                {{ question.title }}
+              </div>
+              <div class="question-no">
+                {{ question.mainNumber }}-{{ question.subNumber }}
+              </div>
             </div>
             <!-- 设置高度 避免动画跳动 -->
-            <div class="quesion-score">
+            <div class="question-score">
               <transition-group name="score-number-animation" tag="span">
                 <span
                   :key="store.currentTask?.markResult?.scoreList[index] || 0"
@@ -197,7 +197,7 @@ const onRightClick = (e: any, index?: any) => {
   ) {
     tmpStyle.left = e.clientX + "px";
     tmpStyle.top = e.clientY + "px";
-    let parentNode = getParentNode(e.target, "board-quesion");
+    let parentNode = getParentNode(e.target, "board-question");
     if (parentNode) {
       activeRightMenuItem.value = parentNode;
     }
@@ -301,11 +301,11 @@ let keys: string[] = [];
 function numberKeyListener(event: KeyboardEvent) {
   if (!store.currentQuestion) return;
   if (" jiklc".includes(event.key)) return;
-  if (event.key === "#") {
-    keys = [];
-    store.currentScore = -0;
-    return;
-  }
+  // if (event.key === "#") {
+  //   keys = [];
+  //   store.currentScore = -0;
+  //   return;
+  // }
 
   function indexOfCurrentQuestion() {
     return (

+ 7 - 7
src/features/mark/MarkHeader.vue

@@ -169,7 +169,7 @@
 </template>
 
 <script setup lang="ts">
-import { doLogout, updateUISetting, clearMarkTask } from "@/api/markPage";
+import { doLogout, clearMarkTask } from "@/api/markPage";
 import { watch, watchEffect } from "vue";
 import { store } from "@/store/store";
 import MarkChangeProfile from "./MarkChangeProfile.vue";
@@ -188,19 +188,19 @@ const exchangeModeName = $computed(() =>
   store.setting.mode === "TRACK" ? "普通模式" : "轨迹模式"
 );
 
-async function toggleSettingMode() {
+function toggleSettingMode() {
   if (store.isTrackMode) {
     store.setting.mode = "COMMON";
   } else {
     store.setting.mode = "TRACK";
   }
-  await updateUISetting(store.setting.mode);
+  // await updateUISetting(store.setting.mode, store.setting.uiSetting);
 
-  const body = document.querySelector("body");
-  if (body) body.innerHTML = "重新加载中...";
+  // const body = document.querySelector("body");
+  // if (body) body.innerHTML = "重新加载中...";
   // 等待一秒后,重新加载页面
-  await new Promise((resolve) => setTimeout(resolve, 1000));
-  window.location.reload();
+  // await new Promise((resolve) => setTimeout(resolve, 1000));
+  // window.location.reload();
 }
 
 const progress = $computed(() => {

+ 7 - 1
src/features/mark/MarkTool.vue

@@ -87,7 +87,10 @@
           <img src="@/assets/icons/icon-minify.svg" />
           <p>缩小</p>
         </div>
-        <div class="mark-tool-item" @click="toOrigin">
+        <div
+          :class="['mark-tool-item', { 'is-active': equalOneScale }]"
+          @click="toOrigin"
+        >
           <img src="@/assets/icons/icon-origin-size.svg" />
           <p>实际大小</p>
         </div>
@@ -174,6 +177,9 @@ const greaterThanOneScale = computed(() => {
 const lessThanOneScale = computed(() => {
   return store.setting.uiSetting["answer.paper.scale"] < 1;
 });
+const equalOneScale = computed(() => {
+  return store.setting.uiSetting["answer.paper.scale"] === 1;
+});
 function keyListener(event: KeyboardEvent) {
   if (event.key === "+") {
     toMagnify();

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

@@ -72,7 +72,7 @@
         </div>
         <div class="cut-item">
           <div>键盘选分</div>
-          <div><span class="cut-key">数字 或 . 或 #</span></div>
+          <div><span class="cut-key">数字 或 .</span></div>
         </div>
         <div class="cut-item">
           <div>取消选分</div>

+ 0 - 9
src/plugins/axiosApp.ts

@@ -20,7 +20,6 @@ axiosRetry(_axiosApp);
 
 // 为请求头添加鉴权信息
 function setAuth(config) {
-  const excludeUrls = ["/api/admin/common/login"];
   const token = vls.get("token");
   if (token) {
     const ids = {
@@ -49,14 +48,6 @@ function setAuth(config) {
     );
     config.headers["Authorization"] = Authorization;
     config.headers["time"] = timestamp;
-
-    if (!excludeUrls.includes(config.url)) {
-      const mark = vls.get("mark");
-      config.params = {
-        ...mark,
-        ...(config.params || {}),
-      };
-    }
   }
   config.headers["deviceId"] = DEVICE_ID;
   config.headers["platform"] = PLATFORM;

+ 72 - 20
src/styles/page.less

@@ -175,21 +175,18 @@
     &:hover {
       color: #000;
     }
-    &.is-active::after {
-      content: "";
-      display: block;
-      position: absolute;
-      height: 3px;
-      width: 90%;
-      bottom: -7px;
-      left: 5%;
-      background-color: #f53f3f;
+    &.is-active {
+      > img {
+        background-color: #e7e7e7;
+        border-radius: 2px;
+      }
     }
 
     > img {
       display: block;
-      width: 20px;
-      height: 20px;
+      width: 24px;
+      height: 24px;
+      padding: 2px;
       margin: 0 auto;
     }
     > p {
@@ -404,6 +401,46 @@
   position: relative;
   .flex-static;
 
+  &.is-key-board {
+    padding-bottom: 16px;
+  }
+
+  &.is-mouse-board {
+    padding-bottom: 16px;
+
+    .board-question-full-box {
+      padding: 0 8px;
+      margin: 16px 0;
+    }
+    .board-question {
+      display: block;
+      border: none;
+      padding: 0;
+      overflow: unset;
+      user-select: none;
+      cursor: auto;
+
+      &:hover {
+        border-color: none;
+        color: inherit;
+      }
+
+      .question-info {
+        .flex-between;
+        height: 21px;
+        overflow: hidden;
+        margin-bottom: 10px;
+      }
+      .question-no {
+        .flex-static;
+        margin-left: 10px;
+      }
+    }
+    .board-score {
+      margin-bottom: 8px;
+    }
+  }
+
   &.in-dialog {
     max-width: 100%;
     min-width: 100%;
@@ -414,6 +451,10 @@
   &.hide {
     display: none;
   }
+  .board-mode {
+    .flex-static;
+    margin-bottom: 16px;
+  }
 
   .board-header {
     display: flex;
@@ -447,7 +488,7 @@
 
       > span {
         display: block;
-        width: 50px;
+        min-width: 50px;
         height: 36px;
         font-size: 30px;
         font-weight: 600;
@@ -470,30 +511,41 @@
     overflow-x: hidden;
     overflow-y: auto;
   }
-  .board-quesion-box {
+  .board-question-box {
     display: inline-block;
     vertical-align: top;
     width: 50%;
     padding: 0 8px 16px;
     font-size: 14px;
   }
-  .board-quesion {
+  .board-question-full-box {
+    padding: 0 8px 16px;
+    font-size: 14px;
+  }
+  .board-question {
     .flex-between;
     border-radius: 4px;
     border: 1px solid #e5e5e5;
-    padding: 16px;
-    height: 74px;
+    padding: 10px 16px;
+    min-height: 74px;
     overflow: hidden;
     color: #262626;
     position: relative;
+    cursor: pointer;
 
-    .quesion-title {
+    .question-info {
       flex-grow: 2;
-      max-height: 42px;
-      overflow: hidden;
       line-height: 21px;
+      overflow: hidden;
+    }
+
+    .question-title {
+      height: 21px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
     }
-    .quesion-score {
+    .question-score {
       .flex-static;
       margin-left: 10px;
       height: 36px;