feat: 添加打印快捷键

This commit is contained in:
pipipi-pikachu 2022-05-22 17:02:52 +08:00
parent 4bbc938fcf
commit 7149b08d72
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,7 @@ export const enum KEYS {
F = 'F',
D = 'D',
B = 'B',
P = 'P',
MINUS = '-',
EQUAL = '=',
DIGIT_0 = '0',
@ -40,6 +41,8 @@ export const HOTKEY_DOC = [
{ label: '恢复', value: 'Ctrl + Y' },
{ label: '删除', value: 'Delete / Backspace' },
{ label: '多选', value: '按住 Ctrl 或 Shift' },
{ label: '打印', value: 'Ctrl + P' },
{ label: '关闭弹窗', value: 'ESC' },
],
},
{

View File

@ -134,6 +134,12 @@ export default () => {
if (shiftKey && !shiftKeyState.value) keyboardStore.setShiftKeyState(true)
if (!disableHotkeys.value && key === KEYS.SPACE) keyboardStore.setSpaceKeyState(true)
if (ctrlOrMetaKeyActive && key === KEYS.P) {
e.preventDefault()
mainStore.setDialogForExport('pdf')
return
}
if (shiftKey && key === KEYS.F5) {
e.preventDefault()
enterScreening()