zhangjie 4 سال پیش
والد
کامیت
6a37170d94

+ 3 - 20
src/components/common/ImportFile/ImportFile.vue

@@ -94,15 +94,6 @@ export default {
     addFilenameParam: {
       type: String,
       default: "fileName"
-    },
-    uploadSuccessHandle: {
-      type: Function,
-      default(response) {
-        return {
-          success: true,
-          msg: "导入成功!"
-        };
-      }
     }
   },
   data() {
@@ -138,22 +129,14 @@ export default {
         this.uploadData[this.addFilenameParam] = file.name;
       this.$refs.UploadComp.clearFiles();
     },
-    handleError(error) {
+    handleError(error, response) {
       this.res = {
         success: false,
-        msg: error.message
+        msg: response.message
       };
     },
     handleSuccess(response) {
-      if (response) {
-        this.res = this.uploadSuccessHandle(response);
-        this.$emit("upload-success", { success: true, data: response });
-      } else {
-        this.res = {
-          success: false,
-          msg: response.message || "上传失败"
-        };
-      }
+      this.$emit("upload-success", response);
     },
     handleFormatError() {
       this.res = {

+ 1 - 0
src/modules/grading/GradingOperation.vue

@@ -342,6 +342,7 @@ export default {
     async stepChange(step) {
       this.curStep = step;
       this.current = 1;
+      this.isFullscreenMarking = false;
       await this.getList();
       if (this.papers.length) {
         this.selectPaper(0);

+ 2 - 2
src/modules/grading/GradingProgress.vue

@@ -138,7 +138,7 @@ export default {
         (this.curSubject.stage == "INIT" &&
           this.curSubject.test !== 2 &&
           !this.curSubject.formal &&
-          this.totalProgress.progress === 100) ||
+          this.totalProgress.progress > 0) ||
         (this.curSubject.stage == "LEVEL" &&
           this.totalProgress.progress !== 100 &&
           this.curSubject.test === 0 &&
@@ -150,7 +150,7 @@ export default {
         (this.curSubject.stage == "INIT" &&
           this.curSubject.test !== 2 &&
           !this.curSubject.formal &&
-          this.totalProgress.progress === 100) ||
+          this.totalProgress.progress > 0) ||
         (this.curSubject.stage == "LEVEL" && this.curSubject.test === 2)
       );
     },

+ 6 - 1
src/modules/grading/components/ModifyFormalGradingTask.vue

@@ -91,6 +91,7 @@ export default {
       modalForm: { ...initModalForm },
       areas: [],
       rules: {
+        questionId: numberValidator("请选择考区"),
         taskCount: numberValidator("请输入分配任务数量")
       }
     };
@@ -104,6 +105,9 @@ export default {
     },
     async getArea() {
       const data = await areaStatProgress(this.subjectId);
+      if (data.length > 1) {
+        data[data.length - 1].questionId = -1;
+      }
       this.areas = data;
       this.modalForm.questionId = data[data.length - 1].questionId;
       this.areaChange();
@@ -135,7 +139,8 @@ export default {
       await createGradingTask({
         subjectId: this.subjectId,
         taskCount: this.modalForm.taskCount,
-        questionId: this.modalForm.questionId
+        questionId:
+          this.modalForm.questionId === -1 ? null : this.modalForm.questionId
       }).catch(() => {
         result = false;
       });

+ 1 - 0
src/modules/grading/components/ModifyGradingUser.vue

@@ -20,6 +20,7 @@
           size="large"
           v-model.trim="modalForm.loginName"
           placeholder="请输入账号"
+          :disabled="isEdit"
           clearable
         ></Input>
       </FormItem>

+ 1 - 1
src/modules/login/LoginHome.vue

@@ -2,7 +2,7 @@
   <div class="login-home login">
     <div class="login login-box">
       <div class="login-title">
-        <h1>美术阅卷管理端</h1>
+        <h1>美术阅卷系统</h1>
       </div>
       <div class="login-form">
         <Form ref="loginForm" :model="loginModel" :rules="loginRules">

+ 10 - 7
src/modules/main/PaperManage.vue

@@ -7,6 +7,7 @@
             v-model="filter.subject"
             @on-change="subjectChange"
             placeholder="科目"
+            clearable
           >
             <Option
               v-for="(item, index) in subjects"
@@ -17,7 +18,7 @@
           </Select>
         </FormItem>
         <FormItem>
-          <Select v-model="filter.areaCode" placeholder="选择考区">
+          <Select v-model="filter.areaCode" placeholder="选择考区" clearable>
             <Option
               v-for="area in areas"
               :key="area.id"
@@ -67,7 +68,7 @@
           ></Input>
         </FormItem>
         <FormItem>
-          <Select v-model="filter.sort" placeholder="排序方式">
+          <Select v-model="filter.sort" placeholder="排序方式" clearable>
             <Option
               v-for="(val, key) in SORT_RULE_TYPE"
               :key="key"
@@ -124,8 +125,8 @@ export default {
         endNumber: null,
         subject: "",
         sort: "",
-        isManual: false,
-        missing: true
+        isManual: null,
+        missing: null
       },
       SORT_RULE_TYPE,
       CAFA_EXCEPTION_TYPE,
@@ -153,7 +154,7 @@ export default {
         return {
           id: paper.id,
           title: paper.examNumber,
-          url: paper.imgSrc,
+          imgSrc: paper.imgSrc,
           thumbSrc: paper.thumbSrc,
           missing: paper.missing,
           stage: paper.stage,
@@ -169,6 +170,8 @@ export default {
     },
     subjectChange() {
       this.filter.areaCode = "";
+      this.areas = [];
+      if (!this.filter.subject) return;
       this.getAreaList();
     },
     async getAreaList() {
@@ -196,8 +199,8 @@ export default {
         this.filter.isManual = false;
         this.filter.missing = true;
       } else {
-        this.filter.isManual = false;
-        this.filter.missing = false;
+        this.filter.isManual = null;
+        this.filter.missing = null;
       }
     }
   }

+ 20 - 33
src/modules/main/StudentManage.vue

@@ -87,7 +87,7 @@
         </FormItem>
         <FormItem>
           <Input
-            v-model.trim="filter.name"
+            v-model.trim="filter.studentName"
             placeholder="输入姓名"
             clearable
           ></Input>
@@ -112,6 +112,16 @@
             >
           </Select>
         </FormItem>
+        <FormItem>
+          <Select v-model="filter.subject" placeholder="科目" clearable>
+            <Option
+              v-for="item in subjects"
+              :key="item.subject"
+              :value="item.subject"
+              :label="item.name"
+            ></Option>
+          </Select>
+        </FormItem>
         <FormItem>
           <Button
             size="small"
@@ -151,7 +161,6 @@
       :download-filename="downloadStudentTemplateFilename"
       :headers="headers"
       :format="['xls', 'xlsx']"
-      :upload-success-handle="uploadStudentSuccess"
       @upload-success="uploadSuccess"
       ref="ExportStudent"
     >
@@ -165,7 +174,6 @@
       :download-filename="downloadRelateTemplateFilename"
       :headers="headers"
       :format="['xls', 'xlsx']"
-      :upload-success-handle="uploadStudentSuccess"
       ref="ExportRelate"
     >
     </import-file>
@@ -203,7 +211,7 @@ export default {
         examRoom: "",
         startNumber: null,
         endNumber: null,
-        name: "",
+        studentName: "",
         upload: null,
         isAbsent: null
       },
@@ -320,6 +328,13 @@ export default {
         page: this.current - 1,
         size: this.size
       };
+      if (
+        (datas.upload !== null && !datas.subject) ||
+        (datas.upload === null && datas.subject)
+      ) {
+        this.$Message.error("上传状态和科目必须同时选择!");
+        return;
+      }
       const data = await studentPageList(datas);
       this.students = data.data.map(student => {
         student.uploadStatus.split(",").map(status => {
@@ -384,35 +399,7 @@ export default {
       this.curStudent = row;
       this.$refs.ModifyStudent.open();
     },
-    uploadStudentSuccess(response) {
-      if (response && !response.length) {
-        return {
-          success: true,
-          msg: "导入成功!"
-        };
-      }
-      var errorInfos = response
-        .filter(function(item) {
-          return !!item.excelErrorType;
-        })
-        .map(function(item) {
-          return "第" + item.row + "行," + item.excelErrorType;
-        })
-        .join(";");
-      if (errorInfos) {
-        return {
-          success: false,
-          msg: errorInfos
-        };
-      } else {
-        return {
-          success: true,
-          msg: "导入成功!"
-        };
-      }
-    },
-    uploadSuccess(result) {
-      if (!result.success) return;
+    uploadSuccess() {
       this.getList();
       this.getAreaList();
     },

+ 1 - 1
src/modules/main/components/ImageActionList.vue

@@ -1,6 +1,6 @@
 <template>
   <div :class="classes">
-    <div class="image-view" v-for="(image, index) in data" :key="index">
+    <div class="image-view" v-for="(image, index) in data" :key="image.id">
       <div class="image-view-container">
         <h5 class="image-view-title">{{ image.title }}</h5>
         <div class="image-view-contain" :style="image.styles">