Просмотр исходного кода

自动化测试添加定时器

wyq 4 лет назад
Родитель
Сommit
11162736f8

+ 11 - 5
src/components/autoTest/AutoKnowledgeMapRuleTest.vue

@@ -16,7 +16,11 @@
           <el-button size="mini" @click="exportData">导出规则中未涉及到的医院术语</el-button>
           <el-button size="mini" @click="exportData">导出规则中未涉及到的医院术语</el-button>
         </el-form-item>
         </el-form-item>
         <el-form-item style="marginbottom: 0px">
         <el-form-item style="marginbottom: 0px">
-          <el-button size="mini" @click="handleAllTest" :disabled="!runningStatus || implement">所有规则测试</el-button>
+          <el-button
+            size="mini"
+            @click="handleAllTest"
+            :disabled="!runningStatus || implement"
+          >所有规则测试</el-button>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
     </crumbs>
     </crumbs>
@@ -56,8 +60,9 @@
               :disabled="!runningStatus || implement"
               :disabled="!runningStatus || implement"
             >
             >
               {{
               {{
-              runningStatusArr[scope.row.caseId-1] === 1 || implement
+              runningStatusArr[scope.row.caseId-1] === 1
               ? '执行测试中'
               ? '执行测试中'
+              :implement?'执行测试'
               : '执行测试'
               : '执行测试'
               }}
               }}
             </el-button>
             </el-button>
@@ -102,6 +107,7 @@ export default {
     this.zskgetDict();
     this.zskgetDict();
     // this._getRunningStatus()   // 进入页面立即确认状态
     // this._getRunningStatus()   // 进入页面立即确认状态
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
+    this.timer = setInterval(this.getRunningState, 20 * 1000);
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     clearInterval(this.timer);
     clearInterval(this.timer);
@@ -121,7 +127,7 @@ export default {
         .getRunningState({ caseGroup: 1 })
         .getRunningState({ caseGroup: 1 })
         .then(res => {
         .then(res => {
           if (res.data.code == '0') {
           if (res.data.code == '0') {
-            this.implement = res.data.data
+            this.implement = res.data.data;
           }
           }
         })
         })
         .catch(error => {
         .catch(error => {
@@ -170,11 +176,11 @@ export default {
               type: 'success'
               type: 'success'
             });
             });
             this.getDataList(this.hospitalId); // 重新获取列表
             this.getDataList(this.hospitalId); // 重新获取列表
-            this.getRunningState()
+            this.getRunningState();
           } else {
           } else {
             this.$message.error(res.data.msg || '重置失败');
             this.$message.error(res.data.msg || '重置失败');
             this.getDataList(this.hospitalId); // 重新获取列表
             this.getDataList(this.hospitalId); // 重新获取列表
-            this.getRunningState()
+            this.getRunningState();
           }
           }
           this.runningStatusArr = statusTempArr;
           this.runningStatusArr = statusTempArr;
         });
         });

+ 3 - 1
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -86,8 +86,9 @@
               :disabled="!runningStatus || implement"
               :disabled="!runningStatus || implement"
               @click="handleTest(scope.row, scope.$index)"
               @click="handleTest(scope.row, scope.$index)"
               >{{
               >{{
-                runningStatusArr[scope.$index] === 1 || implement
+                runningStatusArr[scope.$index] === 1
                   ? '执行测试中...'
                   ? '执行测试中...'
+                  :implement?'执行测试'
                   : '执行测试'
                   : '执行测试'
               }}</el-button
               }}</el-button
             >
             >
@@ -135,6 +136,7 @@ export default {
   created() {
   created() {
     this._getHospitalInfoCDSS();
     this._getHospitalInfoCDSS();
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
+    this.timer = setInterval(this.getRunningState, 20 * 1000);
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     clearInterval(this.timer);
     clearInterval(this.timer);