zhangjie 1 vuosi sitten
vanhempi
commit
fe81b62b4e

+ 1 - 1
src/App.vue

@@ -24,7 +24,7 @@ watch(
 );
 
 watchEffect(() => {
-  const bodyScrollProp = spinning ? "hidden" : "auto";
+  const bodyScrollProp = spinning ? "hidden" : null;
   document.body.style.overflow = bodyScrollProp;
 });
 </script>

+ 2 - 0
src/api/markPage.ts

@@ -83,6 +83,8 @@ export async function saveTask() {
 
   let markResult = store.currentTask.markResult;
   markResult.problem = false;
+  markResult.problemType = undefined;
+  markResult.problemRemark = undefined;
   markResult.unselective = false;
   markResult.spent = Date.now() - store.currentTask.__markStartTime;
   markResult = { ...markResult };

+ 3 - 25
src/features/mark/Mark.vue

@@ -151,7 +151,7 @@ async function updateGroups() {
 let preDrawing = false;
 async function updateTask() {
   const res = await getTask();
-  if (res.data.taskId) {
+  if (res.data?.taskId) {
     const newTask = res.data;
     // newTask.sheetUrls = newTask.sheetUrls || [];
     newTask.sheetUrls = ["/1-1.jpg", "/1-2.jpg"];
@@ -180,7 +180,7 @@ async function updateTask() {
       await new Promise((resolve) => setTimeout(resolve, 3000));
     }
   } else {
-    store.message = res.data.message;
+    store.message = res.message || "数据错误";
   }
 }
 
@@ -198,11 +198,6 @@ function nextTask() {
 // 5秒更新一次tasks
 // addInterval(nextTask, 5 * 1000);
 
-// 不需要
-// addInterval(() => {
-//   updateStatus();
-// }, 5 * 60 * 1000);
-
 onMounted(async () => {
   await updateMarkTask();
   await updateSetting();
@@ -225,24 +220,7 @@ watch(
 );
 
 const showRejectedReason = (task: Task) => {
-  // const rejectShowedTasksString = sessionStorage.getItem("reject-task-showed");
-
-  // let rejectShowedTasks: string[] = [];
-
-  // if (rejectShowedTasksString) {
-  //   rejectShowedTasks = JSON.parse(rejectShowedTasksString);
-  // }
-
-  if (
-    // !rejectShowedTasks.includes(task.secretNumber) &&
-    task.rejected &&
-    task.rejectReason
-  ) {
-    // rejectShowedTasks.push(task.secretNumber);
-    // sessionStorage.setItem(
-    //   "reject-task-showed",
-    //   JSON.stringify(rejectShowedTasks)
-    // );
+  if (task.rejected && task.rejectReason) {
     const [reasonType, reasonDesc] = task.rejectReason.split(":");
     Modal.info({
       title: null,

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

@@ -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, "question");
+    let parentNode = getParentNode(e.target, "board-quesion");
     if (parentNode) {
       activeRightMenuItem.value = parentNode;
     }

+ 3 - 3
src/features/mark/MarkBody.vue

@@ -7,9 +7,9 @@
   <div class="cursor">
     <div class="cursor-border">
       <span v-if="store.currentSpecialTagType === 'TEXT'" class="text">文</span>
-      <span v-else-if="store.currentSpecialTagType === 'RIGHT'" class="text">
+      <!-- <span v-else-if="store.currentSpecialTagType === 'RIGHT'" class="text">
         <CheckOutlined
-      /></span>
+      /></span> -->
       <span v-else-if="store.currentSpecialTag" class="text">
         {{ store.currentSpecialTag }}
       </span>
@@ -27,7 +27,7 @@ import { store } from "@/store/store";
 import { SliceImage, SpecialTag, Track } from "@/types";
 import CustomCursor from "custom-cursor.js";
 import CommonMarkBody from "./CommonMarkBody.vue";
-import { CheckOutlined } from "@ant-design/icons-vue";
+// import { CheckOutlined } from "@ant-design/icons-vue";
 
 // import { message } from "ant-design-vue";
 // 开启本组件,测试后台在整卷的还原效果

+ 8 - 12
src/features/mark/MarkDrawTrack.vue

@@ -26,10 +26,7 @@
       @mousedown.stop
       @mouseup.stop
     >
-      <template v-if="tag.tagType === 'RIGHT'">
-        <CheckOutlined class="tw-m-auto" />
-      </template>
-      <template v-else-if="tag.tagType === 'TEXT'">
+      <template v-if="tag.tagType === 'TEXT'">
         <a-textarea
           v-model:value="tag.tagName"
           class="tag-textarea tw-m-auto"
@@ -37,6 +34,9 @@
           :maxlength="32"
         />
       </template>
+      <!-- <template v-else-if="tag.tagType === 'RIGHT'">
+        <CheckOutlined class="tw-m-auto" />
+      </template> -->
       <span v-else class="tw-m-auto">
         {{ tag.tagName }}
       </span>
@@ -49,7 +49,7 @@ import type { SpecialTag, Track } from "@/types";
 import { toRefs, watch, nextTick, computed } from "vue";
 import { store } from "@/store/store";
 import { message } from "ant-design-vue";
-import { CheckOutlined } from "@ant-design/icons-vue";
+// import { CheckOutlined } from "@ant-design/icons-vue";
 import { useRoute } from "vue-router";
 const route = useRoute();
 
@@ -172,7 +172,7 @@ watch(
   pointer-events: none;
 }
 .score-animation {
-  animation: 1s ease-in-out 0s infinite alternate change_size;
+  animation: 0.5s ease-in-out 0s infinite alternate change_size;
 }
 .score-container .tag-textarea {
   background-color: transparent;
@@ -191,14 +191,10 @@ watch(
 
 @keyframes change_size {
   from {
-    font-size: 2em;
-    margin-top: -100px;
-    margin-left: -100px;
+    transform: scale(1, 1);
   }
   to {
-    font-size: 4em;
-    margin-top: -80px;
-    margin-left: -80px;
+    transform: scale(2, 2);
   }
 }
 .track-score-enter-active {

+ 9 - 16
src/features/mark/MarkHeader.vue

@@ -10,18 +10,12 @@
           <img class="header-icon" src="@/assets/icons/icon-left-menu.svg" />
         </div>
       </a-tooltip>
-      <div class="header-subject">
-        <a
-          :title="store.setting.subject.name"
-          href="/mark/subject-select"
-          @dragstart.prevent
-        >
-          {{
-            `${store.setting.subject.code ?? ""}-${
-              store.setting.subject.name ?? ""
-            }`
-          }}
-        </a>
+      <div class="header-subject" :title="store.setting.subject.name">
+        {{
+          `${store.setting.subject.code ?? ""}-${
+            store.setting.subject.name ?? ""
+          }`
+        }}
       </div>
       <a-tooltip overlayClassName="mark-tooltip">
         <template #title>
@@ -37,7 +31,6 @@
           />
         </div>
       </a-tooltip>
-      <!-- <div v-if="store.setting.statusValue === 'TRIAL'">试评</div> -->
       <div class="header-secret">
         <div class="header-noun">
           <span>编号:</span>
@@ -126,7 +119,7 @@
         <img src="@/assets/icons/icon-track-mode.svg" class="header-icon" />
         {{ modeName }}
       </div>
-      <!-- <a-dropdown>
+      <a-dropdown>
         <template v-if="!store.setting.forceMode" #overlay>
           <a-menu>
             <a-menu-item key="1" @click="toggleSettingMode">
@@ -140,7 +133,7 @@
           {{ modeName }}
           <CaretDownOutlined v-if="!store.setting.forceMode" class="a-icon" />
         </div>
-      </a-dropdown> -->
+      </a-dropdown>
       <div
         class="header-text-btn"
         :title="store.setting.groupTitle + '-' + store.setting.groupNumber"
@@ -240,7 +233,7 @@ const logout = () => {
 
 let changeProfileRef = $ref<InstanceType<typeof MarkChangeProfile>>();
 
-// TODO: 应该是@typescript-eslint/no-unsafe-call不完美的搞法,导致了下面的调用会出错
+// 应该是@typescript-eslint/no-unsafe-call不完美的搞法,导致了下面的调用会出错
 type ShowModalFunc = () => void;
 
 const openProfileModal = () => {

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

@@ -103,7 +103,7 @@ const handleOk = async () => {
     console.log("问题卷处理失败", error);
     void message.error({ content: "网络异常", duration: 5 });
     await new Promise((res) => setTimeout(res, 1500));
-    // window.location.reload();
+    window.location.reload();
   }
 };
 

+ 12 - 12
src/main.ts

@@ -20,6 +20,7 @@ import "ant-design-vue/es/message/style/css.js";
 
 import QmButton from "@/components/QmButton.vue";
 import QmDialog from "@/components/QmDialog.vue";
+import vls from "./utils/storage";
 
 // if(process.env.NODE_ENV)
 // console.log(import.meta.env.DEV);
@@ -38,15 +39,14 @@ app.component("QmDialog", QmDialog);
  */
 initMarkStore();
 
-// if (import.meta.env.DEV) {
-//   await import("./devLogin")
-//     .then((m) => {
-//       return m.initLogin();
-//     })
-//     .then(() => {
-//       app.mount("#app");
-//     });
-// } else {
-//   app.mount("#app");
-// }
-app.mount("#app");
+if (import.meta.env.DEV && !vls.get("user")) {
+  await import("./devLogin")
+    .then((m) => {
+      return m.initLogin();
+    })
+    .then(() => {
+      app.mount("#app");
+    });
+} else {
+  app.mount("#app");
+}

+ 2 - 1
src/store/store.ts

@@ -192,7 +192,8 @@ export const initMarkStore = () => {
           markerScore: null, // 后期通过 scoreList 自动更新
 
           problem: false,
-          problemTypeId: 0,
+          problemType: "",
+          problemRemark: "",
           unselective: false,
         };
         task.markResult.trackList.forEach((t) => {

+ 8 - 3
src/styles/page.less

@@ -10,8 +10,12 @@
 
 // mark
 .mark {
-  width: 100%;
-  overflow: clip;
+  position: absolute;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  overflow: hidden;
 
   .mark-main {
     height: calc(100vh - 56px - 58px);
@@ -74,6 +78,7 @@
     height: 18px;
     line-height: 18px;
     font-size: 14px;
+    text-align: center;
 
     > a {
       display: block;
@@ -89,7 +94,7 @@
     }
   }
   .header-programs {
-    margin: 0 24px 0 16px;
+    margin: 0 15px 0 0;
     padding: 6px;
     height: 30px;
     width: 30px;

+ 4 - 2
src/types/index.ts

@@ -352,8 +352,10 @@ export interface MarkResult {
 
   /** 问题卷 */
   problem: boolean;
-  /** 问题卷类型ID */
-  problemTypeId: number;
+  /** 问题卷类型 */
+  problemType: string;
+  /** 其他问题卷说明 */
+  problemRemark: string;
   /** 当前task是否为学生未选做 */
   unselective: boolean;
 }