Jelajahi Sumber

Merge remote-tracking branch 'origin/rmd-dev'

allen 1 tahun lalu
induk
melakukan
97b1eed4e3

+ 10 - 0
pdaaphm-ui/src/views/algoManager/algorithm/algoRun.vue

@@ -12,6 +12,7 @@
       </el-descriptions>
       <div>
         <el-button plain type="primary" class="btn" size="mini" @click="handleRun(info.id)">确认</el-button>
+        <!-- <el-button plain type="primary" class="result" size="mini" @click="checkResult(info.id)">确认</el-button> -->
       </div>
     </div>
     <div class="log" v-if="show">
@@ -80,6 +81,15 @@ export default {
         }
       })
     },
+    // 跳转查看结果列表
+    // checkResult(id){
+    //   this.$router.push({
+    //     name: 'Result',
+    //     params: {
+    //       resultID: id,
+    //     },
+    //   })
+    // }
   },
 }
 </script>

+ 16 - 4
pdaaphm-ui/src/views/algoManager/result.vue

@@ -27,10 +27,18 @@
             </div>
           </div>
         </template>
-        <el-select v-else v-model="item.uploadId" clearable filterable :disabled="form.status == 2 || item.type == 2">
-          <el-option v-for="inputFile in inputFileList" :key="inputFile.id" :label="inputFile.name"
-            :value="inputFile.id" />
-        </el-select>
+        <template v-if="form.status == 2 && item.path.split('.').pop() == 'csv'">
+          <div>
+            <el-link type="primary" style="fontSize:1.3em;marginRight:20px">{{ item.path.split('/').pop() }}</el-link>
+            <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-download"
+                  @click="download(item.path)"
+                >{{ "下载文件" }}
+            </el-button>
+          </div>
+        </template>
       </el-form-item>
     </el-form>
   </div>
@@ -79,6 +87,7 @@ export default {
         this.resultData = response.data
         this.algoTypeList = this.typeMap.get(this.resultData.type)
         this.fetchFileContent(this.resultData.ioSubList)
+        // 判断是不是csv文件,是的话可以显示在线下载
         this.getInputFileList()
         this.loading = false
       })
@@ -113,6 +122,9 @@ export default {
         this.inputFileList = []
       }
     },
+    download(path) {
+      this.$download.resource(path);
+    },
     // 拿到文本文件里的内容
     async fetchFileContent(ioSubList) {
       try {

+ 12 - 8
pdaaphm-ui/src/views/dataManage/contrast/index.vue

@@ -179,14 +179,18 @@ export default {
         this.chart2.dispose()
         this.chart2 = null
       }
-      if (this.ioSubList)
-        this.ioSubList.forEach(item => {
-          if (item.type === '1') {
-            this.handleCSV(item.path, item.type)
-          } else if (item.type === '2' && item.name === '输出1') {
-            this.handleCSV(item.path, item.type)
-          }
-        })
+      if (this.ioSubList){
+        let firstInput = this.ioSubList.find(item => item.type === "1" && item.path.includes(".csv"));
+        let firstOut = this.ioSubList.find(item => item.type === "2" && item.path.includes(".csv"));
+        if (firstInput) {
+          // console.log(firstInput.path,firstInput.type);
+          this.handleCSV(firstInput.path, firstInput.type)
+        }
+        if(firstOut){
+          // console.log(firstOut.path,firstOut.type);
+          this.handleCSV(firstOut.path, firstOut.type)
+        }
+      }
     },
     /** 创建连接算法大类型和算法子类列表的map */
     createTypeMap() {