🐛 Fix(custom): fix the value not update issue when set per picbed preprocess

This commit is contained in:
Kuingsmile
2026-01-27 11:15:25 +08:00
parent f5ff523cfb
commit cf02a8f4e3
5 changed files with 34 additions and 19 deletions

View File

@@ -1402,6 +1402,11 @@ function safeSetMapValue(form: any, fieldName: string, picbedType: string, value
if (!form[mapFieldName]) {
form[mapFieldName] = {}
}
const globalValue = form[fieldName]
const isSameValue =
fieldName === 'formatConvertObj'
? JSON.stringify(JSON.parse(value)) === JSON.stringify(JSON.parse(globalValue || '{}'))
: value === globalValue
const isValueDefault =
fieldName === 'formatConvertObj'
? JSON.stringify(JSON.parse(value)) === JSON.stringify(defaultValue)
@@ -1410,7 +1415,7 @@ function safeSetMapValue(form: any, fieldName: string, picbedType: string, value
fieldName === 'formatConvertObj'
? JSON.stringify(form[fieldName]) === JSON.stringify(defaultValue)
: form[fieldName] === defaultValue
if (isValueDefault && isFormValueDefault) {
if ((isValueDefault && isFormValueDefault) || isSameValue) {
delete form[mapFieldName][picbedType]
} else {
if (fieldName === 'formatConvertObj') {