Browse Source

[v5.0.230509.1] 剪貼簿 Paste 偵聽功能:避免 與 編輯文字框、設定文字題答案 貼上 行為 衝突

Louise lin 2 years ago
parent
commit
8312c1fef9

+ 11 - 7
HiTeachCC/ClientApp/src/components/AddImgBox.vue

@@ -60,6 +60,7 @@
 const de = require('@/utils/lib1.js')
 const de = require('@/utils/lib1.js')
 import enc from '@/utils/enc.js'
 import enc from '@/utils/enc.js'
 import { mapGetters } from 'vuex'
 import { mapGetters } from 'vuex'
+import OptionViewVue from './Chart/OptionView.vue'
 
 
 export default {
 export default {
   name: 'AddImgBox',
   name: 'AddImgBox',
@@ -92,13 +93,16 @@ export default {
     this.importAll(require.context('../assets/HT_resource/Openclipart', true, /\.png$/), this.images)
     this.importAll(require.context('../assets/HT_resource/Openclipart', true, /\.png$/), this.images)
     this.importAll(require.context('../assets/HT_resource/Backgrounds', true, /\.jpg$/), this.bgImages)
     this.importAll(require.context('../assets/HT_resource/Backgrounds', true, /\.jpg$/), this.bgImages)
     let that=this
     let that=this
-     document.addEventListener('paste',()=> {
-        that.getClipboardData()
-        that.$nextTick(()=>{
-          setTimeout(()=>{
-            that.pastContent()
-          },500)
-        })
+    document.addEventListener('paste',()=> {
+      const isShowTextAnsPop=this?.$optionView?.showTextAnspop
+      if(!this.$store.state.showtextInuptCard&&!isShowTextAnsPop){
+      this.$store.state.mode = 'check'
+      that.getClipboardData()
+      that.$nextTick(()=>{
+        setTimeout(()=>{
+          that.pastContent()
+        },500)
+      })}
     })
     })
   },
   },
   watch: {
   watch: {

+ 3 - 0
HiTeachCC/ClientApp/src/components/Chart/OptionView.vue

@@ -389,6 +389,7 @@ import Result from './../Chart/result.vue'
 import draggable from 'vuedraggable'
 import draggable from 'vuedraggable'
 import html2canvas from 'html2canvas'
 import html2canvas from 'html2canvas'
 import { mapGetters } from 'vuex'
 import { mapGetters } from 'vuex'
+import Vue from 'vue'
 
 
 export default {
 export default {
   components: {
   components: {
@@ -530,6 +531,8 @@ export default {
     this.studentss()
     this.studentss()
   },
   },
   mounted() {
   mounted() {
+    Vue.prototype.$optionView=this
+    
     let that = this
     let that = this
     this.hiteachccorigin = window.location.origin
     this.hiteachccorigin = window.location.origin
     this.$nextTick(() => {
     this.$nextTick(() => {

+ 1 - 1
HiTeachCC/ClientApp/src/store/index.js

@@ -199,7 +199,7 @@ export default new Vuex.Store({
     startTime: 0,
     startTime: 0,
     elapsedTime: 0,
     elapsedTime: 0,
     timeLineEvents: [],
     timeLineEvents: [],
-    version: 'v5.0.230501.1'
+    version: 'v5.0.230509.1'
   },
   },
   mutations: {},
   mutations: {},
   actions: {
   actions: {