|
@@ -16,10 +16,15 @@ import { VideoItem, VideoListResponse } from '../types';
|
|
|
import http from '@src/http';
|
|
|
import { getVideoContentListApi } from '@src/http/api';
|
|
|
import { useVideoCategoryOptions } from '../../hooks/useVideoCategoryOptions';
|
|
|
+import { VideoSortType } from '@src/views/publishContent/weCom/components/videoSelectModal';
|
|
|
+import { GzhPlanType } from '../../hooks/useGzhPlanList';
|
|
|
+import { VideoSearchPlanType } from '@src/views/publishContent/weCom/type';
|
|
|
+import { enumToOptions } from '@src/utils/helper';
|
|
|
|
|
|
const { Paragraph, Text } = Typography;
|
|
|
|
|
|
interface VideoSelectModalProps {
|
|
|
+ planType: GzhPlanType;
|
|
|
visible: boolean;
|
|
|
onClose: () => void;
|
|
|
onOk: (selectedVideos: VideoItem[]) => void;
|
|
@@ -27,9 +32,10 @@ interface VideoSelectModalProps {
|
|
|
selectedVideos?: VideoItem[];
|
|
|
}
|
|
|
|
|
|
-const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, onOk, initialSelectedIds = [], selectedVideos = [] }) => {
|
|
|
+const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible, onClose, onOk, initialSelectedIds = [], selectedVideos = [] }) => {
|
|
|
const { videoCategoryOptions } = useVideoCategoryOptions();
|
|
|
const [category, setCategory] = useState<string>();
|
|
|
+ const [sort, setSort] = useState<VideoSortType>(VideoSortType.平台推荐);
|
|
|
const [searchTerm, setSearchTerm] = useState<string>('');
|
|
|
const [currentPage, setCurrentPage] = useState(1);
|
|
|
const [pageSize, setPageSize] = useState(10);
|
|
@@ -48,6 +54,8 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
const res = await http.post<VideoListResponse>(getVideoContentListApi, {
|
|
|
category,
|
|
|
title: searchTerm,
|
|
|
+ sort,
|
|
|
+ type: planType === GzhPlanType.自动回复 ? VideoSearchPlanType.自动回复 : VideoSearchPlanType.服务号推送,
|
|
|
pageNum: pageNum || currentPage,
|
|
|
pageSize: _pageSize || pageSize,
|
|
|
}).catch(() => {
|
|
@@ -148,11 +156,20 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
}
|
|
|
>
|
|
|
<div className="flex flex-wrap gap-4 mb-6">
|
|
|
+ <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
|
|
|
placeholder="选择品类"
|
|
|
- style={{ width: 180 }}
|
|
|
+ style={{ width: 160 }}
|
|
|
value={category}
|
|
|
allowClear
|
|
|
onChange={setCategory}
|
|
@@ -163,7 +180,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
<span className="text-gray-600">视频标题:</span>
|
|
|
<Input
|
|
|
placeholder="搜索视频标题"
|
|
|
- style={{ width: 200 }}
|
|
|
+ style={{ width: 180 }}
|
|
|
value={searchTerm}
|
|
|
onPressEnter={handleSearch}
|
|
|
allowClear
|
|
@@ -199,7 +216,11 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="p-3 flex justify-between items-center">
|
|
|
- <Text type="secondary" className="text-xs">传播效率: {video.score?.toFixed(2)}</Text>
|
|
|
+ <div className="flex flex-col gap-1">
|
|
|
+ <Text type="secondary" className="text-xs">平台传播得分: {video.score?.toFixed(2) || '无'}</Text>
|
|
|
+ <Text type="secondary" className="text-xs">行业裂变率: {video.industryFissionRate?.toFixed(2) || '无'}</Text>
|
|
|
+ <Text type="secondary" className="text-xs">本渠道传播率: {video.channelFissionRate?.toFixed(2) || '无'}</Text>
|
|
|
+ </div>
|
|
|
{isSelected ? (
|
|
|
<CheckCircleFilled className="text-green-500 text-xl" />
|
|
|
) : (
|