nieyuge 2 týždňov pred
rodič
commit
63e87aeafb

+ 1 - 0
src/views/publishContent/weGZH/components/types.ts

@@ -11,6 +11,7 @@ export interface VideoItem {
 	videoId: number,
 	industryFissionRate: number,
 	channelFissionRate: number,
+	videoLibraryType?: number;
 } 
 
 export interface VideoListResponse {

+ 25 - 18
src/views/publishContent/weGZH/components/videoSelectModal/index.tsx

@@ -80,6 +80,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 			setLoading(false);
 		});
 		if (res && res.code === 0) {
+			selectedVideos = selectedVideos.filter(item => item.videoLibraryType === videoLibraryType)
 			setVideoList([...selectedVideos, ...res.data.objs.filter(v => !selectedVideos.find(ov => ov.videoId === v.videoId))]);
 			setVideoListAll(old => [...old, ...res.data.objs.filter(v => !old.find(ov => ov.videoId === v.videoId))]);
 			setTotal(res.data.totalSize);
@@ -132,6 +133,12 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 
 	const handleOk = () => {
 		const _selectedVideos = videoListAll.filter(video => selectedVideoIds.has(video.videoId));
+		_selectedVideos.forEach(video => {
+			// 加入视频库类型
+			if (!('videoLibraryType' in video)) {
+				video.videoLibraryType = videoLibraryType
+			}
+		});
 		onOk(_selectedVideos);
 		onClose();
 	};
@@ -179,24 +186,24 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 				}
 			>
 				<div className="flex flex-wrap gap-2 mb-6">
-			<div className="flex items-center gap-2">
-				<span className="text-gray-600">视频来源:</span>
-				<Select
-					style={{ width: 120 }}
-					value={videoLibraryType}
-					onChange={setVideoLibraryType}
-					options={enumToOptions(VideoLibraryType)}
-				/>
-			</div>
-			<div className="flex items-center gap-2">
-				<span className="text-gray-600">排序选项:</span>
-				<Select
-					style={{ width: 120 }}
-					value={sort}
-					onChange={setSort}
-					options={enumToOptions(VideoSortType)}
-				/>
-			</div>
+					<div className="flex items-center gap-2">
+						<span className="text-gray-600">视频来源:</span>
+						<Select
+							style={{ width: 120 }}
+							value={videoLibraryType}
+							onChange={setVideoLibraryType}
+							options={enumToOptions(VideoLibraryType)}
+						/>
+					</div>
+					<div className="flex items-center gap-2">
+						<span className="text-gray-600">排序选项:</span>
+						<Select
+							style={{ width: 120 }}
+							value={sort}
+							onChange={setSort}
+							options={enumToOptions(VideoSortType)}
+						/>
+					</div>
 					<div className="flex items-center gap-2">
 						<span className="text-gray-600">品类:</span>
 						<Select