From 85e8c7af0a03795490e1bba458018fe9e90499f8 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期一, 28 十月 2024 13:08:14 +0800
Subject: [PATCH] 新增可靠性仿真评估算法库进程管理功能

---
 web/src/views/modules/taskReliability/SchemeCompar.vue |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/web/src/views/modules/taskReliability/SchemeCompar.vue b/web/src/views/modules/taskReliability/SchemeCompar.vue
index e255b9a..718307c 100644
--- a/web/src/views/modules/taskReliability/SchemeCompar.vue
+++ b/web/src/views/modules/taskReliability/SchemeCompar.vue
@@ -156,11 +156,11 @@
       ProductModelTree,
     },
     watch: {
-      percentage() {
-        if (this.percentage === 100) {
-          this.getEcharts();
-        }
-      }
+      // percentage() {
+      //   if (this.percentage === 100) {
+      //     this.getEcharts();
+      //   }
+      // }
     },
     methods: {
       onTreeSelected(data) {
@@ -205,18 +205,20 @@
         console.log(res.data)
         this.schemeList = res.data
       },
-      getStroke() {
-        if (this.percentage < 100) {
-          let param = {
-            taskList: this.fzIdList
-          }
-          this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param}).then(
-            res => {
-              if (res.data) {
-                this.percentage = parseFloat(res.data)
-              }
+      async getStroke() {
+        let param = {
+          taskList: this.fzIdList
+        }
+        let res = await this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param})
+        if (res.success) {
+          if (res.data) {
+            this.percentage = parseFloat(res.data)
+            if (this.percentage >= 100) {
+              clearInterval(this.timers)
+              this.percentage = 0
+              await this.getEcharts();
             }
-          )
+          }
         } else {
           clearInterval(this.timers)
           this.percentage = 0
@@ -233,6 +235,7 @@
           simulatFrequency: this.dataForm.simulatFrequency
         }
         console.log(this.dataForm.taskModelId, 'this.dataForm.taskModelId')
+        this.percentage = 0
         let res = await this.$http.get('/taskReliability/SimulatAssess/SchemeCompar', {params: params})
         console.log(res.data, "res")
         if (res.success) {

--
Gitblit v1.9.1