11
0

2 Commits 9d65eddabe ... 26ffc36533

Autor SHA1 Mensagem Data
  nieyuge 26ffc36533 重复上报问题 há 2 meses atrás
  nieyuge 9d65eddabe 重复上报问题 há 2 meses atrás

+ 5 - 5
src/hooks/useLogger.ts

@@ -2,7 +2,7 @@ import http from '@src/http';
 import { uploadLogApi } from '@src/http/api';
 import sso from '@src/http/sso';
 import { VideoItem } from '@src/views/publishContent/types';
-import { RecentNotUsedType, SortTypeEnum, TagType, VideoLibraryType } from '@src/views/publishContent/weCom/components/videoSelectModal';
+import { VideoLibraryType, VideoSortType } from '@src/views/publishContent/weCom/components/videoSelectModal';
 import { VideoSearchPlanType } from '@src/views/publishContent/weCom/type';
 
 type NormalLogParams = {
@@ -16,16 +16,16 @@ type NormalLogParams = {
 type VideoListQueryLogParams = {
 	category?: string;
 	title?: string;
-	recentNotUsed?: RecentNotUsedType;
-	sortType?: SortTypeEnum;
-	tags?: TagType[];
+	recentNotUsed?: number;
+	sortType?: VideoSortType;
+	tags?: string[];
 	videoLibraryType?: VideoLibraryType;
 } & NormalLogParams;
 
 type VideoLogParams = {
 	videoId: number;
 	score?: number;
-	tags?: TagType[];
+	tags?: string[];
 	title?: string;
 	cover?: string;
 	libraryType?: VideoLibraryType;

+ 2 - 2
src/views/publishContent/types.ts

@@ -1,4 +1,4 @@
-import { TagType } from "./weCom/components/videoSelectModal";
+
 
 export enum CollectedStatusEnum {
 	已收藏 = 1,
@@ -24,7 +24,7 @@ export interface VideoItem {
   channelFissionRate?: number;
   videoLibraryType?: number;
   recommendScore?: number;
-  tags?: TagType[];
+  tags?: string[];
 	scene?: 0 | 1;
 	collect?: CollectedStatusEnum;
 	status?: VideoStatusEnum;

+ 2 - 2
src/views/publishContent/weCom/components/addPlanModal/index.tsx

@@ -2,7 +2,7 @@
 
 import React, { useEffect, useState } from 'react';
 import { Modal, Form, Input, Select, Button, Card, Typography, message } from 'antd';
-import { WeComPlanType, WeVideoItem, AddWeComPlanParam } from '../../type';
+import { WeComPlanType, WeVideoItem, AddWeComPlanParam, VideoSearchPlanType } from '../../type';
 import { CloseOutlined, PlusOutlined, CaretRightFilled } from '@ant-design/icons';
 import VideoSelectModal from '../videoSelectModal';
 import VideoPlayModal from '../videoPlayModal';
@@ -58,7 +58,7 @@ const AddPlanModal: React.FC<{
 				videoList: selectedVideos,
 				traceId: Date.now(),
 				requestId: Date.now(),
-				planType: type === WeComPlanType.社群 ? '企微社群' : '企微自动回复',
+				planType: type === WeComPlanType.社群 ? VideoSearchPlanType.企微社群 : VideoSearchPlanType.企微自动回复,
 				subChannel: values.subChannel || 'weCom',
 			});
 			onOk({

+ 5 - 7
src/views/publishContent/weCom/components/videoSelectModal/index.tsx

@@ -57,7 +57,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
 	const [playingVideo, setPlayingVideo] = useState<WeVideoItem | null>(null);
 	const [videoLibraryType, setVideoLibraryType] = useState<VideoLibraryType>(VideoLibraryType.平台视频库);
 	const MAX_SELECTION = 3;
-	const { uploadLogVideoPlay, uploadLogVideoPlayEnd, uploadLogVideoCollect, uploadLogVideoListQuery, uploadLogVideoView } = useLogger();
+	const { uploadLogVideoPlay, uploadLogVideoPlayEnd, uploadLogVideoCollect, uploadLogVideoListQuery } = useLogger();
 
 	const getVideoList = async (pageNum?: number, _pageSize?: number) => {
 		setLoading(true);
@@ -103,12 +103,10 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
 
 	// 监听视频库类型变化,重新加载数据
 	useEffect(() => {
-		getVideoList();
-	}, [videoLibraryType]);
-
-	useEffect(() => {
-		getVideoList();
-	}, []);
+		if (visible) {
+			getVideoList();
+		}
+	}, [videoLibraryType, visible]);
 
 	useEffect(() => {
 		if (visible) {

+ 19 - 8
src/views/publishContent/weGZH/components/publishPlanModal/index.tsx

@@ -8,6 +8,7 @@ import { VideoItem } from '../types'; // Import from common types
 import { GzhPlanDataType, GzhPlanType } from '../../hooks/useGzhPlanList';
 import { useAccountOptions } from '../../hooks/useAccountOptions';
 import { VideoLibraryType } from '@src/views/publishContent/weCom/components/videoSelectModal';
+import { VideoSearchPlanType } from '@src/views/publishContent/weCom/type';
 import useLogger from '@src/hooks/useLogger';
 
 const { Option } = Select;
@@ -38,6 +39,16 @@ const AddPunlishPlanModal: React.FC<AddPunlishPlanModalProps> = ({ visible, isSu
 	const { accountOptions, getAccountList } = useAccountOptions();
 	const { uploadLogVideoCreatePublish } = useLogger();
 
+	const getVideoListType = (planType: GzhPlanType) => {
+		if (planType === GzhPlanType.自动回复) {
+			return VideoSearchPlanType.自动回复;
+		} else if (planType === GzhPlanType.公众号推送) {
+			return VideoSearchPlanType.公众号推送;
+		} else {
+			return VideoSearchPlanType.服务号推送;
+		}
+	};
+
 	// 处理code参数
 	useEffect(() => {
 		if (code) {
@@ -102,14 +113,14 @@ const AddPunlishPlanModal: React.FC<AddPunlishPlanModalProps> = ({ visible, isSu
 				}
 				formData.videoList = selectedVideos;
 				// 上报日志
-				uploadLogVideoCreatePublish({
-					videoList: selectedVideos,
-					traceId: Date.now(),
-					requestId: Date.now(),
-					planType: planType,
-					gzhAccountId: formData.accountId,
-					subChannel: 'weGZH'
-				});
+			uploadLogVideoCreatePublish({
+				videoList: selectedVideos,
+				traceId: Date.now(),
+				requestId: Date.now(),
+				planType: getVideoListType(planType),
+				gzhAccountId: formData.accountId,
+				subChannel: 'weGZH'
+			});
 				onOk(formData);
 			})
 			.catch((info) => {