diff --git a/src/DatabaseServices/CommandServer.ts b/src/DatabaseServices/CommandServer.ts index 3e0887e85..f8b235985 100644 --- a/src/DatabaseServices/CommandServer.ts +++ b/src/DatabaseServices/CommandServer.ts @@ -4,7 +4,7 @@ import { PostJson, RequestStatus } from "../Common/Request"; import { GetIndexDBID } from "../Common/Utils"; import { commandMachine } from "../Editor/CommandMachine"; import { IndexedDbStore, StoreName } from "../IndexedDb/IndexedDbStore"; -import { CommandList, ICommand } from "../UI/Components/CommandPanel/CommandList"; +import { CommandList, ICommand, SYSTEM_COMMAND_NAME_START } from "../UI/Components/CommandPanel/CommandList"; import { userConfigStore } from "../UI/Store/UserConfigStore"; /** @@ -128,7 +128,7 @@ export class CommandServer this.RegistCustomCommand(cmd.customize, cmd.command); //组合键 - if (cmd.systemHotkeys)//系统 一定注册 + if (cmd.systemHotkeys && !cmd.command.startsWith(SYSTEM_COMMAND_NAME_START))//系统 一定注册 SYSTEMXXXXX 命令不需要注册 this.RegistHotkey(cmd.systemHotkeys, cmd.command); else if (cmd.hotkeysCustomize) this.RegistHotkey(cmd.hotkeysCustomize, cmd.command); diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index f725e916b..7d8a3d0b0 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -2,6 +2,9 @@ import { CommandNames } from "../../../Common/CommandNames"; import { HotkeyList } from "../../../Common/HotKeyList"; import { IconEnum } from "../../IconEnum"; +//系统命令前缀 使用这个前缀的命令不注册命令 +export const SYSTEM_COMMAND_NAME_START = "SYSTEMCMD_"; + /** * 命令面板列表数据 * 非搜索项放在开头,暂勿随意更改位置,待优化 @@ -1841,17 +1844,6 @@ export const CommandList: ICommand[] = [ // enName: "Offset", chDes: "创建同心圆、平行线和平行曲线", }, - { - icon: IconEnum.Length, - typeId: "util", - link: `#`, - defaultCustom: "LENGTH", - command: "LENGTH", - type: "工具", - chName: "长度", - // enName: "Length", - chDes: "测量长度", - }, { icon: IconEnum.EditPolyLine, typeId: "util", @@ -2318,7 +2310,7 @@ export const CommandList: ICommand[] = [ icon: IconEnum.Print, typeId: "file", link: `#`, - defaultCustom: "PRINT", + defaultCustom: CommandNames.Print, command: CommandNames.Print, type: "文件", chName: "打印", @@ -2649,7 +2641,7 @@ export const CommandList: ICommand[] = [ { typeId: "", defaultCustom: "", - command: "", + command: SYSTEM_COMMAND_NAME_START + "PRINT", type: "内置", chName: "打印", chDes: "系统命令", @@ -2683,7 +2675,7 @@ export const CommandList: ICommand[] = [ { typeId: "", defaultCustom: "", - command: "", + command: SYSTEM_COMMAND_NAME_START + "FORCE_END_CMD", type: "内置", chName: "命令强制结束", chDes: "系统命令",