ソースを参照

feat: 接口调试

zhangjie 11 ヶ月 前
コミット
7a178b8489

+ 6 - 3
src/modules/base/components/ModifyExamStudent.vue

@@ -24,6 +24,7 @@
           v-model="modalForm.semesterId"
           placeholder="学期"
           :disabled="isEdit"
+          style="width: 100%"
         ></semester-select>
       </el-form-item>
       <el-form-item prop="examId" label="考试:">
@@ -32,6 +33,7 @@
           :semester-id="modalForm.semesterId"
           placeholder="考试"
           :disabled="isEdit"
+          class="width-full"
         ></exam-select>
       </el-form-item>
       <el-form-item
@@ -68,6 +70,7 @@
           :filter-param="{
             withoutSecondOrg: true,
           }"
+          style="width: 100%"
           @change="teachingRoomChange"
         ></org-select>
       </el-form-item>
@@ -78,7 +81,7 @@
       >
         <el-select
           v-model="modalForm.courseId"
-          class="course-select"
+          class="width-full"
           placeholder="课程"
           filterable
           :disabled="isEdit"
@@ -145,7 +148,7 @@
           clearable
           :maxlength="1"
           class="width-200"
-          :disabled="isEdit && modalForm.paperType"
+          :disabled="isEdit && !!instance.paperType"
         >
         </el-input>
       </el-form-item>
@@ -162,7 +165,7 @@
           :placeholder="`请输入${item.name}`"
           clearable
           :disabled="
-            item.code === 'paperNumber' && isEdit && modalForm[item.code]
+            item.code === 'paperNumber' && isEdit && !!instance[item.code]
           "
         ></el-input>
       </el-form-item>

+ 10 - 6
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -815,13 +815,17 @@ export default {
       if (!valid) return Promise.reject();
 
       if (this.IS_TIKU_TAB) {
-        const attachmentValid = !this.paperAttachments.some(
-          (item) => !item.cardId
-        );
-        if (!attachmentValid) {
+        const paperValid = !this.paperAttachments.some((item) => !item.paperId);
+        if (!paperValid) {
           this.$message.error("请完成试卷选择!");
           return Promise.reject();
         }
+
+        const cardValid = !this.paperAttachments.some((item) => !item.cardId);
+        if (!cardValid) {
+          this.$message.error("有试卷类型未选择题卡!");
+          return Promise.reject();
+        }
         return Promise.resolve(true);
       }
 
@@ -853,7 +857,7 @@ export default {
       //   return;
       // }
 
-      let cardValid = !this.paperAttachments.some((item) => !item.cardId);
+      const cardValid = !this.paperAttachments.some((item) => !item.cardId);
       if (!cardValid) {
         this.$message.error("有试卷类型未选择题卡!");
         return Promise.reject();
@@ -951,8 +955,8 @@ export default {
         pages: 0,
         used: false,
         createId: null,
+        cards: [],
       };
-      if (this.IS_TIKU_TAB) newAttachment.cards = [];
       this.paperAttachments.push(newAttachment);
     },
     deleteAttachment(index) {

+ 9 - 5
src/modules/exam/components/taskApply/TaskPaper.vue

@@ -586,8 +586,8 @@ export default {
         isExposed: false,
         used: false,
         createId: null,
+        cards: [],
       };
-      if (this.IS_TIKU_TAB) newAttachment.cards = [];
       this.paperAttachments.push(newAttachment);
     },
     deleteAttachment(index) {
@@ -860,13 +860,17 @@ export default {
     },
     checkData() {
       if (this.IS_TIKU_TAB) {
-        const attachmentValid = !this.paperAttachments.some(
-          (item) => !item.cardId
-        );
-        if (!attachmentValid) {
+        const paperValid = !this.paperAttachments.some((item) => !item.paperId);
+        if (!paperValid) {
           this.$message.error("请完成试卷选择!");
           return;
         }
+
+        const cardValid = !this.paperAttachments.some((item) => !item.cardId);
+        if (!cardValid) {
+          this.$message.error("有试卷类型未选择题卡!");
+          return;
+        }
       } else {
         // 设置了入库强制包含试卷时,校验试卷是否上传。
         // 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。

+ 14 - 6
src/modules/mark/components/markParam/MarkParamClass.vue

@@ -34,7 +34,11 @@
           </p>
         </template>
         <template v-else>
-          <p v-for="item in unsignData" :key="item.className">
+          <p
+            v-for="item in unsignData"
+            :key="item.className"
+            style="white-space: pre-wrap"
+          >
             {{ item.content }}
           </p>
         </template>
@@ -108,13 +112,13 @@ export default {
       this.unsignData = this.classList
         .map((className) => {
           const markIds = this.dataList
-            .filter((row) => row.markerClassList.include(className))
-            .map((row) => row.mark.id);
+            .filter((row) => row.markerClassList.includes(className))
+            .map((row) => row.marker.userId);
 
           const unsignGroups = this.groupInfo
             .filter(
               (group) =>
-                !group.markers.some((marker) => markIds.includes(marker.id))
+                !group.markers.some((marker) => markIds.includes(marker.userId))
             )
             .map((group) => {
               return {
@@ -134,8 +138,8 @@ export default {
           if (unsignGroups.length) {
             const groupCont = unsignGroups
               .map((group) => group.question)
-              .join(" ");
-            nrow.content = `${className},${groupCont},未分配评卷员`;
+              .join("   ");
+            nrow.content = `${className}班级,${groupCont},未分配评卷员`;
           }
 
           return nrow;
@@ -143,6 +147,10 @@ export default {
         .filter((item) => item.unsignGroups.length);
     },
     async submit() {
+      if (this.unsignData.length) {
+        this.$message.error("存在未分配班级,请完成分配!");
+        return;
+      }
       if (this.loading) return;
 
       const unvalid = this.dataList.some(