diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 5a6644eb55..d5be3564a3 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -82,7 +82,7 @@ - +
STOP
@@ -303,8 +303,8 @@ export default { this.saveTestCase(data); this.$emit('singleRun', data); }, - stop() { - this.$emit('stop'); + stop(data) { + this.$emit('stop', data.id); }, copyCase(data) { if (data && data.request) { diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index eff112d225..1ecccd0584 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -424,12 +424,13 @@ export default { this.$emit("refreshCase", row.id); }, - stop(callback) { + stop(id) { let url = "/api/automation/stop/" + this.reportId; this.$get(url, () => { - if (callback) { - callback(); - } + // if (callback) { + // callback(); + // } + this.$emit("stop", id); this.singleLoading = false; this.$success(this.$t('report.test_stop_success')); }); diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index 663a8e8dfd..ca62aad2cc 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -162,7 +162,7 @@ :total="total"/> - + @@ -927,6 +927,19 @@ export default { } return returnObj; }, + stop(id) { + for (let item of this.tableData) { + if (id && id === item.id) { + // 获取执行前结果 + this.$get('/api/testcase/get/' + id, res => { + if (res) { + item.status = res.data.status; + } + }) + break; + } + } + }, createPerformance(row, environment) { /** * 思路:调用后台创建性能测试的方法,把当前案例的hashTree在后台转化为jmx并文件创建性能测试。