From b060bcb3897caf8494f1408eadfc50e05cba929c Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Tue, 22 Dec 2020 20:11:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E9=A6=96=E9=A1=B5):=20=E4=BF=AE=E5=A4=8Dtips?= =?UTF-8?q?=E4=B8=8D=E9=9A=8F=E6=9C=BA=E6=9B=B4=E6=8D=A2=E3=80=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复tips不随机更换的缺陷,改为每次进入页面随机更换tips;修复接口用例数量统计:未覆盖+已覆盖总数超过了接口总数的错误;修复统计已删除至回收站中的接口的错误;修复首页数据每次都要刷新浏览器才更新数据的错误 --- .../datacount/response/ApiDataCountDTO.java | 3 +- .../mapper/ext/ExtApiDefinitionMapper.xml | 8 ++--- .../base/mapper/ext/ExtApiTestCaseMapper.java | 12 ------- .../base/mapper/ext/ExtApiTestCaseMapper.xml | 16 +++++++++ .../api/homepage/ApiTestHomePage.vue | 35 +++++++++++++++---- 5 files changed, 50 insertions(+), 24 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java index 847ec139f1..4f9d9e16d6 100644 --- a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java @@ -149,9 +149,10 @@ public class ApiDataCountDTO { for (ApiDataCountResult countResult : countResultList) { if("Underway".equals(countResult.getGroupField())){ - //未开始 + //运行中 this.runningCount+= countResult.getCountNumber(); }else if("Completed".equals(countResult.getGroupField())){ + //已完成 this.finishedCount+= countResult.getCountNumber(); }else if("Prepare".equals(countResult.getGroupField())){ this.notStartedCount+= countResult.getCountNumber(); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 3fc21d282b..226b6b46a5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -275,21 +275,21 @@ \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java index f1ccf24c0f..8f3f4558b6 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java @@ -17,19 +17,7 @@ public interface ExtApiTestCaseMapper { List selectIdsNotExistsInPlan(@Param("projectId") String projectId, @Param("planId") String planId); - @Select({ - "SELECT apiDef.protocol AS groupField,COUNT(testCase.id) AS countNumber FROM api_test_case testCase ", - "INNER JOIN api_definition apiDef ON testCase.api_definition_id = apiDef.id ", - "WHERE testCase.project_id = #{0} ", - "GROUP BY apiDef.protocol " - }) List countProtocolByProjectID(String projectId); - @Select({ - "SELECT count(testCase.id) AS countNumber FROM api_test_case testCase ", - "INNER JOIN api_definition apiDef ON testCase.api_definition_id = apiDef.id ", - "WHERE testCase.project_id = #{projectId} ", - "AND testCase.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp} " - }) long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 8bb53f99b4..a9945e7844 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -275,4 +275,20 @@ where pc.test_plan_id = #{planId} ) + + + + + + \ No newline at end of file diff --git a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue index 6ed0a37f24..15c259cc28 100644 --- a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue +++ b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue @@ -2,9 +2,22 @@
- +
+ 🤔️天凉了,保温杯买了吗? +
+
+ 😔觉得MeterSphere不好用就来https://github.com/metersphere/metersphere/issues吐个槽吧! + + + +
+
+ + 😄觉得MeterSphere好用就来 https://github.com/metersphere/metersphere 点个star吧! +
+
😊 MeterSphere温馨提醒 —— 多喝热水哟! - +
@@ -71,20 +84,28 @@ export default { sceneCountData:{}, testCaseCountData:{}, scheduleTaskCountData:{}, + dateType:"1", result: {}, } }, - // activated() { - // this.getValues(); - // }, + activated() { + this.search(); + this.checkDateType(); + }, // mounted() { // this.getValues(); // }, created() { - this.search(); + // this.search(); }, methods: { - + checkDateType(){ + var random = Math.floor(Math.random() * (4 - 1 + 1))+1; + this.dateType = random +""; + }, + openNewPage(herf){ + window.open(herf, '_blank'); + }, search() { let selectProjectId = getCurrentProjectID(); this.$get("/api/apiCount/"+selectProjectId, response => {