|
|
@@ -376,42 +376,55 @@ export const useActionStore = defineStore('action', () => {
|
|
|
// 键盘事件 复制
|
|
|
useKeyPress(
|
|
|
['ctrl.c'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ console.log('ctrl.c', e)
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onCopy()
|
|
|
}, 100)
|
|
|
)
|
|
|
// 键盘事件 粘贴
|
|
|
useKeyPress(
|
|
|
['ctrl.v'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onPaste()
|
|
|
}, 100)
|
|
|
)
|
|
|
// 键盘事件 剪切
|
|
|
useKeyPress(
|
|
|
['ctrl.x'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onCut()
|
|
|
}, 100)
|
|
|
)
|
|
|
// 键盘事件 复用
|
|
|
useKeyPress(
|
|
|
['ctrl.d'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onCopyFrom()
|
|
|
}, 100)
|
|
|
)
|
|
|
// 键盘事件 删除
|
|
|
useKeyPress(
|
|
|
['delete'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onDelete()
|
|
|
}, 100)
|
|
|
)
|
|
|
// 键盘事件 撤销
|
|
|
useKeyPress(
|
|
|
['ctrl.z'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
projectStore.undo()
|
|
|
}, 100)
|
|
|
)
|
|
|
@@ -474,7 +487,9 @@ export const useActionStore = defineStore('action', () => {
|
|
|
// 键盘事件 全选
|
|
|
useKeyPress(
|
|
|
['ctrl.a'],
|
|
|
- debounce(() => {
|
|
|
+ debounce((e: KeyboardEvent) => {
|
|
|
+ // 忽略输入框
|
|
|
+ if ((e.target as HTMLElement)?.className.includes('el-')) return
|
|
|
onSelectAll()
|
|
|
}, 100)
|
|
|
)
|