Browse Source

答案bug修改

zhangjie 2 năm trước cách đây
mục cha
commit
b424bda525
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      src/modules/question/components/QuestionImportEdit.vue

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

@@ -278,7 +278,14 @@ export default {
     mergeObjData(targetObj, cacheObj) {
       let data = { ...targetObj };
       Object.keys(cacheObj).forEach((k) => {
-        data[k] = this.isNull(cacheObj[k]) ? targetObj[k] : cacheObj[k];
+        if (k === "quesAnswer") {
+          data[k] =
+            this.isNull(targetObj[k]) || targetObj[k] === "[]"
+              ? cacheObj[k]
+              : targetObj[k];
+        } else {
+          data[k] = this.isNull(targetObj[k]) ? cacheObj[k] : targetObj[k];
+        }
       });
       return data;
     },