浏览代码

数据检查页面,学生答案信息接口增加type字段和逻辑

刘洋 1 年之前
父节点
当前提交
b87e8e54dd
共有 4 个文件被更改,包括 80 次插入68 次删除
  1. 33 31
      components.d.ts
  2. 19 19
      src/devLoginParams.ts
  3. 27 17
      src/features/admin/confirmPaper/ConfirmPaper.vue
  4. 1 1
      vite.config.ts

+ 33 - 31
components.d.ts

@@ -1,39 +1,41 @@
 // generated by unplugin-vue-components
 // We suggest you to commit this file into source control
 // Read more: https://github.com/vuejs/core/pull/3399
-import "@vue/runtime-core";
+import '@vue/runtime-core'
 
-export {};
+export {}
 
-declare module "@vue/runtime-core" {
+declare module '@vue/runtime-core' {
   export interface GlobalComponents {
-    AButton: typeof import("ant-design-vue/es")["Button"];
-    AConfigProvider: typeof import("ant-design-vue/es")["ConfigProvider"];
-    ADropdown: typeof import("ant-design-vue/es")["Dropdown"];
-    AForm: typeof import("ant-design-vue/es")["Form"];
-    AFormItem: typeof import("ant-design-vue/es")["FormItem"];
-    AInput: typeof import("ant-design-vue/es")["Input"];
-    AInputSearch: typeof import("ant-design-vue/es")["InputSearch"];
-    AMenu: typeof import("ant-design-vue/es")["Menu"];
-    AMenuItem: typeof import("ant-design-vue/es")["MenuItem"];
-    AModal: typeof import("ant-design-vue/es")["Modal"];
-    APopconfirm: typeof import("ant-design-vue/es")["Popconfirm"];
-    APopover: typeof import("ant-design-vue/es")["Popover"];
-    ARadio: typeof import("ant-design-vue/es")["Radio"];
-    ARadioGroup: typeof import("ant-design-vue/es")["RadioGroup"];
-    ARow: typeof import("ant-design-vue/es")["Row"];
-    ASelect: typeof import("ant-design-vue/es")["Select"];
-    ASelectOption: typeof import("ant-design-vue/es")["SelectOption"];
-    ASlider: typeof import("ant-design-vue/es")["Slider"];
-    ASpin: typeof import("ant-design-vue/es")["Spin"];
-    ASwitch: typeof import("ant-design-vue/es")["Switch"];
-    ATooltip: typeof import("ant-design-vue/es")["Tooltip"];
-    CommonMarkHeader: typeof import("./src/components/CommonMarkHeader.vue")["default"];
-    PageError404: typeof import("./src/components/PageError404.vue")["default"];
-    QmButton: typeof import("./src/components/QmButton.vue")["default"];
-    QmDialog: typeof import("./src/components/QmDialog.vue")["default"];
-    RouterLink: typeof import("vue-router")["RouterLink"];
-    RouterView: typeof import("vue-router")["RouterView"];
-    ZoomPaper: typeof import("./src/components/ZoomPaper.vue")["default"];
+    AButton: typeof import('ant-design-vue/es')['Button']
+    ACol: typeof import('ant-design-vue/es')['Col']
+    AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
+    ADropdown: typeof import('ant-design-vue/es')['Dropdown']
+    AForm: typeof import('ant-design-vue/es')['Form']
+    AFormItem: typeof import('ant-design-vue/es')['FormItem']
+    AInput: typeof import('ant-design-vue/es')['Input']
+    AInputSearch: typeof import('ant-design-vue/es')['InputSearch']
+    AMenu: typeof import('ant-design-vue/es')['Menu']
+    AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
+    AModal: typeof import('ant-design-vue/es')['Modal']
+    APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
+    APopover: typeof import('ant-design-vue/es')['Popover']
+    ARadio: typeof import('ant-design-vue/es')['Radio']
+    ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
+    ARow: typeof import('ant-design-vue/es')['Row']
+    ASelect: typeof import('ant-design-vue/es')['Select']
+    ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
+    ASlider: typeof import('ant-design-vue/es')['Slider']
+    ASpin: typeof import('ant-design-vue/es')['Spin']
+    ASwitch: typeof import('ant-design-vue/es')['Switch']
+    ATextarea: typeof import('ant-design-vue/es')['Textarea']
+    ATooltip: typeof import('ant-design-vue/es')['Tooltip']
+    CommonMarkHeader: typeof import('./src/components/CommonMarkHeader.vue')['default']
+    PageError404: typeof import('./src/components/PageError404.vue')['default']
+    QmButton: typeof import('./src/components/QmButton.vue')['default']
+    QmDialog: typeof import('./src/components/QmDialog.vue')['default']
+    RouterLink: typeof import('vue-router')['RouterLink']
+    RouterView: typeof import('vue-router')['RouterView']
+    ZoomPaper: typeof import('./src/components/ZoomPaper.vue')['default']
   }
 }

+ 19 - 19
src/devLoginParams.ts

@@ -31,17 +31,17 @@
 //   // markerId: "482",
 //   // markerId: "483",
 // };
-export const LOGIN_CONFIG = {
-  isAdmin: false,
-  forceChange: true,
-  loginName: "6-X-M_pj01",
-  // loginName: "liuyang",
-  password: "123456",
-  examId: "432",
-  markerId: "3123",
-  // markerId: "482",
-  // markerId: "483",
-};
+// export const LOGIN_CONFIG = {
+//   isAdmin: false,
+//   forceChange: true,
+//   loginName: "6-X-M_pj01",
+//   // loginName: "liuyang",
+//   password: "123456",
+//   examId: "432",
+//   markerId: "3123",
+//   // markerId: "482",
+//   // markerId: "483",
+// };
 // export const LOGIN_CONFIG = {
 //   isAdmin: false,
 //   forceChange: false,
@@ -56,14 +56,14 @@ export const LOGIN_CONFIG = {
 //   // markerId: "483",
 // };
 /** 224 管理员 */
-// export const LOGIN_CONFIG = {
-//   isAdmin: true,
-//   forceChange: true,
-//   loginName: "admin-test",
-//   password: "123456",
-//   examId: "1",
-//   markerId: "339",
-// };
+export const LOGIN_CONFIG = {
+  isAdmin: true,
+  forceChange: true,
+  loginName: "admin-test",
+  password: "123456",
+  examId: "164",
+  markerId: "null",
+};
 
 /** 255 评卷员 */
 // export const LOGIN_CONFIG = {

+ 27 - 17
src/features/admin/confirmPaper/ConfirmPaper.vue

@@ -90,12 +90,22 @@
                   <a-input
                     class="normal-input"
                     :class="{
-                      'long-input': group.mainTitle.match(/单选|多选|多项|不定项/),
-                      'middle-input': group.mainTitle.match(/判断/),
+                      'long-input': question.type
+                        ? ['SINGLE', 'MULTIPLE'].includes(question.type)
+                        : group.mainTitle.match(/单选|多选|多项|不定项/),
+                      'middle-input': question.type
+                        ? ['TRUE_OR_FALSE'].includes(question.type)
+                        : group.mainTitle.match(/判断/),
                     }"
                     :value="question.answer"
                     :maxLength="
-                      group.mainTitle.match(/多选|多项|不定项/) ? 100 : 1
+                      (
+                        question.type
+                          ? ['MULTIPLE'].includes(question.type)
+                          : group.mainTitle.match(/多选|多项|不定项/)
+                      )
+                        ? 100
+                        : 1
                     "
                     @keydown="onPreventAnswerKey"
                     @input="changeAnswer($event, question)"
@@ -322,7 +332,7 @@ const allowKey = [
 const allowKeyRef = new RegExp(allowKey.join("|"));
 
 function onPreventAnswerKey(e: KeyboardEvent) {
-  console.log(e)
+  console.log(e);
   if (!allowKeyRef.test(e.key)) {
     e.preventDefault();
   }
@@ -334,7 +344,7 @@ function changeAnswer(
   defaultValue?: string
 ) {
   const target = event.target as HTMLInputElement;
-  student!.answers = student!.answers.map((v) => {
+  student.answers = student.answers.map((v) => {
     if (
       v.mainNumber === question.mainNumber &&
       v.subNumber === question.subNumber
@@ -401,7 +411,7 @@ function switchImageArrow({
     }
   }
   if (right) {
-    if (currentImage < student!.sheetUrls.length - 1) {
+    if (currentImage < student.sheetUrls.length - 1) {
       currentImage++;
     }
   }
@@ -415,7 +425,7 @@ function switchImage(event: MouseEvent) {
       currentImage--;
     }
   } else {
-    if (currentImage < student!.sheetUrls.length - 1) {
+    if (currentImage < student.sheetUrls.length - 1) {
       currentImage++;
     }
   }
@@ -426,7 +436,7 @@ const showBigImage = (event: MouseEvent) => {
   // console.log(event);
   let viewer: Viewer = null as unknown as Viewer;
   viewer && viewer.destroy();
-  viewer = new Viewer((event.target as HTMLElement).parentElement!, {
+  viewer = new Viewer((event.target as HTMLElement).parentElement, {
     // inline: true,
     viewed() {
       viewer.zoomTo(1);
@@ -502,7 +512,7 @@ function rotateRight() {
   width: 94px;
   padding: 4px;
 }
-.normal-input.middle-input{
+.normal-input.middle-input {
   width: 61px !important;
   padding: 4px;
 }
@@ -542,12 +552,12 @@ function rotateRight() {
   visibility: hidden;
   opacity: 0;
 }
-.confirm-paper .top-block{
-  background-color:#fff;
-  height:50px;
-  padding:0 20px;
-  display:flex;
-  align-items:center;
-  border-radius:6px;
+.confirm-paper .top-block {
+  background-color: #fff;
+  height: 50px;
+  padding: 0 20px;
+  display: flex;
+  align-items: center;
+  border-radius: 6px;
 }
-</style>
+</style>

+ 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";
+const SERVER_URL = "http://192.168.10.224";
 // const SERVER_URL = "http://192.168.11.103:8090";
 
 const path = require("path");