diff --git a/src/components/composer/ComposerCard.vue b/src/components/composer/ComposerCard.vue
index 3f133c0..6321231 100644
--- a/src/components/composer/ComposerCard.vue
+++ b/src/components/composer/ComposerCard.vue
@@ -28,6 +28,7 @@
:command="command"
v-bind="command.componentProps || {}"
:type="command.commandType"
+ class="control-component"
@addBranch="(chainInfo) => $emit('addBranch', chainInfo)"
/>
@@ -67,11 +68,12 @@
diff --git a/src/components/composer/control/LoopControl.vue b/src/components/composer/control/LoopControl.vue
index b3b88a3..8f43aeb 100644
--- a/src/components/composer/control/LoopControl.vue
+++ b/src/components/composer/control/LoopControl.vue
@@ -2,7 +2,7 @@
-
+
开始
继续
终止
@@ -30,7 +30,7 @@
dropdown-icon="add"
no-icon-animation
size="sm"
- class="control-btn q-ml-sm"
+ class="control-btn"
>
.loop-control-wrapper {
width: 100%;
+ display: flex;
}
.loop-control {
+ width: 100%;
display: flex;
align-items: center;
+ gap: 8px;
}
.control-type-label {
@@ -190,6 +193,7 @@ export default defineComponent({
width: 21px;
height: 21px;
opacity: 0.7;
+ flex-shrink: 0;
}
.control-btn:hover {
@@ -201,6 +205,7 @@ export default defineComponent({
display: flex;
gap: 4px;
flex: 1;
+ min-width: 0;
}
.loop-input {
diff --git a/src/components/composer/control/SwitchControl.vue b/src/components/composer/control/SwitchControl.vue
new file mode 100644
index 0000000..9226fa3
--- /dev/null
+++ b/src/components/composer/control/SwitchControl.vue
@@ -0,0 +1,219 @@
+
+
+
+
+
+ 选择
+ 匹配
+ 默认
+ 结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加匹配分支
+
+
+
+
+ 添加默认分支
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/composer/control/TryCatchControl.vue b/src/components/composer/control/TryCatchControl.vue
new file mode 100644
index 0000000..9c611e9
--- /dev/null
+++ b/src/components/composer/control/TryCatchControl.vue
@@ -0,0 +1,201 @@
+
+
+
+
+
+ 尝试
+ 捕获
+ 最后
+ 结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加捕获分支
+
+
+
+
+ 添加最后分支
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/composer/control/WhileControl.vue b/src/components/composer/control/WhileControl.vue
new file mode 100644
index 0000000..9034d20
--- /dev/null
+++ b/src/components/composer/control/WhileControl.vue
@@ -0,0 +1,202 @@
+
+
+
+
+
+ 满足
+ 继续
+ 终止
+ 结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加继续循环
+
+
+
+
+ 添加终止循环
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/js/composer/cardComponents.js b/src/js/composer/cardComponents.js
new file mode 100644
index 0000000..6baf159
--- /dev/null
+++ b/src/js/composer/cardComponents.js
@@ -0,0 +1,51 @@
+import { defineAsyncComponent } from "vue";
+
+// UI Components
+export const KeyEditor = defineAsyncComponent(() =>
+ import("components/composer/ui/KeyEditor.vue")
+);
+export const FunctionSelector = defineAsyncComponent(() =>
+ import("components/composer/ui/FunctionSelector.vue")
+);
+
+// Control Flow Components
+export const ConditionalJudgment = defineAsyncComponent(() =>
+ import("components/composer/control/ConditionalJudgment.vue")
+);
+export const LoopControl = defineAsyncComponent(() =>
+ import("components/composer/control/LoopControl.vue")
+);
+export const ForEachControl = defineAsyncComponent(() =>
+ import("components/composer/control/ForEachControl.vue")
+);
+export const ForInControl = defineAsyncComponent(() =>
+ import("components/composer/control/ForInControl.vue")
+);
+export const WhileControl = defineAsyncComponent(() =>
+ import("components/composer/control/WhileControl.vue")
+);
+export const SwitchControl = defineAsyncComponent(() =>
+ import("components/composer/control/SwitchControl.vue")
+);
+export const TryCatchControl = defineAsyncComponent(() =>
+ import("components/composer/control/TryCatchControl.vue")
+);
+
+// Editor Components
+export const UBrowserEditor = defineAsyncComponent(() =>
+ import("components/composer/ubrowser/UBrowserEditor.vue")
+);
+export const AxiosConfigEditor = defineAsyncComponent(() =>
+ import("components/composer/http/AxiosConfigEditor.vue")
+);
+export const RegexEditor = defineAsyncComponent(() =>
+ import("components/composer/regex/RegexEditor.vue")
+);
+
+// Crypto Components
+export const SymmetricCryptoEditor = defineAsyncComponent(() =>
+ import("components/composer/crypto/SymmetricCryptoEditor.vue")
+);
+export const AsymmetricCryptoEditor = defineAsyncComponent(() =>
+ import("components/composer/crypto/AsymmetricCryptoEditor.vue")
+);
diff --git a/src/js/composer/commands/controlCommands.js b/src/js/composer/commands/controlCommands.js
index 1ac2648..5735e86 100644
--- a/src/js/composer/commands/controlCommands.js
+++ b/src/js/composer/commands/controlCommands.js
@@ -11,7 +11,7 @@ export const controlCommands = {
},
{
value: "loop",
- label: "循环",
+ label: "循环执行",
component: "LoopControl",
isControlFlow: true,
commandChain: ["loop", "end"],
@@ -23,5 +23,33 @@ export const controlCommands = {
isControlFlow: true,
commandChain: ["forEach", "end"],
},
+ {
+ value: "forIn",
+ label: "遍历对象",
+ component: "ForInControl",
+ isControlFlow: true,
+ commandChain: ["forIn", "end"],
+ },
+ {
+ value: "while",
+ label: "条件循环",
+ component: "WhileControl",
+ isControlFlow: true,
+ commandChain: ["while", "end"],
+ },
+ {
+ value: "switch",
+ label: "条件分支",
+ component: "SwitchControl",
+ isControlFlow: true,
+ commandChain: ["switch", "case", "end"],
+ },
+ {
+ value: "tryCatch",
+ label: "异常处理",
+ component: "TryCatchControl",
+ isControlFlow: true,
+ commandChain: ["try", "catch", "end"],
+ },
],
};