fix(测试计划): 修复测试计划配置自定义报告相关bug
This commit is contained in:
parent
59c2aae047
commit
a445c6e83e
|
@ -106,8 +106,8 @@ const subPlanList: PlanReportDetail = {
|
||||||
endTime: 0,
|
endTime: 0,
|
||||||
summary: '',
|
summary: '',
|
||||||
caseTotal: 1,
|
caseTotal: 1,
|
||||||
passThreshold: 100.0,
|
passThreshold: 100,
|
||||||
passRate: 0.0,
|
passRate: 100,
|
||||||
executeRate: 0,
|
executeRate: 0,
|
||||||
bugCount: 0,
|
bugCount: 0,
|
||||||
planCount: 0,
|
planCount: 0,
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
dataIndex: 'priority',
|
dataIndex: 'priority',
|
||||||
slotName: 'priority',
|
slotName: 'priority',
|
||||||
filterConfig: {
|
filterConfig: {
|
||||||
options: casePriorityOptions,
|
options: props.isPreview ? casePriorityOptions : [],
|
||||||
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
|
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
|
||||||
},
|
},
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
dataIndex: 'executeResult',
|
dataIndex: 'executeResult',
|
||||||
slotName: 'lastExecResult',
|
slotName: 'lastExecResult',
|
||||||
filterConfig: {
|
filterConfig: {
|
||||||
options: lastReportStatusListOptions.value,
|
options: props.isPreview ? lastReportStatusListOptions.value : [],
|
||||||
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_LAST_EXECUTE_STATUS,
|
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_LAST_EXECUTE_STATUS,
|
||||||
},
|
},
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -153,7 +153,10 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
async function loadCaseList() {
|
async function loadCaseList() {
|
||||||
currentCaseTable.value.setLoadListParams({ reportId: props.reportId, shareId: props.shareId ?? undefined });
|
currentCaseTable.value.setLoadListParams({
|
||||||
|
reportId: props.reportId,
|
||||||
|
shareId: props.shareId ?? undefined,
|
||||||
|
});
|
||||||
currentCaseTable.value.loadList();
|
currentCaseTable.value.loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,9 +186,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
onMounted(() => {
|
||||||
if (props.reportId && props.activeType && props.isPreview) {
|
if (props.reportId && props.isPreview) {
|
||||||
currentCaseTable.value.resetFilterParams();
|
|
||||||
currentCaseTable.value.resetPagination();
|
currentCaseTable.value.resetPagination();
|
||||||
loadCaseList();
|
loadCaseList();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { TableSortable } from '@arco-design/web-vue';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
|
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
|
||||||
import type { MsTableColumn } from '@/components/pure/ms-table/type';
|
import type { MsTableColumn } from '@/components/pure/ms-table/type';
|
||||||
import useTable from '@/components/pure/ms-table/useTable';
|
import useTable from '@/components/pure/ms-table/useTable';
|
||||||
|
@ -22,16 +25,22 @@
|
||||||
isPreview?: boolean;
|
isPreview?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const sortableConfig = computed<TableSortable | undefined>(() => {
|
||||||
|
return props.isPreview
|
||||||
|
? {
|
||||||
|
sortDirections: ['ascend', 'descend'],
|
||||||
|
sorter: true,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
});
|
||||||
|
|
||||||
const columns: MsTableColumn = [
|
const columns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'num',
|
dataIndex: 'num',
|
||||||
slotName: 'num',
|
slotName: 'num',
|
||||||
sortIndex: 1,
|
sortIndex: 1,
|
||||||
sortable: {
|
sortable: cloneDeep(sortableConfig.value),
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
|
@ -41,10 +50,7 @@
|
||||||
dataIndex: 'title',
|
dataIndex: 'title',
|
||||||
width: 150,
|
width: 150,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
sortable: {
|
sortable: cloneDeep(sortableConfig.value),
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'bugManagement.status',
|
title: 'bugManagement.status',
|
||||||
|
@ -78,7 +84,7 @@
|
||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
onMounted(() => {
|
||||||
if (props.reportId && props.isPreview) {
|
if (props.reportId && props.isPreview) {
|
||||||
loadCaseList();
|
loadCaseList();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeMount } from 'vue';
|
import { TableSortable } from '@arco-design/web-vue';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||||
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
|
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
|
||||||
|
@ -62,16 +63,22 @@
|
||||||
}>();
|
}>();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const sortableConfig = computed<TableSortable | undefined>(() => {
|
||||||
|
return props.isPreview
|
||||||
|
? {
|
||||||
|
sortDirections: ['ascend', 'descend'],
|
||||||
|
sorter: true,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
});
|
||||||
|
|
||||||
const staticColumns: MsTableColumn = [
|
const staticColumns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'num',
|
dataIndex: 'num',
|
||||||
slotName: 'num',
|
slotName: 'num',
|
||||||
sortIndex: 1,
|
sortIndex: 1,
|
||||||
sortable: {
|
sortable: cloneDeep(sortableConfig.value),
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
@ -81,10 +88,7 @@
|
||||||
title: 'case.caseName',
|
title: 'case.caseName',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
sortable: {
|
sortable: cloneDeep(sortableConfig.value),
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -94,7 +98,7 @@
|
||||||
filterConfig: {
|
filterConfig: {
|
||||||
valueKey: 'key',
|
valueKey: 'key',
|
||||||
labelKey: 'statusText',
|
labelKey: 'statusText',
|
||||||
options: Object.values(executionResultMap),
|
options: props.isPreview ? Object.values(executionResultMap) : [],
|
||||||
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_EXECUTE_RESULT,
|
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_EXECUTE_RESULT,
|
||||||
},
|
},
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -127,7 +131,7 @@
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
// TODO 计划组用例明细字段接口目前还没有
|
|
||||||
const testPlanNameColumns: MsTableColumn = [
|
const testPlanNameColumns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: 'report.plan.name',
|
title: 'report.plan.name',
|
||||||
|
@ -159,7 +163,7 @@
|
||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
onMounted(() => {
|
||||||
if (props.reportId && props.isPreview) {
|
if (props.reportId && props.isPreview) {
|
||||||
loadCaseList();
|
loadCaseList();
|
||||||
} else {
|
} else {
|
||||||
|
@ -182,6 +186,7 @@
|
||||||
});
|
});
|
||||||
executeList.value = [res];
|
executeList.value = [res];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
executeLoading.value = false;
|
executeLoading.value = false;
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
<template #resultStatus="{ record }">
|
<template #resultStatus="{ record }">
|
||||||
<ExecutionStatus v-if="record.resultStatus !== '-'" :status="record.resultStatus" />
|
<ExecutionStatus v-if="record.resultStatus !== '-'" :status="record.resultStatus" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #passThreshold="{ record }">
|
||||||
|
<div>
|
||||||
|
{{ `${record.passThreshold || '0.00'}%` }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #passRate="{ record }">
|
<template #passRate="{ record }">
|
||||||
<div>
|
<div>
|
||||||
{{ `${record.passRate || '0.00'}%` }}
|
{{ `${record.passRate || '0.00'}%` }}
|
||||||
|
@ -97,7 +102,7 @@
|
||||||
dataIndex: 'resultStatus',
|
dataIndex: 'resultStatus',
|
||||||
slotName: 'resultStatus',
|
slotName: 'resultStatus',
|
||||||
filterConfig: {
|
filterConfig: {
|
||||||
options: statusResultOptions.value,
|
options: props.isPreview ? statusResultOptions.value : [],
|
||||||
filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
|
filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
|
||||||
},
|
},
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -138,7 +143,7 @@
|
||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
onMounted(() => {
|
||||||
if (props.reportId && props.isPreview) {
|
if (props.reportId && props.isPreview) {
|
||||||
loadReportDetailList();
|
loadReportDetailList();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
passThreshold: 100, // 通过阈值
|
passThreshold: 100, // 通过阈值
|
||||||
passRate: 100, // 通过率
|
passRate: 100, // 通过率
|
||||||
executeRate: 100, // 执行完成率
|
executeRate: 100, // 执行完成率
|
||||||
bugCount: 0,
|
bugCount: 10,
|
||||||
caseTotal: 0,
|
caseTotal: 0,
|
||||||
executeCount: {
|
executeCount: {
|
||||||
success: 0,
|
success: 0,
|
||||||
|
|
Loading…
Reference in New Issue