zhangjie vor 8 Monaten
Ursprung
Commit
dbbc678911

+ 5 - 4
src/assets/styles/marker.less

@@ -1270,19 +1270,19 @@
     vertical-align: middle;
     font-size: 14px;
 
-    &.ivu-input-number {
+    &.ivu-input-wrapper {
       height: 24px;
       background-color: @color-background;
       border: none;
       border-radius: 0;
     }
-    .ivu-input-number-handler-wrap {
+    .ivu-input-handler-wrap {
       display: none;
     }
-    .ivu-input-number-input-wrap {
+    .ivu-input-input-wrap {
       height: 24px;
     }
-    .ivu-input-number-input {
+    .ivu-input {
       display: block;
       height: 24px;
       line-height: 24px;
@@ -1290,6 +1290,7 @@
       border-radius: 0;
       padding: 0 2px;
       text-align: center;
+      border: none;
     }
   }
 }

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

@@ -559,7 +559,7 @@ export default {
       this.loading = false;
       if (!res) return;
       this.curPaperOrTask.mark = !this.curPaperOrTask.mark;
-      this.$emit("on-history-mark", this.curPaperOrTask.mark);
+      this.$emit("on-history-mark", this.curPaperOrTask);
     },
     // keyboard submit
     keyEvent(e) {

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

@@ -737,7 +737,7 @@ export default {
       this.loading = false;
       if (!res) return;
       this.curPaperOrTask.mark = !this.curPaperOrTask.mark;
-      this.$emit("on-history-mark", this.curPaperOrTask.mark);
+      this.$emit("on-history-mark", this.curPaperOrTask);
     },
     // keyboard submit
     keyEvent(e) {

+ 9 - 4
src/modules/grading/leader/LeaderGrading.vue

@@ -723,10 +723,15 @@ export default {
       this.selectPaper(this.curPaperIndex);
       this.setShortcut(["page", "action"]);
     },
-    historyMarkChange() {
-      this.getStepLevels();
-      this.getList();
-      this.$refs.MarkerHistory.updatePapers();
+    async historyMarkChange() {
+      await this.getStepLevels();
+      await this.getList();
+      await this.$refs.MarkerHistory.updatePapers();
+
+      if (!this.papers.length) {
+        this.paperKey = this.$randomCode();
+        this.curPaper = {};
+      }
     },
     toStandard() {
       this.setShortcut([]);

+ 8 - 9
src/modules/grading/marker/MarkerGrading.vue

@@ -599,26 +599,25 @@ export default {
       this.selectPaper(this.curPaperIndex);
     },
     // paper view action
-    markChange(mark) {
-      if (this.carouselType) {
-        this.carouselPapers[this.curCarouselPaperIndex].mark = mark;
-      } else {
-        this.papers[this.curPaperIndex].mark = mark;
-      }
+    markChange(curPaperOrTask) {
+      const dataList = this.carouselType ? this.carouselPapers : this.papers;
+      const row = dataList.find((item) => item.id === curPaperOrTask.id);
+      if (!row) return;
+      row.mark = curPaperOrTask.mark;
 
       const spos = this.steps.otherStep.findIndex(
         (item) => item.type === "markPaper"
       );
       if (spos === -1) return;
-      if (mark) {
+      if (curPaperOrTask.mark) {
         this.steps.otherStep[spos].count++;
       } else {
         this.steps.otherStep[spos].count--;
         if (this.curStep.type === "markPaper") this.getList();
       }
     },
-    async historyMarkChange(mark) {
-      this.markChange(mark);
+    async historyMarkChange(curPaperOrTask) {
+      this.markChange(curPaperOrTask);
       const data = await this.$refs.MarkerHistory.updatePapers();
       this.carouselPapers = data || [];
     },

+ 1 - 1
src/modules/grading/marker/MarkerHistory.vue

@@ -176,7 +176,7 @@ export default {
       this.loading = false;
       if (!res) return;
       paper.mark = !paper.mark;
-      this.$emit("on-mark", paper.mark);
+      this.$emit("on-mark", paper);
     },
     cancel() {
       this.modalIsShow = false;

+ 12 - 3
src/modules/grading/marker/MarkerImageView.vue

@@ -16,7 +16,7 @@
           </div>
           <div v-if="IS_SAMPLE" class="image-sample">标</div>
           <div
-            v-if="canSelect && !IS_SAMPLE"
+            v-if="canSelect && !IS_SAMPLE && !IS_ONE_CLICK"
             :class="[
               'image-checkbox',
               {
@@ -95,6 +95,9 @@ export default {
         (this.stage === "ROUGH_LEVEL" && this.image.roughSample)
       );
     },
+    IS_ONE_CLICK() {
+      return this.data.oneClick || this.data.roughOneClick;
+    },
   },
   created() {
     this.initData();
@@ -167,10 +170,16 @@ export default {
       this.loading = false;
       if (!res) return;
       this.image.mark = !this.image.mark;
-      this.$emit("on-mark", this.image.mark);
+      this.$emit("on-mark", this.image);
     },
     toSelect() {
-      if (this.IS_SAMPLE || !this.IS_LEVEL || !this.canSelect) return;
+      if (
+        this.IS_SAMPLE ||
+        this.IS_ONE_CLICK ||
+        !this.IS_LEVEL ||
+        !this.canSelect
+      )
+        return;
       if (this.selectHandle && !this.selectHandle(this.image)) return;
       this.image.selected = !this.image.selected;
       this.$emit("to-select", this.image);

+ 23 - 9
src/modules/inspection/paperCheck/TaskDetail.vue

@@ -54,15 +54,13 @@
           <div class="page-item" @click="toPrevPage" title="上一页">
             <Icon type="md-arrow-dropleft" />
           </div>
-          <div class="page-item page-cpage" @keydown.enter="changePage">
-            <InputNumber
+          <div class="page-item page-cpage">
+            <Input
               v-model="pageNo"
               class="page-input"
-              :min="1"
-              :max="totalPage"
-              :step="1"
-              :precision="0"
-            ></InputNumber>
+              @on-keydown="keyEventHandle"
+              @on-change="pageNoChange"
+            ></Input>
             <span>/</span>
             <span>{{ totalPage }}</span>
           </div>
@@ -179,14 +177,30 @@ export default {
       this.current = res.page + 1;
     },
     async toPage(page) {
+      if (page > this.totalPage || page < 1) return;
       this.current = page;
       await this.getList();
       this.pageNo = this.current;
-      console.log(this.pageNo);
+      // console.log(this.pageNo);
+    },
+    // change page no
+    pageNoChange() {
+      if (!/^[0-9]{1,}$/.test(this.pageNo)) {
+        setTimeout(() => {
+          this.pageNo = "";
+        }, 0);
+      }
+    },
+    keyEventHandle(e) {
+      if (e.repeat) return;
+      if (e.code === "Enter") {
+        e.preventDefault();
+        this.changePage();
+      }
     },
     changePage() {
       if (!this.pageNo) return;
-      this.toPage(this.pageNo);
+      this.toPage(Number(this.pageNo));
     },
     async toPrevPage() {
       if (this.current <= 1) return;

+ 1 - 1
src/modules/mark/components/MarkAction.vue

@@ -529,7 +529,7 @@ export default {
       this.loading = false;
       if (!res) return;
       this.curPaperOrTask.mark = !this.curPaperOrTask.mark;
-      this.$emit("on-history-mark", this.curPaperOrTask.mark);
+      this.$emit("on-history-mark", this.curPaperOrTask);
     },
     // keyboard submit
     keyEvent(e) {

+ 9 - 4
src/modules/mark/leader/LeaderMarking.vue

@@ -525,10 +525,15 @@ export default {
       this.selectPaper(this.curPaperIndex);
       this.setShortcut(["page", "action"]);
     },
-    historyMarkChange() {
-      this.getStepLevels();
-      this.getList();
-      this.$refs.MarkerHistory.updatePapers();
+    async historyMarkChange() {
+      await this.getStepLevels();
+      await this.getList();
+      await this.$refs.MarkerHistory.updatePapers();
+
+      if (!this.papers.length) {
+        this.paperKey = this.$randomCode();
+        this.curPaper = {};
+      }
     },
     toProgress() {
       this.setShortcut([]);

+ 8 - 9
src/modules/mark/marker/MarkerMarking.vue

@@ -414,26 +414,25 @@ export default {
       await this.getStepLevels();
       this.toPage(1);
     },
-    markChange(mark) {
-      if (this.carouselType) {
-        this.carouselPapers[this.curCarouselPaperIndex].mark = mark;
-      } else {
-        this.papers[this.curPaperIndex].mark = mark;
-      }
+    markChange(curPaperOrTask) {
+      const dataList = this.carouselType ? this.carouselPapers : this.papers;
+      const row = dataList.find((item) => item.id === curPaperOrTask.id);
+      if (!row) return;
+      row.mark = curPaperOrTask.mark;
 
       const spos = this.steps.otherStep.findIndex(
         (item) => item.type === "markPaper"
       );
       if (spos === -1) return;
-      if (mark) {
+      if (curPaperOrTask.mark) {
         this.steps.otherStep[spos].count++;
       } else {
         this.steps.otherStep[spos].count--;
         if (this.curStep.type === "markPaper") this.getList();
       }
     },
-    async historyMarkChange(mark) {
-      this.markChange(mark);
+    async historyMarkChange(curPaperOrTask) {
+      this.markChange(curPaperOrTask);
       const data = await this.$refs.MarkerHistory.updatePapers();
       this.carouselPapers = data || [];
     },