mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复单选框多选框 选择器未使用label作为选项 (#1719)
This commit is contained in:
parent
f7588c0b28
commit
46c37257bc
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue