添加可视化编排的独立入口

This commit is contained in:
fofolee
2025-01-12 15:35:45 +08:00
parent 2fcad53ef9
commit 9df34cfe08
9 changed files with 134 additions and 63 deletions

View File

@@ -39,8 +39,6 @@
<template v-if="modelValue.program === 'quickcommand'">
<q-btn
v-for="(item, index) in [
// 'keyboard',
// 'rocket_launch',
'help_center',
'view_timeline',
]"
@@ -53,7 +51,6 @@
@click="handleQuickCommandAction(index)"
>
<q-tooltip>
<!-- {{ ["录制按键", "快捷动作", "查看文档", "可视化编排"][index] }} -->
{{ ["查看文档", "可视化编排"][index] }}
</q-tooltip>
</q-btn>
@@ -161,36 +158,13 @@
></q-btn>
</q-btn-group>
</div>
<!-- 移动对话框到这里 -->
<!-- <q-dialog v-model="showActions">
<QuickAction @addAction="addAction" />
</q-dialog> -->
<!-- <q-dialog v-model="showRecorder" position="bottom">
<KeyRecorder @sendKeys="addAction" />
</q-dialog> -->
<q-dialog v-model="showComposer" maximized>
<CommandComposer
ref="composer"
@use-composer="handleComposer"
@update:model-value="showComposer = false"
/>
</q-dialog>
</div>
</template>
<script>
// import QuickAction from "components/popup/QuickAction";
// import KeyRecorder from "components/popup/KeyRecorder";
import CommandComposer from "components/composer/CommandComposer.vue";
export default {
name: "CommandLanguageBar",
components: {
// QuickAction,
// KeyRecorder,
CommandComposer,
},
props: {
modelValue: {
type: Object,
@@ -209,22 +183,12 @@ export default {
default: false,
},
},
data() {
return {
// showActions: false,
// showRecorder: false,
showComposer: false,
};
},
emits: [
"update:modelValue",
"program-changed",
"run",
"save",
// "show-recorder",
// "show-actions",
"show-help",
"use-composer",
"show-composer",
],
computed: {
programLanguages() {
@@ -280,23 +244,14 @@ export default {
},
handleQuickCommandAction(index) {
const actions = [
// () => (this.showRecorder = true),
// () => (this.showActions = true),
() => this.showHelp(),
() => (this.showComposer = true),
() => this.$emit("show-composer"),
];
actions[index]();
},
// addAction(text) {
// this.$emit("add-action", text);
// },
showHelp() {
window.showUb.docs();
},
handleComposer({ type, code }) {
this.$emit("use-composer", { type, code });
if (type !== "run") this.showComposer = false;
},
},
};
</script>