Browse Source

中间计量,重置问题相关

MaiXinRong 4 years ago
parent
commit
e729b30353
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/public/js/stage_im.js

+ 4 - 2
app/public/js/stage_im.js

@@ -261,9 +261,11 @@ const stageIm = (function () {
                 im.org[f] = im[f];
                 im.org[f] = im[f];
             }
             }
         }
         }
-        im.custom_define = detail.custom_define ? detail.custom_define.split(',') : imFields;
+        im.custom_define = detail.custom_define ? detail.custom_define.split(',') : [];
         _.assignInWith(im, detail, function (oV, sV, key) {
         _.assignInWith(im, detail, function (oV, sV, key) {
-            return (im.custom_define.indexOf(key) > -1) ? sV : ((resetFields.indexOf(key) > -1) ? im.org[key] : oV);
+            return im.custom_define.length > 0
+                ? (im.custom_define.indexOf(key) > -1 ? sV : ((resetFields.indexOf(key) > -1) ? im.org[key] : oV))
+                : (imFields.indexOf(key) > -1 ? sV : ((resetFields.indexOf(key) > -1) ? im.org[key] : oV));
         });
         });
         im.uuid = detail.uuid;
         im.uuid = detail.uuid;
         im.doc_code = detail.doc_code;
         im.doc_code = detail.doc_code;