From 2a8c52f9b357702e256afd0d14449f1f074f9131 Mon Sep 17 00:00:00 2001 From: fofolee Date: Thu, 14 Apr 2022 10:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=91=BD=E4=BB=A4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E9=A2=9C=E8=89=B2=E9=85=8D=E7=BD=AE=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0js=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommandCard.vue | 26 +++++++++----------------- src/js/options/commandTypes.js | 12 +++++++++--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/components/CommandCard.vue b/src/components/CommandCard.vue index 63ae593..18142c7 100644 --- a/src/components/CommandCard.vue +++ b/src/components/CommandCard.vue @@ -107,7 +107,7 @@ > - {{ getShortStrByByte(cmd) }} - - {{ (cmd.match && getShortStrByByte(cmd.match)) || "所有文件" @@ -149,7 +149,7 @@ - - - + 图片 @@ -214,14 +214,6 @@ export default { allProgrammings: this.$programmings, maxCmdStingLen: 8, commandTypes: commandTypes, - cmdBadgeSheet: { - key: "primary", - files: "light-blue", - window: "indigo", - regex: "cyan", - over: "light-green", - img: "deep-orange", - }, }; }, computed: { @@ -256,11 +248,11 @@ export default { return this.commandInfo.tags?.includes("默认") ? false : true; }, // 匹配类型的颜色 - cmdBadgeColor() { - return (cmdType = "keyword") => { + matchTypeColor() { + return (cmdType = "key") => { if (!this.isCommandActivated) return this.$q.dark.isActive ? "grey-9" : "grey-5"; - return this.cmdBadgeSheet[cmdType]; + return this.commandTypes[cmdType].color; }; }, }, diff --git a/src/js/options/commandTypes.js b/src/js/options/commandTypes.js index ddbc4f5..ddb68cc 100644 --- a/src/js/options/commandTypes.js +++ b/src/js/options/commandTypes.js @@ -53,6 +53,7 @@ const commandTypes = { name: "key", label: "关键词", icon: "font_download", + color: "primary", matchLabel: "关键词", desc: "在主输入框输入对应关键字进入插件,最通用的一种模式,关键字可以设置多个", valueType: "array", @@ -63,8 +64,9 @@ const commandTypes = { regex: { name: "regex", label: "正则/划词", - matchLabel: "正则", icon: "rule", + color: "cyan", + matchLabel: "正则", desc: "匹配主输入框或超级面板选中的文本,可以获取输入框文本或选中文本作为变量", valueType: "regex", disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g, @@ -75,7 +77,7 @@ const commandTypes = { minNum: 1, }, ], verify: rules => !!rules > 0 || "正则不能为空", - tempPayload: async() => { + tempPayload: async () => { let values = await quickcommand.showInputBox(["需要处理的文本"]) return values[0] } @@ -85,6 +87,7 @@ const commandTypes = { label: "所有文本", matchLabel: "无需设置", icon: "emergency", + color: "light-green", desc: "匹配主输入框的所有文本,但只有在该文本未设置对应的插件或功能时才生效", valueType: null, disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g, @@ -94,7 +97,7 @@ const commandTypes = { minNum: 1, }], verify: rules => true, - tempPayload: async() => { + tempPayload: async () => { let values = await quickcommand.showInputBox(["需要处理的文本"]) return values[0] } @@ -104,6 +107,7 @@ const commandTypes = { label: "窗口/进程", matchLabel: "进程名", icon: "widgets", + color: "indigo", desc: "匹配呼出uTools前或唤出超级面板时的活动窗口,可以获取窗口的信息或文件夹路径作为变量", valueType: "array", disabledSpecialVars: /{{input}}|{{MatchImage}}|{{MatchedFiles.*?}}/g, @@ -121,6 +125,7 @@ const commandTypes = { label: "图片", matchLabel: "无需配置", icon: "panorama", + color: "deep-orange", desc: "匹配主输入框或超级面板选中的图片,并返回图片的 DataUrl", valueType: null, disabledSpecialVars: /{{input}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}|{{MatchedFiles.*?}}/g, @@ -147,6 +152,7 @@ const commandTypes = { label: "复制/选中文件", matchLabel: "正则", icon: "description", + color: "light-blue", desc: "匹配主输入框或超级面板选中的文件,可以获取复制及选中的文件信息作为变量", valueType: "regex", disabledSpecialVars: /{{input}}|{{MatchImage}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}/g,