优化ArrayDict/DictEditor参数传递,修复formatString处理Array时的BUG

This commit is contained in:
fofolee
2025-01-10 18:54:11 +08:00
parent 41b3501945
commit 5e70c4c9a0
10 changed files with 372 additions and 371 deletions

View File

@@ -130,23 +130,8 @@
<template v-if="argvs.optionType === 'json'">
<ArrayEditor
:model-value="argvs.selects"
:options="{
keys: [
{
value: 'id',
label: 'id',
width: 3,
},
{
value: 'title',
label: '标题',
},
{
value: 'description',
label: '描述',
},
],
}"
:columns="arrayEditorColumns"
:default-row-value="arrayEditorDefaultRowValue"
@update:model-value="updateArgvs('selects', $event)"
>
<template #header>
@@ -178,8 +163,7 @@ import VariableInput from "../common/VariableInput.vue";
import ArrayEditor from "../common/ArrayEditor.vue";
import OperationCard from "../common/OperationCard.vue";
import { parseFunction, stringifyArgv } from "js/composer/formatString";
import { newVarInputVal, isVarInputVal} from "js/composer/varInputValManager";
import { newVarInputVal, isVarInputVal } from "js/composer/varInputValManager";
const jsonDefaultSelects = new Array(3).fill().map((_, index) => ({
id: newVarInputVal("var", index),
@@ -226,6 +210,28 @@ export default defineComponent({
showCancelButton: false,
closeOnSelect: true,
},
arrayEditorDefaultRowValue: {
id: newVarInputVal("var"),
title: newVarInputVal("str"),
description: newVarInputVal("str"),
},
arrayEditorColumns: {
id: {
label: "id",
width: 3,
noIcon: true,
},
title: {
label: "标题",
width: 4,
noIcon: true,
},
description: {
label: "描述",
width: 4,
noIcon: true,
},
},
};
},
computed: {