From 950b7ad57b69a340db836a104cb4ca5ef7ea7530 Mon Sep 17 00:00:00 2001 From: yanghongbo1 Date: Mon, 22 Apr 2024 15:12:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Feat=EF=BC=9A=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=94=AF=E6=8C=81mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/config/en.js | 50 +++++++++++++++++++++++++------------------- web/src/config/zh.js | 49 ++++++++++++++++++++++++------------------- 2 files changed, 55 insertions(+), 44 deletions(-) diff --git a/web/src/config/en.js b/web/src/config/en.js index e668d954..9b94f77a 100644 --- a/web/src/config/en.js +++ b/web/src/config/en.js @@ -178,6 +178,12 @@ export const backgroundPositionList = [ } ] +const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; +const ctrl = isMac?'⌘':'Ctrl'; +const enter = isMac?'Return':'Enter'; +const macFn = isMac?'fn + ':''; + + // 背景图片大小 export const backgroundSizeList = [ { @@ -207,7 +213,7 @@ export const shortcutKeyList = [ { icon: 'iconjiedian', name: 'Insert sibling node', - value: 'Enter' + value: enter }, { icon: 'icondodeparent', @@ -217,17 +223,17 @@ export const shortcutKeyList = [ { icon: 'iconshangyi', name: 'Move up node', - value: 'Ctrl + ↑' + value: `${ctrl} + ↑` }, { icon: 'iconxiayi', name: 'Move down node', - value: 'Ctrl + ↓' + value: `${ctrl} + ↓` }, { icon: 'icongaikuozonglan', name: 'Insert summary', - value: 'Ctrl + G' + value: `${ctrl} + G` }, { icon: 'iconzhankai', @@ -247,57 +253,57 @@ export const shortcutKeyList = [ { icon: 'iconfuzhi', name: 'Copy node', - value: 'Ctrl + C' + value: `${ctrl} + C` }, { icon: 'iconjianqie', name: 'Cut node', - value: 'Ctrl + X' + value: `${ctrl} + X` }, { icon: 'iconniantie', name: 'Paste node', - value: 'Ctrl + V' + value: `${ctrl} + V` }, { icon: 'iconbianji', name: 'Edit node', - value: 'F2' + value: macFn+'F2' }, { icon: 'iconhuanhang', name: 'Text Wrap', - value: 'Shift + Enter' + value: `Shift + ${enter}` }, { icon: 'iconhoutui-shi', name: 'Undo', - value: 'Ctrl + Z' + value: `${ctrl} + Z` }, { icon: 'iconqianjin1', name: 'Redo', - value: 'Ctrl + Y' + value: `${ctrl} + Y` }, { icon: 'iconquanxuan', name: 'Select All', - value: 'Ctrl + A' + value: `${ctrl} + A` }, { icon: 'iconquanxuan', name: 'Multiple choice', - value: 'Right click / Ctrl + Left click' + value: `Right click / ${ctrl} + Left click` }, { icon: 'iconzhengli', name: 'Arrange layout', - value: 'Ctrl + L' + value: `${ctrl} + L` }, { icon: 'iconsousuo', name: 'Search and Replace', - value: 'Ctrl + F' + value: `${ctrl} + F` } ] }, @@ -307,27 +313,27 @@ export const shortcutKeyList = [ { icon: 'iconfangda', name: 'Zoom in', - value: 'Ctrl + +' + value: `${ctrl} + +` }, { icon: 'iconsuoxiao', name: 'Zoom out', - value: 'Ctrl + -' + value: `${ctrl} + -` }, { icon: 'iconfangda', name: 'Zoom in/Zoom out', - value: 'Ctrl + Mouse wheel' + value: `${ctrl} + Mouse wheel` }, { icon: 'icondingwei', name: 'Back root node', - value: 'Ctrl + Enter' + value: `${ctrl} + ${enter}` }, { icon: 'iconquanping1', name: 'fit canvas', - value: 'Ctrl + i' + value: `${ctrl} + i` } ] }, @@ -337,7 +343,7 @@ export const shortcutKeyList = [ { icon: 'iconhuanhang', name: 'Text Wrap', - value: 'Shift + Enter' + value: `Shift + ${enter}` }, { icon: 'iconshanchu', @@ -352,7 +358,7 @@ export const shortcutKeyList = [ { icon: 'iconjiedian', name: 'Insert sibling node', - value: 'Enter' + value: enter }, { icon: 'icondodeparent', diff --git a/web/src/config/zh.js b/web/src/config/zh.js index 9daaef15..38b3472f 100644 --- a/web/src/config/zh.js +++ b/web/src/config/zh.js @@ -260,6 +260,11 @@ export const backgroundSizeList = [ export const store = { sidebarZIndex: 1 //侧边栏zIndex } +const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; +const ctrl = isMac?'⌘':'Ctrl'; +const enter = isMac?'Return':'Enter'; +const macFn = isMac?'fn + ':''; + // 快捷键列表 export const shortcutKeyList = [ @@ -274,7 +279,7 @@ export const shortcutKeyList = [ { icon: 'iconjiedian', name: '插入同级节点', - value: 'Enter' + value: enter }, { icon: 'icondodeparent', @@ -284,17 +289,17 @@ export const shortcutKeyList = [ { icon: 'iconshangyi', name: '上移节点', - value: 'Ctrl + ↑' + value: `${ctrl} + ↑` }, { icon: 'iconxiayi', name: '下移节点', - value: 'Ctrl + ↓' + value: `${ctrl} + ↓` }, { icon: 'icongaikuozonglan', name: '插入概要', - value: 'Ctrl + G' + value: `${ctrl} + G` }, { icon: 'iconzhankai', @@ -314,57 +319,57 @@ export const shortcutKeyList = [ { icon: 'iconfuzhi', name: '复制节点', - value: 'Ctrl + C' + value: `${ctrl} + C` }, { icon: 'iconjianqie', name: '剪切节点', - value: 'Ctrl + X' + value: `${ctrl} + X` }, { icon: 'iconniantie', name: '粘贴节点', - value: 'Ctrl + V' + value: `${ctrl} + V` }, { icon: 'iconbianji', name: '编辑节点', - value: 'F2' + value: macFn+'F2' }, { icon: 'iconhuanhang', name: '文本换行', - value: 'Shift + Enter' + value: `Shift + ${enter}` }, { icon: 'iconhoutui-shi', name: '回退', - value: 'Ctrl + Z' + value: `${ctrl} + Z` }, { icon: 'iconqianjin1', name: '前进', - value: 'Ctrl + Y' + value: `${ctrl} + Y` }, { icon: 'iconquanxuan', name: '全选', - value: 'Ctrl + A' + value: `${ctrl} + A` }, { icon: 'iconquanxuan', name: '多选', - value: '右键 / Ctrl + 左键' + value: `右键 / ${ctrl} + 左键` }, { icon: 'iconzhengli', name: '一键整理布局', - value: 'Ctrl + L' + value: `${ctrl} + L` }, { icon: 'iconsousuo', name: '搜索和替换', - value: 'Ctrl + F' + value: `${ctrl} + F` } ] }, @@ -374,27 +379,27 @@ export const shortcutKeyList = [ { icon: 'iconfangda', name: '放大', - value: 'Ctrl + +' + value: `${ctrl} + +` }, { icon: 'iconsuoxiao', name: '缩小', - value: 'Ctrl + -' + value: `${ctrl} + -` }, { icon: 'iconfangda', name: '放大/缩小', - value: 'Ctrl + 鼠标滚动' + value: `${ctrl} + 鼠标滚动` }, { icon: 'icondingwei', name: '回到根节点', - value: 'Ctrl + Enter' + value: `${ctrl} + ${enter}` }, { icon: 'iconquanping1', name: '适应画布', - value: 'Ctrl + i' + value: `${ctrl} + i` } ] }, @@ -404,7 +409,7 @@ export const shortcutKeyList = [ { icon: 'iconhuanhang', name: '文本换行', - value: 'Shift + Enter' + value: `Shift + ${enter}` }, { icon: 'iconshanchu', @@ -419,7 +424,7 @@ export const shortcutKeyList = [ { icon: 'iconjiedian', name: '插入同级节点', - value: 'Enter' + value: enter }, { icon: 'icondodeparent', From bc9d118efd70a9b6f7c62dd899daaf5b097a04ed Mon Sep 17 00:00:00 2001 From: yanghongbo1 Date: Mon, 22 Apr 2024 18:58:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E9=80=89=E6=8B=A9=E5=AD=97=E4=BD=93=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=88=97=E8=A1=A8=E6=96=87=E5=AD=97=E9=87=8D=E5=8F=A0?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/RichTextToolbar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/Edit/components/RichTextToolbar.vue b/web/src/pages/Edit/components/RichTextToolbar.vue index 66bacb58..04374f8d 100644 --- a/web/src/pages/Edit/components/RichTextToolbar.vue +++ b/web/src/pages/Edit/components/RichTextToolbar.vue @@ -299,7 +299,7 @@ export default { } .fontOptionItem { - height: 30px; + height: 50px; width: 100%; display: flex; align-items: center;