fix: bug#18733
This commit is contained in:
parent
50a9d83270
commit
057de400fe
|
@ -109,13 +109,17 @@ const upperOptions = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const onChange = () => {
|
const onChange = () => {
|
||||||
|
const objValue: any = { source: _source.value, value: _value.value }
|
||||||
|
if (_source.value === 'upper') {
|
||||||
|
objValue.upperKey = _value.value
|
||||||
|
}
|
||||||
emit('update:value', _value.value);
|
emit('update:value', _value.value);
|
||||||
emit('update:source', _source.value);
|
emit('update:source', _source.value);
|
||||||
emit('change', { source: _source.value, value: _value.value });
|
emit('change', objValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
_value.value = props.value;
|
_value.value = props.value;
|
||||||
_source.value = props.source || 'fixed';
|
_source.value = props.source || 'fixed';
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -173,11 +173,18 @@ const onChange = () => {
|
||||||
|
|
||||||
const onValueChange = (val: any, label: string) => {
|
const onValueChange = (val: any, label: string) => {
|
||||||
const optionColumn = isObject(val) && (val as any).metadata ? [(val as any).column] : []
|
const optionColumn = isObject(val) && (val as any).metadata ? [(val as any).column] : []
|
||||||
|
|
||||||
|
const objectValue: any = {
|
||||||
|
value: propertyModelRef?.propertiesValue,
|
||||||
|
source: propertyModelRef?.source,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (propertyModelRef?.source === 'upper') {
|
||||||
|
objectValue.upperKey = propertyModelRef?.propertiesValue
|
||||||
|
}
|
||||||
|
|
||||||
const obj = {
|
const obj = {
|
||||||
[`${propertyModelRef.properties}`]: {
|
[`${propertyModelRef.properties}`]: objectValue
|
||||||
value: propertyModelRef?.propertiesValue,
|
|
||||||
source: propertyModelRef?.source,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
emit('update:value', obj);
|
emit('update:value', obj);
|
||||||
emit('change', label || val, optionColumn)
|
emit('change', label || val, optionColumn)
|
||||||
|
@ -212,4 +219,4 @@ const onSave = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({ onSave });
|
defineExpose({ onSave });
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue