Browse Source

Merge branch 'master' of http://124.70.43.205:3000/GYEE_R.D/exam

chenminghua 1 year ago
parent
commit
51521b8571

+ 1 - 0
exam-06173-vue/package.json

@@ -15,6 +15,7 @@
     "babel-plugin-dynamic-import-node": "^2.3.3",
     "clipboard": "^2.0.4",
     "cos-js-sdk-v5": "^1.2.16",
+    "devtools-detector": "^2.0.14",
     "docx-preview": "^0.1.14",
     "dropzone": "5.5.1",
     "echarts": "^4.7.0",

+ 1 - 0
exam-06173-vue/redeme.md

@@ -0,0 +1 @@
+采用node 12版本运行

+ 5 - 0
exam-06173-vue/src/App.vue

@@ -1,13 +1,18 @@
 <template>
   <div id="app">
     <router-view />
+    <!-- <event-control></event-control> -->
   </div>
 </template>
 
 <script>
+// import eventControl from '@/components/EventControl'
 import { Message } from "element-ui";
 export default {
   name: "App",
+  components: {
+    // eventControl
+  },
   watch: {
     $route(r) {
       if (window.__MODE__.showPagePath) {

+ 1 - 1
exam-06173-vue/src/components/Captcha/index.vue

@@ -71,7 +71,7 @@ export default {
       deep: true
     }
   },
-  created() {
+  mounted() {
     this.postForm = this.value
     this.changeCode()
   },

+ 26 - 12
exam-06173-vue/src/components/EventControl/index.vue

@@ -3,7 +3,7 @@
 </template>
 
 <script>
-
+import { addListener, launch } from 'devtools-detector';
 export default {
   name: 'EventControl',
   data() {
@@ -37,18 +37,32 @@ export default {
     // 禁用F12
     document.addEventListener('keydown', this.keyListener)
 
-    // 检查是否打开控制台
-    this.checkTimer = setInterval(() => {
-      if (window.outerWidth - window.innerWidth > this.threshold ||
-        window.outerHeight - window.innerHeight > this.threshold) {
-        // 如果打开控制台,则刷新页面
-        // window.location.reload()
-        this.$message.warning('不允许使用调试模式,系统将在3秒后跳转到首页!')
-        setTimeout(() => {
-          window.location.href = '/'
-        }, 3000)
+    // // 检查是否打开控制台
+    // this.checkTimer = setInterval(() => {
+    //   if (window.outerWidth - window.innerWidth > this.threshold ||
+    //     window.outerHeight - window.innerHeight > this.threshold) {
+    //     // 如果打开控制台,则刷新页面
+    //     // window.location.reload()
+    //     this.$message.warning('不允许使用调试模式,系统将在3秒后跳转到首页!')
+    //     setTimeout(() => {
+    //       window.location.href = '/'
+    //     }, 3000)
+    //   }
+    // }, 3000)
+
+    // 1. add listener
+    addListener(
+      isOpen => {
+        if (isOpen) {
+          this.$message.warning('不允许使用调试模式,系统将在3秒后跳转到首页!')
+          setTimeout(() => {
+            window.location.href = '/'
+          }, 3000)
+        }
       }
-    }, 3000)
+    )
+    // 2. launch detect
+    launch()
   },
   beforeDestroy() {
     // 还原右键

+ 3 - 2
exam-06173-vue/src/layout/components/Navbar.vue

@@ -97,6 +97,7 @@ export default {
         type: 'info'
       }).then(() => {
         that.$store.dispatch('user/logout').then(() => {
+          sessionStorage.clear()
           that.$router.push('/login')
         })
       }).catch(() => {
@@ -208,7 +209,7 @@ export default {
       margin-right: 30px;
 
       .avatar-wrapper {
-        margin-top: 5px;
+        margin-top: 2px;
         position: relative;
 
         .user-avatar {
@@ -222,7 +223,7 @@ export default {
           cursor: pointer;
           position: absolute;
           right: -20px;
-          top: 25px;
+          top: 18px;
           font-size: 12px;
         }
       }

+ 1 - 1
exam-06173-vue/src/views/web/course/components/ReadCheck.vue

@@ -106,7 +106,7 @@ export default {
     // 初始化定时器
     initTimer() {
       // 10秒时间来确认
-      this.stopSec = this.timeSec + 30
+      this.stopSec = this.timeSec + 600
 
       this.checkTimer = setInterval(() => {
         if (this.goSec >= this.timeSec && !this.dialogVisible) {

+ 46 - 1
exam-06173-vue/src/views/web/course/list.vue

@@ -138,6 +138,8 @@ import DicListSelect from "@/components/DicListSelect";
 import DetailLink from "@/components/DetailLink";
 import WebTable from "@/components/WebTable";
 import DicCatalogTree from "../../../components/DicTreeSelect";
+import { post } from '@/utils/request'
+import { checkProcess } from "@/api/paper/exam";
 
 export default {
   name: "UserCourseList",
@@ -163,15 +165,58 @@ export default {
         // 列表请求URL
         listUrl: "/api/course/course/user-paging",
       },
+      unlearn: sessionStorage.unlearn || 'false'
     };
   },
 
-  created() {},
+  created() {
+    this.funGetCourse()
+  },
   methods: {
     tabClick(tab) {
       this.listQuery.params.learnState = tab.name;
       this.$refs.pagingTable.getList();
     },
+    funGetCourse() {
+      if (this.unlearn === 'true') {
+        return false
+      } else {
+        sessionStorage.setItem('unlearn', 'true')
+      }
+      post(this.options.listUrl, {
+        current: 1,
+        size: 10,
+        params: {
+          onlyLearn: this.onlyLearn,
+          learnState: '1'
+        },
+        t: Date.now()
+      }).then(res => {
+        console.log(res)
+        if (res.code === 0) {
+          if (res.data && res.data.records && res.data.records.length) {
+            this.$message.warning('您有未学习的课程, 请注意!')
+          }
+        }
+      })
+      post('/api/exam/exam/online-paging', {
+        current: 1,
+        size: 999,
+        params: {
+          examType: ''
+        },
+        t: Date.now()
+      }).then(res => {
+        if (res.code === 0) {
+          if (res.data && res.data.records && res.data.records.length) {
+            const checkTryCount = res.data.records.every(o => o.tryCount>0)
+            if (!checkTryCount) {
+              this.$message.warning('您有未参加的考试, 请注意!')
+            }
+          }
+        }
+      })
+    },
 
     // 课程详情
     handelView(courseId) {