瀏覽代碼

Merge branch 'feature_addGZHdaliyTab' of Web/contentCooper into master

jihuaqiang 4 天之前
父節點
當前提交
00b9ef7d0d

+ 1 - 0
src/views/publishContent/weCom/type.ts

@@ -25,6 +25,7 @@ export enum VideoSearchPlanType {
 	服务号推送 = 1,
 	企微社群 = 2,
 	企微自动回复 = 3,
+	公众号推送 = 4,
 }
 
 export interface WeVideoItem {

+ 1 - 0
src/views/publishContent/weGZH/components/publishPlanModal/index.tsx

@@ -178,6 +178,7 @@ const AddPunlishPlanModal: React.FC<AddPunlishPlanModalProps> = ({
 						<Select placeholder="选择计划类型" onChange={onTypeChange} className='!w-50' disabled={actionType === 'edit'}>
 							<Option value={GzhPlanType.自动回复}>自动回复</Option>
 							<Option value={GzhPlanType.服务号推送}>服务号推送</Option>
+							<Option value={GzhPlanType.公众号推送}>公众号推送</Option>
 						</Select>
 					</Form.Item>
 					<Form.Item

+ 11 - 1
src/views/publishContent/weGZH/components/videoSelectModal/index.tsx

@@ -47,6 +47,16 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 	const [playingVideo, setPlayingVideo] = useState<VideoItem | null>(null);
 	const MAX_SELECTION = 3;
 
+	const getVideoListType = (planType: GzhPlanType) => {
+		if (planType === GzhPlanType.自动回复) {
+			return VideoSearchPlanType.自动回复;
+		} else if (planType === GzhPlanType.公众号推送) {
+			return VideoSearchPlanType.公众号推送;
+		} else {
+			return VideoSearchPlanType.服务号推送;
+		}
+	}
+
 	const getVideoList = async (pageNum?: number, _pageSize?: number) => {
 		setLoading(true);
 		setCurrentPage(pageNum || currentPage);
@@ -55,7 +65,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 			category,
 			title: searchTerm,
 			sort,
-			type: planType === GzhPlanType.自动回复 ? VideoSearchPlanType.自动回复 : VideoSearchPlanType.服务号推送,
+			type: getVideoListType(planType),
 			pageNum: pageNum || currentPage,
 			pageSize: _pageSize || pageSize,
 		}).catch(() => {

+ 1 - 1
src/views/publishContent/weGZH/hooks/useAccountOptions.ts

@@ -20,7 +20,7 @@ export const useAccountOptions = () => {
       setError(null);
 			const data = await request.get(getGzhAccountOptionsApi, {
 				params: {
-					accountType: accountType === GzhPlanType.自动回复 ? undefined : GzhPlanType.服务号推送
+					accountType: (accountType === GzhPlanType.自动回复 || accountType === GzhPlanType.公众号推送) ? undefined : GzhPlanType.服务号推送
 				}
 			});
       setAccountOptions(data.data as Account[]);

+ 1 - 0
src/views/publishContent/weGZH/hooks/useGzhPlanList.ts

@@ -6,6 +6,7 @@ import { VideoItem } from '../components/types';
 export enum GzhPlanType {
 	自动回复 = '0',
 	服务号推送 = '1',
+	公众号推送 = '2',
 }
 
 export interface GzhPlanDataType {

+ 1 - 0
src/views/publishContent/weGZH/index.tsx

@@ -301,6 +301,7 @@ const WeGZHContent: React.FC = () => {
 					items={[
 						{ label: '自动回复', key: GzhPlanType.自动回复 },
 						{ label: '服务号推送', key: GzhPlanType.服务号推送 },
+						{ label: '公众号推送', key: GzhPlanType.公众号推送 },
 					]}
 					activeKey={planType}
 					onChange={(key) => setPlanType(key as GzhPlanType)}

+ 40 - 0
src/views/weData/gzh/index.tsx

@@ -320,6 +320,46 @@ const Gzh: React.FC = () => {
           {
             key: "3",
             label: "服务号分账号",
+            children: (
+              <Table
+                dataSource={separateDataSource}
+                columns={separateColumns}
+                rowKey={(record, idx) => record.dateStr + record.ghId + idx}
+                loading={loading}
+                pagination={{
+                  current: pagination.current,
+                  pageSize: pagination.pageSize,
+                  total: pagination.total,
+                  showSizeChanger: true,
+                  showTotal: (total) => `共 ${total} 条`,
+                }}
+                onChange={handleTableChange}
+              />
+            ),
+					},
+					{
+            key: "5",
+            label: "公众号总计",
+            children: (
+              <Table
+                dataSource={allDataSource}
+                columns={columns}
+                rowKey={(record, idx) => record.dateStr + record.ghId + idx}
+                loading={loading}
+                pagination={{
+                  current: pagination.current,
+                  pageSize: pagination.pageSize,
+                  total: pagination.total,
+                  showSizeChanger: true,
+                  showTotal: (total) => `共 ${total} 条`,
+                }}
+                onChange={handleTableChange}
+              />
+            ),
+          },
+          {
+            key: "6",
+            label: "公众号分账号",
             children: (
               <Table
                 dataSource={separateDataSource}