feat(测试跟踪): 测试计划报告表格通过率保留两位小数

This commit is contained in:
song-tianyang 2023-08-31 15:02:49 +08:00 committed by fit2-zhao
parent 4f7d1af0f8
commit 7000e965e0
2 changed files with 3 additions and 3 deletions

View File

@ -1758,7 +1758,7 @@ public class TestPlanService {
if (report.getExecuteCount() != 0 && report.getCaseCount() != null) {
double executeRate = Double.parseDouble(rateFormat.format((double) report.getExecuteCount() / (double) report.getCaseCount()));
if (executeRate == 1 && report.getExecuteCount() < report.getCaseCount()) {
report.setExecuteRate(0.99);
report.setExecuteRate(0.9999);
} else {
report.setExecuteRate(executeRate);
}
@ -1768,7 +1768,7 @@ public class TestPlanService {
if (report.getPassCount() != 0 && report.getCaseCount() != null) {
double passRate = Double.parseDouble(rateFormat.format((double) report.getPassCount() / (double) report.getCaseCount()));
if (passRate == 1 && report.getPassCount() < report.getCaseCount()) {
report.setPassRate(0.99);
report.setPassRate(0.9999);
} else {
report.setPassRate(passRate);
}

View File

@ -143,7 +143,7 @@
<template v-slot:default="scope">
<span v-if="scope.row.status === 'RUNNING' || scope.row.status === 'Running'"> - </span>
<span v-else> {{
(scope.row.passRate ? (scope.row.passRate * 100).toFixed(1) : 0) + "%"
(scope.row.passRate ? (scope.row.passRate * 100).toFixed(2) : 0) + "%"
}}</span>
</template>
</ms-table-column>