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(

( ]} >