mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-17 08:54:19 +08:00
添加可视化编排的独立入口
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<ComposerFlow
|
||||
v-model="commandFlow"
|
||||
:generate-code="generateFlowCode"
|
||||
:show-close-button="showCloseButton"
|
||||
@add-command="addCommand"
|
||||
@action="handleComposer"
|
||||
/>
|
||||
@@ -76,7 +77,13 @@ export default defineComponent({
|
||||
hasCommandNeedLoading: false,
|
||||
};
|
||||
},
|
||||
emits: ["use-composer", "update:modelValue"],
|
||||
props: {
|
||||
showCloseButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
emits: ["use-composer"],
|
||||
methods: {
|
||||
addCommand(action) {
|
||||
let newAction = window.lodashM.cloneDeep(action);
|
||||
@@ -99,8 +106,10 @@ export default defineComponent({
|
||||
case "run":
|
||||
return this.runFlow(flow);
|
||||
default:
|
||||
this.$emit("use-composer", { type, code });
|
||||
return this.$emit("update:modelValue", false);
|
||||
return this.$emit("use-composer", {
|
||||
type,
|
||||
code: this.generateFlowCode(),
|
||||
});
|
||||
}
|
||||
},
|
||||
// 传入临时flow说明是运行单独的命令,否则是运行整个命令流
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<ComposerButtons
|
||||
:generate-code="generateCode"
|
||||
:is-all-collapsed="isAllCollapsed"
|
||||
:show-close-button="showCloseButton"
|
||||
@action="handleAction"
|
||||
class="flex-grow"
|
||||
/>
|
||||
@@ -97,6 +98,10 @@ export default defineComponent({
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
showCloseButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const getCurrentVariables = inject("getCurrentVariables");
|
||||
|
||||
@@ -22,17 +22,31 @@
|
||||
v-if="isDev"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn icon="close" dense flat v-close-popup>
|
||||
<q-btn icon="close" dense flat v-close-popup v-if="showCloseButton">
|
||||
<q-tooltip>退出可视化编排</q-tooltip>
|
||||
</q-btn>
|
||||
<q-separator vertical />
|
||||
<q-btn dense icon="read_more" flat @click="$emit('action', 'insert')">
|
||||
<q-separator vertical v-if="showCloseButton" />
|
||||
<q-btn
|
||||
dense
|
||||
icon="read_more"
|
||||
flat
|
||||
v-close-popup
|
||||
@click="$emit('action', 'insert')"
|
||||
v-if="showCloseButton"
|
||||
>
|
||||
<q-tooltip>插入到编辑器光标处</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn dense flat icon="done_all" @click="$emit('action', 'apply')">
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
v-close-popup
|
||||
icon="done_all"
|
||||
@click="$emit('action', 'apply')"
|
||||
v-if="showCloseButton"
|
||||
>
|
||||
<q-tooltip>清空编辑器内容并插入</q-tooltip>
|
||||
</q-btn>
|
||||
<q-separator vertical />
|
||||
<q-separator vertical v-if="showCloseButton" />
|
||||
<q-btn dense flat icon="save" @click="$emit('action', 'save')">
|
||||
<q-tooltip>保存</q-tooltip>
|
||||
</q-btn>
|
||||
@@ -80,6 +94,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
showCloseButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
emits: ["action"],
|
||||
|
||||
Reference in New Issue
Block a user