Jelajahi Sumber

Merge branch 'release_v4.0.1' of http://git.qmth.com.cn/examcloud-frontend/examcloud-admin-web into release_v4.0.1

xiatian 4 tahun lalu
induk
melakukan
fd73b33c2c

+ 3 - 2
src/modules/basic/view/sys_login_rule_list.vue

@@ -253,8 +253,8 @@ export default {
       rootOrgList: [],
       loginRuleTypes: [
         { label: "考生登录", value: "STUDENT_LOGIN" },
-        { label: "考生端登录", value: "STUDENT_CLIENT_LOGIN" },
-        { label: "极验验证码登录", value: "GEETEST_LOGIN" }
+        { label: "考生端登录", value: "STUDENT_CLIENT_LOGIN" }
+        /*{ label: "极验验证码登录", value: "GEETEST_LOGIN" }*/
       ],
       isCreate: true,
       loginRuleDialog: false,
@@ -413,6 +413,7 @@ export default {
           return type.label;
         }
       }
+      return "";
     },
     resetSearchForm() {
       this.searchForm.rootOrgId = null;

+ 4 - 0
src/modules/examwork/view/examStudent.vue

@@ -1567,6 +1567,7 @@ export default {
       this.examStudentForm.phone = null;
       this.examStudentForm.infoCollector = null;
       this.examStudentForm.ext1 = null;
+      this.examStudentForm.examStageId = null;
       if (this.pureLC) {
         this.examStudentForm.orgId = this.lc_id;
         this.orgList4InsertOrUpdate = [
@@ -1579,6 +1580,7 @@ export default {
       }
       this.examList4InsertOrUpdate = [];
       this.courseList4InsertOrUpdate = [];
+      this.examStageDisabled4Insert = true;
 
       this.queryExams4InsertOrUpdate("");
       this.getCourses4InsertOrUpdate("");
@@ -1891,6 +1893,7 @@ export default {
       }
     },
     handleExamChange4Search(value) {
+      this.formSearch.examStageId = "";
       if (this.examList4Search.length > 0) {
         let examArr = this.examList4Search.filter(p => p.id == value);
         if (examArr && examArr.length > 0) {
@@ -1912,6 +1915,7 @@ export default {
       }
     },
     handleExamChange4InsertOrUpdate(value) {
+      this.examStudentForm.examStageId = "";
       if (this.examList4InsertOrUpdate.length > 0) {
         let examArr = this.examList4InsertOrUpdate.filter(p => p.id == value);
         if (examArr && examArr.length > 0) {

+ 84 - 15
src/modules/examwork/view/stageSpecialSettings.vue

@@ -403,7 +403,7 @@
         <!-- 修改场次弹出框 -->
         <el-dialog
           title="编辑场次"
-          width="650px"
+          width="700px"
           :visible.sync="editStageVisible"
         >
           <el-form
@@ -473,8 +473,13 @@
                 </el-form-item>
               </el-row>
               <el-row v-if="editStageForm.submitType == 'TIMING_END'">
-                <el-form-item label="统一交卷时间">
-                  <el-input v-model="editStageForm.submitDuration">
+                <el-form-item label="统一交卷时间" prop="submitDuration">
+                  <el-input
+                    class="input_width_lg"
+                    v-model="editStageForm.submitDuration"
+                    maxlength="10"
+                    @keyup.native="handleSubmitDuration4editStage"
+                  >
                     <template slot="prepend">开考后</template>
                     <template slot="append">分钟</template>
                   </el-input>
@@ -491,13 +496,14 @@
         <!-- 通用设置弹出框 -->
         <el-dialog
           title="收卷设置"
-          width="650px"
+          width="700px"
           :visible.sync="editStageCommonSettingVisible"
         >
           <el-form
             :inline="true"
             inline-message
             :model="editStageCommonSettingForm"
+            :rules="commonSettingRules"
             ref="editStageCommonSettingForm"
             label-position="right"
             label-width="120px"
@@ -512,7 +518,16 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <el-form-item label="收卷设置">
+              <el-form-item label="考试名称">
+                <el-input
+                  class="input_width_lg"
+                  v-model="editStageCommonSettingForm.examName"
+                  :disabled="true"
+                />
+              </el-form-item>
+            </el-row>
+            <el-row>
+              <el-form-item label="收卷设置" prop="submitType">
                 <el-radio-group
                   class="pull_right_sm"
                   v-model="editStageCommonSettingForm.submitType"
@@ -525,8 +540,13 @@
             <el-row
               v-if="editStageCommonSettingForm.submitType == 'TIMING_END'"
             >
-              <el-form-item label="统一交卷时间">
-                <el-input v-model="editStageCommonSettingForm.submitDuration">
+              <el-form-item label="统一交卷时间" prop="submitDuration">
+                <el-input
+                  class="input_width_lg"
+                  v-model="editStageCommonSettingForm.submitDuration"
+                  maxlength="10"
+                  @keyup.native="handleSubmitDuration"
+                >
                   <template slot="prepend">开考后</template>
                   <template slot="append">分钟</template>
                 </el-input>
@@ -566,6 +586,7 @@ export default {
         callback();
       }
     };
+
     return {
       loading: false,
       startExamDatetimeRange: [],
@@ -608,6 +629,7 @@ export default {
       editStageCommonSettingForm: {
         id: null,
         examId: null,
+        examName: "",
         submitType: "NORMAL",
         submitDuration: 0
       },
@@ -634,6 +656,29 @@ export default {
             validator: validateExamDatetimeRange,
             trigger: "blur"
           }
+        ],
+        submitDuration: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "定点交卷时长不允许为空"
+          }
+        ]
+      },
+      commonSettingRules: {
+        submitType: [
+          {
+            required: true,
+            trigger: "change",
+            message: "请选择交卷类型"
+          }
+        ],
+        submitDuration: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "定点交卷时长不允许为空"
+          }
         ]
       },
       tableData: [],
@@ -652,6 +697,18 @@ export default {
     }
   },
   methods: {
+    handleSubmitDuration() {
+      this.editStageCommonSettingForm.submitDuration = this.editStageCommonSettingForm.submitDuration.replace(
+        /[^\d]/g,
+        ""
+      );
+    },
+    handleSubmitDuration4editStage() {
+      this.editStageForm.submitDuration = this.editStageForm.submitDuration.replace(
+        /[^\d]/g,
+        ""
+      );
+    },
     handleAddStage() {
       this.resetAddStageForm();
       this.addStageVisible = true;
@@ -672,13 +729,13 @@ export default {
     },
     handleCommonSetting() {
       this.editStageCommonSettingForm.examId = this.formSearch.examId;
+      this.editStageCommonSettingForm.examName = this.examName;
       this.editStageCommonSettingForm.submitType = "NORMAL";
       this.editStageCommonSettingForm.submitDuration = 0;
       var url = EXAM_WORK_API + "/examStage/getExamStageSetting";
       this.$httpWithMsg
         .get(url, { params: this.formSearch })
         .then(response => {
-          debugger;
           if (response.data) {
             this.editStageCommonSettingForm.id = response.data.id;
             this.editStageCommonSettingForm.submitType =
@@ -979,13 +1036,21 @@ export default {
     },
     saveEditStageCommonSetting() {
       var url = EXAM_WORK_API + "/examStage/saveStageSetting";
-      this.$httpWithMsg.post(url, this.editStageCommonSettingForm).then(() => {
-        this.$notify({
-          type: "success",
-          message: "保存成功"
-        });
-        this.searchForm();
-        this.editStageCommonSettingVisible = false;
+      this.$refs.editStageCommonSettingForm.validate(valid => {
+        if (valid) {
+          this.$httpWithMsg
+            .post(url, this.editStageCommonSettingForm)
+            .then(() => {
+              this.$notify({
+                type: "success",
+                message: "保存成功"
+              });
+              this.searchForm();
+              this.editStageCommonSettingVisible = false;
+            });
+        } else {
+          return false;
+        }
       });
     },
 
@@ -1073,4 +1138,8 @@ export default {
 .editForm .el-form-item {
   margin-bottom: 12px;
 }
+
+.input_width_lg {
+  width: 300px;
+}
 </style>

+ 4 - 3
src/modules/examwork/view/student.vue

@@ -290,9 +290,9 @@
           ></el-table-column>
           <el-table-column width="168" label="更新时间" sortable>
             <template slot-scope="scope">
-              <el-button @click="gotoOperateLog(scope.row.id)" type="text">
-                {{ scope.row.updateTime }}
-              </el-button>
+              <el-button @click="gotoOperateLog(scope.row.id)" type="text">{{
+                scope.row.updateTime
+              }}</el-button>
             </template>
           </el-table-column>
           <el-table-column width="50" label="状态">
@@ -1390,6 +1390,7 @@ export default {
       this.searchForm();
     },
     handleExamChange4Search(value) {
+      this.stuExamSearch.examStageId = "";
       if (this.examList4Search.length > 0) {
         let examArr = this.examList4Search.filter(p => p.id == value);
         if (examArr && examArr.length > 0) {

+ 1 - 0
src/modules/oe/component/commonForm.vue

@@ -222,6 +222,7 @@ export default {
         });
     },
     changeExam(examId) {
+      this.form.examStageId = "";
       this.examList.forEach(exam => {
         if (exam.id == examId) {
           this.form.examType = exam.examType;

+ 5 - 3
src/modules/oe/views/examDetail.vue

@@ -429,7 +429,7 @@
         </el-form>
       </el-dialog>
       <el-dialog :append-to-body="true" :visible.sync="dialogVisible">
-        <img width="100%" :src="dialogImageUrl" alt="" />
+        <img width="100%" :src="dialogImageUrl" alt />
       </el-dialog>
     </el-main>
   </el-container>
@@ -474,7 +474,8 @@ export default {
         endTime: null,
         infoCollector: null,
         hasVirtual: null,
-        ORG_FIND_ALL: false //查询所有机构
+        ORG_FIND_ALL: false, //查询所有机构
+        examStageId: null
       },
       getExamCondition: {
         params: {
@@ -545,7 +546,8 @@ export default {
         startTime: null,
         endTime: null,
         infoCollector: null,
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
+        examStageId: null
       };
       this.startExamDatetimeRange = [];
     },

+ 70 - 22
src/modules/oe/views/examScheduling.vue

@@ -263,9 +263,11 @@
           <el-form>
             <el-form-item label="选择文件类型">
               <el-radio-group v-model="fileType" @change="handleFileTypeChange">
-                <el-radio label="zip">ZIP</el-radio>
-                <el-radio label="pdf">PDF</el-radio>
-                <el-radio label="image">图片(*.jpg|*.jpeg|*.png)</el-radio>
+                <el-radio v-show="optZipVisible" label="zip">ZIP</el-radio>
+                <el-radio v-show="optPdfVisible" label="pdf">PDF</el-radio>
+                <el-radio v-show="optImageVisible" label="image"
+                  >图片(*.jpg|*.jpeg|*.png)</el-radio
+                >
               </el-radio-group>
             </el-form-item>
             <el-form-item label="选择文件">
@@ -447,7 +449,8 @@ export default {
         pageNo: 1,
         pageSize: 10,
         examType: "",
-        ORG_FIND_ALL: false //查询所有机构
+        ORG_FIND_ALL: false, //查询所有机构
+        examStageId: null
       },
       getExamCondition: {
         params: {
@@ -466,7 +469,10 @@ export default {
       },
       summary: "",
       summaryList: [],
-      md5Size: 0
+      md5Size: 0,
+      optZipVisible: false,
+      optPdfVisible: false,
+      optImageVisible: false
     };
   },
   computed: {
@@ -476,7 +482,6 @@ export default {
     },
     //计算是否显示图片上传框
     uploadDisabled() {
-      debugger;
       return this.fileList.length >= this.fileLimit;
     }
   },
@@ -486,7 +491,6 @@ export default {
       this.removeImgs();
     },
     handleChange(file, fileList) {
-      debugger;
       this.fileList = fileList;
       this.calcSummary(this.fileList);
     },
@@ -516,13 +520,16 @@ export default {
     },
 
     calcSummary(fileList) {
-      this.summaryList = [];
-      this.md5Size = 0;
+      var summaryList = [];
+      var md5Size = 0;
+
       for (let i = 0; i < fileList.length; i++) {
         let f = fileList[i];
         this.getFileMD5(f.raw, md5 => {
-          this.summaryList.push({ index: i, summary: md5 });
-          this.md5Size++;
+          summaryList.push({ index: i, summary: md5 });
+          md5Size++;
+          this.summaryList = summaryList;
+          this.md5Size = md5Size;
         });
       }
     },
@@ -557,7 +564,8 @@ export default {
         pageNo: 1,
         pageSize: 10,
         examType: "",
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
+        examStageId: null
       };
     },
     showMoreCondition() {
@@ -599,6 +607,7 @@ export default {
           }
           this.tableLoading = false;
         });
+      this.getUploadFileType();
     },
     selectable(row) {
       return row.isWarn;
@@ -710,6 +719,11 @@ export default {
         });
     },
     openUploadAnswerDialog(examStudentId) {
+      this.fileList = [];
+      this.imageAnswerFileList = [];
+      // this.offlineAnswerFile = "";
+      this.cleanOfflineFile();
+
       this.$http
         .get("/api/ecs_oe_admin/exam/record/data/findByExamStudentId", {
           params: { examStudentId: examStudentId }
@@ -732,7 +746,6 @@ export default {
     },
     uploadAnswerChange(event) {
       if (event.target.files.length > 0) {
-        debugger;
         this.offlineAnswerFile = event.target.files[0];
       } else {
         this.offlineAnswerFile = "";
@@ -776,7 +789,7 @@ export default {
             headers: { "Content-Type": "multipart/form-data" }
           };
           let param = new FormData();
-          debugger;
+
           param.append("file", this.offlineAnswerFile);
           param.append("examRecordDataId", this.currentOfflineExamRecordDataId);
           this.$http
@@ -807,8 +820,34 @@ export default {
             });
         });
     },
+    //获取支持的文件上传类型
+    getUploadFileType() {
+      this.$http
+        .get(
+          "/api/ecs_exam_work/exam/property/" +
+            this.form.examId +
+            "/OFFLINE_UPLOAD_FILE_TYPE"
+        )
+        .then(response => {
+          var allowfileSuffixs = response.data;
+          if (!allowfileSuffixs || allowfileSuffixs.length == 0) {
+            return false;
+          }
+
+          if (allowfileSuffixs.some(p => p.toUpperCase() == "ZIP")) {
+            this.optZipVisible = true;
+          }
+
+          if (allowfileSuffixs.some(p => p.toUpperCase() == "PDF")) {
+            this.optPdfVisible = true;
+          }
+
+          if (allowfileSuffixs.some(p => p.toUpperCase() == "IMAGE")) {
+            this.optImageVisible = true;
+          }
+        });
+    },
     beforeUpload(file) {
-      debugger;
       var index = file.name.lastIndexOf(".");
       var fileNameLength = file.name.length;
       var fileSuffix = file.name
@@ -857,7 +896,6 @@ export default {
       return promise; //通过返回一个promis对象解决
     },
     submitUpload() {
-      debugger;
       this.uploadAnswerDialogLoading = true;
       let config = {
         headers: { "Content-Type": "multipart/form-data" }
@@ -894,11 +932,13 @@ export default {
         });
     },
     cleanOfflineFile() {
-      this.$refs.offlineFileInput.value = "";
+      if (this.$refs.offlineFileInput) {
+        this.$refs.offlineFileInput.value = "";
+      }
+
       this.offlineAnswerFile = "";
     },
     downloadAnswer(files) {
-      debugger;
       if (files && files.length > 0) {
         if (files[0].fileType != "image") {
           window.open(files[0].offlineFileUrl);
@@ -930,7 +970,7 @@ export default {
     },
     batchSubmitUpload() {
       this.$refs.upload.submit();
-      debugger;
+
       let params = new FormData();
       params.append("examRecordDataId", this.currentOfflineExamRecordDataId);
       params.append("fileType", this.fileType);
@@ -964,10 +1004,14 @@ export default {
           this.offlineAnswerFile = "";
           this.search();
         })
-        .catch(() => {
+        .catch(e => {
+          let errMsg = "上传失败";
+          if (e.response) {
+            errMsg = e.response.data.desc;
+          }
           this.$notify({
             title: "提示",
-            message: "上传失败",
+            message: errMsg,
             type: "error",
             duration: 2000
           });
@@ -996,7 +1040,11 @@ export default {
       return false;
     }
   },
-  created() {}
+  created() {
+    if (this.form.examId) {
+      this.getUploadFileType();
+    }
+  }
 };
 </script>
 <style scoped>

+ 1 - 0
src/modules/oe/views/examSummary.vue

@@ -389,6 +389,7 @@ export default {
         });
     },
     changeExam(examId) {
+      this.examStageId = "";
       var exam = this.examList.filter(item => {
         return item.id == examId;
       })[0];

+ 10 - 5
src/modules/oe/views/illegalityNameList.vue

@@ -72,9 +72,9 @@
                   type="text"
                   >{{ scope.row.examRecordDataId }}</el-button
                 >
-                <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">
-                  {{ scope.row.examRecordDataId }}
-                </span>
+                <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">{{
+                  scope.row.examRecordDataId
+                }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -211,7 +211,8 @@ export default {
         isWarn: null,
         pageNo: 1,
         pageSize: 10,
-        ORG_FIND_ALL: false //查询所有机构
+        ORG_FIND_ALL: false, //查询所有机构
+        examStageId: null
       },
 
       getExamCondition: {
@@ -273,7 +274,8 @@ export default {
         isWarn: null,
         pageNo: 1,
         pageSize: 10,
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
+        examStageId: null
       };
     },
     search(type) {
@@ -291,6 +293,9 @@ export default {
       }
       this.tableLoading = true;
       var params = JSON.parse(JSON.stringify(this.form));
+      if (params.examStageId == "") {
+        params.examStageId = null;
+      }
       this.$http
         .post("/api/ecs_oe_admin/exam/audit/discipline/list", params)
         .then(response => {

+ 4 - 2
src/modules/oe/views/scoreStatistics.vue

@@ -253,7 +253,8 @@ export default {
         finished: "",
         startLimit: "",
         endLimit: "",
-        ORG_FIND_ALL: false //查询所有机构
+        ORG_FIND_ALL: false, //查询所有机构
+        examStageId: null
       },
       getExamCondition: {
         params: {
@@ -296,7 +297,8 @@ export default {
         finished: "",
         startLimit: "",
         endLimit: "",
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
+        examStageId: null
       };
     },
     search(type) {