浏览代码

中间计量,重置问题相关

MaiXinRong 4 年之前
父节点
当前提交
e729b30353
共有 1 个文件被更改,包括 4 次插入2 次删除
  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.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) {
-            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.doc_code = detail.doc_code;