瀏覽代碼

接口调试

zhangjie 1 年之前
父節點
當前提交
25bb22c6e1

+ 7 - 0
src/assets/styles/base.scss

@@ -495,3 +495,10 @@ body {
   font-size: 12px;
   padding-right: 8px;
 }
+.el-input-split {
+  position: relative;
+  display: inline-block;
+  margin: 3px 10px;
+  width: 10px;
+  border-bottom: 2px solid #dddddd;
+}

+ 1 - 1
src/assets/styles/pages.scss

@@ -175,7 +175,7 @@
       align-items: stretch;
     }
     &-action {
-      width: 400px;
+      width: 300px;
       margin: 0;
       flex-grow: 0;
       flex-shrink: 0;

+ 12 - 1
src/components/base/ClassSelect.vue

@@ -29,6 +29,7 @@ export default {
     value: { type: [Number, String], default: "" },
     clearable: { type: Boolean, default: true },
     majorName: { type: String, default: "" },
+    examId: { type: String, default: "" },
     cascader: { type: Boolean, default: false },
   },
   data() {
@@ -46,7 +47,14 @@ export default {
     },
     majorName(val, oldval) {
       if (val !== oldval) {
-        this.search("");
+        this.search();
+        this.$emit("input", "");
+        this.$emit("change", {});
+      }
+    },
+    examId(val, oldval) {
+      if (val !== oldval) {
+        this.search();
         this.$emit("input", "");
         this.$emit("change", {});
       }
@@ -58,9 +66,12 @@ export default {
   methods: {
     async search() {
       this.optionList = [];
+
+      if (!this.examId) return;
       if (this.cascader && !this.majorName) return;
       const res = await commonCollegeMajorClassQuery({
         majorName: this.majorName,
+        examId: this.examId,
         dictionaryEnum: "CLAZZ",
       });
       this.optionList = res;

+ 9 - 3
src/components/base/CollegeSelect.vue

@@ -28,6 +28,7 @@ export default {
     placeholder: { type: String, default: "请选择" },
     value: { type: [Number, String], default: "" },
     clearable: { type: Boolean, default: true },
+    examId: { type: String, default: "" },
   },
   data() {
     return {
@@ -42,15 +43,20 @@ export default {
         this.selected = val;
       },
     },
-  },
-  created() {
-    this.search();
+    examId: {
+      immediate: true,
+      handler(val, oldval) {
+        if (val !== oldval) this.search();
+      },
+    },
   },
   methods: {
     async search() {
       this.optionList = [];
+      if (!this.examId) return;
       const res = await commonCollegeMajorClassQuery({
         dictionaryEnum: "COLLEGE",
+        examId: this.examId,
       });
       this.optionList = res;
     },

+ 12 - 1
src/components/base/MajorSelect.vue

@@ -30,6 +30,7 @@ export default {
     clearable: { type: Boolean, default: true },
     collegeName: { type: String, default: "" },
     cascader: { type: Boolean, default: false },
+    examId: { type: String, default: "" },
   },
   data() {
     return {
@@ -46,7 +47,14 @@ export default {
     },
     collegeName(val, oldval) {
       if (val !== oldval) {
-        this.search("");
+        this.search();
+        this.$emit("input", "");
+        this.$emit("change", {});
+      }
+    },
+    examId(val, oldval) {
+      if (val !== oldval) {
+        this.search();
         this.$emit("input", "");
         this.$emit("change", {});
       }
@@ -58,10 +66,13 @@ export default {
   methods: {
     async search() {
       this.optionList = [];
+
+      if (!this.examId) return;
       if (this.cascader && !this.collegeName) return;
 
       const res = await commonCollegeMajorClassQuery({
         collegeName: this.collegeName,
+        examId: this.examId,
         dictionaryEnum: "MAJOR",
       });
       this.optionList = res;

+ 2 - 2
src/modules/base/components/ModifyRole.vue

@@ -130,7 +130,7 @@ export default {
       }
       this.$nextTick(() => {
         this.$refs.modalFormComp.clearValidate();
-        this.$refs.PrivilegeSet.buildTableData(privilegeIds);
+        this.$refs.PrivilegeSet?.buildTableData(privilegeIds);
       });
     },
     cancel() {
@@ -143,7 +143,7 @@ export default {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;
 
-      const privilegeIds = this.$refs.PrivilegeSet.getSelectedPrivilegeIds();
+      const privilegeIds = this.$refs.PrivilegeSet?.getSelectedPrivilegeIds();
       if (!privilegeIds.length) {
         this.$emit("请设置角色权限!");
         return;

+ 36 - 6
src/modules/base/components/ModifyStudent.vue

@@ -33,6 +33,22 @@
           :disabled="isEdit"
         ></el-input>
       </el-form-item>
+      <el-form-item prop="courseName" label="课程名称:">
+        <el-input
+          v-model.trim="modalForm.courseName"
+          placeholder="请输入课程名称"
+          clearable
+          :disabled="isEdit"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="courseCode" label="课程代码:">
+        <el-input
+          v-model.trim="modalForm.courseCode"
+          placeholder="请输入课程代码"
+          clearable
+          :disabled="isEdit"
+        ></el-input>
+      </el-form-item>
       <el-form-item prop="collegeName" label="学院:">
         <el-input
           v-model.trim="modalForm.collegeName"
@@ -54,17 +70,17 @@
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item prop="courseName" label="课程名称:">
+      <el-form-item prop="teacher" label="任课老师:">
         <el-input
-          v-model.trim="modalForm.courseName"
-          placeholder="请输入课程名称"
+          v-model.trim="modalForm.teacher"
+          placeholder="请输入任课老师"
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item prop="courseCode" label="课程代码:">
+      <el-form-item prop="teachClass" label="教学班:">
         <el-input
-          v-model.trim="modalForm.courseCode"
-          placeholder="请输入课程代码"
+          v-model.trim="modalForm.teachClass"
+          placeholder="请输入教学班"
           clearable
         ></el-input>
       </el-form-item>
@@ -193,6 +209,20 @@ export default {
             trigger: "change",
           },
         ],
+        teacher: [
+          {
+            message: "任课老师不能超过30字符",
+            max: 30,
+            trigger: "change",
+          },
+        ],
+        teachClass: [
+          {
+            message: "教学班不能超过50字符",
+            max: 50,
+            trigger: "change",
+          },
+        ],
         courseName: [
           {
             required: true,

+ 1 - 1
src/modules/base/views/RoleManage.vue

@@ -110,7 +110,7 @@
 <script>
 import { ABLE_TYPE } from "@/constants/enumerate";
 import { roleListPage, deleteRole } from "../api";
-import ModifyRole from "../components/ModifyRole";
+import ModifyRole from "../components/ModifyRole.vue";
 import ModifyRoleDataPriviledge from "../components/ModifyRoleDataPriviledge.vue";
 
 export default {

+ 3 - 3
src/modules/record/api.js

@@ -18,7 +18,7 @@ export const unbindScanTaskUser = (paperScanTaskId) => {
   });
 };
 export const scanTaskStudentListPage = (datas) => {
-  return $postParam("/api/admin/paper/library/page_student", datas);
+  return $postParam("/api/admin/paper/document/page_student", datas);
 };
 export const dataCheckStateDetail = (paperScanTaskId) => {
   return $postParam("/api/admin/paper/scan_task/bind_progress_detail", {
@@ -62,7 +62,7 @@ export const studentUnbindTaskListPage = (datas) => {
   return $postParam("/api/admin/paper/library/get_bind_data", datas);
 };
 export const paperBindUser = (datas) => {
-  return $postParam("/api/admin/paper/library/bind", datas);
+  return $postParam("/api/admin/paper/document/rebind", datas);
 };
 export const abnormalPaper = (paperLibraryId) => {
   return $postParam("/api/admin/paper/library/abnormal", { paperLibraryId });
@@ -92,7 +92,7 @@ export const documentDetialDownload = (datas) => {
   });
 };
 export const documentOtherDetialListPage = (datas) => {
-  return $postParam("/api/admin/paper/other/detail", datas);
+  return $postParam("/api/admin/paper/document/other_detail", datas);
 };
 // export const archivesDetailListPage = (datas) => {
 //   return $postParam("/api/admin/paper/archives/page_detail", datas);

+ 3 - 2
src/modules/record/components/ArchivesDetailStudentDialog.vue

@@ -130,9 +130,10 @@ export default {
       this.studentInfo = {
         ...this.student,
         curPagePaperIndex: curPage.fileUrls.indexOf(curImage),
-        pageList: [curPage],
+        pageList: [
+          { ...curPage, paperScanTaskId: this.student.paperScanTaskId },
+        ],
       };
-
       this.$refs.LibraryDialog.open();
     },
   },

+ 26 - 24
src/modules/record/components/DocumentDetailDialog.vue

@@ -21,6 +21,7 @@
             <college-select
               v-model="filter.collegeName"
               placeholder="学院"
+              :exam-id="task.examId"
               style="width: 100%"
             ></college-select>
           </el-form-item>
@@ -28,8 +29,9 @@
             <major-select
               v-model="filter.majorName"
               :college-name="filter.collegeName"
+              :exam-id="task.examId"
               cascader
-              placeholder="请选择专业"
+              placeholder="专业"
               style="width: 100%"
             ></major-select>
           </el-form-item>
@@ -37,6 +39,7 @@
             <class-select
               v-model="filter.clazzName"
               :major-name="filter.majorName"
+              :exam-id="task.examId"
               cascader
               placeholder="班级"
             ></class-select>
@@ -60,11 +63,11 @@
             ></el-input>
           </el-form-item>
           <el-form-item label="教学班:">
-            <teach-clazz-select
-              v-model="filter.teachClass"
+            <el-input
+              v-model.trim="filter.teachClass"
               placeholder="教学班"
-            >
-            </teach-clazz-select>
+              clearable
+            ></el-input>
           </el-form-item>
           <el-form-item label="姓名/学号:">
             <el-input
@@ -76,44 +79,48 @@
           </el-form-item>
           <el-form-item label="起止成绩:">
             <el-input-number
-              style="width: 40px"
-              v-model="modalForm.minScore"
+              style="width: 100px"
+              v-model="filter.minScore"
               :min="0"
               :max="999"
               :step="1"
               step-strictly
               :controls="false"
+              placeholder="成绩"
             ></el-input-number>
             <span class="el-input-split"></span>
             <el-input-number
-              style="width: 40px"
-              v-model="modalForm.maxScore"
+              style="width: 100px"
+              v-model="filter.maxScore"
               :min="0"
               :max="999"
               :step="1"
               step-strictly
               :controls="false"
+              placeholder="成绩"
             ></el-input-number>
           </el-form-item>
           <el-form-item label="起止图片张数:">
             <el-input-number
-              style="width: 40px"
-              v-model="modalForm.minBindCount"
+              style="width: 100px"
+              v-model="filter.minBindCount"
               :min="0"
               :max="999"
               :step="1"
               step-strictly
               :controls="false"
+              placeholder="图片张数"
             ></el-input-number>
             <span class="el-input-split"></span>
             <el-input-number
-              style="width: 40px"
-              v-model="modalForm.maxBindCount"
+              style="width: 100px"
+              v-model="filter.maxBindCount"
               :min="0"
               :max="999"
               :step="1"
               step-strictly
               :controls="false"
+              placeholder="图片张数"
             ></el-input-number>
           </el-form-item>
 
@@ -189,11 +196,6 @@
       ref="ArchivesDetailStudentDialog"
       :student="curRow"
     ></archives-detail-student-dialog>
-    <!-- DataTaskDialog -->
-    <data-task-dialog
-      ref="DataTaskDialog"
-      task-type="DOCUMENT_EXPORT"
-    ></data-task-dialog>
   </div>
 </template>
 
@@ -201,12 +203,11 @@
 import { documentDetialListPage, documentDetialDownload } from "../api";
 import { BOUND_TYPE } from "@/constants/enumerate";
 import ArchivesDetailStudentDialog from "./ArchivesDetailStudentDialog.vue";
-import DataTaskDialog from "../../base/components/DataTaskDialog.vue";
 import { downloadByApi } from "@/plugins/download";
 
 export default {
   name: "document-detail-dialog",
-  components: { ArchivesDetailStudentDialog, DataTaskDialog },
+  components: { ArchivesDetailStudentDialog },
   props: {
     task: {
       type: Object,
@@ -227,10 +228,10 @@ export default {
         teacher: "",
         teachClass: "",
         param: "",
-        minScore: null,
-        maxScore: null,
-        minBindCount: null,
-        maxBindCount: null,
+        minScore: undefined,
+        maxScore: undefined,
+        minBindCount: undefined,
+        maxBindCount: undefined,
       },
       current: 1,
       size: this.GLOBAL.pageSize,
@@ -291,6 +292,7 @@ export default {
       this.curRow = {
         ...row,
         paperScanTaskId: this.task.paperScanTaskId,
+        semesterId: this.task.semesterId,
       };
       this.$refs.ArchivesDetailStudentDialog.open();
     },

+ 29 - 26
src/modules/record/components/LibraryDialog.vue

@@ -14,23 +14,24 @@
       <div class="data-check-body">
         <div class="data-check-action part-box">
           <div class="data-check-action-form">
-            <el-button
-              v-if="openCodeOcr"
-              size="mini"
-              type="success"
-              @click="toSetOcrArea"
-              >设置信息识别区</el-button
-            >
-            <div class="mt-2" v-if="openCodeOcr">
-              <el-radio-group v-model="areaType">
-                <el-radio v-if="openBarCode" label="BAR_CODE"
-                  >条码识别</el-radio
-                >
-                <el-radio v-if="openOcr" label="OCR">OCR识别</el-radio>
-              </el-radio-group>
-            </div>
-
+            <exam-select
+              v-model="filter.examId"
+              :semester-id="filter.semesterId"
+              :clearable="false"
+              class="mb-2 width-full"
+            ></exam-select>
+            <course-select
+              v-model.trim="filter.courseCode"
+              :filter-data="{
+                semesterId: filter.semesterId,
+                examId: filter.examId,
+              }"
+              class="width-full"
+              placeholder="课程(代码)"
+              clearable
+            ></course-select>
             <el-divider></el-divider>
+            <h4 class="mb-1">绑定学生:</h4>
             <el-input
               v-model="studentNameOrNo"
               class="width-full"
@@ -44,7 +45,6 @@
               <el-table-column
                 prop="studentName"
                 label="姓名"
-                width="80"
               ></el-table-column>
               <el-table-column
                 prop="studentCode"
@@ -83,12 +83,12 @@
               @click="switchCurPage(1)"
               >反面</el-button
             >
-            <el-button
+            <!-- <el-button
               type="danger"
               :disabled="curPage.abnormal"
               @click="toAbnormalPaper"
               >标记异常</el-button
-            >
+            > -->
           </div>
           <image-contain
             ref="ImageContain"
@@ -191,6 +191,11 @@ export default {
     return {
       modalIsShow: false,
       studentNameOrNo: "",
+      filter: {
+        examId: "",
+        semesterId: "",
+        courseCode: "",
+      },
       modalForm: { ...initModalForm },
       inputSearchDelay: 300,
       studentList: [],
@@ -228,6 +233,7 @@ export default {
   },
   methods: {
     async visibleChange() {
+      this.filter = this.$objAssign(this.filter, this.student);
       this.modalForm = { ...initModalForm };
       this.studentNameOrNo = "";
       this.donePageList = [];
@@ -290,8 +296,8 @@ export default {
     async getStudentList() {
       if (!this.curPage || !this.curPage.paperScanTaskId) return;
       const datas = {
-        paperScanTaskId: this.curPage.paperScanTaskId,
-        param: this.studentNameOrNo,
+        ...this.filter,
+        studentCode: this.studentNameOrNo,
         pageNumber: 1,
         pageSize: 30,
       };
@@ -347,10 +353,7 @@ export default {
       this.curPagePapers = this.curPage.fileUrls;
       this.switchCurPage(this.curPagePaperIndex);
 
-      if (
-        !this.openCodeOcr &&
-        this.lastPaperScanTaskId !== this.curPage.paperScanTaskId
-      ) {
+      if (this.lastPaperScanTaskId !== this.curPage.paperScanTaskId) {
         this.getStudentList();
       }
     },
@@ -364,7 +367,7 @@ export default {
       if (this.loading) return;
       this.loading = true;
       let datas = { ...this.modalForm };
-      datas.paperLibraryId = this.curPage.id;
+      datas.paperLibraryId = this.curPage.paperLibraryId;
       const res = await paperBindUser(datas).catch(() => {});
       this.loading = false;
 

+ 32 - 2
src/modules/record/components/OtherDocumentDetailDialog.vue

@@ -48,7 +48,9 @@
     <!-- ImagePreviewDialog -->
     <image-preview-dialog
       ref="ImagePreviewDialog"
-      :image="curRow"
+      :image="curImage"
+      @on-prev="toPrevImage"
+      @on-next="toNextImage"
     ></image-preview-dialog>
   </div>
 </template>
@@ -58,7 +60,7 @@ import { documentOtherDetialListPage } from "../api";
 import ImagePreviewDialog from "../../../components/ImagePreviewDialog.vue";
 
 export default {
-  name: "document-detail-dialog",
+  name: "other-document-detail-dialog",
   components: { ImagePreviewDialog },
   props: {
     task: {
@@ -76,6 +78,10 @@ export default {
       total: 0,
       dataList: [],
       curRow: {},
+      // image preview
+      imageList: [],
+      curImage: {},
+      curImageIndex: 0,
     };
   },
   methods: {
@@ -105,8 +111,32 @@ export default {
     },
     toDetail(row) {
       this.curRow = row;
+      this.imageList = row.fileUrls;
+      this.curImageIndex = 0;
+      this.selectImage(this.curImageIndex);
       this.$refs.ImagePreviewDialog.open();
     },
+    selectImage(index) {
+      this.curImage = { url: this.imageList[index] };
+    },
+    toPrevImage() {
+      if (this.curImageIndex === 0) {
+        this.curImageIndex = this.imageList.length - 1;
+      } else {
+        this.curImageIndex--;
+      }
+
+      this.selectImage(this.curImageIndex);
+    },
+    toNextImage() {
+      if (this.curImageIndex === this.imageList.length - 1) {
+        this.curImageIndex = 0;
+      } else {
+        this.curImageIndex++;
+      }
+
+      this.selectImage(this.curImageIndex);
+    },
   },
 };
 </script>

+ 9 - 1
src/modules/record/components/ScanTaskDetailDialog.vue

@@ -2,13 +2,21 @@
   <el-dialog
     class="scan-task-detail-dialog page-dialog"
     :visible.sync="modalIsShow"
-    :title="title"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
     fullscreen
     @open="visibleChange"
   >
+    <template slot="title">
+      <h3>
+        详情
+        <span class="color-gray ml-2"
+          >{{ task.courseName }}({{ task.courseCode }})</span
+        >
+      </h3>
+    </template>
+
     <div class="part-box part-box-pad">
       <el-table ref="TableList" :data="dataList">
         <el-table-column

+ 6 - 0
src/modules/record/router.js

@@ -2,6 +2,7 @@ import ScanTaskManage from "./views/ScanTaskManage";
 import ArchivesManage from "./views/ArchivesManage";
 import ArchivesDetail from "./views/ArchivesDetail";
 import LibraryManage from "./views/LibraryManage";
+import DocumentManage from "./views/DocumentManage";
 
 export default [
   {
@@ -27,4 +28,9 @@ export default [
     name: "LibraryManage",
     component: LibraryManage,
   },
+  {
+    path: "/record/document-manage",
+    name: "DocumentManage",
+    component: DocumentManage,
+  },
 ];

+ 5 - 5
src/modules/record/views/DocumentManage.vue

@@ -48,19 +48,19 @@
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="140"
+          width="180"
           fixed="right"
         >
           <template slot-scope="scope">
             <el-button
-              v-if="checkPrivilege('link', 'detail')"
+              v-if="checkPrivilege('link', 'Detail')"
               class="btn-primary"
               type="text"
               @click="toDetail(scope.row)"
               >查看详情</el-button
             >
             <el-button
-              v-if="checkPrivilege('link', 'other')"
+              v-if="checkPrivilege('link', 'OtherDetail')"
               class="btn-primary"
               type="text"
               @click="toOtherDetail(scope.row)"
@@ -135,11 +135,11 @@ export default {
       this.getList();
     },
     toDetail(row) {
-      this.curRow = row;
+      this.curRow = { ...row, ...this.filter };
       this.$refs.DocumentDetailDialog.open();
     },
     toOtherDetail(row) {
-      this.curRow = row;
+      this.curRow = { ...row, ...this.filter };
       this.$refs.OtherDocumentDetailDialog.open();
     },
   },

+ 4 - 6
src/modules/record/views/ScanTaskManage.vue

@@ -9,11 +9,12 @@
             @exam-default="toPage(1)"
           ></sec-select>
           <el-form-item label="班级:">
-            <teach-clazz-select
-              v-model="filter.className"
+            <el-input
+              v-model.trim="filter.className"
               placeholder="请选择班级"
+              clearable
             >
-            </teach-clazz-select>
+            </el-input>
           </el-form-item>
         </template>
 
@@ -147,9 +148,6 @@ export default {
       loading: false,
     };
   },
-  mounted() {
-    this.getList();
-  },
   methods: {
     async getList() {
       if (!this.checkPrivilege("list", "list")) return;