fix(接口测试功能首页): 修复tips不随机更换、数据统计的缺陷
修复tips不随机更换的缺陷,改为每次进入页面随机更换tips;修复接口用例数量统计:未覆盖+已覆盖总数超过了接口总数的错误;修复统计已删除至回收站中的接口的错误;修复首页数据每次都要刷新浏览器才更新数据的错误
This commit is contained in:
parent
cac54095aa
commit
b060bcb389
|
@ -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();
|
||||
|
|
|
@ -275,21 +275,21 @@
|
|||
</update>
|
||||
|
||||
<select id="countProtocolByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
SELECT protocol AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY protocol
|
||||
SELECT protocol AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} AND `status` != 'Trash' GROUP BY protocol
|
||||
</select>
|
||||
<select id="countStateByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
SELECT status AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY status
|
||||
SELECT status AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} AND `status` != 'Trash' GROUP BY status
|
||||
</select>
|
||||
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">
|
||||
SELECT count(id) AS countNumber FROM api_definition
|
||||
WHERE project_id = #{projectId}
|
||||
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp} AND `status` != 'Trash'
|
||||
</select>
|
||||
<select id="countApiCoverageByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
SELECT count(api.id) AS countNumber, if(test_case_api.api_definition_id is null,"uncoverage","coverage") AS groupField FROM api_definition api left Join (
|
||||
SELECT DISTINCT api_definition_id FROM api_test_case
|
||||
) test_case_api ON api.id = test_case_api.api_definition_id
|
||||
WHERE api.project_id = #{0}
|
||||
WHERE api.project_id = #{0} and api.`status` != 'Trash'
|
||||
GROUP BY groupField
|
||||
</select>
|
||||
</mapper>
|
|
@ -17,19 +17,7 @@ public interface ExtApiTestCaseMapper {
|
|||
|
||||
List<String> 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<ApiDataCountResult> 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);
|
||||
}
|
|
@ -275,4 +275,20 @@
|
|||
where pc.test_plan_id = #{planId}
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="countProtocolByProjectID" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
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
|
||||
</select>
|
||||
|
||||
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">
|
||||
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}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -2,9 +2,22 @@
|
|||
<ms-container>
|
||||
<el-header height="0">
|
||||
<div style="float: right">
|
||||
<span>
|
||||
<div v-if="dateType==='1'">
|
||||
🤔️天凉了,保温杯买了吗?
|
||||
</div>
|
||||
<div v-else-if="dateType==='2'">
|
||||
<el-link href="https://github.com/metersphere/metersphere/issues" target="_blank" type="primary">😔觉得MeterSphere不好用就来https://github.com/metersphere/metersphere/issues吐个槽吧!</el-link>
|
||||
<!-- <el-link href="https://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PostProcessor"-->
|
||||
<!-- type="primary">{{$t('commons.reference_documentation')}}-->
|
||||
<!-- </el-link>-->
|
||||
</div>
|
||||
<div v-else-if="dateType==='3'">
|
||||
<!-- <el-link :herf="'https://github.com/metersphere/metersphere/issues'" target="_blank"></el-link>-->
|
||||
<el-link href="https://github.com/metersphere/metersphere" target="_blank" type="primary">😄觉得MeterSphere好用就来 https://github.com/metersphere/metersphere 点个star吧!</el-link>
|
||||
</div>
|
||||
<div v-else>
|
||||
😊 MeterSphere温馨提醒 —— 多喝热水哟!
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<ms-main-container v-loading="result.loading">
|
||||
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue