fix(测试跟踪): 修复首页图表数据错误的问题
This commit is contained in:
parent
d744621491
commit
266fbd008f
|
@ -23,7 +23,6 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -87,18 +86,10 @@ public class TrackService {
|
|||
public List<ChartsData> getCaseMaintenanceBar(String projectId) {
|
||||
List<TrackCountResult> funcMaintainer = extTestCaseMapper.countFuncMaintainer(projectId);
|
||||
List<TrackCountResult> relevanceMaintainer = extTestCaseMapper.countRelevanceMaintainer(projectId);
|
||||
List<String> list = relevanceMaintainer.stream().map(TrackCountResult::getGroupField).collect(Collectors.toList());
|
||||
|
||||
List<ChartsData> charts = new ArrayList<>();
|
||||
for (TrackCountResult result : funcMaintainer) {
|
||||
String groupField = result.getGroupField();
|
||||
if (!list.contains(groupField)) {
|
||||
// 创建了功能用例,但是未关联测试
|
||||
TrackCountResult trackCount = new TrackCountResult();
|
||||
trackCount.setCountNumber(0);
|
||||
trackCount.setGroupField(groupField);
|
||||
relevanceMaintainer.add(trackCount);
|
||||
}
|
||||
ChartsData chartsData = new ChartsData();
|
||||
chartsData.setxAxis(groupField);
|
||||
chartsData.setyAxis(BigDecimal.valueOf(result.getCountNumber()));
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="square">
|
||||
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card" @redirectPage="redirectPage"/>
|
||||
<relevance-case-card :relevance-count-data="relevanceCountData" class="track-card"
|
||||
@redirectPage="redirectPage"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -136,8 +137,8 @@ export default {
|
|||
xAxis.push(d.xAxis);
|
||||
}
|
||||
});
|
||||
let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => d.yAxis);
|
||||
let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => d.yAxis);
|
||||
let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => [d.xAxis, d.yAxis]);
|
||||
let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => [d.xAxis, d.yAxis]);
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
|
@ -191,7 +192,10 @@ export default {
|
|||
// this.$router.push('/track/plan/view/'+selectType);
|
||||
switch (page) {
|
||||
case "case":
|
||||
this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}});
|
||||
this.$router.push({
|
||||
name: 'testCase',
|
||||
params: {dataType: dataType, dataSelectRange: selectType, projectId: getCurrentProjectID()}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue