mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-24 21:13:34 +08:00
配置菜单组件化
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<span v-for="cmd in commandInfo.features.cmds" :key="cmd">
|
||||
<CommandTypeTag
|
||||
:cmd="cmd"
|
||||
:isGrayColor="!canRunAtCurrentOS || !isActivated"
|
||||
:isGrayColor="!isPlatformSupported || !isActivated"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
commandInfo: Object,
|
||||
isActivated: Boolean,
|
||||
cardStyleVars: Object,
|
||||
canRunAtCurrentOS: Boolean,
|
||||
isPlatformSupported: Boolean,
|
||||
isHovered: Boolean,
|
||||
},
|
||||
emits: ["click"],
|
||||
|
@@ -22,7 +22,7 @@
|
||||
dense
|
||||
color="green"
|
||||
icon="play_arrow"
|
||||
v-show="canRun"
|
||||
v-show="isRunButtonVisible"
|
||||
@click="runCommand"
|
||||
>
|
||||
<q-tooltip anchor="top middle" self="center middle">运行</q-tooltip>
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
isVisible: Boolean,
|
||||
isActivated: Boolean,
|
||||
commandInfo: Object,
|
||||
canRunAtCurrentOS: Boolean,
|
||||
isRunButtonVisible: Boolean,
|
||||
},
|
||||
emits: ["update:isVisible", "commandChanged"],
|
||||
data() {
|
||||
@@ -134,16 +134,6 @@ export default {
|
||||
cronExp() {
|
||||
return this.$root.nativeProfile.crontabs[this.featureCode];
|
||||
},
|
||||
// 命令是否可直接运行
|
||||
canRun() {
|
||||
// 未启用
|
||||
if (!this.isActivated) return false;
|
||||
if (!this.canRunAtCurrentOS) return false;
|
||||
let { cmds } = this.commandInfo.features;
|
||||
// 窗口模式
|
||||
if (cmds[0].type && cmds[0].type === "window") return false;
|
||||
return true;
|
||||
},
|
||||
// 命令未启用可以添加计划任务
|
||||
canAddCron() {
|
||||
return !!this.commandInfo.features.cmds[0].length;
|
||||
|
Reference in New Issue
Block a user