Skip to content

Commit

Permalink
fix: 客户端任务独立窗口无法按command+s保存任务的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Mar 4, 2022
1 parent d1fdec0 commit fec116f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions resources/assets/js/pages/single/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="electron-task">
<PageTitle :title="taskInfo.name"/>
<Loading v-if="loadIng > 0"/>
<TaskDetail v-else :task-id="taskInfo.id" :open-task="taskInfo"/>
<TaskDetail v-else ref="taskDetail" :task-id="taskInfo.id" :open-task="taskInfo"/>
</div>
</template>

Expand Down Expand Up @@ -48,7 +48,10 @@ export default {
}
},
mounted() {
//
document.addEventListener('keydown', this.shortcutEvent);
},
beforeDestroy() {
document.removeEventListener('keydown', this.shortcutEvent);
},
computed: {
...mapState(['cacheTasks']),
Expand Down Expand Up @@ -92,7 +95,15 @@ export default {
}
});
});
}
},
shortcutEvent(e) {
if (e.metaKey || e.ctrlKey) {
if (e.keyCode === 83) {
e.preventDefault();
this.$refs.taskDetail.checkUpdate(true)
}
}
},
}
}
</script>

0 comments on commit fec116f

Please sign in to comment.