Skip to content

Commit 46c3725

Browse files
authored
fix: 修复单选框多选框 选择器未使用label作为选项 (#1719)
1 parent f7588c0 commit 46c3725

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

ui/src/components/dynamics-form/constructor/items/JsonInputConstructor.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import JsonInput from '@/components/dynamics-form/items/JsonInput.vue'
1414
const props = defineProps<{
1515
modelValue: any
1616
}>()
17-
const formField = ref<any>({})
1817
const emit = defineEmits(['update:modelValue'])
1918
const formValue = computed({
2019
set: (item) => {

ui/src/components/dynamics-form/constructor/items/MultiSelectConstructor.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<el-option
6464
v-for="(option, index) in formValue.option_list"
6565
:key="index"
66-
:label="option.value"
66+
:label="option.label"
6767
:value="option.value"
6868
/>
6969
</el-select>
@@ -102,8 +102,8 @@ const getData = () => {
102102
input_type: 'MultiSelect',
103103
attrs: {},
104104
default_value: formValue.value.default_value,
105-
textField: 'label',
106-
valueField: 'value',
105+
text_field: 'label',
106+
value_field: 'value',
107107
option_list: formValue.value.option_list
108108
}
109109
}

ui/src/components/dynamics-form/constructor/items/SingleSelectConstructor.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<el-option
5656
v-for="(option, index) in formValue.option_list"
5757
:key="index"
58-
:label="option.value"
58+
:label="option.label"
5959
:value="option.value"
6060
/>
6161
</el-select>
@@ -94,8 +94,8 @@ const getData = () => {
9494
input_type: 'SingleSelect',
9595
attrs: {},
9696
default_value: formValue.value.default_value,
97-
textField: 'label',
98-
valueField: 'value',
97+
text_field: 'label',
98+
value_field: 'value',
9999
option_list: formValue.value.option_list
100100
}
101101
}

ui/src/workflow/nodes/form-node/index.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,19 @@ import { type FormInstance } from 'element-plus'
113113
import { ref, onMounted, computed } from 'vue'
114114
import { input_type_list } from '@/components/dynamics-form/constructor/data'
115115
import { MsgError } from '@/utils/message'
116-
import { set } from 'lodash'
116+
import { set,cloneDeep } from 'lodash'
117117
const props = defineProps<{ nodeModel: any }>()
118118
const formNodeFormRef = ref<FormInstance>()
119119
const editFormField = (form_field_data: any, field_index: number) => {
120-
form_data.value.form_field_list = form_data.value.form_field_list.map(
120+
const _value=form_data.value.form_field_list.map(
121121
(item: any, index: number) => {
122122
if (field_index === index) {
123-
return form_field_data
123+
return cloneDeep(form_field_data)
124124
}
125-
return item
125+
return cloneDeep(item)
126126
}
127127
)
128+
form_data.value.form_field_list = _value
128129
sync_form_field_list()
129130
}
130131
const addFormField = (form_field_data: any) => {

0 commit comments

Comments
 (0)