Merge pull request #9985 from ulleo/dev

fix(X-Pack): 修复数据填报单选框修改了选项之后,没有清空单选框内被清理掉选项的数据问题
This commit is contained in:
ulleo 2024-05-30 18:05:36 +08:00 committed by GitHub
commit 24b276061c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,6 +115,19 @@ export default {
} else {
f.value = []
}
} else if (f.type === 'select' && !f.settings.multiple || f.type === 'radio') {
if (_value) {
if (!this.readonly) {
const options = map(f.settings.options, f => f.value)
if (!includes(options, _value)) {
f.value = undefined
} else {
f.value = _value
}
} else {
f.value = _value
}
}
} else {
f.value = _value
}