|
|
@@ -23,7 +23,7 @@ import http from '@src/http';
|
|
|
import { getVideoContentListApi, getUploadVideoContentListApi, getCollectVideoContentListApi, saveCollectVideoContentApi, getCollectContentListApi } from '@src/http/api';
|
|
|
import { useVideoCategoryOptions } from '@src/views/publishContent/weGZH/hooks/useVideoCategoryOptions';
|
|
|
import { VideoSearchPlanType } from '@src/views/publishContent/weCom/type'
|
|
|
-import { enumToOptions } from '@src/utils/helper';
|
|
|
+import { enumToOptions, getRandomNumberKey } from '@src/utils/helper';
|
|
|
import { isNil } from 'lodash';
|
|
|
import { CollectedStatusEnum, VideoStatusEnum } from '@src/views/publishContent/types';
|
|
|
import useLogger from '@src/hooks/useLogger';
|
|
|
@@ -189,11 +189,11 @@ export const VideoSelectContent: React.FC<VideoSelectContentProps> = ({
|
|
|
pageSize: _pageSize || pageSize,
|
|
|
};
|
|
|
|
|
|
+ const _requestId = getRandomNumberKey();
|
|
|
const res = await http.post<VideoListResponse>(apiUrl, requestParams).catch(() => {
|
|
|
message.error('获取视频列表失败');
|
|
|
}).finally(() => {
|
|
|
setLoading(false);
|
|
|
- const _requestId = new Date().getTime();
|
|
|
setRequestId(_requestId);
|
|
|
uploadLogVideoListQuery({
|
|
|
traceId: traceId,
|
|
|
@@ -210,8 +210,9 @@ export const VideoSelectContent: React.FC<VideoSelectContentProps> = ({
|
|
|
});
|
|
|
});
|
|
|
if (res && res.code === 0) {
|
|
|
- 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))]);
|
|
|
+ const newVideoList = (res.data.objs || []).map(v => ({...v, requestId: _requestId}));
|
|
|
+ setVideoList([...selectedVideos, ...newVideoList.filter(v => !selectedVideos.find(ov => ov.videoId === v.videoId))]);
|
|
|
+ setVideoListAll(old => [...old, ...newVideoList.filter(v => !old.find(ov => ov.videoId === v.videoId))]);
|
|
|
setTotal(res.data.totalSize);
|
|
|
} else {
|
|
|
message.error('获取视频列表失败');
|