From 7ba7df22c6cb76d377ba1b74edaa60cd3825a5d0 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 10 Jan 2024 15:04:43 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9bug80633?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customField/AddForm.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index ef4d2b5f..92f27b4f 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -663,7 +663,7 @@ export default { submit () { this.$refs.ruleForm.validate(valid => { if (valid) { - const formInline = JSON.parse(JSON.stringify(this.formInline)) + const formInline = { ...this.formInline } Object.keys(formInline).forEach(res => { if (formInline[res] instanceof Array) { if (formInline[res][0] instanceof Object) { @@ -672,6 +672,9 @@ export default { } else { formInline[res] = formInline[res].join(',') } + } else if (typeof formInline[res] === 'undefined') { + // 说明是undefined,改成空字符串,为了解决下拉框改成undefined时,不会传给后端该字段,改不了下拉框值的问题 + formInline[res] = '' } }) this.$emit('submitFormData', formInline)