Explorar o código

前后端日志数据处理

wanggaokun hai 1 ano
pai
achega
bde05a1021

+ 1 - 1
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/AlgorithmServiceImpl.java

@@ -177,7 +177,7 @@ public class AlgorithmServiceImpl implements IAlgorithmService
     @Override
     public List<Map> getOption() { return algorithmMapper.getOption(); }
 
-    // @Async
+    @Async
     @Override
     public void runAlgorithms(Long id) throws IOException {
         String key = "TASK-" + id;

+ 4 - 2
pdaaphm-ui/src/views/algoManager/algorithm/algoRun.vue

@@ -59,6 +59,7 @@ export default {
     },
     /** 运行算法按钮操作 */
     handleRun(id) {
+      this.message = ''
       this.show = true
       const taskId = `TASK-${id}`
       runAlgorithms(id).then(res => {
@@ -67,8 +68,9 @@ export default {
     },
     getLogInfo(taskId) {
       getLog(taskId).then(response => {
-        let logData = response.data
-        if (!logData || (logData && logData.includes('任务执行完成')) ) {
+        let logData = response.data || `<p style='color: #58e072'> INFO: [2023-10-23 15:00:14] -> 算法执行中...... </p>`
+        console.log('response.data', logData);
+        if (logData && logData.includes('任务执行完成')) {
           console.log("定时器销毁");
           clearInterval(this.timer)
         }