Переглянути джерело

阅卷导航优化代码0.1

nikang 6 роки тому
батько
коміт
8ad223111a

+ 5 - 4
src/modules/marking/routes/routes.js

@@ -24,15 +24,16 @@ export default [
         component: Tips
       },
       {
-        path: "mark_work_overview/:workId/:examId/:name", //评卷总览
+        path: "mark_work_overview", //评卷总览
         component: MarkWorkOverview
       },
       {
-        path: "course_detail/:workId/:examId/:name/:courseCode/:courseName", //课程详情
+        path:
+          "course_detail/:workId/:examId/:markWorkName/:courseCode/:courseName", //课程详情
         component: CourseDetail
       },
       {
-        path: "marker/:workId/:examId/:name", //评卷员一览
+        path: "marker", //评卷员一览
         component: Marker
       },
       {
@@ -52,7 +53,7 @@ export default [
         component: MarkWork
       },
       {
-        path: "mark_paper_check/:workId/:examId/:examType", //试卷检查
+        path: "mark_paper_check", //试卷检查
         component: MarkPaperCheck
       },
       {

+ 6 - 15
src/modules/marking/views/CourseDetail.vue

@@ -1,8 +1,6 @@
 <template>
   <div>
-    <LinkTitlesCustom
-      :currentPaths="['评卷总览', '评卷进度', '进度列表', '课程详情']"
-    />
+    <LinkTitlesCustom :currentPaths="['评卷总览', '评卷进度', '课程详情']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
@@ -112,8 +110,7 @@ export default {
       loading: true,
       workId: "",
       examId: "",
-      courseCode: "",
-      examName: ""
+      courseCode: ""
     };
   },
   components: {
@@ -196,15 +193,10 @@ export default {
         this.courseCode;
     },
     back() {
-      this.$router.push({
-        path:
-          "/marking/mark_work_overview/" +
-          this.workId +
-          "/" +
-          this.examId +
-          "/" +
-          this.examName
-      });
+      this.$router.back();
+      // this.$router.push({
+      //   path: "/marking/mark_work_overview"
+      // });
     }
   },
   computed: {
@@ -213,7 +205,6 @@ export default {
   created() {
     this.workId = this.$route.params.workId;
     this.examId = this.$route.params.examId;
-    this.examName = this.$route.params.name;
     this.courseCode = this.$route.params.courseCode;
     this.initSetting();
   }

+ 74 - 47
src/modules/marking/views/MarkPaperCheck.vue

@@ -1,6 +1,5 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['试卷检查', '试卷列表']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
@@ -10,6 +9,25 @@
             ref="formSearch"
             label-width="70px"
           >
+            <el-form-item label="评卷名称" prop="markId">
+              <el-select
+                clearable
+                filterable
+                class="input"
+                v-model="formSearch.markId"
+                placeholder="请选择"
+                style="width:150px;"
+                @change="getCourses"
+              >
+                <el-option value>请选择</el-option>
+                <el-option
+                  v-for="item in markWorkSelect"
+                  :label="item.markName"
+                  :value="item.markId"
+                  :key="item.markId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item label="学习中心" prop="orgCode">
               <el-select
                 :remote-method="getOrgs"
@@ -21,7 +39,7 @@
                 placeholder="请选择"
                 filterable
                 style="width:150px;"
-                @focus="e => getSpecialtyList4Search(e.target.value)"
+                @focus="e => getOrgs(e.target.value)"
               >
                 <el-option label="请选择" value></el-option>
                 <el-option
@@ -122,13 +140,6 @@
                 icon="el-icon-refresh"
                 >重置</el-button
               >
-              <el-button
-                size="small"
-                type="primary"
-                icon="el-icon-arrow-left"
-                @click="back"
-                >返回</el-button
-              >
             </el-form-item>
           </el-form>
 
@@ -214,7 +225,6 @@
 <script>
 import { mapState } from "vuex";
 import { CORE_API, MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
-import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 
 export default {
   data() {
@@ -245,14 +255,23 @@ export default {
       tags: [],
       loading: false,
       examType: "",
-      getOrgsSearchLoading: false
+      getOrgsSearchLoading: false,
+      markWorkList: []
     };
   },
-  components: {
-    LinkTitlesCustom
-  },
   computed: {
     ...mapState({ user: state => state.user }),
+    markWorkSelect() {
+      let markWorkNames = [];
+      for (let markWork of this.markWorkList) {
+        markWorkNames.push({
+          markId: markWork.id,
+          markName: markWork.name,
+          examId: markWork.examId
+        });
+      }
+      return markWorkNames;
+    },
     isAdmin() {
       if (sessionStorage.getItem("AdminButtonShow")) {
         return true;
@@ -275,6 +294,11 @@ export default {
     }
   },
   methods: {
+    getMarkWorks() {
+      this.$http.get(DATA_PROCESS_API + "/markWorks").then(response => {
+        this.markWorkList = response.data;
+      });
+    },
     //查询学习中心
     getOrgs(name) {
       this.getOrgsSearchLoading = true;
@@ -287,7 +311,9 @@ export default {
     getCourses() {
       this.$http
         .get(
-          MARKING_API + "/markResults/queryExamCourseList?workId=" + this.workId
+          MARKING_API +
+            "/markResults/queryExamCourseList?workId=" +
+            this.formSearch.markId
         )
         .then(response => {
           this.courseList = response.data;
@@ -332,26 +358,37 @@ export default {
     },
     //查询方法
     searchMarkPaperCheck() {
-      this.formSearch.workId = this.workId;
-      this.formSearch.examType = this.examType;
-      this.loading = true;
-      var url =
-        DATA_PROCESS_API +
-        "/markResults/all/" +
-        (this.currentPage - 1) +
-        "/" +
-        this.pageSize;
-      this.$http
-        .get(url, { params: this.formSearch })
-        .then(response => {
-          console.log("查询的列表集合", response);
-          this.tableData = response.data.list;
-          this.total = response.data.total;
-          this.loading = false;
-        })
-        .catch(function(response) {
-          console.log(response);
-        });
+      if (this.formSearch.markId) {
+        let obj = {};
+        for (let item of this.markWorkList) {
+          if (item.id === this.formSearch.markId) {
+            obj = item;
+            break;
+          }
+        }
+        this.examId = obj.examId;
+        this.formSearch.workId = this.formSearch.markId;
+        this.examType = obj.examType;
+        this.formSearch.examType = this.examType;
+        this.loading = true;
+        var url =
+          DATA_PROCESS_API +
+          "/markResults/all/" +
+          (this.currentPage - 1) +
+          "/" +
+          this.pageSize;
+        this.$http
+          .get(url, { params: this.formSearch })
+          .then(response => {
+            console.log("查询的列表集合", response);
+            this.tableData = response.data.list;
+            this.total = response.data.total;
+            this.loading = false;
+          })
+          .catch(function(response) {
+            console.log(response);
+          });
+      }
     },
     //导出
     exp() {},
@@ -373,7 +410,7 @@ export default {
         console.log("studentPaperId:", studentPaperId);
         var urls =
           "/marking/view_paper/" +
-          this.workId +
+          this.formSearch.markId +
           "/" +
           this.examId +
           "/" +
@@ -408,22 +445,12 @@ export default {
           return str;
         }
       }
-    },
-    back() {
-      this.$router.push({
-        path: "/marking/mark_setting_work/checking"
-      });
     }
   },
   created() {
-    this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
-    this.examType = this.$route.params.examType;
     //查询标记卷
+    this.getMarkWorks();
     this.getTags();
-    this.getCourses();
-    //查询列表
-    this.searchMarkPaperCheck();
   }
 };
 </script>

+ 1 - 3
src/modules/marking/views/MarkSettingMain.vue

@@ -60,7 +60,6 @@
                       size="small"
                       type="primary"
                       icon="el-icon-upload2"
-                      @click="back"
                       >导入</el-button
                     >
                   </el-dropdown-item>
@@ -69,7 +68,6 @@
                       size="small"
                       type="primary"
                       icon="el-icon-download"
-                      @click="back"
                       >导出</el-button
                     >
                   </el-dropdown-item>
@@ -352,7 +350,7 @@ export default {
     },
     back() {
       this.$router.push({
-        path: "/marking/mark_setting_work/setting"
+        path: "/marking/mark_work"
       });
     },
     //导入

+ 24 - 3
src/modules/marking/views/MarkWork.vue

@@ -82,12 +82,11 @@
               <template slot-scope="scope">
                 <div class="pull-left" v-if="isAdmin">
                   <el-button
-                    @click="editMarkWorkModal(scope.row)"
+                    @click="settingMarkWork(scope.row)"
                     type="primary"
                     size="mini"
-                    icon="el-icon-edit"
                     plain
-                    >编辑</el-button
+                    >评卷设置</el-button
                   >
                   <el-dropdown
                     style="margin-left:10px;"
@@ -106,6 +105,16 @@
                           >重新创建</el-button
                         >
                       </el-dropdown-item>
+                      <el-dropdown-item>
+                        <el-button
+                          @click="editMarkWorkModal(scope.row)"
+                          type="primary"
+                          size="mini"
+                          icon="el-icon-edit"
+                          plain
+                          >编辑</el-button
+                        >
+                      </el-dropdown-item>
                       <el-dropdown-item>
                         <el-button
                           @click="delMarkWork(scope.row)"
@@ -256,6 +265,18 @@ export default {
     ...mapState({ user: state => state.user })
   },
   methods: {
+    settingMarkWork(row) {
+      var url =
+        "/marking/mark_setting_main/" +
+        row.id +
+        "/" +
+        row.examId +
+        "/" +
+        row.name;
+      this.$router.push({
+        path: url
+      });
+    },
     getStatus(code) {
       for (let status of this.statusList) {
         if (status.code == code) {

+ 165 - 32
src/modules/marking/views/MarkWorkOverview.vue

@@ -1,10 +1,41 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['评卷总览', '评卷进度', '进度列表']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
-          <div class="echarts">
+          <div>
+            <el-form
+              :inline="true"
+              :model="markWorkSearchForm"
+              label-position="right"
+              label-width="70px"
+            >
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="评卷名称" class="pull-left">
+                    <el-select
+                      clearable
+                      filterable
+                      class="input"
+                      v-model="markWorkSearchForm.markId"
+                      placeholder="请选择"
+                      @change="searchMarkWork"
+                      @clear="cleanMarkWork"
+                    >
+                      <el-option value>请选择</el-option>
+                      <el-option
+                        v-for="item in markWorkSelect"
+                        :label="item.markName"
+                        :value="item.markId"
+                        :key="item.markId"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </div>
+          <div class="echarts echarts-div">
             <div class="pie"><v-charts :options="pie"></v-charts></div>
             <div class="pie"><v-charts :options="pie1"></v-charts></div>
           </div>
@@ -42,13 +73,6 @@
                     @click="searchSetting"
                     >查询</el-button
                   >
-                  <el-button
-                    size="small"
-                    type="primary"
-                    icon="el-icon-arrow-left"
-                    @click="back"
-                    >返回</el-button
-                  >
                 </el-form-item>
               </el-col>
             </el-row>
@@ -125,31 +149,33 @@
 </template>
 
 <script>
-import { MARKING_API } from "@/constants/constants";
+import { MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import ECharts from "vue-echarts/components/ECharts";
 import "echarts/lib/chart/pie";
-import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   components: {
-    "v-charts": ECharts,
-    LinkTitlesCustom
+    "v-charts": ECharts
   },
   data() {
     return {
       formSearch: {
         courseCode: ""
       },
+      markWorkSearchForm: {
+        markId: ""
+      },
       tableData: [],
       oldData: [],
       currentPage: 1,
       pageSize: 10,
       total: 10,
-      loading: true,
+      loading: false,
       workId: "",
       examId: "",
-      examName: "",
+      markWorkName: "",
       courseList: [],
+      markWorkList: [],
       pie: {
         title: {
           text: "试卷进度情况",
@@ -253,6 +279,88 @@ export default {
     };
   },
   methods: {
+    cleanMarkWork() {
+      //代表清空所有数据列表信息
+      this.pie.series = [
+        {
+          name: "试卷总数:0",
+          type: "pie",
+          radius: "55%",
+          center: ["50%", "60%"],
+          data: [
+            {
+              value: 0,
+              name: "待完成",
+              itemStyle: {
+                normal: {
+                  color: "#FE8463"
+                }
+              }
+            },
+            {
+              value: 0,
+              name: "完成数",
+              itemStyle: {
+                normal: {
+                  color: "#7CB5EC"
+                }
+              }
+            }
+          ],
+          itemStyle: {
+            emphasis: {
+              shadowBlur: 10,
+              shadowOffsetX: 0,
+              shadowColor: "rgba(0, 0, 0, 0.5)"
+            }
+          }
+        }
+      ];
+
+      this.pie1.series = [
+        {
+          name: "课程总数:0",
+          type: "pie",
+          radius: "55%",
+          center: ["50%", "60%"],
+          data: [
+            {
+              value: 0,
+              name: "待完成",
+              itemStyle: {
+                normal: {
+                  color: "#FE8463"
+                }
+              }
+            },
+            {
+              value: 0,
+              name: "完成数",
+              itemStyle: {
+                normal: {
+                  color: "#7CB5EC"
+                }
+              }
+            }
+          ],
+          itemStyle: {
+            emphasis: {
+              shadowBlur: 10,
+              shadowOffsetX: 0,
+              shadowColor: "rgba(0, 0, 0, 0.5)"
+            }
+          }
+        }
+      ];
+      this.courseList = [];
+      this.tableData = [];
+      this.total = 0;
+    },
+    getMarkWorks() {
+      this.$http.get(DATA_PROCESS_API + "/markWorks").then(response => {
+        this.markWorkList = response.data;
+      });
+    },
     getCourses() {
       this.$http
         .get(
@@ -321,11 +429,11 @@ export default {
     courseDetail(row) {
       var url =
         "/marking/course_detail/" +
-        this.$route.params.workId +
+        this.workId +
         "/" +
-        this.$route.params.examId +
+        this.examId +
         "/" +
-        this.$route.params.name +
+        this.markWorkName +
         "/" +
         row.code +
         "/" +
@@ -442,10 +550,22 @@ export default {
           this.loading = false;
         });
     },
-    back() {
-      this.$router.push({
-        path: "/marking/mark_setting_work/overview"
-      });
+    searchMarkWork(val) {
+      if (this.markWorkSearchForm.markId) {
+        let obj = {};
+        for (let item of this.markWorkList) {
+          if (item.id === val) {
+            obj = item;
+            break;
+          }
+        }
+        this.examId = obj.examId;
+        this.markWorkName = obj.name;
+        this.workId = this.markWorkSearchForm.markId;
+        this.doPie();
+        this.initSetting();
+        this.getCourses();
+      }
     }
   },
   computed: {
@@ -457,15 +577,21 @@ export default {
         courseSelect.push({ code: course.code, courseInfo: courseInfo });
       }
       return courseSelect;
+    },
+    markWorkSelect() {
+      let markWorkNames = [];
+      for (let markWork of this.markWorkList) {
+        markWorkNames.push({
+          markId: markWork.id,
+          markName: markWork.name,
+          examId: markWork.examId
+        });
+      }
+      return markWorkNames;
     }
   },
   created() {
-    this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
-    this.examName = this.$route.params.name;
-    this.initSetting();
-    this.doPie();
-    this.getCourses();
+    this.getMarkWorks();
   }
 };
 </script>
@@ -494,8 +620,15 @@ li {
 .echarts {
     display: flex;
 }
-    .pie{
-        width: 450px;
-        height: 350px;
-    }
+.pie{
+    width: 450px;
+    height: 350px;
+    margin-top: 10px;
+    margin-left: 10px
+}
+.echarts-div{
+  border:1px solid #CCC;
+  width: auto;
+  margin-bottom: 10px;
+}
 </style>

+ 53 - 45
src/modules/marking/views/Marker.vue

@@ -1,6 +1,5 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['评卷总览', '评卷员一览', '评卷列表']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
@@ -8,8 +7,25 @@
             :inline="true"
             :model="formSearch"
             label-position="right"
-            label-width="60px"
+            label-width="70px"
           >
+            <el-form-item label="评卷名称" class="pull-left">
+              <el-select
+                clearable
+                filterable
+                class="input"
+                v-model="formSearch.markId"
+                placeholder="请选择"
+              >
+                <el-option value>请选择</el-option>
+                <el-option
+                  v-for="item in markWorkSelect"
+                  :label="item.markName"
+                  :value="item.markId"
+                  :key="item.markId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item label="登录名" class="pull-left">
               <el-input
                 placeholder="登录名"
@@ -30,13 +46,6 @@
                 @click="searchSetting"
                 >查询</el-button
               >
-              <el-button
-                size="small"
-                type="primary"
-                icon="el-icon-arrow-left"
-                @click="back"
-                >返回</el-button
-              >
             </el-form-item>
           </el-form>
 
@@ -107,7 +116,6 @@
 <script>
 import { DATA_PROCESS_API } from "@/constants/constants";
 import { mapState } from "vuex";
-import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   data() {
     return {
@@ -120,15 +128,13 @@ export default {
       currentPage: 1,
       pageSize: 10,
       total: 10,
-      loading: true,
+      loading: false,
       workId: "",
       examId: "",
-      examName: ""
+      markWorkName: "",
+      markWorkList: []
     };
   },
-  components: {
-    LinkTitlesCustom
-  },
   methods: {
     handleSettingCurrentChange(val) {
       this.currentPage = val;
@@ -151,26 +157,20 @@ export default {
       }
       this.tableData = tempData;
     },
-    initSetting() {
-      this.loading = true;
-      this.$http
-        .get(
-          DATA_PROCESS_API +
-            "/markers/all/" +
-            (this.currentPage - 1) +
-            "/" +
-            this.pageSize +
-            "?workId=" +
-            this.workId
-        )
-        .then(response => {
-          console.log(response);
-          this.tableData = response.data.content;
-          this.total = response.data.totalElements;
-          this.loading = false;
-        });
-    },
     searchSetting() {
+      if (!this.formSearch.markId) {
+        return;
+      }
+      let obj = {};
+      for (let item of this.markWorkList) {
+        if (item.id === this.formSearch.markId) {
+          obj = item;
+          break;
+        }
+      }
+      this.examId = obj.examId;
+      this.markWorkName = obj.name;
+      this.workId = this.formSearch.markId;
       this.loading = true;
       this.$http
         .get(
@@ -193,11 +193,11 @@ export default {
     markerDetail(row) {
       var url =
         "/marking/marker_detail/" +
-        this.$route.params.workId +
+        this.workId +
         "/" +
-        this.$route.params.examId +
+        this.examId +
         "/" +
-        this.$route.params.name +
+        this.markWorkName +
         "/" +
         row.userId +
         "/" +
@@ -206,20 +206,28 @@ export default {
         path: url
       });
     },
-    back() {
-      this.$router.push({
-        path: "/marking/mark_setting_work/marker"
+    getMarkWorks() {
+      this.$http.get(DATA_PROCESS_API + "/markWorks").then(response => {
+        this.markWorkList = response.data;
       });
     }
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: state => state.user }),
+    markWorkSelect() {
+      let markWorkNames = [];
+      for (let markWork of this.markWorkList) {
+        markWorkNames.push({
+          markId: markWork.id,
+          markName: markWork.name,
+          examId: markWork.examId
+        });
+      }
+      return markWorkNames;
+    }
   },
   created() {
-    this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
-    this.examName = this.$route.params.name;
-    this.initSetting();
+    this.getMarkWorks();
   }
 };
 </script>

+ 2 - 8
src/modules/marking/views/MarkerDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['评卷总览', '评卷员一览', '评卷列表', '评卷员详情']"
+      :currentPaths="['评卷总览', '评卷员一览', '评卷员详情']"
     />
     <section class="content">
       <div class="box box-info">
@@ -185,13 +185,7 @@ export default {
     },
     back() {
       this.$router.push({
-        path:
-          "/marking/marker/" +
-          this.workId +
-          "/" +
-          this.examId +
-          "/" +
-          this.examName
+        path: "/marking/marker"
       });
     }
   },

+ 1 - 7
src/modules/marking/views/ViewPaper.vue

@@ -37,13 +37,7 @@ export default {
   },
   methods: {
     back() {
-      var url =
-        "/marking/mark_paper_check/" +
-        this.workId +
-        "/" +
-        this.examId +
-        "/" +
-        this.examType;
+      var url = "/marking/mark_paper_check/";
       this.$router.push({
         path: url
       });

+ 3 - 3
src/modules/portal/views/tips/Tips.vue

@@ -183,7 +183,7 @@ const ALL_INSTRUCTIONS = {
       menu2: [
         {
           name: "评卷总览——评卷进度",
-          link: "/marking/mark_setting_work/overview",
+          link: "/marking/mark_work_overview",
           detail: "本次评卷完成进度,可以按卷量、课程进行查询。"
         }
       ]
@@ -193,7 +193,7 @@ const ALL_INSTRUCTIONS = {
       menu2: [
         {
           name: "评卷总览——评卷员一览",
-          link: "/marking/mark_setting_work/marker",
+          link: "/marking/marker",
           detail: "可以按评卷员统计出阅卷量、最高分、最低分、方差等。"
         }
       ]
@@ -203,7 +203,7 @@ const ALL_INSTRUCTIONS = {
       menu2: [
         {
           name: "试卷检查",
-          link: "/marking/mark_setting_work/checking",
+          link: "/marking/mark_paper_check",
           detail:
             "可以查看所有已评卷的结果,并对有疑问的试卷进行打回,让评卷员进行重新给分。"
         }