ShortcutKeyModal.vue
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<n-modal v-model:show="modelShowRef" :mask-closable="true" @afterLeave="closeHandle">
<n-table class="model-content" :bordered="false" :single-line="false">
<thead>
<tr>
<th>{{ t('common.shortCutKeyInfo.th1') }}</th>
<th>{{ t('common.shortCutKeyInfo.th2') }}</th>
<th>
<n-space justify="space-between">
<span> {{ t('common.shortCutKeyInfo.th3') }} </span>
<n-icon size="20" class="go-cursor-pointer" @click="closeHandle">
<close-icon></close-icon>
</n-icon>
</n-space>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in shortcutKeyOptions" :key="index">
<td>{{ item.label }}</td>
<td>{{ item.win }}</td>
<td v-if="item.macSource">{{ item.mac }}</td>
<td v-else>
<n-gradient-text :size="22">{{ item.mac.substr(0, 1) }}</n-gradient-text>
+ {{ item.mac.substr(3) }}
</td>
</tr>
</tbody>
</n-table>
</n-modal>
</template>
<script setup lang="ts">
import { watch, ref } from 'vue'
import { icon } from '@/plugins'
import { WinKeyboard, MacKeyboard } from '@/enums/editPageEnum'
const { CloseIcon } = icon.ionicons5
const t = window['$t']
const modelShowRef = ref(false)
const emit = defineEmits(['update:modelShow'])
const props = defineProps({
modelShow: Boolean
})
watch(
() => props.modelShow,
newValue => {
modelShowRef.value = newValue
}
)
// 快捷键
const shortcutKeyOptions = [
{
label: t('common.shortCutKeyInfo.label1'),
win: `${WinKeyboard.SPACE.toUpperCase()} + 🖱️ `,
mac: `${MacKeyboard.SPACE.toUpperCase()} + 🖱️ `,
macSource: true
},
{
label: t('common.shortCutKeyInfo.label2'),
win: `${WinKeyboard.CTRL.toUpperCase()} + ↑ 或 → 或 ↓ 或 ←`,
mac: `${MacKeyboard.CTRL.toUpperCase()} + ↑ `
},
{
label: t('common.shortCutKeyInfo.label3'),
win: `${WinKeyboard.CTRL.toUpperCase()} + L `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + L `
},
{
label: t('common.shortCutKeyInfo.label4'),
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()}+ L `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + ${MacKeyboard.SHIFT.toUpperCase()} + L `
},
{
label: t('common.shortCutKeyInfo.label5'),
win: `${WinKeyboard.CTRL.toUpperCase()} + H `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + H `
},
{
label: t('common.shortCutKeyInfo.label6'),
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + H `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + ${MacKeyboard.SHIFT.toUpperCase()} + H `
},
{
label: t('common.shortCutKeyInfo.label7'),
win: 'Delete'.toUpperCase(),
mac: `${MacKeyboard.CTRL.toUpperCase()} + Backspace `
},
{
label: t('common.shortCutKeyInfo.label8'),
win: `${WinKeyboard.CTRL.toUpperCase()} + C `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + C `
},
{
label: t('common.shortCutKeyInfo.label9'),
win: `${WinKeyboard.CTRL.toUpperCase()} + X `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + X `
},
{
label: t('common.shortCutKeyInfo.label10'),
win: `${WinKeyboard.CTRL.toUpperCase()} + V `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + V `
},
{
label: t('common.shortCutKeyInfo.label11'),
win: `${WinKeyboard.CTRL.toUpperCase()} + Z `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + Z `
},
{
label: t('common.shortCutKeyInfo.label12'),
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + Z `,
mac: `${MacKeyboard.CTRL.toUpperCase()} + ${MacKeyboard.SHIFT.toUpperCase()} + Z `
},
{
label: t('common.shortCutKeyInfo.label13'),
win: `${WinKeyboard.CTRL.toUpperCase()} + 🖱️ `,
mac: `${MacKeyboard.CTRL_SOURCE_KEY.toUpperCase()} + 🖱️ `
},
{
label: t('common.shortCutKeyInfo.label14'),
win: `${WinKeyboard.CTRL.toUpperCase()} + G / 🖱️ `,
mac: `${MacKeyboard.CTRL_SOURCE_KEY.toUpperCase()} + G / 🖱️`
},
{
label: t('common.shortCutKeyInfo.label15'),
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + G `,
mac: `${MacKeyboard.CTRL_SOURCE_KEY.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + G `
}
]
const closeHandle = () => {
emit('update:modelShow', false)
}
</script>
<style lang="scss" scoped>
.model-content {
width: 50vw;
padding-bottom: 20px;
overflow: hidden;
border-radius: 15px;
td {
padding: 5px 10px;
}
}
</style>