scorpioyq 2 年之前
父节点
当前提交
2b28287b9f
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      src/views/task/component/task.vue

+ 8 - 6
src/views/task/component/task.vue

@@ -119,12 +119,14 @@ export default {
           this.form = val
           this.data = this.fetchIndex(this.data, this.form.taskStatus)
           this.data1 = this.fetchIndex(this.data1, this.form.level)
-          this.fileList = val.files.map(ele => {
-            return {
-              fileId: ele.id,
-              title: ele.title
-            }
-          })
+          if (val.files && val.files.length > 0) {
+            this.fileList = val.files.map(ele => {
+              return {
+                fileId: ele.id,
+                title: ele.title
+              }
+            })
+          }
         }
       },
       immediate: true