diff --git a/src/components/composer/card/OutputEditor.vue b/src/components/composer/card/OutputEditor.vue
index e94b879..4906733 100644
--- a/src/components/composer/card/OutputEditor.vue
+++ b/src/components/composer/card/OutputEditor.vue
@@ -4,174 +4,82 @@
@@ -183,12 +91,17 @@
+
+
diff --git a/src/components/composer/card/output/OutputStructure.vue b/src/components/composer/card/output/OutputStructure.vue
new file mode 100644
index 0000000..917f5f4
--- /dev/null
+++ b/src/components/composer/card/output/OutputStructure.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
diff --git a/src/components/composer/card/output/SectionBlock.vue b/src/components/composer/card/output/SectionBlock.vue
new file mode 100644
index 0000000..9178e37
--- /dev/null
+++ b/src/components/composer/card/output/SectionBlock.vue
@@ -0,0 +1,29 @@
+
+
+
+
{{ title }}
+
+ {{ subtitle }}
+
+
+
+
+
+
+
diff --git a/src/components/composer/flow/FlowManager.vue b/src/components/composer/flow/FlowManager.vue
index b137e11..c01aef1 100644
--- a/src/components/composer/flow/FlowManager.vue
+++ b/src/components/composer/flow/FlowManager.vue
@@ -35,6 +35,7 @@
dense
borderless
class="var-input"
+ @blur="validateVariable(localFlow)"
>
标识
@@ -76,8 +77,8 @@
dense
borderless
class="var-input"
- @blur="validateVariable(variable, 'param')"
- @keydown.enter="validateVariable(variable, 'param')"
+ @blur="validateVariable(variable)"
+ @keydown.enter="validateVariable(variable)"
/>
import { defineComponent } from "vue";
+import { validateVariableName } from "js/common/variableValidator";
export default defineComponent({
name: "FlowManager",
@@ -242,14 +244,14 @@ export default defineComponent({
this.localFlow.customVariables = newVars;
}
},
- validateVariable(variable, type) {
- if (!variable.name) {
- const prefix = type === "param" ? "param_" : "var_";
- const count = this.localFlow.customVariables.filter(
- (v) => v.type === type
- ).length;
- variable.name = prefix + count;
+ validateVariable(variable) {
+ if (validateVariableName(variable.name).isValid) {
+ return;
}
+ quickcommand.showMessageBox(
+ `变量/函数名 ${variable.name} 包含无效字符,请修改`,
+ "error"
+ );
},
},
});
diff --git a/src/js/composer/generateCode.js b/src/js/composer/generateCode.js
index b4f375a..f0c12ac 100644
--- a/src/js/composer/generateCode.js
+++ b/src/js/composer/generateCode.js
@@ -10,6 +10,9 @@ export function generateCode(flow) {
return `${varName} = ${varValue};`;
}
usedVarNames[funcName].push(varName);
+ if (!varValue) {
+ return `let ${varName};`;
+ }
return `let ${varName} = ${varValue};`;
};