From 3aeccbb4ebf60403e120b4c76f2349d81b2e271f Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 18 Sep 2024 15:13:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8A=A5=E5=91=8A):=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=8A=A5=E5=91=8A=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046593 --user=白奇 【接口测试】报告-用例报告- https://www.tapd.cn/55049933/s/1579806 --- frontend/package.json | 2 +- .../components/pure/ms-table/base-table.vue | 2 +- .../src/components/pure/ms-table/useTable.ts | 8 ++++--- .../views/api-test/report/exportCasePDF.vue | 21 +++++++++++-------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 47ddc86011..4e3ee101db 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index 468ade315a..e2dae47c5a 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -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; } diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index ce9544d05d..8a1153f00c 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -389,11 +389,13 @@ export default function useTableProps( 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( } 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) { diff --git a/frontend/src/views/api-test/report/exportCasePDF.vue b/frontend/src/views/api-test/report/exportCasePDF.vue index af7dd55b0a..788fbd1f44 100644 --- a/frontend/src/views/api-test/report/exportCasePDF.vue +++ b/frontend/src/views/api-test/report/exportCasePDF.vue @@ -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);