wjx 1 年之前
父節點
當前提交
f088166356

+ 1 - 1
src/pages/launchSystemNew/adMonitorListV3/config.ts

@@ -92,7 +92,7 @@ const qiliangpaihanghour = [
             { title: '投手', dataIndex: 'put_user_name', serverIndex: 'sys_user.put_user_name', label: '设置信息', default: 11, width: 65 },
             { title: '投放时间', dataIndex: 'begin_date', serverIndex: 'adgroup.begin_date, adgroup.end_date', label: '设置信息', default: 12, width: 135 },
             { title: '广告状态', dataIndex: 'system_status', serverIndex: 'adgroup.system_status', label: '设置信息', width: 85 },
-            { title: '操作', dataIndex: 'event', label: '设置信息', default: 13, width: 170 },
+            { title: '操作', dataIndex: 'event', label: '设置信息', default: 13, width: 210 },
         ]
     },
     {

+ 17 - 2
src/pages/launchSystemNew/adMonitorListV3/monitor.tsx

@@ -1,4 +1,4 @@
-import { Card, Input, Radio, Select, Space, Spin, Tag, TimePicker, Tooltip } from "antd";
+import { Card, Input, Radio, Select, Space, Spin, Tag, TimePicker, Tooltip, message } from "antd";
 import React, { useCallback, useEffect, useState } from "react";
 import { ColumnHeightOutlined, ColumnWidthOutlined, EyeInvisibleOutlined, EyeOutlined, RedoOutlined } from "@ant-design/icons";
 import useEcharts from '@/Hook/useEcharts'
@@ -13,6 +13,8 @@ import FilterQuery from "@/pages/adMonitor/adMonitorList/components/FilterQuery"
 import Details from "./Details";
 import { columnsMonitor } from "./tableMonitorConfig";
 import { qiliangpaihanghour } from "./config";
+import { syncBatchApi } from "@/services/launchAdq/adqv3";
+import { useAjax } from "@/Hook/useAjax";
 interface newListType extends ListType {
     totalTimeUnit: 'total' | 'minute' | 'hour' | 'day',
     planTimeUnit: 'minute' | 'hour' | 'day'
@@ -49,6 +51,7 @@ function Monitor(props: { onChange: () => void }) {
     const { totalTimeUnit, planTimeUnit, adgroup, accountId, sysUserId, groupAccountIds } = queryForm
     const configName = '起量广告排行明细3.0'
     const { getGroupList, groupListInit } = useModel('useLaunchAdq.useAdAuthorize')
+    const syncBatch = useAjax((params) => syncBatchApi(params))
 
     useEffect(() => {
         groupListInit()
@@ -254,6 +257,18 @@ function Monitor(props: { onChange: () => void }) {
         setLogVisible(true)
     }
 
+    const sync = (data: any) => {
+        const hide = message.loading(`${data?.adgroup_name}广告同步中`, 0, () => {
+            message.success('修改成功');
+        });
+        let accountAdgroupMaps = [data.account_id + ',' + data.adgroup_id]
+        syncBatch.run({ accountAdgroupMaps }).then(res => {
+            hide()
+            getListForHourV3.refresh()
+            message.success('同步完成!')
+        }).catch(() => hide())
+    }
+
     return <Space direction='vertical' style={{ width: '100%' }} className="monitor">
         <Card hoverable bodyStyle={{ padding: '12px 16px' }}>
             <div style={{ display: 'flex', justifyContent: 'space-between' }}>
@@ -410,7 +425,7 @@ function Monitor(props: { onChange: () => void }) {
                 refreshData={getList}
                 bodyStyle={{ padding: '12px 16px' }}
                 gutter={[0, 12]}
-                columns={columnsMonitor(planDetail, details, (value) => { setQueryForm({ ...queryForm, adgroup: value }); }, log)}
+                columns={columnsMonitor(planDetail, details, (value) => { setQueryForm({ ...queryForm, adgroup: value }); }, log, sync)}
                 dataSource={getListForHourV3?.data?.data?.records}
                 loading={getListForHourV3?.loading}
                 ajax={getListForHourV3}

+ 2 - 2
src/pages/launchSystemNew/adMonitorListV3/tableMonitorConfig.tsx

@@ -6,10 +6,9 @@ import React from 'react'
 import { ReactComponent as RocketSvg } from '@/assets/rocket.svg'
 import '@/pages/adMonitor/adMonitorList/index.less'
 import { CHUJIAFANGSHI, YOUHUAMUBIAO } from '@/pages/adMonitor/adMonitorList/enum'
-import { GGStateData } from '@/pages/adMonitor/adMonitorList/data'
 import { copy } from '@/utils/utils'
 import { ADGROUP_STATUS } from '../adqv3/const'
-function columnsMonitor(planDetail: (id: number) => void, details: (id: number) => void, onChange: (value: any) => void, log: (value: any) => void) {
+function columnsMonitor(planDetail: (id: number) => void, details: (id: number) => void, onChange: (value: any) => void, log: (value: any) => void, sync: (data: any) => void) {
     const { copy } = useCopy()
     return function columns() {
         let newArr: ColumnsType<any> = [
@@ -604,6 +603,7 @@ function columnsMonitor(planDetail: (id: number) => void, details: (id: number)
                     </div>
                     <a onClick={() => log(b)}>告警日志</a>
                     <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.account_id}/admanage/index?tab=adgroup&query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroup_id}%22}`)} target="_blank">腾讯广告</a>
+                    <a onClick={() => sync(b)}>同步</a>
                 </Space>
                 )
             }