Ver Fonte

细节优化

zhangjie há 3 anos atrás
pai
commit
91cd8399cc

+ 0 - 10
src/assets/styles/base.less

@@ -35,7 +35,6 @@ u {
 input {
   outline: none;
   border: none;
-  box-shadow: 100px 100px 100px #fff inset;
   font-family: "Microsoft YaHei", Tahoma, Helvetica, Arial, sans-serif;
   -webkit-appearance: none;
 }
@@ -69,15 +68,6 @@ button {
 }
 
 /* common-style */
-input:-webkit-autofill {
-  box-shadow: 0 0 0 1000px white inset;
-}
-input[type="text"]:focus,
-input[type="password"]:focus,
-input[type="number"]:focus,
-textarea:focus {
-  box-shadow: 0 0 0 1000px white inset;
-}
 input,
 select {
   -webkit-appearance: none;

+ 1 - 1
src/assets/styles/marker.less

@@ -335,7 +335,7 @@
   overflow-x: hidden;
 
   &-fullscreen {
-    z-index: 10000;
+    z-index: 2000;
   }
 
   .action-search {

+ 4 - 10
src/modules/grading/GradingAnalysis.vue

@@ -4,11 +4,7 @@
       <div class="part-box-head-left">
         <Form ref="FilterForm" label-position="left" inline>
           <FormItem>
-            <Select
-              v-model="filter.questionId"
-              @on-change="areaChange"
-              placeholder="选择考区"
-            >
+            <Select v-model="filter.questionId" placeholder="选择考区">
               <Option
                 v-for="area in areas"
                 :key="area.id"
@@ -22,7 +18,7 @@
               size="small"
               class="btn-form-search"
               type="primary"
-              @click="toPage(1)"
+              @click="toSearch"
               >查询</Button
             >
           </FormItem>
@@ -118,10 +114,8 @@ export default {
         };
       });
     },
-    areaChange() {
-      this.$nextTick(() => {
-        this.$refs.GradeAnalysis.initData();
-      });
+    toSearch() {
+      this.$refs.GradeAnalysis.initData();
     },
     // export
     toExport() {

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

@@ -252,7 +252,8 @@ export default {
           return group;
         });
       }
-      this.$parent.setProgress(data.totalProgress.progress);
+      this.$parent.setProgress &&
+        this.$parent.setProgress(data.totalProgress.progress);
     },
     addProgress(data) {
       return data.map(item => {

+ 44 - 36
src/modules/grading/GradingStandardPaperManage.vue

@@ -32,14 +32,17 @@
           <p
             v-for="(level, index) in levels"
             :key="level"
-            :class="[
-              'level-item',
-              { 'level-item-act': index === curLevelIndex }
-            ]"
+            :class="['level-item', { 'level-item-act': curLevel === level }]"
             @click="switchLevel(index)"
           >
             {{ level }}
           </p>
+          <p
+            :class="['level-item', { 'level-item-act': !curLevel }]"
+            @click="showAllLevel"
+          >
+            全部
+          </p>
         </div>
       </div>
     </div>
@@ -129,7 +132,6 @@
 <script>
 import {
   paperList,
-  // subjectDetail,
   sampleAreaList,
   workLevelList,
   cancelStandardPaper,
@@ -149,10 +151,10 @@ export default {
       questionId: "",
       lastQuestionId: "",
       curLevel: "",
-      curLevelIndex: 0,
+      curLevelIndex: -1,
       levels: [],
       areas: [],
-      paperMap: {},
+      paperList: [],
       papers: [],
       curPaper: {},
       curPaperIndex: 0,
@@ -169,18 +171,11 @@ export default {
   },
   methods: {
     async initData() {
-      // this.curSubject = await subjectDetail(this.subjectId);
-      // const isLevelOrScore =
-      //   (this.curSubject.stage === "LEVEL" ||
-      //     this.curSubject.stage === "SCORE") &&
-      //   this.curSubject.test === 0;
-      // this.canCancel = !isLevelOrScore;
-
       await this.getAreaList();
       this.questionId = this.areas[0] && this.areas[0].id;
       if (!this.questionId) return;
       await this.getWorkLevels();
-      this.switchLevel(0);
+      this.search();
     },
     async getWorkLevels() {
       const data = await workLevelList(this.workId);
@@ -199,37 +194,46 @@ export default {
         };
       });
     },
-    search() {
-      if (this.lastQuestionId !== this.questionId) this.paperMap = {};
+    async search() {
       this.lastQuestionId = this.questionId;
-      this.getList();
+      await this.getPaperList();
+      this.updatePapers();
     },
-    async getList() {
-      if (this.paperMap[this.curLevel] && this.paperMap[this.curLevel].length) {
-        this.papers = this.paperMap[this.curLevel];
-        return;
+    updatePapers() {
+      if (this.curLevel) {
+        this.papers = this.paperList.filter(
+          paper => paper.level === this.curLevel
+        );
+      } else {
+        this.papers = this.paperList;
       }
+    },
+    async getPaperList() {
       const datas = {
         questionId: this.questionId,
-        level: this.curLevel,
+        level: "",
         sort: "secretNumber",
         isSample: true,
         page: 0,
         size: 100
       };
       const data = await paperList(datas);
-      this.papers = data.data.map(item => {
+      this.paperList = data.data.map(item => {
         item.title = `NO.${item.sn}`;
         item.loading = false;
         return item;
       });
-      this.paperMap[this.curLevel] = data.data;
     },
     switchLevel(index) {
       this.curLevelIndex = index;
       this.curLevel = this.levels[index];
 
-      this.getList();
+      this.updatePapers();
+    },
+    showAllLevel() {
+      this.curLevelIndex = -1;
+      this.curLevel = "";
+      this.updatePapers();
     },
     cancelPaper(paper) {
       if (paper.loading) return;
@@ -240,9 +244,11 @@ export default {
           const res = await cancelStandardPaper(paper.id).catch(() => {});
           paper.loading = false;
           if (!res) return;
-          this.paperMap[this.curLevel] = null;
-          await this.getList();
-          this.selectPaper(this.curPaperIndex);
+
+          this.paperList = this.paperList.filter(
+            item => paper.level !== item.level
+          );
+          this.papers = this.papers.filter(item => paper.level !== item.level);
         }
       });
     },
@@ -275,10 +281,9 @@ export default {
       if (!result) return;
 
       this.$Message.success("操作成功!");
-      this.paperMap[datas.level] = [];
-      this.paperMap[this.curLevel] = [];
+      await this.getPaperList();
       this.cancelChange();
-      this.getList();
+      this.updatePapers();
     },
     cancelChange() {
       this.curSelectLevel = null;
@@ -303,13 +308,13 @@ export default {
     },
     async toPrevPaper() {
       if (this.curPaperIndex === 0) {
-        if (this.curLevelIndex === 0) {
+        if (this.curLevelIndex === 0 || this.curLevelIndex === -1) {
           this.$Message.warning("当前已经是第一条数据了");
           return;
         } else {
           this.curLevelIndex--;
           this.curLevel = this.levels[this.curLevelIndex];
-          await this.getList();
+          await this.updatePapers();
           this.curPaperIndex = this.papers.length - 1;
         }
       } else {
@@ -323,13 +328,16 @@ export default {
         this.curPaperIndex === this.papers.length - 1 ||
         !this.papers.length
       ) {
-        if (this.curLevelIndex === this.levels.length - 1) {
+        if (
+          this.curLevelIndex === this.levels.length - 1 ||
+          this.curLevelIndex === -1
+        ) {
           this.$Message.warning("当前已经是最后一条数据了");
           return;
         } else {
           this.curLevelIndex++;
           this.curLevel = this.levels[this.curLevelIndex];
-          await this.getList();
+          await this.updatePapers();
           this.curPaperIndex = 0;
         }
       } else {

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

@@ -102,6 +102,7 @@ export default {
   },
   methods: {
     async initData() {
+      this.lineChartData = null;
       const subs = this.subjectId.split("-");
       this.levelData = await gradingStatData({
         questionId: this.questionId,

+ 4 - 1
src/modules/grading/marker/MarkerHeader.vue

@@ -123,7 +123,7 @@
               :name="step.name"
             >
               <i>{{ step.name }}</i>
-              <i v-if="IS_MARK_LEADER"
+              <i v-if="IS_MARK_LEADER && !IS_MARK_LEADER__SCORE"
                 >({{ step.count }} / {{ step.gcount }})</i
               >
               <i v-else>({{ step.count }})</i>
@@ -212,6 +212,9 @@ export default {
     ]),
     stageName() {
       return this.curSubject.stage === "LEVEL" ? "分档" : "打分";
+    },
+    IS_MARK_LEADER__SCORE() {
+      return this.IS_MARK_LEADER && this.curSubject.stage === "SCORE";
     }
   },
   mounted() {

+ 18 - 6
src/modules/grading/marker/MarkerHistory.vue

@@ -17,9 +17,9 @@
           <marker-image-view :data="paper" @to-review="toReview(index)">
             <div class="image-info">
               <div class="image-level">
-                {{ IS_MARK_LEADER ? paper.level : paper.result }}
+                {{ paper.actionResult }}
               </div>
-              <div class="image-action-name">{{ actionName }}</div>
+              <div class="image-action-name">{{ paper.actionName }}</div>
             </div>
             <div class="image-sn">NO.{{ paper.sn }}</div>
           </marker-image-view>
@@ -60,10 +60,7 @@ export default {
     };
   },
   computed: {
-    ...mapState("marker", ["IS_MARK_LEADER"]),
-    actionName() {
-      return this.IS_MARK_LEADER ? "一键定档" : "已评";
-    }
+    ...mapState("marker", ["IS_MARK_LEADER"])
   },
   mounted() {
     this.userId = this.$ls.get("user", { id: "" }).id;
@@ -98,6 +95,21 @@ export default {
       }
 
       this.papers = data.reverse();
+      this.papers.forEach(paper => {
+        paper.actionResult = this.IS_MARK_LEADER ? paper.level : paper.result;
+        paper.actionName = this.IS_MARK_LEADER
+          ? this.getLeaderActionName(paper)
+          : "已评";
+      });
+    },
+    getLeaderActionName(paper) {
+      const names = {
+        oneClick: "一键定档",
+        sample: "设立标准卷",
+        isRejectedByLeader: "打回"
+      };
+      const typeKey = Object.keys(names).find(key => paper[key]);
+      return typeKey && names[typeKey];
     },
     updateCachePapers(papers) {
       papers.forEach(paper => {

+ 58 - 33
src/modules/grading/marker/MarkerStandard.vue

@@ -11,11 +11,17 @@
       <div
         v-for="(level, index) in levels"
         :key="index"
-        :class="['level-item', { 'level-item-act': curLevelIndex === index }]"
-        @click="setCurLevel(index)"
+        :class="['level-item', { 'level-item-act': curLevel === level.name }]"
+        @click="setCurLevel(level.name)"
       >
         {{ level.name }}
       </div>
+      <div
+        :class="['level-item', { 'level-item-act': !curLevel }]"
+        @click="setCurLevel('')"
+      >
+        全部
+      </div>
     </div>
 
     <div class="standard-image-list marker-image-list" v-if="papers.length">
@@ -28,7 +34,7 @@
           <marker-image-view :data="paper" @to-review="toReview(index)">
             <div class="image-info">
               <div class="image-level">
-                {{ curLevel }}
+                {{ paper.level }}
               </div>
               <div class="image-title">{{ paper.title }}</div>
             </div>
@@ -77,7 +83,7 @@
               'level-item-disabled': level.name === curChangePaper.level
             }
           ]"
-          @click="selectLevel(level)"
+          @click="selectLevel(level.name)"
         >
           {{ level.name }}
         </p>
@@ -120,9 +126,8 @@ export default {
     return {
       modalIsShow: false,
       curLevel: "",
-      curLevelIndex: 0,
+      paperList: [],
       papers: [],
-      paperMap: {},
       isLoading: false,
       // change standard
       levelModalIsShow: false,
@@ -131,6 +136,11 @@ export default {
       isSubmit: false
     };
   },
+  watch: {
+    questionId(val, oldval) {
+      if (val !== oldval) this.getPaperList();
+    }
+  },
   computed: {
     ...mapState("marker", ["IS_MARK_LEADER", "paramsSet"]),
     showStandardPaperManage() {
@@ -138,40 +148,46 @@ export default {
     }
   },
   methods: {
-    visibleChange(visible) {
-      if (visible) {
-        this.curLevel = this.levels[this.curLevelIndex].name;
-        this.updatePapers();
+    async visibleChange(visible) {
+      if (!visible) return;
+
+      if (!this.paperList.length) {
+        await this.getPaperList();
       }
+      this.updatePapers();
     },
-    async updatePapers() {
-      if (this.paperMap[this.curLevel] && this.paperMap[this.curLevel].length) {
-        this.papers = this.paperMap[this.curLevel];
-        return;
-      }
+    async getPaperList() {
       this.isLoading = true;
       const datas = {
         questionId: this.questionId,
-        level: this.curLevel,
+        level: "",
         sort: "secretNumber",
         isSample: true,
         page: 0,
-        size: 100
+        size: 1000
       };
       const data = await paperList(datas).catch(() => {});
       this.isLoading = false;
       if (!data) return;
-      this.papers = data.data.map(item => {
+      this.paperList = data.data.map(item => {
         item.title = `NO.${item.sn}`;
         item.loading = false;
         return item;
       });
-      this.paperMap[this.curLevel] = data.data;
     },
-    async updateLevelPapers(level) {
+    updatePapers() {
+      if (this.curLevel) {
+        this.papers = this.paperList.filter(
+          paper => paper.level === this.curLevel
+        );
+      } else {
+        this.papers = this.paperList;
+      }
+    },
+    async updateLevelPapers(levelName) {
       const datas = {
         questionId: this.questionId,
-        level: this.curLevel,
+        level: levelName,
         sort: "secretNumber",
         isSample: true,
         page: 0,
@@ -180,14 +196,24 @@ export default {
       const data = await paperList(datas).catch(() => {});
       this.isLoading = false;
       if (!data) return;
-      this.paperMap[this.curLevel] = data.data;
-      if (this.curLevel === level) {
-        this.papers = data.data;
+
+      this.paperList = this.paperList.filter(
+        paper => paper.level !== levelName
+      );
+
+      const papers = data.data.map(item => {
+        item.title = `NO.${item.sn}`;
+        item.loading = false;
+        return item;
+      });
+      this.paperList = [...this.paperList, ...papers];
+
+      if (this.curLevel === levelName) {
+        this.papers = papers;
       }
     },
-    setCurLevel(index) {
-      this.curLevel = this.levels[index].name;
-      this.curLevelIndex = index;
+    setCurLevel(levelName) {
+      this.curLevel = levelName;
       this.updatePapers();
     },
     cancel() {
@@ -208,7 +234,7 @@ export default {
           const res = await cancelStandardPaper(paper.id).catch(() => {});
           paper.loading = false;
           if (!res) return;
-          this.updateLevelPapers(this.curLevel);
+          this.updateLevelPapers(paper.level);
         }
       });
     },
@@ -217,9 +243,9 @@ export default {
       this.curChangePaper = paper;
       this.levelModalIsShow = true;
     },
-    selectLevel(level) {
-      if (level.name === this.curChangePaper.level) return;
-      this.curSelectLevel = level.name;
+    selectLevel(levelName) {
+      if (levelName === this.curChangePaper.level) return;
+      this.curSelectLevel = levelName;
     },
     async confirmChange() {
       if (!this.curSelectLevel) return;
@@ -241,8 +267,7 @@ export default {
       if (!result) return;
 
       this.$Message.success("操作成功!");
-      this.paperMap[datas.level] = [];
-      this.paperMap[this.curLevel] = [];
+      await this.getPaperList();
       this.cancelChange();
       this.updatePapers();
     },

+ 1 - 0
src/modules/main/StudentManage.vue

@@ -54,6 +54,7 @@
             v-model="filter.school"
             @on-change="schoolChange"
             placeholder="学校"
+            filterable
             clearable
           >
             <Option

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

@@ -8,6 +8,7 @@
     <mark-step
       :steps="steps"
       :init-step="curStep"
+      :show-top-number="false"
       @on-change="stepChange"
       ref="MarkStep"
       v-if="steps.levelStep"

+ 26 - 4
src/modules/mark/marker/MarkerMarking.vue

@@ -82,6 +82,26 @@
       @on-close="carouseImagePreviewClose"
       ref="CarouselPapersPreview"
     ></simple-image-preview>
+    <!-- level-change-modal-info -->
+    <Modal
+      v-model="levelChangeModalIsShow"
+      width="400"
+      footer-hide
+      :z-index="2001"
+      :closable="false"
+      :mask-closable="false"
+    >
+      <div class="ivu-modal-confirm">
+        <div class="ivu-modal-confirm-body">
+          <div>{{ levelChangeTips }}</div>
+        </div>
+        <div class="ivu-modal-confirm-footer">
+          <Button type="primary" @click="levelChangeModalIsShow = false"
+            >确定</Button
+          >
+        </div>
+      </div>
+    </Modal>
   </div>
 </template>
 
@@ -154,7 +174,10 @@ export default {
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      isFullscreenMarking: false
+      isFullscreenMarking: false,
+      // tips-modal
+      levelChangeTips: "",
+      levelChangeModalIsShow: false
     };
   },
   computed: {
@@ -377,9 +400,8 @@ export default {
         this.curPaper["level"] &&
         this.curPaper["level"] !== lastPaper["level"]
       ) {
-        this.$Modal.info({
-          content: `即将打分档位:${this.curPaper.level}`
-        });
+        this.levelChangeTips = `即将打分档位:${this.curPaper.level}`;
+        this.levelChangeModalIsShow = true;
       }
     },
     async toPrevPaper() {