From 05a4c18628bba5010c0ce423408cc5f40f864ee0 Mon Sep 17 00:00:00 2001 From: xyc <jc_xiong@hotmail.com> Date: 星期六, 28 九月 2024 18:54:10 +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