不适用当前平台式匹配类型为灰

This commit is contained in:
fofolee 2022-04-26 17:11:33 +08:00
parent 035d5aab67
commit 511cf11434

View File

@ -273,13 +273,19 @@ export default {
(!this.isCommandActivated || !this.canCommandRun), (!this.isCommandActivated || !this.canCommandRun),
}; };
}, },
//
canCommandRunAtCurrentOS() {
let { platform } = this.commandInfo.features;
return !_.isEmpty(platform) && !platform.includes(window.processPlatform)
? false
: true;
},
// , cmds cmds[0] // , cmds cmds[0]
canCommandRun() { canCommandRun() {
// //
if (!this.isCommandActivated) return false; if (!this.isCommandActivated) return false;
let { platform, cmds } = this.commandInfo.features; if (!this.canCommandRunAtCurrentOS) return false;
if (!_.isEmpty(platform) && !platform.includes(window.processPlatform)) let { cmds } = this.commandInfo.features;
return false;
// //
if (cmds[0].type && cmds[0].type === "window") return false; if (cmds[0].type && cmds[0].type === "window") return false;
return true; return true;
@ -296,7 +302,7 @@ export default {
// //
matchTypeColor() { matchTypeColor() {
return (cmdType = "key") => { return (cmdType = "key") => {
return this.isCommandActivated return this.canCommandRunAtCurrentOS && this.isCommandActivated
? this.commandTypes[cmdType].color ? this.commandTypes[cmdType].color
: this.disabledColor; : this.disabledColor;
}; };