From f91c4b0c2bd83c9078c0dd92851bd0c831090957 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 15 Feb 2022 17:27:17 +0800
Subject: [PATCH] +保按考试系统,动态提出滚动条,解决1366分辨率题目完成按钮点不到,改签到系统搜索栏和字段位置

---
 src/store/onresize.js                 |   37 +-
 src/views/qiandao/tables.vue          |   54 ++--
 vue.config.js                         |   83 +++---
 src/views/singleperformance/index.vue |   52 ++--
 src/main.js                           |   12 
 src/views/exam/startexam.vue          |  155 +++++++++----
 src/views/qiandao/index.vue           |   16 
 src/store/modules/control.js          |   70 ++++++
 src/styles/element-ui.scss            |    6 
 src/views/qiandao/signIn.vue          |    2 
 src/views/startexam/index.vue         |  114 +++++-----
 11 files changed, 367 insertions(+), 234 deletions(-)

diff --git a/src/main.js b/src/main.js
index d762e2e..52496fd 100644
--- a/src/main.js
+++ b/src/main.js
@@ -5,9 +5,11 @@
 import router from './router/router';
 import './permission'; // 权限
 import './error'; // 日志
-import './cache';//页面缓存
+import './cache'; //页面缓存
 import store from './store';
-import { loadStyle } from './util/util'
+import {
+  loadStyle
+} from './util/util'
 import * as urls from '@/config/env';
 import Element from 'element-ui';
 import {
@@ -55,10 +57,14 @@
 });
 
 Vue.config.productionTip = false;
+// Window.onresize 事件  动态调整窗口
+import "@/store/onresize";
 
-new Vue({
+let myVue = new Vue({
   router,
   store,
   i18n,
   render: h => h(App)
 }).$mount('#app');
+
+export default myVue
diff --git a/src/store/modules/control.js b/src/store/modules/control.js
index 50693d6..5dc9309 100644
--- a/src/store/modules/control.js
+++ b/src/store/modules/control.js
@@ -16,14 +16,80 @@
       total: 0,
       pageSizes: [15, 30, 50, 100],
     },
-    windowWidth: 1025,
+    windowWidth: window.innerWidth,
+    windowHeight: window.innerHeight,
+    tableWindowHeight: window.innerHeight,
+    screenSize: window.screen.width,
+    screenHeight: window.screen.height,
+    updown: true,
   },
   actions: {
+    changeZoom({
+      state,
+      commit,
+      dispatch
+    }, data) {
+      if (window.innerWidth <= 1396 && window.innerHeight <= 798) {
+        // var devicewidth = document.documentElement.clientWidth; //获取当前分辨率下的可是区域宽度
+        // console.log(devicewidth)
+        let devicewidth = 1143;
+        var scale = devicewidth / 1366; // 分母——设计稿的尺寸
+        document.body.style.zoom = scale; //放大缩小相应倍数
+        // console.log("应用1366*768")
+      } else {
+        if (document.body.style.zoom != 1) {
+          document.body.style.zoom = 1;
+          // console.log("还原缩放")
+        }
+      }
+      // return;
+      //监听可视高度
+      Object.defineProperty(state, "tableWindowHeight", {
+        set: function (key, value) {
+          //   //此处拦截了设置请求
+          // window.console.log(key, value, "tableWindowHeight");
+          //获取答题区域subject_main
+          let subject_main = document.querySelector(".subject_main");
+          // console.log(subject_main)
+          //获取卡片区域
+          let exam_card_body = document.querySelector(".exam-card-body");
+          // console.log(subject_exam_title.offsetHeight);
+          //获取标题
+          let subject_exam_title = document.querySelector(".subject-exam-title");
+          // console.log(subject_exam_title);
+          if (subject_main && exam_card_body && subject_exam_title) {
+            let ecbh = exam_card_body.offsetHeight;
+            let seth = subject_exam_title.offsetHeight;
+            console.log(ecbh - seth);
+            subject_main.style.maxHeight = ecbh - seth - 60 + "px";
+          }
+        },
+      });
+      state.tableWindowHeight + 1;
+    },
   },
   mutations: {
     setWindowSize: (state, data) => {
       state.windowWidth = data.innerWidth;
-      // console.log(data)
+      state.windowHeight = data.innerHeight;
+    },
+    setScreenSize(state, data) {
+      state.screenSize = data.w <= 1366 && data.h <= 768 ? 1366 : data.w;
+      state.screenHeight = data.h;
+    },
+    setWindowSizeHeight: (state, data) => {
+      state.tableWindowHeight = data;
+    },
+    setWindowSizeHeightAdd: (state, data) => {
+      setTimeout(() => {
+        if (state.updown) {
+          state.tableWindowHeight += 1;
+          state.updown = false;
+        } else {
+          state.tableWindowHeight -= 1;
+          state.updown = true;
+        }
+      }, 0);
     },
   }
 };
diff --git a/src/store/onresize.js b/src/store/onresize.js
index da66589..436fe75 100644
--- a/src/store/onresize.js
+++ b/src/store/onresize.js
@@ -3,16 +3,21 @@
 
 // 设置 init 函数
 function init() {
-    if (_this) {
-        let innerWH = {
-            innerWidth: window.innerWidth,
-            innerHeight: window.innerHeight,
-        }
-        _this.$store.commit('setWindowSize', innerWH);
-        // console.log(' window.innerWidth', window.innerWidth);
-        // console.log(' window.innerHeight', window.innerHeight);
-
+  if (_this) {
+    let innerWH = {
+      innerWidth: window.innerWidth,
+      innerHeight: window.innerHeight,
     }
+    _this.$store.commit('setWindowSize', innerWH);
+    // console.log(' window.innerWidth', window.innerWidth);
+    // console.log(' window.innerHeight', window.innerHeight);
+    _this.$store.commit("setWindowSizeHeight", innerWH.innerHeight);
+    _this.$store.commit("setScreenSize", {
+      w: window.screen.width,
+      h: window.screen.height
+    });
+    _this.$store.dispatch("changeZoom");
+  }
 }
 
 // 节流 ms 触发间隔毫秒
@@ -20,7 +25,7 @@
 var lastClick = Date.now() - ms;
 // 初始化
 setTimeout(() => {
-    init();
+  init();
 }, 500);
 // 改变窗口大小时重新设置 rem
 // window.onresize = function () {
@@ -31,9 +36,9 @@
 //     }
 // }
 window.addEventListener('resize', () => {
-    // 节流 
-    if (Date.now() - lastClick >= ms) {
-        init();
-        lastClick = Date.now();
-    }
-}, false)
\ No newline at end of file
+  // 节流 
+  if (Date.now() - lastClick >= ms) {
+    init();
+    lastClick = Date.now();
+  }
+}, false)
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index 82be42c..1a275f3 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -200,6 +200,10 @@
             line-height: 26px !important;
             letter-spacing: 0.1rem !important;
         }
+        .subject-options > li label {
+            display: flex;
+            align-items: center;
+        }
     }
     .subject-option-prefix {
         font-size: 24px !important;
@@ -252,7 +256,7 @@
 // }
 
 .avue-crud__search .avue-form__group.avue-form__group--flex .avue-form__menu--center {
-    width: 115px !important;
+    width: 118px !important;
 }
 .avue-crud__search .avue-form__group.avue-form__group--flex .avue-form__row {
     padding: 0 !important;
diff --git a/src/views/exam/startexam.vue b/src/views/exam/startexam.vue
index 0788a05..3c03e56 100644
--- a/src/views/exam/startexam.vue
+++ b/src/views/exam/startexam.vue
@@ -1,10 +1,5 @@
-/*
- * @Author: Morpheus
- * @Date: 2021-07-31 16:31:54
- * @Last Modified by: liu
- * @Last Modified time: 2021-12-13 14:37:49
- * menu-name 考试管理
- */
+/* * @Author: Morpheus * @Date: 2021-07-31 16:31:54 * @Last Modified by: liu *
+@Last Modified time: 2021-12-13 14:37:49 * menu-name 考试管理 */
 <template>
   <!-- <div class="exam">
         <button class="logout" 
@@ -62,7 +57,6 @@
   </div>
 </template>
 
-
 <script>
 import CountDown from "vue2-countdown";
 import { getCurrentTime } from "@/api/exam/examRecord";
@@ -70,7 +64,7 @@
 import {
   getExamDetail,
   getNowTime,
-  calculations,
+  calculations
 } from "@/api/examapi/examination";
 import { updateApplyStatus } from "@/api/examapi/applyexam";
 import moment from "moment";
@@ -78,11 +72,11 @@
   messageSuccess,
   messageFail,
   messageWarn,
-  isNotEmpty,
+  isNotEmpty
 } from "@/util/util";
 export default {
   components: {
-    CountDown,
+    CountDown
   },
   data() {
     return {
@@ -100,16 +94,16 @@
         span: 8,
         data: [
           {
-            list: [],
-          },
-        ],
-      },
+            list: []
+          }
+        ]
+      }
     };
   },
   computed: {
     ...mapState({
-      userInfo: (state) => state.user.userInfo,
-    }),
+      userInfo: state => state.user.userInfo
+    })
   },
   mounted() {
     //获取数据
@@ -118,12 +112,12 @@
   },
   methods: {
     //继续考试时间
-    countDownS_c: function () {
+    countDownS_c: function() {
       // console.log(12112);
       messageSuccess(this, "请继续考试");
       // this.startTime = this.getCurrentTimes();
     },
-    countDownE_c: function () {
+    countDownE_c: function() {
       messageWarn(this, "考试结束123");
       this.overExam();
       //   this.disableSubmit = true;
@@ -134,7 +128,7 @@
       this.$confirm("是否退出系统, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       }).then(() => {
         this.$store.dispatch("LogOut").then(() => {
           this.$router.push({ path: "/login" });
@@ -149,7 +143,7 @@
         console.log(that.resData);
         that.$router.push({
           path: `/startexam/${that.resData.scoreId}`,
-          query: that.resData,
+          query: that.resData
         });
         return;
       }
@@ -157,7 +151,7 @@
       if (this.isTime == 3) {
         this.$message({
           type: "warning",
-          message: "未到考试时间!",
+          message: "未到考试时间!"
         });
         return;
       }
@@ -165,7 +159,7 @@
       if (this.isTime == 1) {
         this.$message({
           type: "warning",
-          message: "已过考试时间!",
+          message: "已过考试时间!"
         });
         return;
       }
@@ -176,7 +170,7 @@
         examType: this.resData.examType,
         examId: this.resData.id,
         userId: this.userInfo.user_id,
-        candidateNo: this.resData.candidateNo,
+        candidateNo: this.resData.candidateNo
       };
       // this.$notify({
       //   message:
@@ -187,7 +181,7 @@
       //   // type: "warning",
       // });
       // return;
-      updateApplyStatus(data).then((res) => {
+      updateApplyStatus(data).then(res => {
         that.resData["examScoreId"] = res.data.id;
         this.$store.commit("SetScoreId", res.data.id);
         // console.log(res.data.id, "ididididiidididididid");
@@ -197,12 +191,12 @@
             "考试期间切勿退出登入、关闭浏览器, 否则考试成绩无效, 如有问题及时联系管理人员!",
           duration: 6000,
           showClose: false,
-          customClass: "beginS",
+          customClass: "beginS"
           // type: "warning",
         });
         that.$router.push({
           path: `/startexam/${that.resData.id}`,
-          query: that.resData,
+          query: that.resData
         });
       });
     },
@@ -215,36 +209,36 @@
             color: color,
             isExam: isExam,
             subtext: subtext,
-            click: function () {
+            click: function() {
               window.parent.startExam();
             },
             list: [
               {
                 title: "姓名:     ",
                 value: that.resData.realName,
-                check: true,
+                check: true
               },
               {
                 title: "准考证号:    ",
                 value: that.resData.candidateNo,
-                check: true,
+                check: true
               },
               {
                 title: "身份证号:     ",
                 value: that.resData.idCardNo,
-                check: true,
+                check: true
               },
               {
                 title: "性别:     ",
                 value: that.sex,
-                check: true,
-              },
-            ],
-          },
+                check: true
+              }
+            ]
+          }
         ];
         that.$store.commit("SetexamUserData", that.option.data[0]);
       };
-      var duibiTime = function (newTime, oldTime) {
+      var duibiTime = function(newTime, oldTime) {
         var newYear = newTime.split(" ")[0],
           newDat = newTime.split(" ")[1],
           oldYear = oldTime.split(" ")[0],
@@ -255,12 +249,12 @@
           let newD = {
             s: +newDat.split(":")[0],
             f: +newDat.split(":")[1],
-            m: +newDat.split(":")[2],
+            m: +newDat.split(":")[2]
           };
           let oldD = {
             s: +oldDat.split(":")[0],
             f: +oldDat.split(":")[1],
-            m: +oldDat.split(":")[2],
+            m: +oldDat.split(":")[2]
           };
           if (newD.s - oldD.s > 1) {
             return false;
@@ -280,10 +274,10 @@
       };
 
       var data = {
-        userId:this.userInfo.user_id
-      }
+        userId: this.userInfo.user_id
+      };
       getExamDetail(data).then(
-        (res) => {
+        res => {
           that.resData = res.data.data[0];
 
           var data = res.data.data[0];
@@ -293,7 +287,7 @@
             startD = new Date(data.startTime),
             //考试截止时间
             endD = new Date(data.endTime);
-          getNowTime().then((res) => {
+          getNowTime().then(res => {
             nowD = new Date(res.data.data);
             //对比时间
             //getTime() 方法可返回距 1970 年 1 月 1 日之间的毫秒数。
@@ -321,7 +315,7 @@
               setData({ color: "success", subtext: "继续考试", isExam: 3 });
               const currentTimeSTART = moment(data.examStartTime);
               const currentSTART = currentTimeSTART.valueOf();
-              getCurrentTime().then((response) => {
+              getCurrentTime().then(response => {
                 that.currentTime = currentSTART;
                 that.startTime = currentSTART;
                 var listTime = duibiTime(
@@ -348,7 +342,7 @@
           });
         },
 
-        (error) => {
+        error => {
           window.console.log(error);
         }
       );
@@ -360,17 +354,17 @@
         confirmButtonText: "确定",
         callback: () => {
           calculations(scoreId)
-            .then((response) => {
+            .then(response => {
               messageSuccess(that, "提交成功");
               if (response) {
                 that.$store.commit("DEL_TAG", that.$store.state.tags.tag);
                 var obj = {
                   userId: that.userInfo.user_id,
-                  examId: that.$route.query.id,
+                  examId: that.$route.query.id
                 };
                 that.$router.push({
                   path: `/singleperformance/index`,
-                  query: obj,
+                  query: obj
                 });
               }
             })
@@ -378,10 +372,10 @@
               that.disableSubmit = false;
               messageFail(that, "提交题目失败");
             });
-        },
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss">
@@ -410,8 +404,63 @@
   position: relative;
   //   top: -20px;
 }
-//最终
 .startexam {
+  //登入页面样式
+  // border: 1px solid red;
+  width: calc(100% - 100px);
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  .startexam_heard {
+    font-size: 34px;
+    color: rgb(240, 114, 29);
+    margin-bottom: 5%;
+    // position: absolute;
+    // top: 10%;
+  }
+  .startexam_main {
+    width: 960px;
+    height: 300px;
+    // border: 1px solid red;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    background-color: #fff;
+    box-shadow: 0px 0px 5px 3px rgba($color: #797979, $alpha: 0.2);
+    .s_m_img {
+      width: 50%;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      img {
+        width: 90%;
+        height: 90%;
+      }
+    }
+    .s_m_value {
+      width: 50%;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+      div {
+        width: 90%;
+        height: 15%;
+        font-size: 17px;
+        .s_m_v_title {
+          display: inline-block;
+          width: 100px;
+        }
+      }
+    }
+  }
+}
+//最终
+.startexamOld {
   // width: 100%;
   // height: 100%;
   // border: 1px solid red;
@@ -426,8 +475,8 @@
   .startexam_heard {
     font-size: 34px;
     color: rgb(240, 114, 29);
-    position: relative;
-    top: -10%;
+    position: absolute;
+    top: 10%;
   }
   .startexam_main {
     width: 960px;
diff --git a/src/views/qiandao/index.vue b/src/views/qiandao/index.vue
index dadbced..54b1890 100644
--- a/src/views/qiandao/index.vue
+++ b/src/views/qiandao/index.vue
@@ -43,21 +43,21 @@
     return {
       tabs: "",
       userName: "",
-      activeName: "first",
+      activeName: "first"
     };
   },
   components: {
     tables,
     forms,
-    signIn,
+    signIn
   },
   computed: {
-    ...mapGetters(["userInfo"]),
+    ...mapGetters(["userInfo"])
   },
   watch: {
     userInfo() {
       // console.log(userInfo);
-    },
+    }
   },
   mounted() {
     this.userName = this.userInfo.account;
@@ -70,15 +70,15 @@
       this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
         confirmButtonText: this.$t("submitText"),
         cancelButtonText: this.$t("cancelText"),
-        type: "warning",
+        type: "warning"
       }).then(() => {
         this.$store.dispatch("LogOut").then(() => {
           resetRouter();
           this.$router.push({ path: "/login" });
         });
       });
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss">
@@ -153,4 +153,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>
diff --git a/src/views/qiandao/signIn.vue b/src/views/qiandao/signIn.vue
index bdc0840..5604d3c 100644
--- a/src/views/qiandao/signIn.vue
+++ b/src/views/qiandao/signIn.vue
@@ -97,7 +97,7 @@
             prop: "idCardNo",
             search: true,
             searchSpan: 9,
-            searchLabelWidth: 85,
+            searchLabelWidth: 90,
             // searchRange: true,
             // searchValue: this.getuserid(),
             width: 180
diff --git a/src/views/qiandao/tables.vue b/src/views/qiandao/tables.vue
index d960313..e7017f7 100644
--- a/src/views/qiandao/tables.vue
+++ b/src/views/qiandao/tables.vue
@@ -55,7 +55,7 @@
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 0,
+        total: 0
       },
       query: {},
       data: [],
@@ -93,30 +93,30 @@
             search: true,
             searchSpan: 5,
             searchLabelWidth: 45,
-            width: 70,
+            width: 70
           },
           {
             label: "公司",
             prop: "deptName",
             search: true,
             searchSpan: 6,
-            searchLabelWidth: 45,
+            searchLabelWidth: 45
           },
           {
             label: "身份证号码",
             prop: "idCardNo",
             search: true,
             searchSpan: 8,
-            searchLabelWidth: 80,
+            searchLabelWidth: 90,
             // searchRange: true,
             // searchValue: this.getuserid(),
-            width: 180,
-          },
+            width: 180
+          }
         ],
         delBtn: false,
         editBtn: false,
-        addBtn: false,
-      },
+        addBtn: false
+      }
     };
   },
   computed: {
@@ -125,8 +125,8 @@
       "cardInfor",
       "permission",
       "haveCardid",
-      "useZhiWen",
-    ]),
+      "useZhiWen"
+    ])
     // permissionList() {
     //   return {
     //     addBtn: this.vaildData(this.permission.notice_add, false),
@@ -146,12 +146,12 @@
         this.onLoad(
           this.page,
           {
-            idCardNo: this.cardInfor.id,
+            idCardNo: this.cardInfor.id
           },
           "shibie"
         );
       }
-    },
+    }
   },
   mounted() {
     // let dom = document.getElementsByClassName("el-table--small");
@@ -167,7 +167,7 @@
     //   console.log("不刷新");
     // }
     let t = this;
-    window.addEventListener("resize", function () {
+    window.addEventListener("resize", function() {
       t.resetHeight();
     });
     t.resetHeight();
@@ -264,13 +264,13 @@
     },
     getZhiwen(row) {
       let that = this;
-      getZhiwen(row.userId).then((res) => {
+      getZhiwen(row.userId).then(res => {
         // console.log(res);
         let zhiwen = {
           featuredatas: res.data.data.myPicture,
           imgBMP: res.data.data.fingerprint,
           // url: row.fingerprint,
-          isoks: false,
+          isoks: false
         };
         if (
           zhiwen.featuredatas != "" &&
@@ -300,9 +300,9 @@
         registered: row.registered,
         fingerprint: row.fingerprint,
         myPicture: row.myPicture,
-        candidateNo: row.candidateNo,
+        candidateNo: row.candidateNo
       };
-      upData(b).then((res) => {
+      upData(b).then(res => {
         const data = res.data;
         // console.log(data);
         if (data.code == 200) {
@@ -310,12 +310,12 @@
           this.$confirm("签到成功!", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "指纹采集",
-            type: "success",
+            type: "success"
           })
             .then(() => {
               this.$message({
                 type: "success",
-                message: "请继续放入身份证进行识别!",
+                message: "请继续放入身份证进行识别!"
               });
               this.$store.commit("setIsClears", true);
               // this.$store.commit("setCardidState", false);
@@ -335,7 +335,7 @@
               // });
               this.$message({
                 type: "success",
-                message: "请采集指纹并点击更新进行签到!",
+                message: "请采集指纹并点击更新进行签到!"
               });
             });
         } else {
@@ -439,10 +439,10 @@
     refreshChange() {
       this.onLoad(this.page, this.query);
     },
-    msg: function (type, msg) {
+    msg: function(type, msg) {
       this.$message({
         message: msg,
-        type: type,
+        type: type
       });
     },
     onLoad(page, params = {}, shibie) {
@@ -460,7 +460,7 @@
         this.page.total = 0;
         return;
       }
-      getList(page.currentPage, page.pageSize, values).then((res) => {
+      getList(page.currentPage, page.pageSize, values).then(res => {
         // console.log(res);
         const data = res.data.data;
         this.page.total = data.total;
@@ -473,7 +473,7 @@
               featuredatas: "",
               imgBMP: "",
               url: "",
-              isoks: false,
+              isoks: false
             };
             this.useZhiWen("setZhiwenData", zhiwen);
           } else if (data.total == 1) {
@@ -486,7 +486,7 @@
               featuredatas: "",
               imgBMP: "",
               url: "",
-              isoks: false,
+              isoks: false
             };
             this.useZhiWen("setZhiwenData", zhiwen);
             this.msg("warning", "查询出多人,请选择对应人员更新!");
@@ -494,8 +494,8 @@
         }
         this.loading = false;
       });
-    },
-  },
+    }
+  }
 };
 </script>
 
diff --git a/src/views/singleperformance/index.vue b/src/views/singleperformance/index.vue
index 17d8196..463594f 100644
--- a/src/views/singleperformance/index.vue
+++ b/src/views/singleperformance/index.vue
@@ -1,10 +1,5 @@
-/*
- * @Author: Morpheus
- * @Date: 2021-08-02 09:31:54
- * @Last Modified by: liu
- * @Last Modified time: 2021-10-09 17:13:00
- * menu-name 成绩管理
- */
+/* * @Author: Morpheus * @Date: 2021-08-02 09:31:54 * @Last Modified by: liu *
+@Last Modified time: 2021-10-09 17:13:00 * menu-name 成绩管理 */
 <template>
   <div class="exam-end">
     <!-- <button class="logout" 
@@ -80,7 +75,7 @@
       paddWord: "",
       UserData: window.localStorage.getItem("useInfo")
         ? JSON.parse(window.localStorage.getItem("useInfo"))
-        : "",
+        : ""
     };
   },
   created() {
@@ -88,12 +83,12 @@
   },
   computed: {
     ...mapState({
-      examUserData: (state) => state.exam.examUserData,
-      scoreId: (state) =>
+      examUserData: state => state.exam.examUserData,
+      scoreId: state =>
         state.exam.scoreId
           ? state.exam.scoreId
-          : window.localStorage.getItem("scoreId"),
-    }),
+          : window.localStorage.getItem("scoreId")
+    })
   },
   mounted() {
     //获取考试成绩
@@ -106,7 +101,7 @@
       this.$confirm("是否退出系统, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       }).then(() => {
         this.$store.dispatch("LogOut").then(() => {
           this.$router.push({ path: "/login" });
@@ -117,9 +112,9 @@
       var data = {
         // userId: this.$route.query.userId,
         // examId: this.$route.query.examId,
-        id: this.scoreId,
+        id: this.scoreId
       };
-      getExamScore(data).then((res) => {
+      getExamScore(data).then(res => {
         if (res.data.data.theoryGrade != undefined) {
           this.score = res.data.data.theoryGrade;
         }
@@ -136,43 +131,49 @@
           this.$message({
             showClose: true,
             message: "密码错误!请联系管理员",
-            type: "warning",
+            type: "warning"
           });
           return;
         }
-        reselfExamScore(this.scoreId).then((res) => {
+        reselfExamScore(this.scoreId).then(res => {
           if ((res.data.success = true)) {
             this.$message({
               showClose: true,
               message: "重置成功,返回主页重新点击开始考试!",
-              type: "success",
+              type: "success"
             });
             this.paddWord = "";
             this.$router.push({
-              path: `/exam/startexam`,
+              path: `/exam/startexam`
             });
           } else {
             this.$message({
               showClose: true,
               message: "重置错误!请联系管理员",
-              type: "warning",
+              type: "warning"
             });
           }
         });
       } else {
         this.dialogVisible = true;
       }
-    },
-  },
+    }
+  }
 };
 </script>
 
 <style lang="scss" scoped>
 .exam-end {
+  // width: calc(100% - 100px);
+  // height: 89%;
+  // margin: 2.5% 50px;
+  // background-color: rgba($color: #fff, $alpha: 1);
+  // display: flex;
+  // align-items: center;
+  // justify-content: center;
+  // flex-direction: column;
   width: calc(100% - 100px);
-  height: 89%;
-  margin: 2.5% 50px;
-  background-color: rgba($color: #fff, $alpha: 1);
+  height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
@@ -187,6 +188,7 @@
     width: 960px;
     height: 300px;
     // border: 1px solid red;
+    background-color: #fff;
     display: flex;
     align-items: center;
     justify-content: space-between;
diff --git a/src/views/startexam/index.vue b/src/views/startexam/index.vue
index 3ed2ac3..dcb1029 100644
--- a/src/views/startexam/index.vue
+++ b/src/views/startexam/index.vue
@@ -100,12 +100,9 @@
                       "
                       >完成考试 {{ time }}</el-button
                     > -->
-                      <el-button
-                        type="success"
-                        @click="submitExam"
-                        :disabled="subjectIndex != 60"
-                        >完成考试 {{ time }}</el-button
-                      >
+                      <el-button type="success" @click="submitExam"
+                        >完成考试 {{ time }}
+                      </el-button>
                     </div>
                   </div>
                 </div>
@@ -140,9 +137,9 @@
                   v-for="(value, index) in subjectIds"
                   :style="{ background: value.color, color: value.fontColor }"
                   :key="index"
+                  @click="toSubject(value.everyID, value.type, index)"
                   >&nbsp;{{ index + 1 }}&nbsp;</el-button
                 >
-                <!-- @click="toSubject(value.everyID, value.type, index)" -->
               </el-row>
             </el-dialog>
           </div>
@@ -164,7 +161,7 @@
   messageSuccess,
   messageFail,
   messageWarn,
-  isNotEmpty,
+  isNotEmpty
 } from "@/util/util";
 import Tinymce from "@/components/Tinymce";
 import Choices from "@/components/Subjects/Choices";
@@ -184,7 +181,7 @@
     Choices,
     MultipleChoices,
     PracticalOperation,
-    Judgement,
+    Judgement
     // ShortAnswer,
   },
   data() {
@@ -203,7 +200,7 @@
         examRecordId: undefined,
         subjectId: undefined,
         userId: undefined,
-        type: 0,
+        type: 0
       },
       subject: {},
       answer: "",
@@ -230,7 +227,7 @@
 
         remark: "全国计算机统考练习题10道",
 
-        newRecord: false,
+        newRecord: false
       },
       firstFlag: true,
       times: ["30", "00"],
@@ -238,20 +235,20 @@
       timeOTiv: null,
       timesIT: true,
       timesITValue: 0,
-      first: true,
+      first: true
     };
   },
   computed: {
     ...mapState({
-      userInfo: (state) => state.user.userInfo,
-      scoreId: (state) =>
+      userInfo: state => state.user.userInfo,
+      scoreId: state =>
         state.exam.scoreId
           ? state.exam.scoreId
-          : window.localStorage.getItem("scoreId"),
+          : window.localStorage.getItem("scoreId")
     }),
     time() {
       var d = [+this.times[0], +this.times[1]];
-    },
+    }
   },
   created() {
     var useInfo = this.$store.state.exam.examUserData;
@@ -293,12 +290,12 @@
     }
   },
   methods: {
-    countDownS_cb: function () {
+    countDownS_cb: function() {
       // console.log(12456);
       messageSuccess(this, "考试开始");
       this.startTime = this.getCurrentTimes();
     },
-    countDownE_cb: function () {
+    countDownE_cb: function() {
       messageWarn(this, "考试结束");
       //   this.disableSubmit = true;
       // this.submitExam("over");
@@ -306,7 +303,7 @@
     bottonControl(time) {
       //倒计时循环
       let times = time * 60;
-      var setTime = function (time) {
+      var setTime = function(time) {
         let a, b, d;
         a = parseInt(time / 60);
         b = time - a * 60;
@@ -314,35 +311,35 @@
         return d;
       };
       if (this.timeOTiv == null) {
-        this.timeOTiv = setInterval((res) => {
+        this.timeOTiv = setInterval(res => {
           times--;
           this.timesITValue = setTime(times);
         }, 1000);
       } else {
         clearTimeout(this.timeOTiv);
         this.timeOTiv = null;
-        this.timeOTiv = setInterval((res) => {
+        this.timeOTiv = setInterval(res => {
           times--;
           this.timesITValue = setTime(times);
         }, 1000);
       }
       //倒计时定时
       if (this.timeOut == null) {
-        this.timeOut = setTimeout((res) => {
+        this.timeOut = setTimeout(res => {
           this.timesIT = false;
           this.timesITValue--;
         }, time * 3600);
       } else {
         clearTimeout(this.timeOut);
         this.timeOut = null;
-        this.timeOut = setTimeout((res) => {
+        this.timeOut = setTimeout(res => {
           this.timesIT = false;
         }, time * 3600);
       }
     },
     validateExamTime() {
       getCurrentTime()
-        .then((response) => {
+        .then(response => {
           // console.log(response, 7777);
           const currentTime = moment(response.data.data);
           if (currentTime.isAfter(this.exam.endTime)) {
@@ -384,7 +381,7 @@
       //   this.endTime = current + 60 * 60 * 1000;
       // }
       if (!this.first) {
-        getSubjectRefresh(scoreId).then((obj) => {
+        getSubjectRefresh(scoreId).then(obj => {
           const objs = obj.data.data;
           // console.log(objs, "objobjobjobjobjobj");
           const subjectData = objs.examSubjectChoicesVOSList;
@@ -401,7 +398,7 @@
                 score: subjectData[i].score,
                 color: "#fff",
                 fontColor: "#000",
-                title: subjectData[i].subjectName,
+                title: subjectData[i].subjectName
               });
             }
 
@@ -441,7 +438,7 @@
                     for (var k = 0; k < ans.length; k++) {
                       anw.push({
                         key: k + 1,
-                        value: ans[k],
+                        value: ans[k]
                       });
                     }
                     this.subjectIds[i].answer = anw;
@@ -456,7 +453,7 @@
             //适应时间
             const datyTime = objs.examScore.examTime;
             // console.log(objs, "datyTimedatyTimedatyTime");
-            var duibiTime = function (newTime, oldTime) {
+            var duibiTime = function(newTime, oldTime) {
               var newYear = newTime.split(" ")[0],
                 newDat = newTime.split(" ")[1],
                 oldYear = oldTime.split(" ")[0],
@@ -467,12 +464,12 @@
                 let newD = {
                   s: +newDat.split(":")[0],
                   f: +newDat.split(":")[1],
-                  m: +newDat.split(":")[2],
+                  m: +newDat.split(":")[2]
                 };
                 let oldD = {
                   s: +oldDat.split(":")[0],
                   f: +oldDat.split(":")[1],
-                  m: +oldDat.split(":")[2],
+                  m: +oldDat.split(":")[2]
                 };
                 if (newD.s - oldD.s > 1) {
                   return false;
@@ -512,7 +509,7 @@
       // 获取题目ID列表
       // console.log("subjectResponsesubjectResponsesubjectResponse");
       getSubjectIds(scoreId)
-        .then((subjectResponse) => {
+        .then(subjectResponse => {
           const subjectData = subjectResponse.data.data;
           // console.log(
           //   subjectResponse,
@@ -530,7 +527,7 @@
                 answer: "",
                 score: subjectData[i].score,
                 color: "#fff",
-                fontColor: "#000",
+                fontColor: "#000"
               });
             }
 
@@ -542,9 +539,9 @@
             this.updateSubjectIndex();
             // 获取当前题目信息
             getSubjectResultInfo({
-              id: this.subjectIds[0].everyID,
+              id: this.subjectIds[0].everyID
             })
-              .then((response) => {
+              .then(response => {
                 if (isNotEmpty(response.data.data)) {
                   response.data.data.answer = "";
                   this.setSubjectInfo(response.data.data);
@@ -592,7 +589,7 @@
           if (this.getAnswer() == "") {
             this.$message({
               message: "请选择答案",
-              type: "warning",
+              type: "warning"
             });
             return;
           }
@@ -615,7 +612,7 @@
             if (!goShiCao) {
               this.$message({
                 message: "实操题目请选择完整顺序!",
-                type: "warning",
+                type: "warning"
               });
               return;
             }
@@ -655,7 +652,7 @@
       var str = "";
 
       if (Array.isArray(answerData)) {
-        answerData.forEach((item) => {
+        answerData.forEach(item => {
           str += item.value + ",";
         });
 
@@ -668,10 +665,10 @@
         id: nextSubjectId,
         preSubJectId: this.query.subjectId,
         preResult: answerData,
-        scoreId: this.scoreId,
+        scoreId: this.scoreId
       };
       getSubjectResultInfo(data)
-        .then((response) => {
+        .then(response => {
           if (response.data.data !== null) {
             // 保存成功后更新答题卡状态
             const subject = response.data.data;
@@ -703,17 +700,20 @@
             }
 
             this.setSubjectInfo(subject);
-            // console.log(subject);
+            console.log(subject);
+            this.$store.commit("setWindowSizeHeightAdd");
+
             // store.dispatch('SetSubjectInfo', subject).then(() => { })
           }
           // 更新时间
-          getCurrentTime().then((response) => {
+          getCurrentTime().then(response => {
             this.subjectStartTime = moment(response.data.data);
           });
           this.endLoading(nextType);
         })
-        .catch((error) => {
+        .catch(error => {
           console.log(error);
+          this.$store.commit("setWindowSizeHeightAdd");
           messageFail(this, "获取题目失败");
           this.endLoading(nextType);
         });
@@ -723,10 +723,10 @@
       this.startLoading(nextType);
 
       var data = {
-        id: nextSubjectId,
+        id: nextSubjectId
       };
       getSubjectResultInfo(data)
-        .then((response) => {
+        .then(response => {
           if (response.data.data !== null) {
             // 保存成功后更新答题卡状态
             const subject = response.data.data;
@@ -760,12 +760,12 @@
             // store.dispatch('SetSubjectInfo', subject).then(() => { })
           }
           // 更新时间
-          getCurrentTime().then((response) => {
+          getCurrentTime().then(response => {
             this.subjectStartTime = moment(response.data.data);
           });
           this.endLoading(nextType);
         })
-        .catch((error) => {
+        .catch(error => {
           console.log(error);
           messageFail(this, "获取题目失败");
           this.endLoading(nextType);
@@ -833,7 +833,7 @@
       this.$confirm("确定要提交吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           this.disableSubmit = true;
@@ -853,7 +853,7 @@
         examTime: this.startTime,
         papersId: this.$route.query.id,
         examEndTime: this.getCurrentTimes(),
-        examResultVOS: null,
+        examResultVOS: null
       };
       var arr = [];
       console.log(this.subjectIds);
@@ -867,7 +867,7 @@
           if (item.answer.length > 0) {
             //如果是数组
             if (item.answer instanceof Array) {
-              item.answer.forEach((it) => {
+              item.answer.forEach(it => {
                 if (it.value != "") {
                   str += it.value + ",";
                 }
@@ -878,13 +878,13 @@
               arr.push({
                 subjectChoicesId: item.everyID,
                 value: a,
-                grade: item.score,
+                grade: item.score
               });
             } else {
               arr.push({
                 subjectChoicesId: item.everyID,
                 value: item.answer,
-                grade: item.score,
+                grade: item.score
               });
             }
           }
@@ -892,7 +892,7 @@
           arr.push({
             subjectChoicesId: item.everyID,
             value: item.answer,
-            grade: item.score,
+            grade: item.score
           });
         }
       }
@@ -903,17 +903,17 @@
       // console.log(obj.examResultVOS, 789);
 
       saveAndNext(obj)
-        .then((response) => {
+        .then(response => {
           messageSuccess(this, "提交成功");
           if (response) {
             this.$store.commit("DEL_TAG", this.$store.state.tags.tag);
             var obj = {
               userId: this.userInfo.user_id,
-              examId: this.$route.query.id,
+              examId: this.$route.query.id
             };
             this.$router.push({
               path: `/singleperformance/index`,
-              query: obj,
+              query: obj
             });
           }
         })
@@ -1048,8 +1048,8 @@
           console.error(error);
         }
       }
-    },
-  },
+    }
+  }
 };
 </script>
 
diff --git a/vue.config.js b/vue.config.js
index 4b43a45..74f6103 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,43 +1,44 @@
 module.exports = {
-    //路径前缀
-    publicPath: "/",
-    lintOnSave: true,
-    productionSourceMap: false,
-    chainWebpack: (config) => {
-        //忽略的打包文件
-        config.externals({
-            'vue': 'Vue',
-            'vue-router': 'VueRouter',
-            'vuex': 'Vuex',
-            'axios': 'axios',
-            'element-ui': 'ELEMENT',
-        });
-        const entry = config.entry('app');
-        entry.add('babel-polyfill').end();
-        entry.add('classlist-polyfill').end();
-        entry.add('@/mock').end();
-    },
-    css: {
-        extract: {
-            ignoreOrder: true
-        }
-    },
-    //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
-    devServer: {
-        port: 1888,
-        proxy: {
-            '/api': {
-                //本地服务接口地址
-                // target: 'http://192.168.0.114:81',
-                target: 'http://localhost:81',
-                // target: 'http://172.20.10.2:81',
-                //远程演示服务地址,可用于直接启动项目
-                // target: 'http://2h3f861221.wicp.vip:58646',
-                ws: true,
-                pathRewrite: {
-                    '^/api': '/'
-                }
-            }
-        }
+  //路径前缀
+  publicPath: "/",
+  lintOnSave: true,
+  productionSourceMap: false,
+  chainWebpack: (config) => {
+    //忽略的打包文件
+    config.externals({
+      'vue': 'Vue',
+      'vue-router': 'VueRouter',
+      'vuex': 'Vuex',
+      'axios': 'axios',
+      'element-ui': 'ELEMENT',
+    });
+    const entry = config.entry('app');
+    entry.add('babel-polyfill').end();
+    entry.add('classlist-polyfill').end();
+    entry.add('@/mock').end();
+  },
+  css: {
+    extract: {
+      ignoreOrder: true
     }
-};
\ No newline at end of file
+  },
+  //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
+  devServer: {
+    port: 1888,
+    proxy: {
+      '/api': {
+        //本地服务接口地址
+        // target: 'http://192.168.0.114:81',
+        // target: 'http://localhost:81',
+        // target: 'http://172.20.10.2:81',
+        target: 'http://223.82.109.183:2080/api',
+        //远程演示服务地址,可用于直接启动项目
+        // target: 'http://2h3f861221.wicp.vip:58646',
+        ws: true,
+        pathRewrite: {
+          '^/api': '/'
+        }
+      }
+    }
+  }
+};

--
Gitblit v1.9.3