@@ -146,6 +146,8 @@
+
+
@@ -172,6 +174,7 @@ import { videoConfig } from '@/views/risk/dailyTask/config/video'
import moment from 'moment'
import TeamModal from '@/views/risk/dailyTask/components/TeamModal.vue'
import GtTable from '@/views/basic/project/components/GtTable.vue'
+import ShortcutModal from '@/views/risk/dailyTask/components/ShortcutModal.vue'
const tmp = {
bidName: '',
@@ -194,7 +197,7 @@ const tmp = {
export default {
name: 'RemoteWatchModal',
- components: { GtTable, TeamModal },
+ components: { ShortcutModal, GtTable, TeamModal },
props: ['componentVisible', 'currentId', 'currentBid'],
data() {
return {
@@ -203,11 +206,25 @@ export default {
startVideoStatus: false,
mediaRecorder: null,
recordedChunks: [],
+ shortcut: [
+ { key: 'w', name: '向上', value: 'up', stop: 'stopTurn' },
+ { key: 's', name: '向下', value: 'down', stop: 'stopTurn' },
+ { key: 'a', name: '向左', value: 'left', stop: 'stopTurn' },
+ { key: 'd', name: '向右', value: 'right', stop: 'stopTurn' },
+ { key: 'q', name: '放大', value: 'amplify', stop: 'stopZoom' },
+ { key: 'e', name: '缩小', value: 'shrink', stop: 'stopZoom' },
+ { key: 'r', name: '远焦', value: 'far', stop: 'stopFocus' },
+ { key: 't', name: '近焦', value: 'near', stop: 'stopFocus' },
+ { key: 'f', name: '拍照', value: 'capture' },
+ { key: 'g', name: '录像', value: 'video' }
+ ],
videoUrl: null,
//
- teamQualityVisible: true,
+ teamQualityVisible: false,
currentBidCode: '',
gtInfoVisible: false,
+ shortcutModalVisible: false,
+ handlingKeyEvent: false,
currentGtId: '',
list: [],
listQuery: {
@@ -248,11 +265,21 @@ export default {
this.getList()
this.initVideo()
this.handleFilter()
+ window.addEventListener('keydown', this.handleKeyDown)
+ window.addEventListener('keyup', this.handleKeyUp)
+ } else {
+ window.removeEventListener('keydown', this.handleKeyDown)
+ window.removeEventListener('keyup', this.handleKeyUp)
}
}
},
mounted() {
- // this.initVideo()
+ window.addEventListener('keydown', this.handleKeyDown)
+ window.addEventListener('keyup', this.handleKeyUp)
+ },
+ beforeDestroy() {
+ window.removeEventListener('keydown', this.handleKeyDown)
+ window.removeEventListener('keyup', this.handleKeyUp)
},
methods: {
getList() {
@@ -458,6 +485,35 @@ export default {
handleGtInfoShow() {
this.currentBidCode = this.currentBid
this.gtInfoVisible = true
+ },
+ handleShortcut() {
+ this.shortcutModalVisible = true
+ },
+ handleKeyDown(event) {
+ if (this.shortcutModalVisible || this.teamQualityVisible || this.gtInfoVisible || this.handlingKeyEvent) return
+ this.handlingKeyEvent = true
+ const key = event.key
+ let shortcut = localStorage.getItem('shortcut')
+ shortcut = shortcut ? JSON.parse(shortcut) : this.shortcut
+
+ const currentKey = shortcut.find(item => item?.key === key)
+ if (currentKey) {
+ this.handleControl(currentKey.value)
+ }
+ console.log('按键被按下:', event.key)
+ },
+ handleKeyUp(event) {
+ if (this.shortcutModalVisible || this.teamQualityVisible || this.gtInfoVisible) return
+ console.log('按键被释放:', event.key)
+ const key = event.key
+ let shortcut = localStorage.getItem('shortcut')
+ shortcut = shortcut ? JSON.parse(shortcut) : this.shortcut
+
+ const currentKey = shortcut.find(item => item?.key === key)
+ if (currentKey && currentKey?.stop) {
+ this.handleControl(currentKey.stop)
+ }
+ this.handlingKeyEvent = false
}
}
}
diff --git a/ah-jjzhgd-web/src/views/risk/dailyTask/components/RiskLevelSelect.vue b/ah-jjzhgd-web/src/views/risk/dailyTask/components/RiskLevelSelect.vue
index 97ec311..c4d83ff 100644
--- a/ah-jjzhgd-web/src/views/risk/dailyTask/components/RiskLevelSelect.vue
+++ b/ah-jjzhgd-web/src/views/risk/dailyTask/components/RiskLevelSelect.vue
@@ -1,5 +1,5 @@
-
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
diff --git a/ah-jjzhgd-web/src/views/risk/dailyTask/components/TeamModal.vue b/ah-jjzhgd-web/src/views/risk/dailyTask/components/TeamModal.vue
index 7995509..e2c65b9 100644
--- a/ah-jjzhgd-web/src/views/risk/dailyTask/components/TeamModal.vue
+++ b/ah-jjzhgd-web/src/views/risk/dailyTask/components/TeamModal.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/ah-jjzhgd-web/src/views/risk/emergency/components/EmergencyCase.vue b/ah-jjzhgd-web/src/views/risk/emergency/components/EmergencyCase.vue
index 0ab50ec..f5e25f2 100644
--- a/ah-jjzhgd-web/src/views/risk/emergency/components/EmergencyCase.vue
+++ b/ah-jjzhgd-web/src/views/risk/emergency/components/EmergencyCase.vue
@@ -2,7 +2,7 @@
-
+
-
+
-->
-
-
+
+
@@ -184,7 +184,7 @@