Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

WANG 6 yıl önce
ebeveyn
işleme
b255110389

+ 1 - 0
src/modules/marking/views/MarkPaperCheck.vue

@@ -21,6 +21,7 @@
                 placeholder="请选择"
                 filterable
                 style="width:150px;"
+                @focus="e => getSpecialtyList4Search(e.target.value)"
               >
                 <el-option label="请选择" value></el-option>
                 <el-option

+ 0 - 158
src/modules/oe/component/examSummaryLine.vue

@@ -1,158 +0,0 @@
-<template>
-  <div><v-chart :options="options" /></div>
-</template>
-<script>
-import ECharts from "vue-echarts/components/ECharts";
-import "echarts/lib/chart/pie";
-import "echarts/lib/component/polar";
-import "echarts/lib/component/tooltip";
-import "echarts/lib/component/title";
-import "echarts/lib/chart/bar";
-import "echarts/lib/chart/line";
-export default {
-  props: ["examId"],
-  components: {
-    "v-chart": ECharts
-  },
-  data() {
-    return { options: {} };
-  },
-  methods: {
-    getData() {
-      if (!this.examId) {
-        return;
-      }
-      this.$http
-        .get(
-          "/api/ecs_oe_admin/exam/student/courseProgress/list?examId=" +
-            this.examId +
-            "&isForChart=true"
-        )
-        .then(response => {
-          debugger;
-          var resp = response.data;
-          resp.sort(function(a, b) {
-            if (b["completedProportion"] != a["completedProportion"]) {
-              return b["completedProportion"] - a["completedProportion"];
-            } else if (b["allNum"] != a["allNum"]) {
-              return b["allNum"] - a["allNum"];
-            } else {
-              return b["completedNum"] - a["completedNum"];
-            }
-          });
-
-          var campusCount = 5;
-          var courseProgressDataList = [];
-          //找出5个完成比例最高的
-          if (resp.length >= campusCount) {
-            courseProgressDataList = resp.slice(0, campusCount);
-          } else {
-            courseProgressDataList = resp;
-          }
-          var xAxisData = [];
-          var seriesBar = {
-            name: "计划数",
-            type: "bar",
-            data: []
-          };
-          var seriesLine1 = {
-            name: "完成数",
-            type: "line",
-            data: []
-          };
-          var seriesLine2 = {
-            name: "完成比(%)",
-            type: "line",
-            data: []
-          };
-          var yAxis_maxScale1 = 0;
-          for (var i = 0; i < courseProgressDataList.length; i++) {
-            xAxisData.push(courseProgressDataList[i].courseName);
-            seriesBar.data.push(courseProgressDataList[i].allNum);
-            seriesLine1.data.push(courseProgressDataList[i].completedNum);
-            seriesLine2.data.push(
-              courseProgressDataList[i].completedProportion
-            );
-            if (courseProgressDataList[i].allNum > yAxis_maxScale1) {
-              yAxis_maxScale1 = courseProgressDataList[i].allNum;
-            }
-          }
-          var optionData = {
-            legendData: ["计划数", "完成数", "完成比(%)"],
-            xAxis: { data: xAxisData },
-            series: [seriesBar, seriesLine1, seriesLine2],
-            yAxis_maxScale1
-          };
-          this.buildOptions(optionData);
-        });
-    },
-    buildOptions(optionData) {
-      var colors = ["#FE8463", "#66CCFF", "#675bba"];
-      this.options = {
-        color: colors,
-        tooltip: {
-          trigger: "axis",
-          axisPointer: {
-            type: "cross",
-            crossStyle: {
-              color: "#999"
-            }
-          }
-        },
-        toolbox: {
-          feature: {
-            dataView: { show: true, readOnly: false },
-            magicType: { show: true, type: ["line", "bar"] },
-            restore: { show: true },
-            saveAsImage: { show: true }
-          }
-        },
-        legend: {
-          data: optionData.legendData
-        },
-        xAxis: [
-          {
-            type: "category",
-            data: optionData.xAxis.data,
-            axisPointer: {
-              type: "shadow"
-            }
-          }
-        ],
-        yAxis: [
-          {
-            type: "value",
-            name: "人次",
-            min: 0,
-            max: optionData.yAxis_maxScale1,
-            interval: 10000,
-            axisLabel: {
-              formatter: "{value} "
-            }
-          },
-          {
-            type: "value",
-            name: "完成比例",
-            min: 0,
-            max: 100,
-            interval: 20,
-            axisLabel: {
-              formatter: "{value} %"
-            }
-          }
-        ],
-        series: optionData.series
-      };
-    }
-  },
-  watch: {
-    examId: function(newData) {
-      if (newData) {
-        this.getData();
-      }
-    }
-  },
-  created() {}
-};
-</script>
-<style></style>

+ 0 - 96
src/modules/oe/component/examSummaryPie.vue

@@ -1,96 +0,0 @@
-<template>
-  <div><v-chart :options="options" /></div>
-</template>
-<script>
-import ECharts from "vue-echarts/components/ECharts";
-import "echarts/lib/chart/pie";
-import "echarts/lib/component/polar";
-import "echarts/lib/component/tooltip";
-import "echarts/lib/component/title";
-import "echarts/lib/component/legend";
-import "echarts/lib/component/legendScroll";
-export default {
-  props: ["examId"],
-  components: {
-    "v-chart": ECharts
-  },
-  data() {
-    return { options: {} };
-  },
-  methods: {
-    getData() {
-      if (!this.examId) {
-        return;
-      }
-      this.$http
-        .post(
-          "/api/ecs_oe_admin/exam/student/statistic/by/finished?examId=" +
-            this.examId
-        )
-        .then(response => {
-          var resp = response.data;
-          debugger;
-          var optionData = {
-            title: "考试人次:" + (resp.finished + resp.unFinished),
-            legendData: [
-              "未完成:" + resp.unFinished,
-              "已完成:" + resp.finished
-            ],
-            seriesData: [
-              { name: "未完成:" + resp.unFinished, value: resp.unFinished },
-              { name: "已完成:" + resp.finished, value: resp.finished }
-            ]
-          };
-          this.buildOptions(optionData);
-        });
-    },
-    buildOptions(data) {
-      var colors = ["#7CB5EC", "#FE8463"];
-      this.options = {
-        color: colors,
-        title: {
-          text: data.title,
-          subtext: "",
-          x: "left"
-        },
-        tooltip: {
-          trigger: "item",
-          formatter: "{b}人次<br/>占比:{d}%"
-        },
-        legend: {
-          type: "scroll",
-          orient: "vertical",
-          right: 150,
-          bottom: 100,
-          data: data.legendData
-        },
-        series: [
-          {
-            name: "",
-            type: "pie",
-            radius: "50%",
-            center: ["32%", "50%"],
-            data: data.seriesData,
-            itemStyle: {
-              emphasis: {
-                shadowBlur: 10,
-                shadowOffsetX: 0,
-                shadowColor: "rgba(0, 0, 0, 0.5)"
-              }
-            }
-          }
-        ]
-      };
-    }
-  },
-  watch: {
-    examId: function(newData) {
-      if (newData) {
-        this.getData();
-      }
-    }
-  },
-  created() {}
-};
-</script>
-<style></style>

+ 18 - 3
src/modules/oe/views/examScheduling.vue

@@ -195,6 +195,7 @@
           title="上传作答"
           v-loading="uploadAnswerDialogLoading"
           :visible.sync="uploadAnswerDialogVisible"
+          @closed="cleanOfflineFile"
         >
           <el-form>
             <el-form-item label="选择文件"
@@ -202,7 +203,9 @@
                 type="file"
                 accept="application/pdf,application/zip"
                 id="importFile"
+                ref="offlineFileInput"
                 @change="uploadAnswerChange"
+                v-bind:class="{ offline_file: offlineAnswerFile }"
               />
               <div>温馨提示:仅支持pdf和zip文件,文件大小请不要超过30M!</div>
             </el-form-item>
@@ -362,7 +365,9 @@ export default {
           if (response.data) {
             var examRecordList = response.data;
             if (examRecordList && examRecordList.length > 0) {
-              window.open("/preview_paper/" + examRecordList[0].basePaperId);
+              window.open(
+                "/admin/preview_paper/" + examRecordList[0].basePaperId
+              );
             } else {
               this.$message({
                 message: "该考生未参加考试",
@@ -473,15 +478,22 @@ export default {
           });
           this.uploadAnswerDialogVisible = false;
           this.uploadAnswerDialogLoading = false;
+          this.$refs.offlineFileInput.value = "";
+          this.offlineAnswerFile = "";
         })
-        .catch(error => {
-          console.log(error);
+        .catch(() => {
           this.$message({
             message: "上传失败",
             type: "error"
           });
           this.uploadAnswerDialogLoading = false;
+          this.$refs.offlineFileInput.value = "";
+          this.offlineAnswerFile = "";
         });
+    },
+    cleanOfflineFile() {
+      this.$refs.offlineFileInput.value = "";
+      this.offlineAnswerFile = "";
     }
   },
   created() {}
@@ -499,5 +511,8 @@ export default {
   cursor: pointer;
   color: #409eff;
 }
+.offline_file {
+  color: blue;
+}
 </style>
 <style scoped src="../style/common.css"></style>

+ 192 - 7
src/modules/oe/views/examSummary.vue

@@ -30,11 +30,11 @@
       <el-row :gutter="2">
         <el-col :span="10" class="chart-border">
           <div class="chart-header">考试进度情况</div>
-          <examSummaryPie :examId="examId"></examSummaryPie>
+          <div><v-chart :options="pieOptions" /></div>
         </el-col>
         <el-col :span="14" class="chart-border">
           <div class="chart-header">课程完成进度TOP5</div>
-          <examSummaryLine :examId="examId"></examSummaryLine>
+          <div><v-chart :options="lineOptions" /></div>
         </el-col>
       </el-row>
       <el-row style="margin-top:10px;">
@@ -176,10 +176,17 @@
 </template>
 <script>
 import { mapState } from "vuex";
-import examSummaryPie from "../component/examSummaryPie.vue";
-import examSummaryLine from "../component/examSummaryLine.vue";
+import ECharts from "vue-echarts/components/ECharts";
+import "echarts/lib/component/legend";
+import "echarts/lib/component/legendScroll";
+import "echarts/lib/chart/pie";
+import "echarts/lib/component/polar";
+import "echarts/lib/component/tooltip";
+import "echarts/lib/component/title";
+import "echarts/lib/chart/bar";
+import "echarts/lib/chart/line";
 export default {
-  components: { examSummaryPie, examSummaryLine },
+  components: { "v-chart": ECharts },
   data() {
     return {
       examList: [],
@@ -190,7 +197,9 @@ export default {
       courseId: "",
       activeName: "first",
       orgExamInfos: [],
-      courseProgressList: []
+      courseProgressList: [],
+      lineOptions: {},
+      pieOptions: {}
     };
   },
   computed: {
@@ -203,7 +212,7 @@ export default {
       }
       this.$http
         .get("/api/ecs_exam_work/exam/queryByNameLike", {
-          params: { name: examName }
+          params: { name: examName, examTypes: "ONLINE#OFFLINE" }
         })
         .then(response => {
           this.examList = response.data;
@@ -256,6 +265,7 @@ export default {
         .then(response => {
           if (response.data && response.data.length > 0) {
             this.courseProgressList = response.data;
+            this.buildLine(response.data);
           } else {
             this.courseProgressList = [];
           }
@@ -281,9 +291,184 @@ export default {
         });
     },
     changeExam() {
+      this.getPieData();
       this.getCourses();
       this.getOrgExamInfos();
       this.getCourseProgress();
+    },
+    getPieData() {
+      if (!this.examId) {
+        return;
+      }
+      this.$http
+        .post(
+          "/api/ecs_oe_admin/exam/student/statistic/by/finished?examId=" +
+            this.examId
+        )
+        .then(response => {
+          var resp = response.data;
+          var optionData = {
+            title: "考试人次:" + (resp.finished + resp.unFinished),
+            legendData: [
+              "未完成:" + resp.unFinished,
+              "已完成:" + resp.finished
+            ],
+            seriesData: [
+              { name: "未完成:" + resp.unFinished, value: resp.unFinished },
+              { name: "已完成:" + resp.finished, value: resp.finished }
+            ]
+          };
+          this.buildPieOptions(optionData);
+        });
+    },
+    buildPieOptions(data) {
+      var colors = ["#7CB5EC", "#FE8463"];
+      this.pieOptions = {
+        color: colors,
+        title: {
+          text: data.title,
+          subtext: "",
+          x: "left"
+        },
+        tooltip: {
+          trigger: "item",
+          formatter: "{b}人次<br/>占比:{d}%"
+        },
+        legend: {
+          type: "scroll",
+          orient: "vertical",
+          right: 200,
+          top: 30,
+          data: data.legendData
+        },
+        series: [
+          {
+            name: "",
+            type: "pie",
+            radius: "50%",
+            center: ["30%", "60%"],
+            data: data.seriesData,
+            itemStyle: {
+              emphasis: {
+                shadowBlur: 10,
+                shadowOffsetX: 0,
+                shadowColor: "rgba(0, 0, 0, 0.5)"
+              }
+            }
+          }
+        ]
+      };
+    },
+    buildLine(courseProgressList) {
+      courseProgressList.sort(function(a, b) {
+        if (b["completedProportion"] != a["completedProportion"]) {
+          return b["completedProportion"] - a["completedProportion"];
+        } else if (b["allNum"] != a["allNum"]) {
+          return b["allNum"] - a["allNum"];
+        } else {
+          return b["completedNum"] - a["completedNum"];
+        }
+      });
+
+      var campusCount = 5;
+      var courseProgressDataList = [];
+      //找出5个完成比例最高的
+      if (courseProgressList.length >= campusCount) {
+        courseProgressDataList = courseProgressList.slice(0, campusCount);
+      } else {
+        courseProgressDataList = courseProgressList;
+      }
+      var xAxisData = [];
+      var seriesBar = {
+        name: "计划数",
+        type: "bar",
+        data: []
+      };
+      var seriesLine1 = {
+        name: "完成数",
+        type: "line",
+        data: []
+      };
+      var seriesLine2 = {
+        name: "完成比(%)",
+        type: "line",
+        data: []
+      };
+      var yAxis_maxScale1 = 0;
+      for (var i = 0; i < courseProgressDataList.length; i++) {
+        xAxisData.push(courseProgressDataList[i].courseName);
+        seriesBar.data.push(courseProgressDataList[i].allNum);
+        seriesLine1.data.push(courseProgressDataList[i].completedNum);
+        seriesLine2.data.push(courseProgressDataList[i].completedProportion);
+        if (courseProgressDataList[i].allNum > yAxis_maxScale1) {
+          yAxis_maxScale1 = courseProgressDataList[i].allNum;
+        }
+      }
+      var optionData = {
+        legendData: ["计划数", "完成数", "完成比(%)"],
+        xAxis: { data: xAxisData },
+        series: [seriesBar, seriesLine1, seriesLine2],
+        yAxis_maxScale1
+      };
+      this.buildLineOptions(optionData);
+    },
+    buildLineOptions(optionData) {
+      var colors = ["#FE8463", "#66CCFF", "#675bba"];
+      this.lineOptions = {
+        color: colors,
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "cross",
+            crossStyle: {
+              color: "#999"
+            }
+          }
+        },
+        toolbox: {
+          feature: {
+            dataView: { show: true, readOnly: false },
+            magicType: { show: true, type: ["line", "bar"] },
+            restore: { show: true },
+            saveAsImage: { show: true }
+          }
+        },
+        legend: {
+          data: optionData.legendData
+        },
+        xAxis: [
+          {
+            type: "category",
+            data: optionData.xAxis.data,
+            axisPointer: {
+              type: "shadow"
+            }
+          }
+        ],
+        yAxis: [
+          {
+            type: "value",
+            name: "人次",
+            min: 0,
+            max: optionData.yAxis_maxScale1,
+            interval: 10000,
+            axisLabel: {
+              formatter: "{value} "
+            }
+          },
+          {
+            type: "value",
+            name: "完成比例",
+            min: 0,
+            max: 100,
+            interval: 20,
+            axisLabel: {
+              formatter: "{value} %"
+            }
+          }
+        ],
+        series: optionData.series
+      };
     }
   },
   created() {

+ 1 - 1
src/modules/questions/views/EditPaper.vue

@@ -55,7 +55,7 @@
             上传音频文件
           </el-button>
           <el-button @click="back" size="small" type="primary"
-            ><i class="el-icon-arrow-left"></i> 退回</el-button
+            ><i class="el-icon-arrow-left"></i> 回</el-button
           >
         </div>
       </div>

+ 12 - 18
src/modules/questions/views/EditSelectQuestion.vue

@@ -148,10 +148,10 @@
             <el-col :xs="3" :sm="3" :md="3" :lg="3">
               <el-form-item>
                 <el-button
-                  type="info"
+                  type="primary"
                   @click="insertProperty"
                   style="margin-left:-30px;"
-                  >新增属性</el-button
+                  ><i class="el-icon-plus"></i> 新增属性</el-button
                 >
               </el-form-item>
             </el-col>
@@ -205,8 +205,7 @@
               type="primary"
               icon="caret-left"
               @click="backToQuesList()"
-            >
-              返回列表
+              ><i class="el-icon-arrow-left"></i> 返回列表
             </el-button>
           </el-form-item>
         </el-form>
@@ -376,9 +375,9 @@ export default {
         )
         .then(() => {
           this.fullscreenLoading = false;
-          this.$message({
+          this.$notify({
             type: "info",
-            message: `保存成功`
+            message: "保存成功"
           });
           this.$router.push({ path: "/questions/question_list/0" });
         })
@@ -578,23 +577,18 @@ export default {
         return false;
       }
       return true;
-    },
+    }
+  },
+  computed: {
     answer() {
       if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
         return this.singleRightAnswer;
       } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
-        return this.multipleRightAnswer.sort().toString();
+        var obj = this.multipleRightAnswer;
+        return obj.sort().toString();
       }
-    }
-  },
-  computed: {
-    // answer: function() {
-    //   if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
-    //     return this.singleRightAnswer;
-    //   } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
-    //     return this.multipleRightAnswer.sort().toString();
-    //   }
-    // },
+      return this.quesModel.quesAnswer;
+    },
     saveDisabled: function() {
       if (!this.questionId && this.quesModel.quesOptions.length == 0) {
         return true;

+ 10 - 6
src/modules/questions/views/ExtractPaperInfo.vue

@@ -540,7 +540,8 @@ export default {
               this.loading = false;
               this.$notify({ type: "success", message: "保存成功" });
               this.$router.push({
-                path: "/index/extract_paper_rule/" + this.extractConfig.examId
+                path:
+                  "/questions/extract_paper_rule/" + this.extractConfig.examId
               });
             },
             response => {
@@ -579,7 +580,6 @@ export default {
     },
     //校验调卷规则数据
     verificationData() {
-      debugger;
       let myExamPaperList = [];
       let examPaperList = this.examPaperList;
       for (let i = 0; i < examPaperList.length; i++) {
@@ -608,8 +608,10 @@ export default {
             break;
           } else {
             //$(".errorMsg_" + i + "_" + j).hide();
-            document.getElementById("errorMsg_" + i + "_" + j).style.display =
-              "none";
+            if (document.getElementById("errorMsg_" + i + "_" + j)) {
+              document.getElementById("errorMsg_" + i + "_" + j).style.display =
+                "none";
+            }
           }
           var reg = /^([1]?\d{1,2})$/;
           if (
@@ -627,8 +629,10 @@ export default {
             break;
           } else {
             //$(".errorMsg_" + i + "_" + j).hide();
-            document.getElementById("errorMsg_" + i + "_" + j).style.display =
-              "none";
+            if (document.getElementById("errorMsg_" + i + "_" + j)) {
+              document.getElementById("errorMsg_" + i + "_" + j).style.display =
+                "none";
+            }
             weightCount += parseInt(_paperInfoList[j].weight);
             selectedPaperIds.push(_paperInfoList[j].paper.id);
             myExamPaperList.push({

+ 11 - 8
src/modules/questions/views/InsertPaperTitle.vue

@@ -48,7 +48,11 @@
                 >
                 </el-option>
               </el-select>
-              <el-button type="info" @click="insertPaper">新增试卷</el-button>
+              <span style="padding-left:5px;">
+                <el-button type="primary" @click="insertPaper"
+                  ><i class="el-icon-plus"></i> 新增试卷</el-button
+                >
+              </span>
             </el-form-item>
           </el-row>
           <el-row v-if="paperDetailDisable">
@@ -100,30 +104,29 @@
         </el-form>
 
         <!-- 添加试卷弹出框 -->
-        <el-dialog title="新增试卷" v-model="paperDialog" size="tiny">
+        <el-dialog title="新增试卷" :visible.sync="paperDialog" width="500px">
           <el-form
-            :inline="true"
             :model="paperForm"
             ref="paperForm"
             :rules="rules"
             label-position="right"
-            label-width="90px"
+            label-width="120px"
+            inline-message
           >
             <el-row>
               <el-form-item label="试卷名称" label-width="120px" prop="name">
                 <el-input
-                  class="pull_length"
+                  class="dialog_input_width"
                   v-model="paperForm.name"
-                  auto-complete="off"
                   placeholder="请输入试卷名称"
                 ></el-input>
               </el-form-item>
             </el-row>
-            <el-row class="pull_center">
+            <el-row class="margin_top_10 margin_left_120">
               <el-button type="primary" @click="submitPaperForm('paperForm')"
                 >保 存</el-button
               >
-              <el-button type="danger" @click="resetPaperForm('paperForm')"
+              <el-button @click="resetPaperForm('paperForm')"
                 ><i class="el-icon-refresh"></i> 重 置</el-button
               >
             </el-row>