Pārlūkot izejas kodu

静态知识 测试 重置代码提交

Morphone0429 4 gadi atpakaļ
vecāks
revīzija
9c7975feff

+ 3 - 0
src/api/cdss.js

@@ -546,4 +546,7 @@ export default {
   getRunningStatusByHospitalId(param) {
     return axios.post(urls.getRunningStatusByHospitalId, param);
   },
+  updateRunningStatus(param) {
+    return axios.post(urls.updateRunningStatus, param);
+  },
 };

+ 1 - 0
src/api/config.js

@@ -517,6 +517,7 @@ export default {
     'staticKnowledgeTest': '/api/cdssman/test/staticKnowledge/staticKnowledgeTest',   //静态知识测试
     'getRunningStatus': '/api/cdssman/test/running/getStatus',   //查看测试用例运行状态
     'getRunningStatusByHospitalId': '/api/cdssman/test/running/getStatusByHospitalId',   //查拉面所有测试用例运行状态
+    'updateRunningStatus': '/api/cdssman/test/running/updateStatus',   //更新测试用例运行状态
 
   },
   menuIconList: { //菜单对应图标

+ 33 - 0
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -91,6 +91,15 @@
                   : '执行测试'
               }}</el-button
             >
+            <span v-if="runningStatusArr[scope.$index] === 1"> | </span>
+            <el-button
+              v-if="runningStatusArr[scope.$index] === 1"
+              type="text"
+              size="small"
+              @click="handleUpdateStatus(scope.row, scope.$index)"
+            >
+              重置
+            </el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -174,6 +183,30 @@ export default {
           return null;
       }
     },
+    // 重置状态
+    handleUpdateStatus(row, index) {
+      const { caseId } = row;
+      api
+        .updateRunningStatus({
+          hospitalId: this.hospitalId,
+          caseId,
+          status: 0,
+        })
+        .then((res) => {
+          if (res.data.code === '0' && res.data.data) {
+            this.$message({
+              message: '重置成功',
+              type: 'success',
+            });
+            this.getDataList(this.hospitalId); // 重新获取列表
+          } else {
+            this.$message.error(res.data.msg || '重置失败');
+            this.getDataList(this.hospitalId); // 重新获取列表
+          }
+          this.runningStatusArr = [0, 0, 0, 0, 0];
+        });
+    },
+
     // 执行测试
     handleTest(row, index) {
       let inp = document.getElementById('upFile');