diff --git a/src/editor/Menu/File.tsx b/src/editor/Menu/File.tsx index a68d982..601e55d 100644 --- a/src/editor/Menu/File.tsx +++ b/src/editor/Menu/File.tsx @@ -7,10 +7,31 @@ const FileMenu = () => { {...{ name: "文件", items: [ - { name: "打开GeoJSON", onClick: globalController.openGeoJSON }, - { name: "打开工程", onClick: globalController.openProject }, - { name: "保存GeoJSON", onClick: globalController.saveGeoJSON }, - { name: "保存工程", onClick: globalController.saveProject }, + { + name: "打开GeoJSON", + onClick: globalController.openGeoJSON, + hotkey: "Alt+O", + }, + { + name: "打开工程", + onClick: globalController.openProject, + hotkey: "Ctrl+O", + }, + { + name: "暂存工程", + onClick: globalController.saveTemp, + hotkey: "Alt+S", + }, + { + name: "保存GeoJSON", + onClick: globalController.saveGeoJSON, + hotkey: "Ctrl+S", + }, + { + name: "保存工程", + onClick: globalController.saveProject, + hotkey: "Ctrl+Alt+S", + }, ], }} /> diff --git a/src/editor/Menu/MenuGroup.tsx b/src/editor/Menu/MenuGroup.tsx index a2968f0..dd5c8da 100644 --- a/src/editor/Menu/MenuGroup.tsx +++ b/src/editor/Menu/MenuGroup.tsx @@ -3,6 +3,7 @@ import { Menu, Dropdown } from "antd"; export type MenuItemConfig = { name: string; onClick: () => void; + hotkey?: string; }; export type MenuConfig = { @@ -14,15 +15,16 @@ const MenuGroup = (props: MenuConfig) => { const menu = (
); return ( -