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/SimulatAssess.vue |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/web/src/views/modules/taskReliability/SimulatAssess.vue b/web/src/views/modules/taskReliability/SimulatAssess.vue
index 915cb2e..de15fbc 100644
--- a/web/src/views/modules/taskReliability/SimulatAssess.vue
+++ b/web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -24,6 +24,9 @@
         <zt-form-item style="margin-left: 20px">
           <zt-button @click="analyze()">浠跨湡鍒嗘瀽</zt-button>
         </zt-form-item>
+        <zt-form-item style="margin-left: 20px">
+          <zt-button @click="displayProcess()">鏌ョ湅绠楁硶搴撹繘绋�</zt-button>
+        </zt-form-item>
       </el-form>
       <el-progress v-if="isShow" :percentage="percentage"></el-progress>
           <el-col :span="4">
@@ -55,18 +58,20 @@
         <el-button type="primary" @click="dialogVisible = false">鍏� 闂�</el-button>
       </div>
     </el-dialog>
+    <Process ref="process"></Process>
   </div>
 </template>
 
 <script>
   import SimulatCurve from "./SimulatCurve";
   import ProductModelTree from "../basicInfo/ProductModelTree";
+  import Process from "./Process";
 
 
   export default {
     data() {
       return {
-        timers: '',
+        timers: null,
         isSelect: false,
         isShow: false,
         percentage: 0,
@@ -94,15 +99,16 @@
       this.getProductList()
     },
     watch: {
-      percentage() {
-        if (this.percentage === 100) {
-          this.$refs.SimulatCurve.initEcharts(this.dataForm);
-        }
-      }
+      // percentage() {
+      //   if (this.percentage === 100) {
+      //     this.$refs.SimulatCurve.initEcharts(this.dataForm);
+      //   }
+      // }
     },
     components: {
       ProductModelTree,
       SimulatCurve,
+      Process,
     },
 
     methods: {
@@ -141,18 +147,20 @@
         console.log(res.data)
         this.taskList = res.data
       },
-      getStroke() {
-        if (this.percentage < 100) {
-          let param = {
-            taskList: [this.dataForm.id]
-          }
-          this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param}).then(
-            res => {
-              if (res.data) {
-                this.percentage = parseFloat(res.data)
-              }
+      async getStroke() {
+        let param = {
+          taskList: [this.dataForm.id]
+        }
+        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
+              this.$refs.SimulatCurve.initEcharts(this.dataForm);
             }
-          )
+          }
         } else {
           clearInterval(this.timers)
           this.percentage = 0
@@ -164,9 +172,10 @@
         this.isShow = true
         let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`)
         this.dataForm.id = result.data
+        this.percentage = 0
         let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm)
         if (res.success) {
-          console.log(res.data)
+          console.log(res.data, 'res.data')
           if (res.data && res.data.length > 0) {
             this.modelCheckResult = res.data
             this.dialogVisible = true
@@ -174,6 +183,9 @@
             this.timers = window.setInterval(this.getStroke, 1000)
           }
         }
+      },
+      displayProcess() {
+        this.$refs.process.$refs.dialog.init()
       }
     }
   }

--
Gitblit v1.9.1