From b06a0e16b030f9dc9a63c3ea6f4aa6adaec5ec7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Thu, 7 Aug 2025 18:27:37 +0800 Subject: [PATCH] =?UTF-8?q?FEAT=20=3D>=20=E6=9C=AC=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B9=E7=9B=AE=E4=B8=BA=EF=BC=9A=20=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E9=80=89=E6=8B=A9=E6=9E=84=E5=BB=BA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/components/ContentSelector.tsx | 38 +++++-------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/nkebao/src/pages/mobile/workspace/group-push/form/components/ContentSelector.tsx b/nkebao/src/pages/mobile/workspace/group-push/form/components/ContentSelector.tsx index 1e3adff0..7b1e12fd 100644 --- a/nkebao/src/pages/mobile/workspace/group-push/form/components/ContentSelector.tsx +++ b/nkebao/src/pages/mobile/workspace/group-push/form/components/ContentSelector.tsx @@ -38,32 +38,13 @@ const ContentSelector = forwardRef( })); // 处理选择变化 - const handleLibrariesChange = (contentGroups: string[]) => { - const newSelectedLibraries = contentGroups.map(id => ({ - id, - name: `内容库 ${id}`, // 这里应该从API获取完整信息 - targets: [], // 这里应该从API获取完整信息 - })); + const handleLibrariesChange = (contentGroupsOptions: ContentItem[]) => { + const contentGroups = contentGroupsOptions.map(c => c.id.toString()); onNext({ - contentGroups: libraryIds, - contentGroupsOptions: newSelectedLibraries, + contentGroups, + contentGroupsOptions, }); - form.setFieldValue("contentLibraries", libraryIds); - }; - - // 处理选择详情变化 - const handleSelectDetail = (libraries: any[]) => { - // 将API返回的数据转换为ContentLibrary格式 - const convertedLibraries = libraries.map(lib => ({ - id: lib.id, - name: lib.name, - targets: [], // 这里需要根据实际情况获取targets数据 - })); - onNext(convertedLibraries); - form.setFieldValue( - "contentLibraries", - libraries.map(lib => lib.id), - ); + form.setFieldValue("contentGroups", contentGroups); }; return ( @@ -72,7 +53,7 @@ const ContentSelector = forwardRef(
c.id) }} >

@@ -84,7 +65,7 @@ const ContentSelector = forwardRef(

( ]} >