|
@@ -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}
|