zhangjie 2 سال پیش
والد
کامیت
4feb40559d
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      src/modules/question/components/QuestionImportEdit.vue

+ 4 - 1
src/modules/question/components/QuestionImportEdit.vue

@@ -270,10 +270,13 @@ export default {
         return detail;
       });
     },
+    isNull(val) {
+      return val === null || val === "" || val === undefined;
+    },
     mergeObjData(targetObj, cacheObj) {
       let data = { ...targetObj };
       Object.keys(cacheObj).forEach((k) => {
-        data[k] = cacheObj[k] || targetObj[k];
+        data[k] = this.isNull(cacheObj[k]) ? targetObj[k] : cacheObj[k];
       });
       return data;
     },