fix: 测试报告优化tapdID:1006224,1006204
This commit is contained in:
parent
3fdddef1b9
commit
56a3b1edcc
|
@ -244,6 +244,11 @@ public class TestPlanService {
|
|||
testPlan.setActualEndTime(null);
|
||||
}
|
||||
|
||||
if ((testPlan.getStatus().equals(TestPlanStatus.Finished.name()) || testPlan.getStatus().equals(TestPlanStatus.Completed.name()))
|
||||
&& res.getActualEndTime() == null) {
|
||||
testPlan.setActualEndTime(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
int i;
|
||||
if (testPlan.getName() == null) {// 若是点击该测试计划,则仅更新了updateTime,其它字段全为null,使用updateByPrimaryKeySelective
|
||||
i = testPlanMapper.updateByPrimaryKeySelective(testPlan);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
:fields-width="fieldsWidth"
|
||||
prop="createTime"
|
||||
min-width="140px"
|
||||
sortable="custom"
|
||||
:sortable="sortable"
|
||||
:label="$t('commons.create_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
:column-key="columnKey ? columnKey : prop"
|
||||
:label="label"
|
||||
:sortable="sortable"
|
||||
:filter-method="filterMethod"
|
||||
:show-overflow-tooltip="showOverflowTooltip">
|
||||
<template v-slot:default="scope">
|
||||
<slot :row="scope.row" :$index="scope.$index">
|
||||
|
@ -26,6 +27,7 @@ export default {
|
|||
label: String,
|
||||
width: [String, Number],
|
||||
minWidth: [String, Number],
|
||||
filterMethod: Function,
|
||||
fixed: String,
|
||||
// 排序列, 后端mapper处理filters
|
||||
filters: Array,
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="'执行率' + ':'">
|
||||
{{ (report.executeRate ? (report.executeRate.toFixed(3) * 100) : 0) + '%'}}
|
||||
{{ (report.executeRate ? (report.executeRate * 100).toFixed(1) : 0) + '%'}}
|
||||
<ms-instructions-icon content="执行过的用例/所有用例 * 100%"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="'通过率' + ':'">
|
||||
{{ (report.passRate ? (report.passRate.toFixed(3) * 100) : 0) + '%'}}
|
||||
{{ (report.passRate ? (report.passRate * 100 ).toFixed(1) : 0) + '%'}}
|
||||
<ms-instructions-icon content="执行通过用例/所有用例 * 100%"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<template v-slot:default="scope">
|
||||
<status-table-item v-if="scope.row.execResult === 'success'" :value="'Pass'"/>
|
||||
<status-table-item v-if="scope.row.execResult === 'error'" :value="'Failure'"/>
|
||||
<status-table-item v-if="scope.row.execResult != 'error' && scope.row.execResult != 'success'" :value="'Prepare'"/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
</ms-table>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<template v-slot:default="{row}">
|
||||
<status-table-item v-if="row.lastResult === 'Success'" :value="'Pass'"/>
|
||||
<status-table-item v-if="row.lastResult === 'Fail'" :value="'Failure'"/>
|
||||
<status-table-item v-if="row.lastResult != 'Fail' && row.lastResult != 'Success'" :value="'Prepare'"/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
</ms-table>
|
||||
|
|
|
@ -10,21 +10,21 @@
|
|||
|
||||
<ms-table-column
|
||||
:label="$t('test_track.issue.id')"
|
||||
prop="id" v-if="false">
|
||||
</ms-table-column>
|
||||
<ms-table-column
|
||||
:label="$t('test_track.issue.id')"
|
||||
:sortable="true"
|
||||
prop="num">
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
:label="$t('test_track.issue.title')"
|
||||
:sortable="true"
|
||||
prop="title">
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
:label="$t('test_track.issue.platform_status')"
|
||||
v-if="isThirdPart"
|
||||
:filters="statusFilters"
|
||||
:filter-method="filterStatus"
|
||||
prop="platformStatus">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.platformStatus ? scope.row.platformStatus : '--'}}
|
||||
|
@ -33,7 +33,9 @@
|
|||
|
||||
<ms-table-column
|
||||
v-else
|
||||
:filters="statusFilters"
|
||||
:label="$t('test_track.issue.status')"
|
||||
:filter-method="filterStatus"
|
||||
prop="status">
|
||||
<template v-slot="scope">
|
||||
<span>{{ issueStatusMap[scope.row.status] ? issueStatusMap[scope.row.status] : scope.row.status }}</span>
|
||||
|
@ -41,11 +43,15 @@
|
|||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
:filters="platformFilters"
|
||||
:filter-method="filterPlatform"
|
||||
:label="$t('test_track.issue.platform')"
|
||||
prop="platform">
|
||||
</ms-table-column>
|
||||
|
||||
<issue-description-table-item/>
|
||||
|
||||
<ms-create-time-column />
|
||||
</ms-table>
|
||||
|
||||
</div>
|
||||
|
@ -55,11 +61,12 @@
|
|||
import MsTable from "@/business/components/common/components/table/MsTable";
|
||||
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
|
||||
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
|
||||
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
||||
import {CUSTOM_FIELD_SCENE_OPTION, ISSUE_PLATFORM_OPTION, ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
||||
import {getIssuesByPlanId, getShareIssuesByPlanId} from "@/network/Issue";
|
||||
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
|
||||
export default {
|
||||
name: "FunctionalIssueList",
|
||||
components: {IssueDescriptionTableItem, MsTableColumn, MsTable},
|
||||
components: {MsCreateTimeColumn, IssueDescriptionTableItem, MsTableColumn, MsTable},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
|
@ -72,6 +79,27 @@ export default {
|
|||
issueStatusMap() {
|
||||
return ISSUE_STATUS_MAP;
|
||||
},
|
||||
platformFilters() {
|
||||
let platforms = this.data.map(i => i.platform);
|
||||
let option = ISSUE_PLATFORM_OPTION;
|
||||
return option.filter(i => platforms.indexOf(i.value) > -1);
|
||||
},
|
||||
statusFilters() {
|
||||
let statusFilter = [];
|
||||
this.data.forEach(item => {
|
||||
if (item.status) {
|
||||
let values = statusFilter.map(i => i.value);
|
||||
let status = this.isThirdPart ? item.platformStatus : item.status;
|
||||
if (values.indexOf(status) == -1) {
|
||||
statusFilter.push({
|
||||
value: status,
|
||||
text: status
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return statusFilter;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.isThirdPart = this.report.isThirdPartIssue;
|
||||
|
@ -85,6 +113,13 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
filterStatus(value, row) {
|
||||
let status = this.isThirdPart ? row.platformStatus : row.status;
|
||||
return status === value;
|
||||
},
|
||||
filterPlatform(value, row) {
|
||||
return row.platform === value;
|
||||
},
|
||||
getIssues() {
|
||||
if (this.isTemplate || this.isDb) {
|
||||
this.data = this.report.issueList ? this.report.issueList : [];
|
||||
|
|
|
@ -67,7 +67,8 @@ export default {
|
|||
this.caseCharData = caseCharData;
|
||||
|
||||
let issueCharData = [];
|
||||
let colors = ['#F56C6C', '#67C23A', '#E6A23C', '#909399', 'lightskyblue', '#DEDE10'];
|
||||
let colors = ['#67C23A', '#E6A23C','#DEDE10',
|
||||
'#F56C6C','#909399'];
|
||||
let usedSet = new Set();
|
||||
|
||||
this.functionResult.issueData.forEach(item => {
|
||||
|
@ -75,19 +76,28 @@ export default {
|
|||
let data = this.issueDataMap.get(status);
|
||||
if (!data) {
|
||||
data = {name: status, itemStyle: {color: null}};
|
||||
// if (status === 'new' || status === '新' | status === '待办' | status === 'active') {
|
||||
// data.color = '#F56C6C';
|
||||
// }
|
||||
if (status === 'new' || status === '新' | status === '待办' | status === 'active') {
|
||||
data.itemStyle.color = '#F56C6C';
|
||||
usedSet.add(data.itemStyle.color);
|
||||
}
|
||||
if (status === '已拒绝' || status === 'reject') {
|
||||
data.itemStyle.color = '#909399';
|
||||
usedSet.add(data.itemStyle.color);
|
||||
}
|
||||
if (status === '已关闭' || status === 'close') {
|
||||
data.itemStyle.color = '#67C23A';
|
||||
usedSet.add(data.itemStyle.color);
|
||||
}
|
||||
if (!data.itemStyle.color) {
|
||||
for (let i = 0; i < colors.length; i++) {
|
||||
let color = colors[i];
|
||||
if (!usedSet.has(color)) {
|
||||
data.itemStyle.color = color;
|
||||
usedSet.add(data.itemStyle.color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
usedSet.add(data.itemStyle.color);
|
||||
}
|
||||
data.value = item.count;
|
||||
issueCharData.push(data);
|
||||
|
|
|
@ -5,6 +5,9 @@ import '@/common/css/menu-header.css';
|
|||
import '@/common/css/main.css';
|
||||
import i18n from "@/i18n/i18n";
|
||||
import chart from "@/common/js/chart";
|
||||
import filters from "@/common/js/filter";
|
||||
import icon from "@/common/js/icon";
|
||||
|
||||
// import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
|
||||
function planReportUse(id, template) {
|
||||
|
@ -23,6 +26,8 @@ function planReportUse(id, template) {
|
|||
Vue.use(Card);
|
||||
Vue.use(TableColumn);
|
||||
Vue.use(Table);
|
||||
Vue.use(filters);
|
||||
Vue.use(icon);
|
||||
// Vue.use(CKEditor);
|
||||
|
||||
new Vue({
|
||||
|
|
Loading…
Reference in New Issue