|
@@ -1,9 +1,10 @@
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
import { getTaskV3LogListApi } from "@/services/adqV3"
|
|
|
-import { Button, Drawer, Space, Table, Tag } from "antd"
|
|
|
+import { Button, Drawer, Space, Table, Tag, message } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import { columnsLog } from "./tableConfig"
|
|
|
import DynamicLog from "./dynamicLog"
|
|
|
+import { syncAdInfoApi } from "@/services/adqV3/global"
|
|
|
|
|
|
interface Props {
|
|
|
data: any
|
|
@@ -22,6 +23,7 @@ const Log: React.FC<Props> = (props) => {
|
|
|
const [queryForm, setQueryForm] = useState<PULLIN.GetTaskV3LogProps>({ pageNum: 1, pageSize: 20 })
|
|
|
|
|
|
const getTaskV3LogList = useAjax((params) => getTaskV3LogListApi(params), { formatResult: true })
|
|
|
+ const syncAdInfo = useAjax((params) => syncAdInfoApi(params))
|
|
|
/*****************************/
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -35,6 +37,20 @@ const Log: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 同步
|
|
|
+ const sync = (value: any) => {
|
|
|
+ const hide = message.loading(`正在同步...`, 0, () => {
|
|
|
+ message.success('同步成功,结果可能几分钟之后返回');
|
|
|
+ });
|
|
|
+ syncAdInfo.run({ accountAdgroupMaps: [value.accountId + ',' + value.adgroupId], adgroupCreateLogId: value.id }).then(res => {
|
|
|
+ if(res) {
|
|
|
+ getTaskV3LogList.refresh()
|
|
|
+ message.success('同步成功,结果可能几分钟之后返回')
|
|
|
+ hide()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
return <Drawer
|
|
|
bodyStyle={{ padding: 0 }}
|
|
|
title={<Space>
|
|
@@ -47,7 +63,7 @@ const Log: React.FC<Props> = (props) => {
|
|
|
visible={visible}
|
|
|
>
|
|
|
<Table
|
|
|
- columns={columnsLog()}
|
|
|
+ columns={columnsLog(sync)}
|
|
|
dataSource={getTaskV3LogList?.data?.data?.records}
|
|
|
size="small"
|
|
|
loading={getTaskV3LogList?.loading}
|