SanHQin 2 tháng trước cách đây
mục cha
commit
b5ded67ca2
40 tập tin đã thay đổi với 454 bổ sung37 xóa
  1. 0 0
      dist/index.html
  2. 1 1
      dist/report.html
  3. 0 0
      dist/static/css/chunk-22ca305b.d2be54bb.css
  4. 0 0
      dist/static/css/chunk-4ab42e4a.01fa89b1.css
  5. 0 1
      dist/static/css/chunk-5542237d.b9d00ab7.css
  6. 0 0
      dist/static/css/chunk-55e3fa90.2e9f9d7f.css
  7. 0 0
      dist/static/css/chunk-60b2ab15.b68785a5.css
  8. 1 0
      dist/static/css/chunk-65f085a8.469bfcd7.css
  9. 0 1
      dist/static/css/chunk-6b5e1f52.b7038e93.css
  10. 0 0
      dist/static/css/chunk-75202293.1fa5d21f.css
  11. 0 0
      dist/static/css/chunk-793d7e56.e80602a0.css
  12. 1 0
      dist/static/css/chunk-8d8468b2.7e3df26d.css
  13. 0 0
      dist/static/css/chunk-9771956a.995e130f.css
  14. 0 0
      dist/static/js/app.1c85c568.js
  15. 0 0
      dist/static/js/app.b716c27f.js
  16. 0 0
      dist/static/js/chunk-07b980da.1b24e096.js
  17. 0 0
      dist/static/js/chunk-212a8cf7.a4fda349.js
  18. 0 0
      dist/static/js/chunk-22ca305b.25c396ce.js
  19. 0 0
      dist/static/js/chunk-2a8fbba6.354d8b41.js
  20. 0 0
      dist/static/js/chunk-4ab42e4a.0d37341e.js
  21. 0 0
      dist/static/js/chunk-5542237d.b8d9fcee.js
  22. 0 0
      dist/static/js/chunk-55e3fa90.e8fece2f.js
  23. 0 0
      dist/static/js/chunk-60b2ab15.588d9f12.js
  24. 0 0
      dist/static/js/chunk-65f085a8.2b7efcea.js
  25. 0 0
      dist/static/js/chunk-6a21acd5.85161a3a.js
  26. 0 0
      dist/static/js/chunk-6b5e1f52.c10deea1.js
  27. 0 0
      dist/static/js/chunk-75202293.be4e8422.js
  28. 0 0
      dist/static/js/chunk-793d7e56.9caa73d9.js
  29. 0 0
      dist/static/js/chunk-87a128fc.154fde0c.js
  30. 0 0
      dist/static/js/chunk-8d8468b2.c1d7b090.js
  31. 0 0
      dist/static/js/chunk-9771956a.155cc898.js
  32. 0 0
      dist/static/js/chunk-ae47d3da.d4ec0293.js
  33. 0 0
      dist/static/js/chunk-d2934c8e.54b402a0.js
  34. 7 16
      src/components/sweepPage.vue
  35. 5 5
      src/store/modules/user.js
  36. 253 0
      src/views/testDetail/components/punchQRcode.vue
  37. 20 3
      src/views/testDetail/components/sweep.vue
  38. 35 7
      src/views/testDetail/components/topic.vue
  39. 77 3
      src/views/testDetail/index.vue
  40. 54 0
      src/views/testDetail/preview.vue

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/report.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/css/chunk-22ca305b.d2be54bb.css


+ 0 - 0
dist/static/css/chunk-2a8fbba6.01fa89b1.css → dist/static/css/chunk-4ab42e4a.01fa89b1.css


+ 0 - 1
dist/static/css/chunk-5542237d.b9d00ab7.css

@@ -1 +0,0 @@
-.navTitle[data-v-4e39bdca]{font-size:.42667rem;color:#fff}.home-container[data-v-4e39bdca]{height:100vh;overflow:hidden}.home-container .step_box[data-v-4e39bdca]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-4e39bdca]{width:100%;margin:0 auto}.home-container .edit_top[data-v-4e39bdca] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

+ 0 - 0
dist/static/css/chunk-87a128fc.2e9f9d7f.css → dist/static/css/chunk-55e3fa90.2e9f9d7f.css


+ 0 - 0
dist/static/css/chunk-61229b5a.c1320d08.css → dist/static/css/chunk-60b2ab15.b68785a5.css


+ 1 - 0
dist/static/css/chunk-65f085a8.469bfcd7.css

@@ -0,0 +1 @@
+.navTitle[data-v-145042b7]{font-size:.42667rem;color:#fff}.home-container[data-v-145042b7]{height:100vh;overflow:hidden}.home-container .step_box[data-v-145042b7]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-145042b7]{width:100%;margin:0 auto}.home-container .edit_top[data-v-145042b7] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

+ 0 - 1
dist/static/css/chunk-6b5e1f52.b7038e93.css

@@ -1 +0,0 @@
-.navTitle[data-v-2423d447]{font-size:.42667rem;color:#fff}.home-container[data-v-2423d447]{height:100vh;overflow:hidden}.home-container .step_box[data-v-2423d447]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-2423d447]{width:100%;margin:0 auto}.home-container .edit_top[data-v-2423d447] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

+ 0 - 0
dist/static/css/chunk-6a21acd5.1fa5d21f.css → dist/static/css/chunk-75202293.1fa5d21f.css


+ 0 - 0
dist/static/css/chunk-5f369096.4bacebab.css → dist/static/css/chunk-793d7e56.e80602a0.css


+ 1 - 0
dist/static/css/chunk-8d8468b2.7e3df26d.css

@@ -0,0 +1 @@
+.navTitle[data-v-0fb3e726]{font-size:.42667rem;color:#fff}.home-container[data-v-0fb3e726]{height:100vh;overflow:hidden}.home-container .step_box[data-v-0fb3e726]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-0fb3e726]{width:100%;margin:0 auto}.home-container .edit_top[data-v-0fb3e726] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

+ 0 - 0
dist/static/css/chunk-67c4ee97.995e130f.css → dist/static/css/chunk-9771956a.995e130f.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/app.1c85c568.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/app.b716c27f.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-07b980da.1b24e096.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-212a8cf7.a4fda349.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-22ca305b.25c396ce.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-2a8fbba6.354d8b41.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-4ab42e4a.0d37341e.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-5542237d.b8d9fcee.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-55e3fa90.e8fece2f.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-60b2ab15.588d9f12.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-65f085a8.2b7efcea.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-6a21acd5.85161a3a.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-6b5e1f52.c10deea1.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-75202293.be4e8422.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-793d7e56.9caa73d9.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-87a128fc.154fde0c.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-8d8468b2.c1d7b090.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-9771956a.155cc898.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-ae47d3da.d4ec0293.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/static/js/chunk-d2934c8e.54b402a0.js


+ 7 - 16
src/components/sweepPage.vue

@@ -47,6 +47,9 @@ export default {
   methods: {
     open() {
       this.show = true
+      // setTimeout(()=>{
+      //   this.$emit('success', "功能测试2503261429")
+      // },1000)
     },
     close() {
       clearInterval(this.timer)
@@ -57,26 +60,14 @@ export default {
       // this.$toast(result)
     },
     async onInit(promise) {
-      const { capabilities } = await promise
-
-      const TORCH_IS_SUPPORTED = !!capabilities.torch
       try {
+        const { capabilities } = await promise
+        const TORCH_IS_SUPPORTED = !!capabilities.torch
+        console.log('TORCH_IS_SUPPORTED',TORCH_IS_SUPPORTED)
         await promise
       } catch (error) {
+        this.$emit('error',error)
         this.close()
-        if (error.name === 'NotAllowedError') {
-          this.$toast.fail('您需要授予相机访问权限')
-        } else if (error.name === 'NotFoundError') {
-          this.$toast.fail('这个设备上没有摄像头')
-        } else if (error.name === 'NotSupportedError') {
-          this.$toast.fail('所需的安全上下文(HTTPS、本地主机)')
-        } else if (error.name === 'NotReadableError') {
-          this.$toast.fail('相机被占用')
-        } else if (error.name === 'OverconstrainedError') {
-          this.$toast.fail('安装摄像头不合适')
-        } else if (error.name === 'StreamApiNotSupportedError') {
-          this.$toast.fail('此浏览器不支持流API')
-        }
       }
     }
   }

+ 5 - 5
src/store/modules/user.js

@@ -76,11 +76,11 @@ const actions = {
           resolve(_user.userid)
         })
         .catch(error => {
-          // var _user = { userid: '6c56ec0e-2c74-11ef-bee5-005056b86db5' }
-          // commit('SET_ID', _user.userid)
-          // setToken(_user.userid)
-          // resolve(_user.userid)
-          reject(error)
+          var _user = { userid: '6c56ec0e-2c74-11ef-bee5-005056b86db5' }
+          commit('SET_ID', _user.userid)
+          setToken(_user.userid)
+          resolve(_user.userid)
+          // reject(error)
         })
     })
   },

+ 253 - 0
src/views/testDetail/components/punchQRcode.vue

@@ -0,0 +1,253 @@
+<template>
+  <div class="c_box">
+    <div class="choice_box">
+      <div class="title" style="display: flex;">
+        <span style="min-width: fit-content;">{{ tindex + 1 + '、' }}</span>
+        <span>{{ checkJson.title }}</span>
+      </div>
+      <div
+        class="detail"
+        v-if="checkJson.detail"
+        v-html="checkJson.detail"
+        style="color: #00000099;margin-top: 5px;"
+      ></div>
+
+			<div
+        class="detail"
+        v-if="checkJson.answer2 && typeof checkJson.answer2=='string'"
+        v-html="checkJson.answer2"
+        style="color: #000000;margin-top: 5px;"
+      ></div>
+
+      <div class="choices">
+        <el-button type="primary" size="small" @click="sweepBtn">扫一扫</el-button>
+      </div>
+    </div>
+		<sweepPage ref="sweepPageRef" @success="sweepSuccess" @error="sweepError"/>
+  </div>
+</template>
+
+<script>
+import sweepPage from '@/components/sweepPage.vue';
+export default {
+  props: {
+    tindex: {
+      type: Number
+    },
+    cJson: {
+      type: Object
+    },
+    checktype: {
+      type: Number,
+      default: 1
+    },
+    see: {
+      type: Boolean,
+      default: false
+    }
+  },
+	components:{
+		sweepPage
+	},
+  data() {
+    return {
+      option: {
+        1: { name: '附件' }
+      },
+      userid: this.$route.query.userid,
+      checkJson: {
+				title:"",
+				detail:""
+			},
+    }
+  },
+  watch: {
+    checkJson: {
+      handler(newValue) {
+        this.$emit('update:cJson', newValue)
+      },
+      deep: true
+    }
+  },
+  methods: {
+    depthCopy(s) {
+      return JSON.parse(JSON.stringify(s))
+    },
+		sweepBtn(){
+			this.$refs.sweepPageRef.open();
+		},
+		sweepSuccess(result){
+      let _valueAndTime = this.extractValueAndTime(result);
+
+      if(!_valueAndTime)return this.$toast.fail("扫码的格式不正确");
+
+      //判断当前时间和扫码时间是否超过设置的时间
+      if(_valueAndTime.time){
+        let currentTime = new Date().getTime(); // 获取当前时间戳
+		    let checkTime = new Date(_valueAndTime.time).getTime(); // 获取_valueAndTime.time的时间戳
+		    let minutes = parseInt(this.checkJson.minutes); // 获取minutes对象
+
+		    if ((currentTime - checkTime) > minutes * 60 * 1000) {
+		    	// 超过指定分钟数的逻辑处理
+		    	this.$toast.fail("该二维码已失效")
+		    } else {
+		    	// 在限制时间内的逻辑处理
+		    	this.checkJson.answer2 = _valueAndTime.value;
+          this.checkJson.codeScanningTime = _valueAndTime.time;
+		    }
+      }
+      console.log(_valueAndTime)
+			// this.checkJson.answer2 = result;
+			this.$refs.sweepPageRef.close();
+		},
+    sweepError(error){
+      if (error.name === 'NotAllowedError') {
+          this.$toast.fail('您需要授予相机访问权限')
+        } else if (error.name === 'NotFoundError') {
+          this.$toast.fail('这个设备上没有摄像头')
+        } else if (error.name === 'NotSupportedError') {
+          this.$toast.fail('所需的安全上下文(HTTPS、本地主机)')
+        } else if (error.name === 'NotReadableError') {
+          this.$toast.fail('相机被占用')
+        } else if (error.name === 'OverconstrainedError') {
+          this.$toast.fail('安装摄像头不合适')
+        } else if (error.name === 'StreamApiNotSupportedError') {
+          this.$toast.fail('此浏览器不支持流API')
+        }else{
+          this.$toast.fail(error.name)
+        }
+    },
+    extractValueAndTime(inputStr) {
+      try {
+        // 1. 同时提取前缀文本和时间数字(格式:前缀 + 10位数字)
+        const match = inputStr.match(/^(.*?)(\d{10})$/);
+        if (!match || match[2].length !== 10) {
+          throw new Error("格式无效:需以10位数字结尾");
+        }
+
+        const [full, value, timeStr] = match; // 解构匹配结果
+        if (!value || !timeStr) {
+          throw new Error("未找到有效的前缀或时间编码");
+        }
+
+        // 2. 解析时间部分(格式:YYMMDDHHMM → 25 03 24 15 44)
+        const year = `20${timeStr.substring(0, 2)}`;
+        const month = timeStr.substring(2, 4);
+        const day = timeStr.substring(4, 6);
+        const hours = timeStr.substring(6, 8);
+        const minutes = timeStr.substring(8, 10);
+
+        // 3. 构造 Date 对象并验证
+        const date = new Date(
+          parseInt(year),
+          parseInt(month) - 1,
+          parseInt(day),
+          parseInt(hours),
+          parseInt(minutes),
+          0
+        );
+        if (isNaN(date.getTime())) {
+          throw new Error("解析到无效的日期时间");
+        }
+
+        // 4. 格式化为目标字符串
+        const format = num => String(num).padStart(2, "0");
+        const formattedTime =
+          `${date.getFullYear()}/${format(date.getMonth() + 1)}/${format(
+            date.getDate()
+          )} ` + `${format(date.getHours())}:${format(date.getMinutes())}:00`;
+
+        // 5. 返回对象
+        return { value, time: formattedTime };
+      } catch (error) {
+        console.error("错误:", error.message);
+        return null;
+      }
+    }
+  },
+  mounted() {
+    this.checkJson = this.cJson ? this.depthCopy(this.cJson) : undefined
+
+  }
+}
+</script>
+
+<style scoped>
+.c_box {
+  width: 100%;
+  position: relative;
+}
+
+/* .mask {
+    position: absolute;
+    height: 100%;
+    width: 100%;
+    z-index: 2;
+} */
+
+.choice_box {
+  white-space: pre-line;
+}
+
+.choice_box > .title {
+  font-weight: bold;
+  width: 100%;
+  word-break: break-all;
+}
+
+.choice_box > .choices {
+  margin-top: 10px;
+}
+
+.choices > .page {
+  margin-top: 10px;
+  display: flex;
+  align-items: center;
+}
+
+.p_page {
+  margin: 0 10px;
+}
+
+.course {
+  display: flex;
+  align-items: center;
+  cursor: pointer;
+}
+
+.course + .course {
+  margin-top: 10px;
+}
+
+.course > .banner {
+  min-width: 100px;
+  width: 100px;
+  height: 100px;
+  border-radius: 5px;
+  overflow: hidden;
+  border: 1px solid #3896fc;
+  box-sizing: border-box;
+  padding: 5px;
+  margin-right: 15px;
+}
+.course > .banner > img {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+.course > .content {
+  max-width: calc(100% - 100px - 15px);
+}
+.course > .content > .c_c {
+  display: flex;
+}
+.course > .content > .c_c + .c_c {
+  margin-top: 5px;
+}
+.course > .content > .c_c span:nth-child(1) {
+  min-width: fit-content;
+}
+.course > .content > .c_c span:nth-child(2) {
+  word-break: break-word;
+}
+</style>

+ 20 - 3
src/views/testDetail/components/sweep.vue

@@ -23,7 +23,7 @@
         <el-button type="primary" size="small" @click="sweepBtn">扫一扫</el-button>
       </div>
     </div>
-		<sweepPage ref="sweepPageRef" @success="sweepSuccess"/>
+		<sweepPage ref="sweepPageRef" @success="sweepSuccess"  @error="sweepError"/>
   </div>
 </template>
 
@@ -79,11 +79,28 @@ export default {
 		sweepSuccess(result){
 			this.checkJson.answer2 = result;
 			this.$refs.sweepPageRef.close();
-		}
+      this.$forceUpdate();
+		},
+    sweepError(error){
+      if (error.name === 'NotAllowedError') {
+          this.$toast.fail('您需要授予相机访问权限')
+        } else if (error.name === 'NotFoundError') {
+          this.$toast.fail('这个设备上没有摄像头')
+        } else if (error.name === 'NotSupportedError') {
+          this.$toast.fail('所需的安全上下文(HTTPS、本地主机)')
+        } else if (error.name === 'NotReadableError') {
+          this.$toast.fail('相机被占用')
+        } else if (error.name === 'OverconstrainedError') {
+          this.$toast.fail('安装摄像头不合适')
+        } else if (error.name === 'StreamApiNotSupportedError') {
+          this.$toast.fail('此浏览器不支持流API')
+        }else{
+          this.$toast.fail(error.name)
+        }
+    },
   },
   mounted() {
     this.checkJson = this.cJson ? this.depthCopy(this.cJson) : undefined
-   
   }
 }
 </script>

+ 35 - 7
src/views/testDetail/components/topic.vue

@@ -95,6 +95,13 @@
               v-else-if="item.type == 13"
               :see="see"
               :isTeacher="isTeacher"></number>
+
+              <punchQRcode :tindex="index"
+              :cJson.sync="item.json"
+              :checktype="checktype"
+              v-else-if="item.type == 14"
+              :see="see"
+              :isTeacher="isTeacher"></punchQRcode>
             <!-- <span v-else>暂未设置题目</span> -->
           </div>
           <div v-for="(item2, index2) in item.array" :key="`${index}-${index2}`" class="check_box_xia">
@@ -184,7 +191,12 @@
                 :see="see"
                 :isTeacher="isTeacher"></number>
 
-
+                <punchQRcode  :tindex="index2"
+                :cJson.sync="item2.json"
+                :checktype="checktype"
+                v-else-if="item2.type == 14"
+                :see="see"
+                :isTeacher="isTeacher"></punchQRcode>
               <!-- <span v-else>暂未设置题目</span> -->
             </div>
           </div>
@@ -276,6 +288,12 @@
               v-else-if="item.type == 13"
               :see="see"
               :isTeacher="isTeacher"></number>
+              <punchQRcode  :tindex="index"
+              :cJson.sync="item.json"
+              :checktype="checktype"
+              v-else-if="item.type == 14"
+              :see="see"
+              :isTeacher="isTeacher"></punchQRcode>
             <!-- <span v-else>暂未设置题目</span> -->
           </div>
           <div v-for="(item2, index2) in item.array" :key="`${index}-${index2}`" class="check_box_xia">
@@ -363,6 +381,12 @@
                 v-else-if="item2.type == 13"
                 :see="see"
                 :isTeacher="isTeacher"></number>
+                <punchQRcode  :tindex="index2"
+                :cJson.sync="item2.json"
+                :checktype="checktype"
+                v-else-if="item2.type == 14"
+                :see="see"
+                :isTeacher="isTeacher"></punchQRcode>
               <!-- <span v-else>暂未设置题目</span> -->
             </div>
           </div>
@@ -394,6 +418,7 @@ import timeV from './time.vue'
 import courseV2 from './course2.vue'
 import sweep from './sweep.vue'
 import number from './number'
+import punchQRcode from './punchQRcode'
 export default {
   props: {
     cJson: {
@@ -429,6 +454,7 @@ export default {
       type: String,
       default: ''
     }
+
   },
   components: {
     choiceV,
@@ -439,7 +465,8 @@ export default {
     timeV,
     courseV2,
 		sweep,
-    number
+    number,
+    punchQRcode
   },
   data() {
     return {
@@ -551,7 +578,7 @@ export default {
         const checkArray = _json.filter(item => {
           if (item.array) {
             item.array = item.array.filter(item2 => {
-              if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7 && item.type != 12) {
+              if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7 && item.type != 12 && item.type != 14) {
                 item2.json.answer2 = []
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type == 6) {
                 item2.json.answer2 = this.gcourseid ? this.gcourseid : item2.json.courses[0]
@@ -576,13 +603,14 @@ export default {
                 item2.json &&
                 !item2.json.answer2 &&
                 item2.json.answer2 !== 0 &&
-                item2.type == 12
+                item2.type == 12 &&
+                item2.type == 14
               ) {
                 item2.json.answer2 = ''
               }
               if (item2.array) {
                 item2.array = item2.array.filter(item3 => {
-                  if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7 && item3.type != 12) {
+                  if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7 && item3.type != 12 && item3.type != 14) {
                     item3.json.answer2 = []
                   } else if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type == 6) {
                     item3.json.answer2 = this.gcourseid ? this.gcourseid : item3.json.courses[0]
@@ -617,7 +645,7 @@ export default {
               return (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
             })
           }
-          if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 7 && item.type != 12) {
+          if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 7 && item.type != 12 && item.type != 14) {
             item.json.answer2 = []
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.type == 6) {
             item.json.answer2 = this.gcourseid ? this.gcourseid : item.json.courses[0]
@@ -625,7 +653,7 @@ export default {
             item.json.answer2 = ''
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.json.answer2 !== 0 && item.type == 8) {
             item.json.answer2 = ''
-          } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.json.answer2 !== 0 && item.type == 12) {
+          } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.json.answer2 !== 0 && item.type == 12 && item.type == 14) {
             item.json.answer2 = ''
           }
           console.log(item.array)

+ 77 - 3
src/views/testDetail/index.vue

@@ -177,7 +177,14 @@ export default {
       const checkArray = _json.filter(item => {
         if (item.array) {
           item.array = item.array.filter(item2 => {
-            if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item2.type != 7) {
+            if (
+              item2.ttype == 1 &&
+              item2.json &&
+              !item2.json.answer2 &&
+              item2.type != 6 &&
+              item2.type != 7 &&
+              item2.type != 14
+            ) {
               item2.json.answer2 = []
             } else if (item2.type == 6) {
               item2.json.answer2 = this.courseid ? this.courseid : ''
@@ -186,7 +193,14 @@ export default {
             }
             if (item2.array) {
               item2.array = item2.array.filter(item3 => {
-                if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7) {
+                if (
+                  item3.ttype == 1 &&
+                  item3.json &&
+                  !item3.json.answer2 &&
+                  item3.type != 6 &&
+                  item3.type != 7 &&
+                  item2.type != 14
+                ) {
                   item3.json.answer2 = []
                 } else if (item3.type == 6) {
                   item3.json.answer2 = this.courseid ? this.courseid : ''
@@ -199,7 +213,15 @@ export default {
             return (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
           })
         }
-        if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 6 && item.type != 7) {
+        if (
+          item.ttype == 1 &&
+          item.json &&
+          !item.json.answer2 &&
+          item.type != 6 &&
+          item.type != 6 &&
+          item.type != 7 &&
+          item2.type != 14
+        ) {
           item.json.answer2 = []
         } else if (item.type == 6) {
           item.json.answer2 = this.courseid ? this.courseid : ''
@@ -293,6 +315,33 @@ export default {
     publish2() {
       console.log('publish2')
       const cjson = this.$refs['topicVue'].checkArray
+
+      for (let i = 0; i < cjson.length; i++) {
+        let _item = cjson[i]
+        if (_item.type == 14) {
+          if (!_item.json.answer2) {
+            this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+            return
+          } else {
+            if (_item.json.codeScanningTime) {
+              let currentTime = new Date().getTime() // 获取当前时间戳
+              let checkTime = new Date(_item.json.codeScanningTime).getTime() // 获取_valueAndTime.time的时间戳
+              let minutes = parseInt(_item.json.minutes) // 获取minutes对象
+
+              if (currentTime - checkTime > minutes * 60 * 1000) {
+                // 超过指定分钟数的逻辑处理
+                this.$toast.fail(i + 1 + '、' + _item.json.title+'二维码已过期,请重新扫码打卡。')
+              } else {
+                // 在限制时间内的逻辑处理
+              }
+            } else {
+              this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+              return
+            }
+          }
+        }
+      }
+
       const _cjson = this.JSONSetting(JSON.parse(JSON.stringify(cjson)))
       const pan = this.panJSON(_cjson)
       if (!pan) {
@@ -331,6 +380,31 @@ export default {
       console.log('publish')
 
       const cjson = this.$refs['topicVue'].checkArray
+      for (let i = 0; i < cjson.length; i++) {
+        let _item = cjson[i]
+        if (_item.type == 14) {
+          if (!_item.json.answer2) {
+            this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+            return
+          } else {
+            if (_item.json.codeScanningTime) {
+              let currentTime = new Date().getTime() // 获取当前时间戳
+              let checkTime = new Date(_item.json.codeScanningTime).getTime() // 获取_valueAndTime.time的时间戳
+              let minutes = parseInt(_item.json.minutes) // 获取minutes对象
+
+              if (currentTime - checkTime > minutes * 60 * 1000) {
+                // 超过指定分钟数的逻辑处理
+                this.$toast.fail(i + 1 + '、' + _item.json.title+'二维码已过期,请重新扫码打卡。')
+              } else {
+                // 在限制时间内的逻辑处理
+              }
+            } else {
+              this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+              return
+            }
+          }
+        }
+      }
 
       const params = [
         {

+ 54 - 0
src/views/testDetail/preview.vue

@@ -279,6 +279,33 @@ export default {
 
     publish() {
       let cjson = this.$refs['topicVue'].checkArray
+
+      for (let i = 0; i < cjson.length; i++) {
+        let _item = cjson[i]
+        if (_item.type == 14) {
+          if (!_item.json.answer2) {
+            this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+            return
+          } else {
+            if (_item.json.codeScanningTime) {
+              let currentTime = new Date().getTime() // 获取当前时间戳
+              let checkTime = new Date(_item.json.codeScanningTime).getTime() // 获取_valueAndTime.time的时间戳
+              let minutes = parseInt(_item.json.minutes) // 获取minutes对象
+
+              if (currentTime - checkTime > minutes * 60 * 1000) {
+                // 超过指定分钟数的逻辑处理
+                this.$toast.fail(i + 1 + '、' + _item.json.title+'二维码已过期,请重新扫码打卡。')
+              } else {
+                // 在限制时间内的逻辑处理
+              }
+            } else {
+              this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+              return
+            }
+          }
+        }
+      }
+
       const params = [
         {
           uid: this.tid,
@@ -298,6 +325,33 @@ export default {
     },
     publish2() {
       let cjson = this.$refs['topicVue'].checkArray
+
+      for (let i = 0; i < cjson.length; i++) {
+        let _item = cjson[i]
+        if (_item.type == 14) {
+          if (!_item.json.answer2) {
+            this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+            return
+          } else {
+            if (_item.json.codeScanningTime) {
+              let currentTime = new Date().getTime() // 获取当前时间戳
+              let checkTime = new Date(_item.json.codeScanningTime).getTime() // 获取_valueAndTime.time的时间戳
+              let minutes = parseInt(_item.json.minutes) // 获取minutes对象
+
+              if (currentTime - checkTime > minutes * 60 * 1000) {
+                // 超过指定分钟数的逻辑处理
+                this.$toast.fail(i + 1 + '、' + _item.json.title+'二维码已过期,请重新扫码打卡。')
+              } else {
+                // 在限制时间内的逻辑处理
+              }
+            } else {
+              this.$toast.fail(i + 1 + '、' + _item.json.title + '未打卡')
+              return
+            }
+          }
+        }
+      }
+
       let _cjson = this.JSONSetting(JSON.parse(JSON.stringify(cjson)))
       let pan = this.panJSON(_cjson)
       console.log('pan', pan)

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác