配置菜单组件化

This commit is contained in:
fofolee
2024-12-20 23:01:26 +08:00
parent a65d9ccdff
commit ffdb737750
11 changed files with 755 additions and 805 deletions

View File

@@ -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"],

View File

@@ -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;