fix: 修复单选框多选框 选择器未使用label作为选项 (#1719)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2024-12-01 00:05:04 +08:00 committed by GitHub
parent f7588c0b28
commit 46c37257bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,6 @@ import JsonInput from '@/components/dynamics-form/items/JsonInput.vue'
const props = defineProps<{
modelValue: any
}>()
const formField = ref<any>({})
const emit = defineEmits(['update:modelValue'])
const formValue = computed({
set: (item) => {

View File

@ -63,7 +63,7 @@
<el-option
v-for="(option, index) in formValue.option_list"
:key="index"
:label="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
@ -102,8 +102,8 @@ const getData = () => {
input_type: 'MultiSelect',
attrs: {},
default_value: formValue.value.default_value,
textField: 'label',
valueField: 'value',
text_field: 'label',
value_field: 'value',
option_list: formValue.value.option_list
}
}

View File

@ -55,7 +55,7 @@
<el-option
v-for="(option, index) in formValue.option_list"
:key="index"
:label="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
@ -94,8 +94,8 @@ const getData = () => {
input_type: 'SingleSelect',
attrs: {},
default_value: formValue.value.default_value,
textField: 'label',
valueField: 'value',
text_field: 'label',
value_field: 'value',
option_list: formValue.value.option_list
}
}

View File

@ -113,18 +113,19 @@ import { type FormInstance } from 'element-plus'
import { ref, onMounted, computed } from 'vue'
import { input_type_list } from '@/components/dynamics-form/constructor/data'
import { MsgError } from '@/utils/message'
import { set } from 'lodash'
import { set,cloneDeep } from 'lodash'
const props = defineProps<{ nodeModel: any }>()
const formNodeFormRef = ref<FormInstance>()
const editFormField = (form_field_data: any, field_index: number) => {
form_data.value.form_field_list = form_data.value.form_field_list.map(
const _value=form_data.value.form_field_list.map(
(item: any, index: number) => {
if (field_index === index) {
return form_field_data
return cloneDeep(form_field_data)
}
return item
return cloneDeep(item)
}
)
form_data.value.form_field_list = _value
sync_form_field_list()
}
const addFormField = (form_field_data: any) => {