From b4033c002e21c1376d68be61622da56182a962e9 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 14 八月 2024 15:19:52 +0800
Subject: [PATCH] 修复设备信息表单生产失败

---
 components/form/form-util.js |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/components/form/form-util.js b/components/form/form-util.js
index 9286ddf..58ec443 100644
--- a/components/form/form-util.js
+++ b/components/form/form-util.js
@@ -60,13 +60,17 @@
       }
       // 涓嬫媺妗嗛櫎浜嗚祴鍊硷紝闇�瑕侀澶栬祴鍊煎睘鎬value(鏁扮粍绫诲瀷锛岀粍浠秚-picker鐨勭壒鎬�)
       else if (e.inputType == 'picker') {
-        if (defaultValue.hasOwnProperty(e.name)) {
+        if (
+          defaultValue.hasOwnProperty(e.name) &&
+          defaultValue[e.name] != null &&
+          defaultValue[e.name] != undefined
+        ) {
           e.value = defaultValue[e.name] + '';
           e._value = [e.value];
-          const op = e.options.find(o=>{
-            return o.value == e.value
-          })
-          e._label = op.label
+          const op = e.options.find(o => {
+            return o.value == e.value;
+          });
+          e._label = op.label;
         }
       }
       // 绾ц仈閫夋嫨鍣紝鏍规嵁灞炴�eferItems鎵惧埌瀵瑰簲鐨勫垵濮嬫暟鎹�
@@ -76,7 +80,11 @@
           note,
           options = e.options;
         e.referItems.forEach(r => {
-          if (defaultValue.hasOwnProperty(r)) {
+          if (
+            defaultValue.hasOwnProperty(r) &&
+            defaultValue[r] != null &&
+            defaultValue[r] != undefined
+          ) {
             const o = options.find(v => {
               return v.value == defaultValue[r];
             });

--
Gitblit v1.9.3