fix(报告): 接口测试用例报告导出重复

--bug=1046593 --user=白奇 【接口测试】报告-用例报告- https://www.tapd.cn/55049933/s/1579806
This commit is contained in:
baiqi 2024-09-18 15:13:59 +08:00 committed by Craftsman
parent 1b3db8bbbc
commit 3aeccbb4eb
4 changed files with 19 additions and 14 deletions

View File

@ -37,7 +37,7 @@
"dependencies": {
"@7polo/kity": "2.0.8",
"@7polo/kityminder-core": "1.4.53",
"@arco-design/web-vue": "^2.55.3",
"@arco-design/web-vue": "^2.56.2",
"@arco-themes/vue-metersphere-v3": "^0.0.2",
"@form-create/arco-design": "^3.1.29",
"@halo-dev/richtext-editor": "0.0.0-alpha.33",

View File

@ -723,7 +723,7 @@
function getCurrentList(data: TableData[], key: string, id: string) {
return data.find((item) => {
const currentChildrenIds = (item.children || []).map((e) => e[key]);
const currentChildrenIds = (item.children || []).map((e: any) => e[key]);
if (currentChildrenIds?.includes(id)) {
return true;
}

View File

@ -389,11 +389,13 @@ export default function useTableProps<T>(
const allChildrenSelected =
record.children && record.children.length
? record.children.every((child) => selectedKeys.has(child[key]))
? record.children.every((child: any) => selectedKeys.has(child[key]))
: false;
const someChildrenSelected =
record.children && record.children.length ? record.children.some((child) => selectedKeys.has(child[key])) : false;
record.children && record.children.length
? record.children.some((child: any) => selectedKeys.has(child[key]))
: false;
if (allChildrenSelected) {
selectedKeys.add(parentKey);
@ -423,7 +425,7 @@ export default function useTableProps<T>(
}
if (record.children && record.children.length) {
record.children.forEach((childRecord) => handleSelectChildren(childRecord, select));
record.children.forEach((childRecord: any) => handleSelectChildren(childRecord, select));
}
// 处理父节点的选中状态
if (!select && parentKey && rowSelectionDisabledConfig?.checkStrictly) {

View File

@ -42,15 +42,18 @@
try {
loading.value = true;
reportStepDetail.value = await reportCaseDetail(id || (route.query.id as string));
setTimeout(() => {
nextTick(async () => {
await exportPDF(reportStepDetail.value?.name || '', 'report-detail');
loading.value = false;
Message.success(
t('report.detail.exportPdfSuccess', { name: characterLimit(reportStepDetail.value?.name, 50) })
);
});
}, 500);
await new Promise((resolve) => {
setTimeout(async () => {
await nextTick(async () => {
await exportPDF(reportStepDetail.value?.name || '', 'report-detail');
loading.value = false;
Message.success(
t('report.detail.exportPdfSuccess', { name: characterLimit(reportStepDetail.value?.name, 50) })
);
resolve(true);
});
}, 500); // TODO: pdf 500ms
});
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);