zhangjie 2 年 前
コミット
d6fdbb1d68

+ 6 - 0
src/api/examwork-course.js

@@ -32,6 +32,7 @@ export function saveCourse({
   courseCode = "",
   objectiveShuffle = "",
   optionShuffle = "",
+  mobilePhotoUpload = "",
 }) {
   const data = pickBy(
     {
@@ -39,6 +40,7 @@ export function saveCourse({
       courseCode,
       objectiveShuffle,
       optionShuffle,
+      mobilePhotoUpload,
     },
     (v) => v !== ""
   );
@@ -68,6 +70,10 @@ export function savePapers(papers) {
   return httpApp.post("/api/admin/exam/paper/save", papers);
 }
 
+export function examDeletePaper(id) {
+  return httpApp.post("/api/admin/exam/paper/delete", {}, { params: id });
+}
+
 export function searchUnionPapers(courseCode) {
   return httpApp.post(
     "/api/admin/exam/union/paper/query?" + object2QueryString({ courseCode })

+ 0 - 2
src/api/examwork-exam.js

@@ -70,7 +70,6 @@ export function saveExam({
   shortCode = "",
   showObjectiveScore = 0,
   startTime = "",
-  mobilePhotoUpload = 0,
   examStudentCallEnable = 0,
 }) {
   const data = pickBy(
@@ -115,7 +114,6 @@ export function saveExam({
       shortCode,
       showObjectiveScore,
       startTime,
-      mobilePhotoUpload,
       examStudentCallEnable,
     },
     (v) => v !== ""

+ 2 - 2
src/api/invigilation.js

@@ -125,8 +125,8 @@ export function invigilateFinish(datas) {
   return httpApp.post("/api/admin/invigilate/finish", data);
 }
 // 结束监考接口
-export function invigilateExamFinish(examId) {
-  const data = pickBy({ examId }, paramFilter);
+export function invigilateExamFinish(examId, status) {
+  const data = pickBy({ examId, status }, paramFilter);
   return httpApp.post(
     "/api/admin/invigilate/exam/finish?" + object2QueryString(data),
     {}

+ 33 - 9
src/features/examwork/CourseManagement/CoursePaperDialog.vue

@@ -19,12 +19,12 @@
             disabled
           />
         </el-form-item>
-        <el-form-item>
+        <!-- <el-form-item>
           <el-button type="primary" @click="toAddPaper">新增绑卷</el-button>
-        </el-form-item>
+        </el-form-item> -->
       </div>
       <el-table :data="papers" stripe style="width: 100%;">
-        <el-table-column label="试卷名称">
+        <!-- <el-table-column label="试卷名称">
           <template slot-scope="scope">
             <el-select
               v-if="scope.row.isHandleAdd"
@@ -41,6 +41,9 @@
             </el-select>
             <span v-else>{{ scope.row.name }}</span>
           </template>
+        </el-table-column> -->
+        <el-table-column label="试卷名称">
+          <span slot-scope="scope">{{ scope.row.name }}</span>
         </el-table-column>
         <el-table-column width="100" label="分值">
           <span slot-scope="scope">{{ scope.row.totalScore }}</span>
@@ -73,7 +76,12 @@
         </el-table-column>
         <el-table-column label="操作" width="100">
           <div slot-scope="scope">
-            <el-button size="mini" type="danger" plain @click="toDelete(scope)">
+            <el-button
+              size="mini"
+              type="danger"
+              plain
+              @click="toDelete(scope.row)"
+            >
               删除
             </el-button>
           </div>
@@ -97,6 +105,14 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否允许小程序作答">
+            <el-radio-group v-model="refreshCourse.mobilePhotoUpload">
+              <el-radio :label="1">是</el-radio>
+              <el-radio :label="0">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -116,6 +132,7 @@ import {
   saveCourse,
   savePapers,
   searchUnionPapers,
+  examDeletePaper,
 } from "@/api/examwork-course";
 
 export default {
@@ -140,7 +157,7 @@ export default {
       handler() {
         this.refreshCourse = {};
         this.papers = [];
-        this.getPaperSources();
+        // this.getPaperSources();
         this.initData();
       },
     },
@@ -184,8 +201,16 @@ export default {
         isHandleAdd: true,
       });
     },
-    toDelete({ $index }) {
-      this.papers.splice($index, 1);
+    async toDelete(row) {
+      const confirm = await this.$confirm(`操作提示`, "确定要删除试卷吗?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        dangerouslyUseHTMLString: true,
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+      await examDeletePaper(row.id);
+      this.$notify({ title: "操作成功", type: "success" });
     },
     selectPaperChange({ row, $index }) {
       const sPapers = this.papers
@@ -215,6 +240,7 @@ export default {
           courseCode: this.refreshCourse.courseCode,
           objectiveShuffle: this.refreshCourse.objectiveShuffle,
           optionShuffle: this.refreshCourse.optionShuffle,
+          mobilePhotoUpload: this.refreshCourse.mobilePhotoUpload,
         });
         const ps = [];
         for (const paper of this.papers) {
@@ -239,5 +265,3 @@ export default {
   },
 };
 </script>
-
-<style></style>

+ 0 - 20
src/features/examwork/ExamManagement/ExamEdit.vue

@@ -186,16 +186,6 @@
               </el-radio>
             </el-form-item>
           </el-row>
-          <el-row>
-            <el-form-item label="是否允许小程序作答">
-              <el-radio v-model="form.mobilePhotoUpload" :label="1">
-                是
-              </el-radio>
-              <el-radio v-model="form.mobilePhotoUpload" :label="0">
-                否
-              </el-radio>
-            </el-form-item>
-          </el-row>
         </el-form>
       </el-tab-pane>
 
@@ -681,8 +671,6 @@ export default {
     "form.cameraPhotoUpload": {
       handler(v) {
         if (v) {
-          this.form.mobilePhotoUpload = 0;
-
           this.form.inProcessFaceVerify = 0;
           this.form.inProcessFaceStrangerIgnore = 0;
           this.form.inProcessRealnessVerify = 0;
@@ -691,13 +679,6 @@ export default {
         }
       },
     },
-    "form.mobilePhotoUpload": {
-      handler(v) {
-        if (v) {
-          this.form.cameraPhotoUpload = 0;
-        }
-      },
-    },
   },
   async created() {
     if (this.isEdit) {
@@ -753,7 +734,6 @@ export default {
         objectiveScorePolicy: "EQUAL",
         showObjectiveScore: 0,
         cameraPhotoUpload: 0,
-        mobilePhotoUpload: 0,
         entryAuthenticationPolicy: "OFF",
         inProcessFaceVerify: 0,
         inProcessFaceStrangerIgnore: 0,

+ 12 - 3
src/features/invigilation/InvigilationDetail/InvigilationDetail.vue

@@ -314,7 +314,9 @@ export default {
       return this.user.roleCodes.includes("INVIGILATE");
     },
     curExamIsOver() {
-      return this.curExamBatch && this.curExamBatch.monitorStatus === "END";
+      return (
+        this.curExamBatch && this.curExamBatch.monitorStatus === "FINISHED"
+      );
     },
   },
   mounted() {
@@ -438,12 +440,19 @@ export default {
 
       if (!result) return;
 
-      await invigilateExamFinish(this.filter.examId);
-      this.$refs.ExamBatchDialog.getExamList();
+      await invigilateExamFinish(
+        this.filter.examId,
+        this.curExamIsOver ? "NOT_START" : "FINISHED"
+      );
       this.$message({
         type: "success",
         message: "操作成功!",
       });
+      await this.getExamBatchList();
+      const curExamBatch = this.examBatchs.find(
+        (item) => item.id === this.filter.examId
+      );
+      this.curExamBatch = curExamBatch || {};
     },
   },
 };