Browse Source

解决算法无文本文档生成时就报错的bug

twzydn20000928 1 year ago
parent
commit
89558c1d4e
1 changed files with 13 additions and 9 deletions
  1. 13 9
      pdaaphm-ui/src/views/algoManager/algorithm/index.vue

+ 13 - 9
pdaaphm-ui/src/views/algoManager/algorithm/index.vue

@@ -365,13 +365,13 @@ export default {
       });
     },
 
-    getFileList() {
-      getFileList().then((resp) => {
-        this.fileList = resp.data;
-        console.info(resp);
-        console.info(this);
-      });
-    },
+    // getFileList() {
+    //   getFileList().then((resp) => {
+    //     this.fileList = resp.data;
+    //     console.info(resp);
+    //     console.info(this);
+    //   });
+    // },
 
     getInputFileList() {
       getInputFileList(this.form.subTypeId).then((resp) => {
@@ -545,8 +545,12 @@ export default {
             filePath = item.path;
           }
         }
-        const response = await axios.get(this.realSrc(filePath), { responseType: 'text' });
-        this.fileContent = response.data;
+        if (filePath) {
+          const response = await axios.get(this.realSrc(filePath), { responseType: 'text' });
+          this.fileContent = response.data;
+        }
+        // const response = await axios.get(this.realSrc(filePath), { responseType: 'text' });
+        // this.fileContent = response.data;
       } catch (error) {
         console.error("Error fetching the file:", error);
         alert('无法加载文件内容');