From 2ee6833b9685779dafd23ba659e1063c5237f72d Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 22 Feb 2024 13:52:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=85=B3?= =?UTF-8?q?=E8=81=94=E4=B8=89=E6=96=B9=E9=9C=80=E6=B1=82=E7=BC=BA=E5=B0=91?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/case-management/featureCase.ts | 1 - .../src/components/pure/ms-table/useTable.ts | 18 ++++++---- .../src/models/caseManagement/featureCase.ts | 1 + .../tabContent/tabComment/tabCommentIndex.vue | 1 - .../tabDemand/associatedDemandTable.vue | 5 +-- .../tabContent/tabDemand/demand.vue | 36 +++++++++++++++++-- .../tabDemand/thirdDemandDrawer.vue | 20 +++++++++-- .../caseManagementFeature/locale/en-US.ts | 2 +- .../caseManagementFeature/locale/zh-CN.ts | 2 +- .../organization/template/locale/en-US.ts | 5 ++- .../organization/template/locale/zh-CN.ts | 7 +++- 11 files changed, 78 insertions(+), 20 deletions(-) diff --git a/frontend/src/api/modules/case-management/featureCase.ts b/frontend/src/api/modules/case-management/featureCase.ts index 804ed94bd0..0c2d876973 100644 --- a/frontend/src/api/modules/case-management/featureCase.ts +++ b/frontend/src/api/modules/case-management/featureCase.ts @@ -239,7 +239,6 @@ export function getThirdDemandList(data: TableQueryParams) { // 上传文件并关联用例 export function uploadOrAssociationFile(data: Record) { - debugger; return MSR.uploadFile({ url: UploadOrAssociationFileUrl }, { request: data.request, fileList: data.file }); } // 转存文件 diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index e1297b7e0f..3bc2cd51cb 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -320,6 +320,17 @@ export default function useTableProps( // } } }; + const collectIds = (data, rowKey: string, selectedKeys: Set) => { + data.forEach((item: any) => { + if (item[rowKey] && !selectedKeys.has(item[rowKey])) { + selectedKeys.add(item[rowKey]); + } + if (item.children) { + collectIds(item.children, rowKey, selectedKeys); + } + }); + return selectedKeys; + }; // 获取表格请求参数 const getTableQueryParams = () => { @@ -398,12 +409,7 @@ export default function useTableProps( resetSelector(); } else { resetSelector(false); - data.forEach((item: Record) => { - if (item[rowKey] && !selectedKeys.has(item[rowKey])) { - selectedKeys.add(item[rowKey]); - } - }); - propsRes.value.selectedKeys = selectedKeys; + propsRes.value.selectedKeys = collectIds(data, rowKey, selectedKeys); } }, diff --git a/frontend/src/models/caseManagement/featureCase.ts b/frontend/src/models/caseManagement/featureCase.ts index fccaa548db..51f528a606 100644 --- a/frontend/src/models/caseManagement/featureCase.ts +++ b/frontend/src/models/caseManagement/featureCase.ts @@ -242,6 +242,7 @@ export interface DemandItem { createUser: string; updateUser: string; children: DemandItem[]; // 平台下对应的需求 + [key: string]: any; } // 平台需求列表 diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue index 4387069cd7..6c7e1c3944 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue @@ -103,7 +103,6 @@ // 添加或者更新评论 async function handleUpdateOrAdd(item: CommentParams, cb: (result: boolean) => void) { - debugger; try { if (item.id) { await updateCommentList(item); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/associatedDemandTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/associatedDemandTable.vue index cf21c7bd93..5220e4c352 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/associatedDemandTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/associatedDemandTable.vue @@ -7,7 +7,7 @@ >