We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d49a785 commit 44b3aedCopy full SHA for 44b3aed
ui/src/components/dynamics-form/index.vue
@@ -172,8 +172,17 @@ const render = (
172
formFieldList.value = ok.data
173
})
174
}
175
- if (data) {
176
- formValue.value = _.cloneDeep(data)
+ const form_data = data ? data : {}
+ if (form_data) {
177
+ const value = formFieldList.value
178
+ .map((item) => {
179
+ if (form_data[item.field] !== undefined) {
180
+ return { [item.field]: form_data[item.field] }
181
+ }
182
+ return { [item.field]: item.default_value }
183
+ })
184
+ .reduce((x, y) => ({ ...x, ...y }), {})
185
+ formValue.value = _.cloneDeep(value)
186
187
188
/**
0 commit comments