mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-18 03:07:36 +08:00
🐛 Fix(custom): fix the value not update issue when set per picbed preprocess
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user