Browse Source

feat: 1.3.8细节调整

chenhao 2 years ago
parent
commit
b508671d6c

+ 1 - 1
src/components/CommonMarkHeader.vue

@@ -138,7 +138,7 @@
       @click="store.toggleScoreBoard"
     >
       <span
-        title="给分板"
+        title="弹出给分板"
         class="tw-inline-flex tw-place-content-center tw-relative"
       >
         <img

+ 7 - 0
src/features/library/inspect/LibraryInspect.vue

@@ -194,6 +194,13 @@ const rejectQuestions = async ({
     reason
   );
   if (res.data.success) {
+    const rejectShowedTasksString = sessionStorage.getItem("reject-showed");
+    let rejectShowedTasks: string[] = [];
+    if (rejectShowedTasksString) {
+      rejectShowedTasks = JSON.parse(rejectShowedTasksString);
+    }
+    rejectShowedTasks.push(store.currentTask.secretNumber);
+    sessionStorage.setItem("reject-showed", JSON.stringify(rejectShowedTasks));
     store.currentTask = undefined;
     void message.success({ content: "打回成功", key: mkey, duration: 2 });
     if (!store.historyOpen) {

+ 1 - 0
src/features/library/inspect/ReviewReturnDialog.vue

@@ -10,6 +10,7 @@
       <a-form
         autocomplete="off"
         :model="reasonOption"
+        :labelCol="{span: 5}"
         @keydown.stop=""
         @keypress.stop=""
         @finish="onConfirm"

+ 29 - 11
src/features/mark/Mark.vue

@@ -33,9 +33,17 @@
   <SpecialTagModal />
   <ShortCutModal />
   <MarkBoardTrackDialog
-v-if="store.isTrackMode" @submit="saveTaskToServer" @allZeroSubmit="allZeroSubmit"
-    @unselectiveSubmit="unselectiveSubmit" />
-  <a-spin v-if="statusSpinning" wrapperClassName="status-spin" size="large" :spinning="loadingStatusSpinning">
+    v-if="store.isTrackMode"
+    @submit="saveTaskToServer"
+    @allZeroSubmit="allZeroSubmit"
+    @unselectiveSubmit="unselectiveSubmit"
+  />
+  <a-spin
+    v-if="statusSpinning"
+    wrapperClassName="status-spin"
+    size="large"
+    :spinning="loadingStatusSpinning"
+  >
     <div
       style="height: 100vh"
       class="tw-text-8xl tw-flex tw-items-center tw-justify-center tw-text-red-500"
@@ -222,7 +230,19 @@ watch(
 );
 
 const showRejectedReason = (task: Task) => {
-  if (task.rejected && task.rejectReason) {
+  const rejectShowedTasksString = sessionStorage.getItem("reject-showed");
+
+  let rejectShowedTasks: string[] = [];
+
+  if (rejectShowedTasksString) {
+    rejectShowedTasks = JSON.parse(rejectShowedTasksString);
+  }
+
+  if (
+    rejectShowedTasks.includes(task.secretNumber) &&
+    task.rejected &&
+    task.rejectReason
+  ) {
     const [reasonType, reasonDesc] = task.rejectReason.split(":");
     Modal.info({
       title: null,
@@ -269,13 +289,11 @@ watch(
     // 重置当前选择的quesiton和score
     store.currentQuestion = undefined;
     store.currentScore = undefined;
-    nextTick()
-      .then(() => {
-        if (store.currentTask) {
-          showRejectedReason(store.currentTask);
-        }
-      })
-      .catch(() => {});
+    void nextTick(() => {
+      if (store.currentTask) {
+        showRejectedReason(store.currentTask);
+      }
+    });
   }
 );
 

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

@@ -255,7 +255,7 @@ class="tw-flex tw-place-content-center tw-cursor-pointer tw-items-center" style=
         退出
       </div>
       <a-tooltip placement="bottomRight" :overlayStyle="{ width: '58px' }">
-        <template #title>给分板</template>
+        <template #title>弹出给分板</template>
         <div
 class="tw-flex tw-place-content-center tw-cursor-pointer menu" :class="[
           store.isScoreBoardVisible && store.currentTask && 'menu-toggled',

+ 47 - 7
src/features/student/studentInspect/MarkBoardInspect.vue

@@ -19,9 +19,15 @@
       </div>
     </div>
 
-    <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 tw-pl-5 tw-pr-3">
+    <div v-if="groups" class="question-list tw-flex-grow tw-overflow-auto">
+      <template
+        v-for="({ groupNumber, selectiveIndex }, index) in groups"
+        :key="index"
+      >
+        <div class="question-item tw-mb-4 tw-bg-white tw-p-4 tw-pl-5 tw-pr-3">
+          <div v-if="selectiveIndex" class="question-item-select-group">
+            {{ selectiveIndex }}
+          </div>
           <div
             class="tw-flex tw-justify-between tw-place-items-center hover:tw-bg-gray-200"
             @mouseover="addFocusTrack(groupNumber, undefined, undefined)"
@@ -134,8 +140,16 @@ watch(
   }
 );
 const groups = $computed(() => {
-  const gs = store.currentTaskEnsured.questionList.map((q) => q.groupNumber);
-  return [...new Set(gs)].sort((a, b) => a - b);
+  const gs = store.currentTaskEnsured.questionList.reduce((gs, q) => {
+    if (!gs[q.groupNumber]) {
+      gs[q.groupNumber] = {
+        groupNumber: q.groupNumber,
+        selectiveIndex: q.selectiveIndex,
+      };
+    }
+    return gs;
+  }, {} as Record<number, { groupNumber: number; selectiveIndex: number | null }>);
+  return Object.values(gs);
 });
 
 const questions = $computed(() => {
@@ -214,7 +228,6 @@ function onConfirmReturn(reason: string) {
   max-width: 290px;
   min-width: 290px;
   max-height: calc(100vh - 56px);
-  padding: 20px;
   z-index: 1001;
   transition: margin-right 0.5s;
   color: var(--app-small-header-text-color);
@@ -230,10 +243,37 @@ function onConfirmReturn(reason: string) {
   background-color: var(--app-container-bg-color);
   height: 86px;
   border-radius: 5px;
-
+  margin: 20px;
+  margin-bottom: 0;
   color: white;
   background-color: var(--app-primary-button-bg-color);
 }
+
+.question-list {
+  padding: 20px;
+}
+
+.question-item {
+  border-radius: 5px;
+  position: relative;
+}
+
+/** 选做题分组 */
+.question-item-select-group {
+  position: absolute;
+  left: -12px;
+  top: -12px;
+  width: 24px;
+  height: 24px;
+  background: #d3d9e6;
+  border-radius: 12px 12px 4px 12px;
+  color: #435488;
+  text-align: center;
+  line-height: 24px;
+  font-size: 12px;
+  font-weight: bold;
+}
+
 .total-score {
   color: var(--app-main-text-color);
   font-size: 32px;

+ 7 - 0
src/features/student/studentInspect/StudentInspect.vue

@@ -197,6 +197,13 @@ const rejectQuestions = async ({
   void message.loading({ content: "打回评卷任务...", key: mkey });
   const res = await rejectInspectedTask(realStudentId, questions, reason);
   if (res.data.success && store.currentTask) {
+    const rejectShowedTasksString = sessionStorage.getItem("reject-showed");
+    let rejectShowedTasks: string[] = [];
+    if (rejectShowedTasksString) {
+      rejectShowedTasks = JSON.parse(rejectShowedTasksString);
+    }
+    rejectShowedTasks.push(store.currentTask.secretNumber);
+    sessionStorage.setItem("reject-showed", JSON.stringify(rejectShowedTasks));
     store.currentTask = undefined;
     void message.success({ content: "打回成功", key: mkey, duration: 2 });
     if (!store.historyOpen) {

+ 2 - 0
src/types/index.ts

@@ -236,6 +236,8 @@ interface RawQuestion {
   score: number | null;
   /** 未计分 */
   uncalculate: boolean
+  /** 选做题分组 */
+  selectiveIndex: number | null
 }
 export interface Question extends RawQuestion {
   /** question 在 task 里面的 index ,用来对应 scoreList 的 score */

+ 1 - 1
vite.config.ts

@@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue";
 import ViteComponents from "unplugin-vue-components/vite";
 import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
 
-const SERVER_URL = "http://192.168.10.225:8000";
+const SERVER_URL = "http://192.168.10.224";
 const path = require("path");
 
 function mockDevLogin(): Plugin {