OutPutEditor添加键入建议变量名功能,并加入重名检测

This commit is contained in:
fofolee
2025-01-26 17:25:58 +08:00
parent baf5217132
commit 73684865ae
8 changed files with 124 additions and 48 deletions

View File

@@ -3,7 +3,7 @@
<OperationCard
v-if="hasSubCommands"
:model-value="funcName"
@update:model-value="funcName = $event"
@update:model-value="updateFuncName"
:options="localCommand.subCommands"
/>
<ParamInput :configs="localConfig" :values="argvs" @update="updateArgv" />
@@ -204,6 +204,15 @@ export default defineComponent({
width: `calc(${columnWidth}% - var(--grid-gap))`,
};
},
updateFuncName(value) {
this.funcName = value;
// 如果切换了子命令,更新输出变量
const selectSubCommand = this.getSelectSubCommand(value);
if (!selectSubCommand) return;
const newModelValue = { ...this.modelValue, value: value };
delete newModelValue.outputVariable;
this.$emit("update:modelValue", newModelValue);
},
},
mounted() {
const argvs = this.modelValue.argvs || this.defaultArgvs;