diff --git a/ui/src/components/dynamics-form/constructor/items/SingleSelectConstructor.vue b/ui/src/components/dynamics-form/constructor/items/SingleSelectConstructor.vue
index 17d52a268..48315ad6c 100644
--- a/ui/src/components/dynamics-form/constructor/items/SingleSelectConstructor.vue
+++ b/ui/src/components/dynamics-form/constructor/items/SingleSelectConstructor.vue
@@ -77,6 +77,7 @@ const getData = () => {
}
const rander = (form_data: any) => {
formValue.value.option_list = form_data.option_list
+ formValue.value.default_value = form_data.default_value
}
defineExpose({ getData, rander })
diff --git a/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue b/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue
index 1f23ad846..7ac8e86fd 100644
--- a/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue
+++ b/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue
@@ -3,7 +3,7 @@
@@ -13,7 +13,7 @@
@@ -27,8 +27,8 @@
>
{
return {
input_type: 'TextInput',
attrs: {
- maxlength: formValue.value.max_length,
- minlength: formValue.value.min_length,
+ maxlength: formValue.value.maxlength,
+ minlength: formValue.value.minlength,
'show-word-limit': true
},
default_value: formValue.value.default_value
@@ -64,14 +64,14 @@ const getData = () => {
}
const rander = (form_data: any) => {
const attrs = form_data.attrs || {}
- formValue.value.min_length = attrs.min_length
- formValue.value.max_length = attrs.max_length
+ formValue.value.minlength = attrs.minlength
+ formValue.value.maxlength = attrs.maxlength
formValue.value.default_value = form_data.default_value
}
defineExpose({ getData, rander })
onMounted(() => {
- formValue.value.min_length = 0
- formValue.value.max_length = 20
+ formValue.value.minlength = 0
+ formValue.value.maxlength = 20
formValue.value.default_value = ''
})
diff --git a/ui/src/workflow/nodes/base-node/component/UserFieldFormDialog.vue b/ui/src/workflow/nodes/base-node/component/UserFieldFormDialog.vue
index ffa343917..6b3daf519 100644
--- a/ui/src/workflow/nodes/base-node/component/UserFieldFormDialog.vue
+++ b/ui/src/workflow/nodes/base-node/component/UserFieldFormDialog.vue
@@ -44,10 +44,11 @@ const currentRow = computed(() => {
const row = currentItem.value
switch (row.type) {
case 'input':
- if (check_field(['field', 'input_type', 'label', 'required'], currentItem.value)) {
+ if (check_field(['field', 'input_type', 'label', 'required', 'attrs'], currentItem.value)) {
return currentItem.value
}
return {
+ attrs: row.attrs || { maxlength: 20, minlength: 0 },
field: row.field || row.variable,
input_type: 'TextInput',
label: row.label || row.name,
@@ -64,12 +65,13 @@ const currentRow = computed(() => {
return currentItem.value
}
return {
+ attrs: row.attrs || {},
field: row.field || row.variable,
input_type: 'SingleSelect',
label: row.label || row.name,
default_value: row.default_value,
required: row.required != undefined ? row.required : row.is_required,
- option_list: row.optionList.map((o: any) => {
+ option_list: row.option_list ? row.option_list: row.optionList.map((o: any) => {
return { key: o, value: o }
})
}
@@ -106,6 +108,8 @@ const currentRow = computed(() => {
default:
return currentItem.value
}
+ } else {
+ return { input_type: 'TextInput', required: true, attrs: { maxlength: 20, minlength: 0 } }
}
})
const currentIndex = ref(null)
@@ -124,6 +128,8 @@ const open = (row: any, index: any) => {
isEdit.value = true
currentItem.value = cloneDeep(row)
currentIndex.value = index
+ } else {
+ currentItem.value = null
}
}