zhangjie před 4 roky
rodič
revize
5ba51e3fe1

+ 17 - 0
src/assets/styles/iview-custom.less

@@ -174,6 +174,23 @@
       }
     }
   }
+
+  &-prev,
+  &-next {
+    border-radius: @box-border-radius-small;
+    height: 32px;
+    width: 32px;
+    line-height: 30px;
+    min-width: 32px;
+  }
+
+  &-options-sizer {
+    width: 80px;
+    .ivu-select {
+      min-width: auto;
+      width: 100%;
+    }
+  }
 }
 
 /* button */

+ 44 - 39
src/components/SimpleImagePreview.vue

@@ -34,6 +34,7 @@
         ]"
         :style="styles"
         v-show="!loading"
+        v-if="modalIsShow"
       >
         <img
           :src="curImage.imgSrc"
@@ -85,53 +86,57 @@ export default {
       nosition: false
     };
   },
-  mounted() {
-    this.registfileLoad();
+  watch: {
+    "curImage.imgSrc": {
+      handler() {
+        this.loading = true;
+      }
+    }
   },
   methods: {
     visibleChange(visible) {
       if (!visible) return;
-      this.initData();
-    },
-    initData() {
-      this.nosition = true;
-      this.loadingSetT = setTimeout(() => {
-        this.loading = true;
-      }, 100);
+      this.loading = true;
+      this.$nextTick(() => {
+        this.registfileLoad();
+      });
     },
     registfileLoad() {
       const imgDom = this.$refs.PreviewImgDetail;
       imgDom.onload = () => {
-        const { naturalWidth, naturalHeight } = imgDom;
-        const imageSize = this.getImageSizePos({
-          win: {
-            width: this.$refs.ReviewBody.clientWidth,
-            height: this.$refs.ReviewBody.clientHeight
-          },
-          img: {
-            width: naturalWidth,
-            height: naturalHeight
-          },
-          rotate: 0
-        });
+        this.rezizeImage(imgDom);
+      };
+    },
+    rezizeImage(imgDom) {
+      const { naturalWidth, naturalHeight } = imgDom;
+      const imageSize = this.getImageSizePos({
+        win: {
+          width: this.$refs.ReviewBody.clientWidth,
+          height: this.$refs.ReviewBody.clientHeight
+        },
+        img: {
+          width: naturalWidth,
+          height: naturalHeight
+        },
+        rotate: 0
+      });
 
-        this.styles = Object.assign(this.styles, {
-          width: imageSize.width + "px",
-          height: imageSize.height + "px",
-          top: imageSize.top + "px",
-          left: imageSize.left + "px",
-          transform: ""
-        });
-        this.transform = {
-          scale: 1,
-          rotate: 0
-        };
-        if (this.loadingSetT) clearTimeout(this.loadingSetT);
-        this.loading = false;
-        setTimeout(() => {
-          this.nosition = false;
-        }, 100);
+      this.styles = Object.assign(this.styles, {
+        width: imageSize.width + "px",
+        height: imageSize.height + "px",
+        top: imageSize.top + "px",
+        left: imageSize.left + "px",
+        transform: ""
+      });
+      this.transform = {
+        scale: 1,
+        rotate: 0
       };
+      this.loading = false;
+      console.log(11);
+      setTimeout(() => {
+        this.nosition = false;
+      }, 100);
     },
     getImageSizePos({ win, img, rotate }) {
       const imageSize = {
@@ -178,11 +183,11 @@ export default {
     },
     showPrev() {
       this.$emit("on-prev");
-      this.initData();
+      // this.initData();
     },
     showNext() {
       this.$emit("on-next");
-      this.initData();
+      // this.initData();
     },
     // dome-move
     setStyleTransform() {

+ 2 - 2
src/components/ViewHeader.vue

@@ -3,7 +3,7 @@
     <div class="head-main">
       <div class="head-logo">
         <slot name="logo">
-          <h1>美术阅卷管理端</h1>
+          <h1>美术阅卷系统</h1>
         </slot>
       </div>
       <div class="head-user">
@@ -49,7 +49,7 @@ export default {
   },
   data() {
     return {
-      username: this.$ls.get("user", { name: "" }).name
+      username: this.$ls.get("user", { loginName: "" }).loginName
     };
   },
   methods: {

+ 5 - 0
src/constants/authority.js

@@ -136,6 +136,11 @@ export const mark = [
     title: "打分详情",
     icon: "ivu-icon-score-detail"
   },
+  {
+    name: "MarkUserManage",
+    title: "用户管理",
+    icon: "ivu-icon-student"
+  },
   {
     name: "MarkExamPaperView",
     title: "查看试卷",

+ 74 - 60
src/modules/grading/GradingDetail.vue

@@ -125,30 +125,23 @@
     </div>
 
     <!-- image-preview -->
-    <image-preview
+    <simple-image-preview
       :class="imagePreviewClasses"
-      :image-list="papers"
-      :init-index="curPaperIndex"
-      @on-paper-change="selectPaper"
-      @on-page-prev="prevPage"
-      @on-page-next="nextPage"
+      :cur-image="curPaper"
+      @on-prev="toPrevPaper"
+      @on-next="toNextPaper"
       @on-close="isFullscreenMarking = false"
-      header-hide
-      ref="ImagePreview"
-      v-if="papers.length"
-    ></image-preview>
+      ref="SimpleImagePreview"
+    ></simple-image-preview>
     <!-- carousel paper review -->
-    <image-preview
+    <simple-image-preview
       :class="imagePreviewClasses"
-      :image-list="carouselPapers"
-      :init-index="curCarouselPaperIndex"
-      @on-paper-change="selectCarouselPaper"
+      :cur-image="curPaper"
+      @on-prev="toCarousePaper('prev')"
+      @on-next="toCarousePaper('next')"
       @on-close="carouseImagePreviewClose"
-      loop
-      header-hide
       ref="CarouselPapersPreview"
-      v-if="carouselPapers.length"
-    ></image-preview>
+    ></simple-image-preview>
     <!-- modify-leader-grading -->
     <modify-leader-grading
       :level-info="levelInfo"
@@ -176,7 +169,7 @@ import {
   taskSnSearch,
   subjectDetail
 } from "@/api";
-import ImagePreview from "@/components/common/ImagePreview";
+import SimpleImagePreview from "@/components/SimpleImagePreview";
 import GradeStep from "./components/GradeStep";
 import GradeStandardPaper from "./components/GradeStandardPaper";
 import GradeHistoryPaper from "./components/GradeHistoryPaper";
@@ -195,7 +188,7 @@ import GradeAnalysisExport from "./components/GradeAnalysisExport";
 export default {
   name: "grading-detail",
   components: {
-    ImagePreview,
+    SimpleImagePreview,
     GradeStep,
     GradeHistoryPaper,
     GradeStandardPaper,
@@ -244,7 +237,6 @@ export default {
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      beforeCarouselCurPaperIndex: 0,
       isFullscreenMarking: false,
       // export
       renderExportPage: false,
@@ -400,47 +392,64 @@ export default {
         this.toPage(1);
       }
     },
-    selectPaper(index) {
-      this.curPaperIndex = index;
-      this.curPaper = { ...this.papers[index] };
-    },
     toReview(index) {
       this.isFullscreenMarking = true;
       this.selectPaper(index);
-      this.$refs.ImagePreview.open();
+      this.$refs.SimpleImagePreview.open();
     },
-    async prevPage() {
-      if (this.current === 1) {
-        this.$Message.warning("当前已经是第一条数据了");
-        return;
+    selectPaper(index) {
+      let nindex = index;
+      if (!this.papers.length) {
+        nindex = 0;
+      } else if (index > this.papers.length - 1) {
+        nindex = this.papers.length - 1;
+      } else if (index < 0) {
+        nindex = 0;
       }
-      this.current--;
-      await this.getList();
-      this.selectPaper(this.papers.length - 1);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      this.curPaperIndex = nindex;
+      this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
     },
-    async nextPage() {
-      if (this.current === this.totalPage) {
+    async toPrevPaper() {
+      if (this.curPaperIndex === 0) {
         if (this.current > 1) {
           this.current--;
+          this.curPaperIndex = this.size - 1;
+          await this.getList();
         } else {
+          this.$Message.warning("当前已经是第一条数据了");
+          return;
+        }
+      } else {
+        this.curPaperIndex--;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toNextPaper() {
+      if (this.curPaperIndex === this.papers.length - 1) {
+        if (this.current === this.totalPage) {
           this.$Message.warning("当前已经是最后一条数据了");
-          this.$refs.ImagePreview.cancel();
-          this.$refs.CarouselPapersPreview &&
-            this.$refs.CarouselPapersPreview.cancel();
+          return;
+        } else {
+          this.current++;
+          this.curPaperIndex = 0;
+          await this.getList();
         }
+      } else {
+        this.curPaperIndex++;
       }
-      // 下一页时,继续获取当前页数据。
-      await this.getList();
-      this.selectPaper(0);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+
+      this.selectPaper(this.curPaperIndex);
     },
-    toNext() {
-      this.$refs.ImagePreview.showNext();
+    async toActionNextPaper() {
+      if (this.current > 1 && this.papers.length === 1) {
+        this.current--;
+        this.curPaperIndex = this.size;
+      }
+
+      await this.getList();
+      if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
+      this.selectPaper(this.curPaperIndex);
     },
     updateHistory() {
       this.$refs.GradeHistoryPaper.updatePapers();
@@ -455,9 +464,10 @@ export default {
         this.$Message.error("没有查找到结果!");
         return;
       }
-      data.title = data.examNumber;
+      data.title = this.IS_ADMIN ? data.examNumber : `NO.${data.sn}`;
       this.papers = [data];
       this.total = 1;
+      this.selectPaper(0);
     },
     leaderSelectLevel(levelInfo, markers) {
       this.levelInfo = levelInfo;
@@ -466,22 +476,15 @@ export default {
     },
     leaderGradingSuccess(datas, paper) {
       if (datas.action === "sampling") {
-        // todo:设定标准卷之后
+        // TODO:设定标准卷之后
       }
-      this.updatePaperList(paper);
       this.getStepLevels();
       this.updateHistory();
-      this.toNext();
-    },
-    updatePaperList(data) {
-      const index = this.papers.findIndex(item => item.id === data.id);
-      this.papers[index] = Object.assign(this.papers[index], data);
+      this.toActionNextPaper();
     },
     // paper carousel
     toViewCarouselPaper(paperIndex, papers) {
       this.isFullscreenMarking = true;
-      this.beforeCarouselCurPaperIndex = this.curPaperIndex;
-      this.curPaperIndex = null;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
       this.$nextTick(() => {
@@ -492,9 +495,20 @@ export default {
       this.curCarouselPaperIndex = index;
       this.curPaper = { ...this.carouselPapers[index] };
     },
+    toCarousePaper(type) {
+      if (type === "prev" && this.curCarouselPaperIndex > 0) {
+        this.curCarouselPaperIndex--;
+      } else if (
+        type === "next" &&
+        this.curCarouselPaperIndex < this.carouselPapers.length - 1
+      ) {
+        this.curCarouselPaperIndex++;
+      }
+      this.selectCarouselPaper(this.curCarouselPaperIndex);
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
-      this.selectPaper(this.beforeCarouselCurPaperIndex);
+      this.selectPaper(this.curPaperIndex);
     },
     // export
     toExport() {

+ 74 - 60
src/modules/grading/GradingOperation.vue

@@ -101,6 +101,7 @@
                   :page-size="size"
                   show-total
                   show-elevator
+                  show-sizer
                   :page-size-opts="[4, 6, 8]"
                   @on-page-size-change="pageSizeChange"
                   @on-change="toPage"
@@ -118,31 +119,24 @@
     </div>
 
     <!-- image-preview -->
-    <image-preview
+    <simple-image-preview
       class="grading-operation-image-preview"
-      :image-list="papers"
-      :init-index="curPaperIndex"
-      @on-paper-change="selectPaper"
-      @on-page-prev="prevPage"
-      @on-page-next="nextPage"
+      :cur-image="curPaper"
+      @on-prev="toPrevPaper"
+      @on-next="toNextPaper"
       @on-close="isFullscreenMarking = false"
-      header-hide
-      ref="ImagePreview"
-      v-if="papers.length"
-    ></image-preview>
+      ref="SimpleImagePreview"
+    ></simple-image-preview>
 
     <!-- carousel paper review -->
-    <image-preview
+    <simple-image-preview
       class="grading-operation-image-preview"
-      :image-list="carouselPapers"
-      :init-index="curCarouselPaperIndex"
-      @on-paper-change="selectCarouselPaper"
+      :cur-image="curPaper"
+      @on-prev="toCarousePaper('prev')"
+      @on-next="toCarousePaper('next')"
       @on-close="carouseImagePreviewClose"
-      loop
-      header-hide
       ref="CarouselPapersPreview"
-      v-if="carouselPapers.length"
-    ></image-preview>
+    ></simple-image-preview>
   </div>
 </template>
 
@@ -156,7 +150,7 @@ import {
   paperSelectLevelOrScore,
   paperTaskPass
 } from "@/api";
-import ImagePreview from "@/components/common/ImagePreview";
+import SimpleImagePreview from "@/components/SimpleImagePreview";
 import GradeStep from "./components/GradeStep";
 import GradeStandardPaper from "./components/GradeStandardPaper";
 import GradeHistoryPaper from "./components/GradeHistoryPaper";
@@ -172,7 +166,7 @@ import GradeAction from "./components/GradeAction";
 export default {
   name: "grading-operation",
   components: {
-    ImagePreview,
+    SimpleImagePreview,
     GradeStep,
     GradeHistoryPaper,
     GradeStandardPaper,
@@ -216,7 +210,6 @@ export default {
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      beforeCarouselCurPaperIndex: 0,
       isFullscreenMarking: false
     };
   },
@@ -354,66 +347,78 @@ export default {
       this.getStepLevels();
       this.toPage(1);
     },
-    selectPaper(index) {
-      this.curPaperIndex = index;
-      this.curPaper = { ...this.papers[index] };
-    },
     toReview(index) {
       this.isFullscreenMarking = true;
       this.selectPaper(index);
-      this.$refs.ImagePreview.open();
+      this.$refs.SimpleImagePreview.open();
     },
-    async prevPage() {
-      if (this.current === 1) {
-        this.$Message.warning("当前已经是第一条数据了");
-        return;
+    selectPaper(index) {
+      let nindex = index;
+      if (!this.papers.length) {
+        nindex = 0;
+      } else if (index > this.papers.length - 1) {
+        nindex = this.papers.length - 1;
+      } else if (index < 0) {
+        nindex = 0;
       }
-      this.current--;
-      await this.getList();
-      this.selectPaper(this.papers.length - 1);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      this.curPaperIndex = nindex;
+      this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
     },
-    async nextPage() {
-      if (this.current === this.totalPage) {
+    async toPrevPaper() {
+      if (this.curPaperIndex === 0) {
         if (this.current > 1) {
           this.current--;
+          this.curPaperIndex = this.size - 1;
+          await this.getList();
         } else {
+          this.$Message.warning("当前已经是第一条数据了");
+          return;
+        }
+      } else {
+        this.curPaperIndex--;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toNextPaper() {
+      if (this.curPaperIndex === this.papers.length - 1) {
+        if (this.current === this.totalPage) {
           this.$Message.warning("当前已经是最后一条数据了");
-          this.$refs.ImagePreview.cancel();
-          this.$refs.CarouselPapersPreview &&
-            this.$refs.CarouselPapersPreview.cancel();
+          return;
+        } else {
+          this.current++;
+          this.curPaperIndex = 0;
+          await this.getList();
         }
+      } else {
+        this.curPaperIndex++;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toActionNextPaper() {
+      if (this.current > 1 && this.papers.length === 1) {
+        this.current--;
+        this.curPaperIndex = this.size;
       }
-      // 下一页时,继续获取当前页数据。
+
       await this.getList();
-      this.selectPaper(0);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
+      this.selectPaper(this.curPaperIndex);
     },
     async gradeCurPaper(level) {
-      const data = await paperSelectLevelOrScore(
+      await paperSelectLevelOrScore(
         this.curPaper.id, // is taskId
         level.name,
         "LEVEL"
       );
-      this.updatePaperList(data);
       this.getStepLevels();
       this.updateHistory();
-      this.toNext();
-    },
-    updatePaperList(data) {
-      const index = this.papers.findIndex(item => item.id === data.id);
-      this.papers[index] = Object.assign(this.papers[index], data);
+      this.toActionNextPaper();
     },
     async passCurPaper() {
       await paperTaskPass(this.curPaper.id);
-      this.toNext();
-    },
-    toNext() {
-      this.$refs.ImagePreview.showNext();
+      this.toActionNextPaper();
     },
     updateHistory() {
       this.$refs.GradeHistoryPaper.updatePapers();
@@ -421,8 +426,6 @@ export default {
     // paper carousel
     toViewCarouselPaper(paperIndex, papers) {
       this.isFullscreenMarking = true;
-      this.beforeCarouselCurPaperIndex = this.curPaperIndex;
-      this.curPaperIndex = null;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
       this.$nextTick(() => {
@@ -433,9 +436,20 @@ export default {
       this.curCarouselPaperIndex = index;
       this.curPaper = { ...this.carouselPapers[index] };
     },
+    toCarousePaper(type) {
+      if (type === "prev" && this.curCarouselPaperIndex > 0) {
+        this.curCarouselPaperIndex--;
+      } else if (
+        type === "next" &&
+        this.curCarouselPaperIndex < this.carouselPapers.length - 1
+      ) {
+        this.curCarouselPaperIndex++;
+      }
+      this.selectCarouselPaper(this.curCarouselPaperIndex);
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
-      this.selectPaper(this.beforeCarouselCurPaperIndex);
+      this.selectPaper(this.curPaperIndex);
     }
   }
 };

+ 19 - 6
src/modules/grading/GradingUserManage.vue

@@ -28,6 +28,7 @@
 
     <!-- modify-grading-user -->
     <modify-grading-user
+      :subject="curSubject"
       :instance="curUser"
       @modified="getList"
       ref="ModifyGradingUser"
@@ -36,7 +37,12 @@
 </template>
 
 <script>
-import { gradingUserList, deleteGradingUser, resetPwd } from "@/api";
+import {
+  gradingUserList,
+  deleteGradingUser,
+  resetPwd,
+  subjectDetail
+} from "@/api";
 import ModifyGradingUser from "./components/ModifyGradingUser";
 import { ROLE_TYPE, MARKER_RIGHT_TYPE } from "@/constants/enumerate";
 
@@ -50,6 +56,7 @@ export default {
       subject: "",
       users: [],
       curUser: {},
+      curSubject: {},
       columns: [
         {
           type: "index",
@@ -106,8 +113,10 @@ export default {
                 action: () => {
                   this.toEdit(param.row);
                 }
-              },
-              {
+              }
+            ];
+            if (param.row.role !== "MARK_LEADER") {
+              actions.push({
                 icon: "md-trash",
                 classes: ["icon-danger"],
                 attrs: {
@@ -116,8 +125,8 @@ export default {
                 action: () => {
                   this.toDelete(param.row);
                 }
-              }
-            ];
+              });
+            }
             return h("div", this.$tableIconAction(h, actions));
           }
         }
@@ -127,6 +136,7 @@ export default {
   mounted() {
     this.subject = this.subjectId.split("-")[1];
     this.getList();
+    this.getSubjectDetail();
   },
   methods: {
     async getList() {
@@ -145,6 +155,9 @@ export default {
       await resetPwd({ userId: row.id, password: "123456" });
       this.$Message.success("重置密码成功!");
     },
+    async getSubjectDetail() {
+      this.curSubject = await subjectDetail(this.subjectId);
+    },
     toAdd() {
       this.curUser = {
         workId: this.workId,
@@ -172,7 +185,7 @@ export default {
     },
     toExport() {
       window.open(
-        `${this.GLOBAL.domain}/api/export/users?workId=${this.workId}`
+        `${this.GLOBAL.domain}/api/export/users?workId=${this.workId}&subject=${this.subject}`
       );
     }
   }

+ 14 - 5
src/modules/grading/components/GradeAction.vue

@@ -8,10 +8,10 @@
         placeholder="密号类型"
       >
         <Option
-          v-for="(val, key) in CODE_TYPE"
-          :key="key"
-          :value="key"
-          :label="val"
+          v-for="item in codeTypes"
+          :key="item.key"
+          :value="item.key"
+          :label="item.val"
         ></Option>
       </Select>
       <Input
@@ -216,7 +216,7 @@ export default {
         codeType: "examNumber",
         code: ""
       },
-      CODE_TYPE,
+      codeTypes: [],
       stepDict: {
         undo: "待评",
         done: "已评",
@@ -249,6 +249,14 @@ export default {
     }
   },
   mounted() {
+    this.codeTypes = Object.entries(CODE_TYPE)
+      .map(([key, val]) => {
+        return {
+          key,
+          val
+        };
+      })
+      .filter(item => this.IS_ADMIN || item.key !== "examNumber");
     this.rebuildRight();
   },
   methods: {
@@ -300,6 +308,7 @@ export default {
       });
     },
     selectLevel(level) {
+      if (this.IS_MARKER && this.curPaperOrTask.level === level.name) return;
       if (this.btnClicked) return;
       this.btnClicked = true;
 

+ 32 - 8
src/modules/grading/components/ModifyGradingUser.vue

@@ -29,7 +29,7 @@
           size="large"
           v-model.trim="modalForm.password"
           placeholder="请输入密码"
-          readonly
+          disabled
         ></Input>
       </FormItem>
       <FormItem prop="name" label="姓名">
@@ -37,16 +37,22 @@
           size="large"
           v-model.trim="modalForm.name"
           placeholder="请输入姓名"
+          :disabled="isEdit"
           clearable
         ></Input>
       </FormItem>
       <FormItem prop="role" label="角色">
-        <Select size="large" v-model="modalForm.role" placeholder="请选择角色">
+        <Select
+          size="large"
+          v-model="modalForm.role"
+          :disabled="isEdit"
+          placeholder="请选择角色"
+        >
           <Option
-            v-for="(val, key) in ROLE_TYPE"
-            :key="key"
-            :value="key"
-            :label="val"
+            v-for="item in roleTypes"
+            :key="item.key"
+            :value="item.key"
+            :label="item.val"
           ></Option>
         </Select>
       </FormItem>
@@ -59,6 +65,7 @@
           size="large"
           v-model="modalForm.markRight"
           placeholder="请选择权限"
+          disabled
         >
           <Option
             v-for="(val, key) in MARKER_RIGHT_TYPE"
@@ -119,7 +126,7 @@ const initModalForm = {
   password: "123456",
   name: "",
   role: null,
-  markRight: null,
+  markRight: "ALLOW_ALL",
   weight: null,
   oneClickLevel: false,
   standardVolume: false,
@@ -134,6 +141,12 @@ export default {
       default() {
         return {};
       }
+    },
+    subject: {
+      type: Object,
+      default() {
+        return {};
+      }
     }
   },
   computed: {
@@ -148,7 +161,7 @@ export default {
     return {
       modalIsShow: false,
       isSubmit: false,
-      ROLE_TYPE,
+      roleTypes: [],
       MARKER_RIGHT_TYPE,
       modalForm: { ...initModalForm },
       rules: {
@@ -184,6 +197,17 @@ export default {
   methods: {
     initData(val) {
       this.$refs.modalFormComp.resetFields();
+      this.roleTypes = Object.keys(ROLE_TYPE).map(key => {
+        return {
+          key,
+          val: ROLE_TYPE[key]
+        };
+      });
+      if (!this.isEdit) {
+        this.roleTypes.filter(
+          item => this.subject.stage === "INIT" || item.key === "MARK_LEADER"
+        );
+      }
       this.modalForm = this.$objAssign(initModalForm, val);
     },
     visibleChange(visible) {

+ 1 - 1
src/modules/grading/components/ModifyLeaderGrading.vue

@@ -93,7 +93,7 @@ export default {
       this.standardVolume = user.standardVolume;
       this.levelCallback = user.levelCallback;
       this.oneClickLevel = user.oneClickLevel;
-      this.selectedMarkers = this.markers.map(item => item.id);
+      // this.selectedMarkers = this.markers.map(item => item.id);
     },
     visibleChange(visible) {
       if (visible) {

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

@@ -67,7 +67,7 @@
           ></Input>
         </FormItem>
         <FormItem>
-          <Select v-model="filter.sort" placeholder="排序方式" clearable>
+          <Select v-model="filter.sortBy" placeholder="排序方式" clearable>
             <Option
               v-for="(val, key) in SORT_RULE_TYPE"
               :key="key"
@@ -123,7 +123,7 @@ export default {
         startNumber: null,
         endNumber: null,
         subject: "",
-        sort: "",
+        sortBy: "",
         isManual: null,
         missing: null
       },
@@ -164,6 +164,10 @@ export default {
       this.total = data.totalCount;
     },
     toPage(page) {
+      if (!this.filter.subject || !this.filter.areaCode) {
+        this.$Message.error("请选择科目和考区!");
+        return;
+      }
       this.current = page;
       this.getList();
     },
@@ -188,7 +192,7 @@ export default {
     },
     async getSubjects() {
       const data = await subjectList(this.filter.workId);
-      this.subjects = data.filter(item => item.enable && item.stage === "INIT");
+      this.subjects = data.filter(item => item.enable);
     },
     typeChange() {
       if (this.paperType === "1") {

+ 2 - 2
src/modules/main/StudentManage.vue

@@ -329,8 +329,8 @@ export default {
         size: this.size
       };
       if (
-        (datas.upload !== null && !datas.subject) ||
-        (datas.upload === null && datas.subject)
+        ((datas.upload || datas.upload === 0) && !datas.subject) ||
+        (!datas.upload && datas.upload !== 0 && datas.subject)
       ) {
         this.$Message.error("上传状态和科目必须同时选择!");
         return;

+ 71 - 53
src/modules/mark/MarkDetail.vue

@@ -103,30 +103,23 @@
     </div>
 
     <!-- image-preview -->
-    <image-preview
+    <simple-image-preview
       :class="imagePreviewClasses"
-      :image-list="papers"
-      :init-index="curPaperIndex"
-      @on-paper-change="selectPaper"
-      @on-page-prev="prevPage"
-      @on-page-next="nextPage"
+      :cur-image="curPaper"
+      @on-prev="toPrevPaper"
+      @on-next="toNextPaper"
       @on-close="isFullscreenMarking = false"
-      header-hide
-      ref="ImagePreview"
-      v-if="papers.length"
-    ></image-preview>
+      ref="SimpleImagePreview"
+    ></simple-image-preview>
     <!-- carousel paper review -->
-    <image-preview
+    <simple-image-preview
       :class="imagePreviewClasses"
-      :image-list="carouselPapers"
-      :init-index="curCarouselPaperIndex"
-      @on-paper-change="selectCarouselPaper"
+      :cur-image="curPaper"
+      @on-prev="toCarousePaper('prev')"
+      @on-next="toCarousePaper('next')"
       @on-close="carouseImagePreviewClose"
-      loop
-      header-hide
       ref="CarouselPapersPreview"
-      v-if="carouselPapers.length"
-    ></image-preview>
+    ></simple-image-preview>
   </div>
 </template>
 
@@ -140,7 +133,7 @@ import {
   taskSnSearch,
   markStepChangeLevel
 } from "@/api";
-import ImagePreview from "@/components/common/ImagePreview";
+import SimpleImagePreview from "@/components/SimpleImagePreview";
 import GradeStep from "../grading/components/GradeStep";
 import GradeHistoryPaper from "../grading/components/GradeHistoryPaper";
 import MarkAction from "./components/MarkAction";
@@ -155,7 +148,7 @@ import MarkAction from "./components/MarkAction";
 export default {
   name: "mark-detail",
   components: {
-    ImagePreview,
+    SimpleImagePreview,
     GradeStep,
     GradeHistoryPaper,
     MarkAction
@@ -187,7 +180,6 @@ export default {
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      beforeCarouselCurPaperIndex: 0,
       isFullscreenMarking: false
     };
   },
@@ -338,47 +330,64 @@ export default {
       this.getStepLevels();
       this.toPage(1);
     },
-    selectPaper(index) {
-      this.curPaperIndex = index;
-      this.curPaper = { ...this.papers[index] };
-    },
     toReview(index) {
       this.isFullscreenMarking = true;
       this.selectPaper(index);
-      this.$refs.ImagePreview.open();
+      this.$refs.SimpleImagePreview.open();
     },
-    async prevPage() {
-      if (this.current === 1) {
-        this.$Message.warning("当前已经是第一条数据了");
-        return;
+    selectPaper(index) {
+      let nindex = index;
+      if (!this.papers.length) {
+        nindex = 0;
+      } else if (index > this.papers.length - 1) {
+        nindex = this.papers.length - 1;
+      } else if (index < 0) {
+        nindex = 0;
       }
-      this.current--;
-      await this.getList();
-      this.selectPaper(this.papers.length - 1);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      this.curPaperIndex = nindex;
+      this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
     },
-    async nextPage() {
-      if (this.current === this.totalPage) {
+    async toPrevPaper() {
+      if (this.curPaperIndex === 0) {
         if (this.current > 1) {
           this.current--;
+          this.curPaperIndex = this.size - 1;
+          await this.getList();
         } else {
+          this.$Message.warning("当前已经是第一条数据了");
+          return;
+        }
+      } else {
+        this.curPaperIndex--;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toNextPaper() {
+      if (this.curPaperIndex === this.papers.length - 1) {
+        if (this.current === this.totalPage) {
           this.$Message.warning("当前已经是最后一条数据了");
-          this.$refs.ImagePreview.cancel();
-          this.$refs.CarouselPapersPreview &&
-            this.$refs.CarouselPapersPreview.cancel();
+          return;
+        } else {
+          this.current++;
+          this.curPaperIndex = 0;
+          await this.getList();
         }
+      } else {
+        this.curPaperIndex++;
       }
-      // 下一页时,继续获取当前页数据。
-      await this.getList();
-      this.selectPaper(0);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+
+      this.selectPaper(this.curPaperIndex);
     },
-    toNext() {
-      this.$refs.ImagePreview.showNext();
+    async toActionNextPaper() {
+      if (this.current > 1 && this.papers.length === 1) {
+        this.current--;
+        this.curPaperIndex = this.size;
+      }
+
+      await this.getList();
+      if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
+      this.selectPaper(this.curPaperIndex);
     },
     updateHistory() {
       this.$refs.GradeHistoryPaper.updatePapers();
@@ -414,15 +423,13 @@ export default {
           this.$Message.success("申请改档成功!");
           this.getStepLevels();
           this.updateHistory();
-          this.toNext();
+          this.toActionNextPaper();
         }
       });
     },
     // paper carousel
     toViewCarouselPaper(paperIndex, papers) {
       this.isFullscreenMarking = true;
-      this.beforeCarouselCurPaperIndex = this.curPaperIndex;
-      this.curPaperIndex = null;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
       this.$nextTick(() => {
@@ -433,9 +440,20 @@ export default {
       this.curCarouselPaperIndex = index;
       this.curPaper = { ...this.carouselPapers[index] };
     },
+    toCarousePaper(type) {
+      if (type === "prev" && this.curCarouselPaperIndex > 0) {
+        this.curCarouselPaperIndex--;
+      } else if (
+        type === "next" &&
+        this.curCarouselPaperIndex < this.carouselPapers.length - 1
+      ) {
+        this.curCarouselPaperIndex++;
+      }
+      this.selectCarouselPaper(this.curCarouselPaperIndex);
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
-      this.selectPaper(this.beforeCarouselCurPaperIndex);
+      this.selectPaper(this.curPaperIndex);
     }
   }
 };

+ 1 - 0
src/modules/mark/MarkHome.vue

@@ -114,6 +114,7 @@ export default {
         this.navs = [...main.slice(0, 2), ...this.navs];
       } else {
         this.navs.splice(1, 1);
+        this.navs.splice(2, 1);
       }
     },
     actSubNav() {

+ 75 - 63
src/modules/mark/MarkOperation.vue

@@ -112,31 +112,24 @@
     </div>
 
     <!-- image-preview -->
-    <image-preview
+    <simple-image-preview
       class="grading-operation-image-preview"
-      :image-list="papers"
-      :init-index="curPaperIndex"
-      @on-paper-change="selectPaper"
-      @on-page-prev="prevPage"
-      @on-page-next="nextPage"
+      :cur-image="curPaper"
+      @on-prev="toPrevPaper"
+      @on-next="toNextPaper"
       @on-close="isFullscreenMarking = false"
-      header-hide
-      ref="ImagePreview"
-      v-if="papers.length"
-    ></image-preview>
+      ref="SimpleImagePreview"
+    ></simple-image-preview>
 
     <!-- carousel paper review -->
-    <image-preview
+    <simple-image-preview
       class="grading-operation-image-preview"
-      :image-list="carouselPapers"
-      :init-index="curCarouselPaperIndex"
-      @on-paper-change="selectCarouselPaper"
+      :cur-image="curPaper"
+      @on-prev="toCarousePaper('prev')"
+      @on-next="toCarousePaper('next')"
       @on-close="carouseImagePreviewClose"
-      loop
-      header-hide
       ref="CarouselPapersPreview"
-      v-if="carouselPapers.length"
-    ></image-preview>
+    ></simple-image-preview>
   </div>
 </template>
 
@@ -151,7 +144,7 @@ import {
   paperSelectLevelOrScore,
   paperTaskPass
 } from "@/api";
-import ImagePreview from "@/components/common/ImagePreview";
+import SimpleImagePreview from "@/components/SimpleImagePreview";
 import MarkStep from "./components/MarkStep";
 import GradeHistoryPaper from "../grading/components/GradeHistoryPaper";
 import MarkAction from "./components/MarkAction";
@@ -166,7 +159,7 @@ import MarkAction from "./components/MarkAction";
 export default {
   name: "mark-operation",
   components: {
-    ImagePreview,
+    SimpleImagePreview,
     MarkStep,
     GradeHistoryPaper,
     MarkAction
@@ -216,7 +209,6 @@ export default {
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      beforeCarouselCurPaperIndex: 0,
       isFullscreenMarking: false
     };
   },
@@ -359,77 +351,88 @@ export default {
       this.getStepLevels();
       this.toPage(1);
     },
-    selectPaper(index) {
-      this.curPaperIndex = index;
-      this.curPaper = { ...this.papers[index] };
-    },
     toReview(index) {
       this.isFullscreenMarking = true;
       this.selectPaper(index);
-      this.$refs.ImagePreview.open();
+      this.$refs.SimpleImagePreview.open();
     },
-    async prevPage() {
-      if (this.current === 1) {
-        this.$Message.warning("当前已经是第一条数据了");
-        return;
+    selectPaper(index) {
+      let nindex = index;
+      if (!this.papers.length) {
+        nindex = 0;
+      } else if (index > this.papers.length - 1) {
+        nindex = this.papers.length - 1;
+      } else if (index < 0) {
+        nindex = 0;
       }
-      this.current--;
-      await this.getList();
-      this.selectPaper(this.papers.length - 1);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      this.curPaperIndex = nindex;
+      this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
     },
-    async nextPage() {
-      if (this.current === this.totalPage) {
+    async toPrevPaper() {
+      if (this.curPaperIndex === 0) {
         if (this.current > 1) {
           this.current--;
+          this.curPaperIndex = this.size - 1;
+          await this.getList();
         } else {
+          this.$Message.warning("当前已经是第一条数据了");
+          return;
+        }
+      } else {
+        this.curPaperIndex--;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toNextPaper() {
+      if (this.curPaperIndex === this.papers.length - 1) {
+        if (this.current === this.totalPage) {
           this.$Message.warning("当前已经是最后一条数据了");
-          this.$refs.ImagePreview.cancel();
-          this.$refs.CarouselPapersPreview &&
-            this.$refs.CarouselPapersPreview.cancel();
+          return;
+        } else {
+          this.current++;
+          this.curPaperIndex = 0;
+          await this.getList();
         }
+      } else {
+        this.curPaperIndex++;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toActionNextPaper() {
+      if (this.current > 1 && this.papers.length === 1) {
+        this.current--;
+        this.curPaperIndex = this.size;
       }
-      // 下一页时,继续获取当前页数据。
+
       await this.getList();
-      this.selectPaper(0);
-      this.$nextTick(() => {
-        if (this.papers.length) this.$refs.ImagePreview.initData();
-      });
+      if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
+      this.selectPaper(this.curPaperIndex);
     },
     async gradingCurPaper({ selectedLevel }) {
-      const data = await paperSelectLevelOrScore(
+      await paperSelectLevelOrScore(
         this.curPaper.id, // is taskId
         selectedLevel,
         "LEVEL"
       );
-      this.updatePaperList(data);
       this.getStepLevels();
       this.updateHistory();
-      this.toNext();
+      this.toActionNextPaper();
     },
     async scoreCurPaper(score) {
-      const data = await paperSelectLevelOrScore(
+      await paperSelectLevelOrScore(
         this.curPaper.id, // is taskId
         score,
         "SCORE"
       );
-      this.updatePaperList(data);
       this.getStepLevels();
       this.updateHistory();
-      this.toNext();
-    },
-    updatePaperList(data) {
-      const index = this.papers.findIndex(item => item.id === data.id);
-      this.papers[index] = Object.assign(this.papers[index], data);
+      this.toActionNextPaper();
     },
     async passCurPaper(level) {
       await paperTaskPass(this.curPaper.id);
-      this.toNext();
-    },
-    toNext() {
-      this.$refs.ImagePreview.showNext();
+      this.toActionNextPaper();
     },
     updateHistory() {
       this.$refs.GradeHistoryPaper.updatePapers();
@@ -437,8 +440,6 @@ export default {
     // paper carousel
     toViewCarouselPaper(paperIndex, papers) {
       this.isFullscreenMarking = true;
-      this.beforeCarouselCurPaperIndex = this.curPaperIndex;
-      this.curPaperIndex = null;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
       this.$nextTick(() => {
@@ -449,9 +450,20 @@ export default {
       this.curCarouselPaperIndex = index;
       this.curPaper = { ...this.carouselPapers[index] };
     },
+    toCarousePaper(type) {
+      if (type === "prev" && this.curCarouselPaperIndex > 0) {
+        this.curCarouselPaperIndex--;
+      } else if (
+        type === "next" &&
+        this.curCarouselPaperIndex < this.carouselPapers.length - 1
+      ) {
+        this.curCarouselPaperIndex++;
+      }
+      this.selectCarouselPaper(this.curCarouselPaperIndex);
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
-      this.selectPaper(this.beforeCarouselCurPaperIndex);
+      this.selectPaper(this.curPaperIndex);
     }
   }
 };

+ 9 - 0
src/routers/mark.js

@@ -3,6 +3,7 @@ import MarkHome from "../modules/mark/MarkHome";
 import MarkProgress from "../modules/mark/MarkProgress";
 import MarkDetail from "../modules/mark/MarkDetail";
 import MarkTaskManage from "../modules/mark/MarkTaskManage";
+import MarkUserManage from "../modules/mark/MarkUserManage";
 // import MarkGroupManage from "../modules/mark/MarkGroupManage";
 import ExamPaperView from "../modules/main/ExamPaperView";
 
@@ -34,6 +35,14 @@ const markRoutes = [
       title: "打分详情"
     }
   },
+  {
+    path: "mark-user-manage",
+    name: "MarkUserManage",
+    component: MarkUserManage,
+    meta: {
+      title: "用户管理"
+    }
+  },
   {
     path: "exam-paper-view",
     name: "MarkExamPaperView",