默认命令只读保护

This commit is contained in:
fofolee 2022-04-09 16:40:55 +08:00
parent 94b19dce5d
commit 690553c9e8
3 changed files with 10 additions and 2 deletions

View File

@ -290,8 +290,6 @@ export default {
handleCardClick() { handleCardClick() {
// //
if (this.cardStyle.code === 1) return this.runCommand(); if (this.cardStyle.code === 1) return this.runCommand();
if (!this.canCommandEdit)
return quickcommand.showMessageBox("默认命令不可编辑", "warning");
this.editCommand(); this.editCommand();
}, },
// //

View File

@ -3,6 +3,7 @@
<!-- 命令设置栏 --> <!-- 命令设置栏 -->
<CommandMenu <CommandMenu
ref="menu" ref="menu"
:canCommandSave="canCommandSave"
:quickcommandInfo="quickcommandInfo" :quickcommandInfo="quickcommandInfo"
class="absolute-left shadow-10" class="absolute-left shadow-10"
:style="{ :style="{

View File

@ -21,6 +21,7 @@
<div> <div>
<!-- 说明 --> <!-- 说明 -->
<q-input <q-input
:disable="!canCommandSave"
stack-label stack-label
label-color="primary" label-color="primary"
borderless borderless
@ -36,6 +37,7 @@
</q-input> </q-input>
<!-- 匹配类型 --> <!-- 匹配类型 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -72,6 +74,7 @@
</q-select> </q-select>
<!-- 匹配规则 --> <!-- 匹配规则 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -96,6 +99,7 @@
</template> </template>
</q-select> </q-select>
<q-input <q-input
:disable="!canCommandSave"
v-else v-else
autogrow autogrow
borderless borderless
@ -113,6 +117,7 @@
</q-input> </q-input>
<!-- 标签 --> <!-- 标签 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -138,6 +143,7 @@
</q-select> </q-select>
<!-- 特殊变量 --> <!-- 特殊变量 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -174,6 +180,7 @@
> >
<!-- 输出 --> <!-- 输出 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -206,6 +213,7 @@
</q-select> </q-select>
<!-- 平台 --> <!-- 平台 -->
<q-select <q-select
:disable="!canCommandSave"
hide-dropdown-icon hide-dropdown-icon
stack-label stack-label
label-color="primary" label-color="primary"
@ -261,6 +269,7 @@ export default {
}, },
props: { props: {
quickcommandInfo: Object, quickcommandInfo: Object,
canCommandSave: Boolean,
}, },
mounted() { mounted() {
window.CommandMenu = this; window.CommandMenu = this;