fix(系统日志): 计划报告名称跳转错误

--bug=1042506 --user=宋昌昌 【系统日志】-点击日志中报告名称,跳转页面错误,跳转到了报告列表界面 https://www.tapd.cn/55049933/s/1532097
This commit is contained in:
song-cc-rock 2024-06-19 17:44:01 +08:00 committed by Craftsman
parent 95df95b1ff
commit cf5f9a0b4f
3 changed files with 17 additions and 8 deletions

View File

@ -156,7 +156,8 @@ public class OperationLogModule {
public static final String TEST_PLAN = "TEST_PLAN";
public static final String TEST_PLAN_INDEX = "TEST_PLAN_INDEX";
public static final String TEST_PLAN_MODULE = "TEST_PLAN_MODULE";
public static final String TEST_PLAN_REPORT = "TEST_PLAN_REPORT";
public static final String TEST_PLAN_REPORT = "TEST_PLAN_REPORT_TEST_PLAN";
public static final String TEST_PLAN_GROUP_REPORT = "TEST_PLAN_REPORT_TEST_PLAN_GROUP";
// 个人信息-基本信息
public static final String PERSONAL_INFORMATION_BASE_INFO = "PERSONAL_INFORMATION_BASE_INFO";

View File

@ -109,7 +109,7 @@ public class TestPlanReportLogService {
report.getId(),
userId,
OperationLogType.ADD.name(),
OperationLogModule.TEST_PLAN_REPORT,
report.getIntegrated() ? OperationLogModule.TEST_PLAN_GROUP_REPORT : OperationLogModule.TEST_PLAN_REPORT,
report.getName());
log.setPath(path);
log.setMethod(HttpMethodConstants.POST.name());

View File

@ -16,7 +16,7 @@
<div>{{ t('testPlan.testPlanIndex.TotalCases') }}</div>
</td>
<td class="-ml-[2px] font-medium">
{{ props.detail.caseTotal || 0 }}
{{ countTotal || 0 }}
</td>
</tr>
<tr v-if="props.status === 'pending'" class="popover-tr">
@ -96,8 +96,6 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import MsColorLine from '@/components/pure/ms-color-line/index.vue';
import { defaultCount, statusConfig } from '@/config/testPlan';
@ -138,6 +136,16 @@
return props.detail[countKey] ? (props.detail[countKey] as countDetail) : defaultCount;
});
const countTotal = computed(() => {
return (
countDetailData.value.pending +
countDetailData.value.success +
countDetailData.value.error +
countDetailData.value.block +
countDetailData.value.fakeError
);
});
const colorData = computed(() => {
if (countDetailData.value[props.status] === 0) {
return [
@ -149,19 +157,19 @@
}
return [
{
percentage: (countDetailData.value[props.status] / props.detail.caseTotal) * 100,
percentage: (countDetailData.value[props.status] / countTotal.value) * 100,
color: statusObject.value.color,
},
];
});
const getPassRate = computed(() => {
const result = (countDetailData.value[props.status] / props.detail.caseTotal) * 100;
const result = (countDetailData.value[props.status] / countTotal.value) * 100;
return `${Number.isNaN(result) ? 0 : result.toFixed(2)}%`;
});
const calculateRate = (count: number) => {
const rate = (count / props.detail.caseTotal) * 100;
const rate = (count / countTotal.value) * 100;
return `${Number.isNaN(rate) ? 0 : rate.toFixed(2)}%`;
};