From 7686039d6fcdf7dc4d1fdde3758bd98ff9646f2a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 26 九月 2024 18:00:45 +0800
Subject: [PATCH] 修改

---
 web/packages/views/pages/generator.vue |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/web/packages/views/pages/generator.vue b/web/packages/views/pages/generator.vue
index a04809b..58596ac 100644
--- a/web/packages/views/pages/generator.vue
+++ b/web/packages/views/pages/generator.vue
@@ -10,6 +10,11 @@
           <el-button @click="getTableInfo()">鏌ヨ</el-button>
         </el-form-item>
       </el-form>
+      <el-form>
+        <el-button type="primary" @click="callPythonCalc()">鍚姩python璁$畻</el-button>
+<!--        <el-button type="primary" @click="getPythonCalcResult()">鑾峰彇python璁$畻杩涘害</el-button>-->
+        <el-tag>浠跨湡杩涘害锛歿{progress}}%</el-tag>
+      </el-form>
       <el-table :data="dataForm.tableData" height="320" stripe style="width: 100%">
         <el-table-column prop="columnName" label="CODE"></el-table-column>
         <el-table-column prop="remarks" label="鍚嶇О">
@@ -114,8 +119,9 @@
           isExport: false,
           tableData: [],
           tableList:[]
-        }
-
+        },
+        progress: 0,
+        timer: null,
       }
     },
 
@@ -151,6 +157,28 @@
       this.getInfo()
     },
     methods: {
+      async callPythonCalc() {
+        // 鍚姩python璁$畻
+        let res = await this.$http.get('/taskReliability/ModelLine/callPythonCalc')
+        if (res.success) {
+          this.$alert('鍚姩python璁$畻鎴愬姛锛�')
+          // 瀹氭椂鑾峰彇python璁$畻杩涘害
+          this.timer = setInterval(this.getPythonCalcResult, 5000)
+        }
+      },
+
+      async getPythonCalcResult() {
+        // setTimeout(() => {
+          let res = await this.$http.get('/taskReliability/ModelLine/getPythonCalcResult')
+          if (res.success) {
+            this.progress = res.data
+            if (this.progress==='100') {
+              clearInterval(this.timer)
+            }
+          }
+        // }, 5000)
+      },
+
       // 鑾峰彇淇℃伅
       async getInfo() {
         let res = await this.$http.get(`/sys/generator/properties`)

--
Gitblit v1.9.1