diff --git a/src/components/editor/composer/CommandComposer.vue b/src/components/editor/composer/CommandComposer.vue
index 45fc94b..9ec4aa5 100644
--- a/src/components/editor/composer/CommandComposer.vue
+++ b/src/components/editor/composer/CommandComposer.vue
@@ -3,33 +3,18 @@
-
@@ -39,7 +24,6 @@
import { defineComponent, provide, ref } from "vue";
import ComposerList from "./ComposerList.vue";
import ComposerFlow from "./ComposerFlow.vue";
-import ComposerButtons from "./ComposerButtons.vue";
import { commandCategories } from "js/composer/composerConfig";
import { generateCode } from "js/composer/generateCode";
// 从commandCategories中提取所有命令
@@ -57,7 +41,6 @@ export default defineComponent({
components: {
ComposerList,
ComposerFlow,
- ComposerButtons,
},
setup() {
const variables = ref([]);
@@ -154,25 +137,6 @@ export default defineComponent({
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
-.section-header {
- display: flex;
- align-items: center;
- padding: 12px 16px;
- height: 28px;
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
-}
-
-.body--dark .section-header {
- border-bottom-color: rgba(255, 255, 255, 0.1);
-}
-
-.command-scroll {
- flex: 1;
- overflow: hidden;
- border-radius: 8px;
- padding-bottom: 8px;
-}
-
/* 滚动美化 */
:deep(.q-scrollarea__thumb) {
width: 2px;
diff --git a/src/components/editor/composer/ComposerButtons.vue b/src/components/editor/composer/ComposerButtons.vue
index 81503fa..378fef6 100644
--- a/src/components/editor/composer/ComposerButtons.vue
+++ b/src/components/editor/composer/ComposerButtons.vue
@@ -98,7 +98,7 @@ export default defineComponent({
.composer-buttons > .q-btn:hover {
opacity: 1;
- transform: translateY(-2px);
+ transform: translateY(-1px);
color: var(--q-primary);
}
diff --git a/src/components/editor/composer/ComposerFlow.vue b/src/components/editor/composer/ComposerFlow.vue
index dc6c260..d9bae8b 100644
--- a/src/components/editor/composer/ComposerFlow.vue
+++ b/src/components/editor/composer/ComposerFlow.vue
@@ -1,55 +1,67 @@
-
-
+
+ 命令流程
+
+
+
+
+
+
-
-
-
- handleArgvChange(index, val)"
- @update:command="(val) => updateCommand(index, val)"
- />
-
-
-
-
-
-
-
-
从左侧拖拽命令到这里开始编排
+
+
+
+
+ handleArgvChange(index, val)"
+ @update:command="(val) => updateCommand(index, val)"
+ />
+
+
+
+
+
+
+
-
-
-
-
+
@@ -57,20 +69,26 @@
import { defineComponent, inject } from "vue";
import draggable from "vuedraggable";
import ComposerCard from "./ComposerCard.vue";
+import ComposerButtons from "./ComposerButtons.vue";
export default defineComponent({
name: "ComposerFlow",
components: {
draggable,
ComposerCard,
+ ComposerButtons,
},
props: {
modelValue: {
type: Array,
required: true,
},
+ generateCode: {
+ type: Function,
+ required: true,
+ },
},
- emits: ["update:modelValue", "add-command"],
+ emits: ["update:modelValue", "add-command", "action"],
computed: {
commands: {
get() {
@@ -230,8 +248,25 @@ export default defineComponent({
diff --git a/src/components/editor/composer/ComposerList.vue b/src/components/editor/composer/ComposerList.vue
index cad6f72..6b49544 100644
--- a/src/components/editor/composer/ComposerList.vue
+++ b/src/components/editor/composer/ComposerList.vue
@@ -1,43 +1,75 @@
-
-
-
-
-
- {{ category.label }}
-
-
+
-
-
- {{
- command.label
- }}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ category.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/js/composer/commands/encodeCommands.js b/src/js/composer/commands/encodeCommands.js
index 16f3f3a..a12be83 100644
--- a/src/js/composer/commands/encodeCommands.js
+++ b/src/js/composer/commands/encodeCommands.js
@@ -1,6 +1,7 @@
export const encodeCommands = {
label: "编码解码",
icon: "code",
+ defaultOpened: false,
commands: [
{
value: "(text=>Buffer.from(text).toString('base64'))",
diff --git a/src/js/composer/commands/fileCommands.js b/src/js/composer/commands/fileCommands.js
index 7a640c3..3559345 100644
--- a/src/js/composer/commands/fileCommands.js
+++ b/src/js/composer/commands/fileCommands.js
@@ -1,6 +1,7 @@
export const fileCommands = {
label: "文件操作",
icon: "folder",
+ defaultOpened: true,
commands: [
{
value: "open",
diff --git a/src/js/composer/commands/keyCommands.js b/src/js/composer/commands/keyCommands.js
index c03d7a3..40e4275 100644
--- a/src/js/composer/commands/keyCommands.js
+++ b/src/js/composer/commands/keyCommands.js
@@ -1,6 +1,7 @@
export const keyCommands = {
label: "按键操作",
icon: "keyboard",
+ defaultOpened: false,
commands: [
{
value: "keyTap",
diff --git a/src/js/composer/commands/networkCommands.js b/src/js/composer/commands/networkCommands.js
index 2de503e..ed3aa85 100644
--- a/src/js/composer/commands/networkCommands.js
+++ b/src/js/composer/commands/networkCommands.js
@@ -1,6 +1,7 @@
export const networkCommands = {
label: "网络操作",
icon: "language",
+ defaultOpened: true,
commands: [
{
value: "visit",
diff --git a/src/js/composer/commands/notifyCommands.js b/src/js/composer/commands/notifyCommands.js
index f6f91b2..1d93498 100644
--- a/src/js/composer/commands/notifyCommands.js
+++ b/src/js/composer/commands/notifyCommands.js
@@ -1,6 +1,7 @@
export const notifyCommands = {
label: "消息通知",
icon: "notifications",
+ defaultOpened: false,
commands: [
{
value: "console.log",
diff --git a/src/js/composer/commands/otherCommands.js b/src/js/composer/commands/otherCommands.js
index 3c07cea..ef5e04d 100644
--- a/src/js/composer/commands/otherCommands.js
+++ b/src/js/composer/commands/otherCommands.js
@@ -1,6 +1,7 @@
export const otherCommands = {
label: "其他功能",
icon: "more_horiz",
+ defaultOpened: false,
commands: [
{
value: "utools.redirect",
diff --git a/src/js/composer/commands/systemCommands.js b/src/js/composer/commands/systemCommands.js
index c1a2f87..ca63678 100644
--- a/src/js/composer/commands/systemCommands.js
+++ b/src/js/composer/commands/systemCommands.js
@@ -1,6 +1,7 @@
export const systemCommands = {
label: "系统操作",
icon: "computer",
+ defaultOpened: false,
commands: [
{
value: "system",