wjx vor 2 Jahren
Ursprung
Commit
b5158d5533

+ 4 - 4
src/pages/launchSystemNew/components/adPopover/index.tsx

@@ -1,13 +1,13 @@
 import { useAjax } from "@/Hook/useAjax"
 import { BidModeEnum, BidStrategyEnum, OptimizationGoalEnum, PromotedObjectType, SiteSetEnum } from "@/services/launchAdq/enum"
 import { getSysAdgroupsInfo } from "@/services/launchAdq/localAd"
-import { EyeOutlined } from "@ant-design/icons"
 import { Popover, Spin } from "antd"
 import React, { useState } from "react"
 import style from '../targetingPopover/index.less'
 
 interface Props {
-    id: number
+    id: number,
+    name: string
 }
 
 /**
@@ -17,7 +17,7 @@ interface Props {
 const AdPopover: React.FC<Props> = (props) => {
 
     /*************************/
-    const { id } = props
+    const { id, name } = props
     const [visible, setVisible] = useState<boolean>(false)
 
     const getSysAdgroups = useAjax((params) => getSysAdgroupsInfo(params))
@@ -55,7 +55,7 @@ const AdPopover: React.FC<Props> = (props) => {
         onVisibleChange={handleVisibleChange}
     >
         {/* 查看广告 */}
-        <a style={{ color: '#1890ff', fontSize: 12 }}><EyeOutlined /></a>
+        <a style={{ color: '#1890ff', fontSize: 12 }}>{name || id}</a>
     </Popover>
 }
 

+ 4 - 3
src/pages/launchSystemNew/components/adcreativePopover/index.tsx

@@ -8,7 +8,8 @@ import style from '../targetingPopover/index.less'
 
 
 interface Props {
-    id: number
+    id: number,
+    name: string
 }
 /**
  * 表格查看创意基本信息
@@ -17,7 +18,7 @@ interface Props {
 const AdcreativePopover: React.FC<Props> = (props) => {
 
     /*************************/
-    const { id } = props
+    const { id, name } = props
     const [visible, setVisible] = useState<boolean>(false)
 
     const getSysAdcreative = useAjax((params) => getSysAdcreativeInfo(params))
@@ -42,7 +43,7 @@ const AdcreativePopover: React.FC<Props> = (props) => {
         onVisibleChange={handleVisibleChange}
     >
         {/* 查看创意 */}
-        <a style={{ color: '#1890ff', fontSize: 12 }}><EyeOutlined /></a>
+        <a style={{ color: '#1890ff', fontSize: 12 }}>{name || id}</a>
     </Popover>
 }
 

+ 0 - 8
src/pages/launchSystemNew/launchManage/taskList/index.tsx

@@ -3,7 +3,6 @@ import { PromotedObjectType } from "@/services/launchAdq/enum"
 import { getTaskListApi, TaskListProps } from "@/services/launchAdq/taskList"
 import { Input, Select, Space } from "antd"
 import React, { useEffect, useState } from "react"
-import LookLanding from "../../components/lookLanding"
 import TableData from "../../components/TableData"
 import Log from "./log"
 import tableConfig from './tableConfig'
@@ -13,7 +12,6 @@ const TaskList: React.FC = () => {
     /*************************/
     const [queryForm, setQueryForm] = useState<TaskListProps>({ pageSize: 20, pageNum: 1 })
     const [logVisible, setLogVisible] = useState<boolean>(false)
-    const [lookVisible, setLookVisible] = useState<boolean>(false)
     const [logData, setLogData] = useState<{ taskId: number, campaignName: string } | number>({ taskId: 0, campaignName: '' })
     const [allData, setAllData] = useState<any>({})
 
@@ -43,10 +41,6 @@ const TaskList: React.FC = () => {
                 setLogVisible(true)
                 setAllData(allData)
                 break
-            case 'page':
-                setLogData(data)
-                setLookVisible(true)
-                break
         }
     }
 
@@ -89,8 +83,6 @@ const TaskList: React.FC = () => {
         />
         {/* 日志 */}
         {logVisible && <Log {...logData as any} visible={logVisible} onClose={() => setLogVisible(false)} allData={allData}/>}
-        {/* 查看落地页 */}
-        {lookVisible && <LookLanding visible={lookVisible} onClose={() => setLookVisible(false)} id={logData as any} />}
     </>
 }
 

+ 15 - 5
src/pages/launchSystemNew/launchManage/taskList/log.tsx

@@ -3,6 +3,7 @@ import { getTaskLogListApi, TaskLogListProps } from "@/services/launchAdq/taskLi
 import { Button, Drawer, Select, Space } from "antd"
 import React, { useEffect, useState } from "react"
 import { useModel } from "umi"
+import LookLanding from "../../components/lookLanding"
 import TableData from "../../components/TableData"
 import BatchCreativeCopy from "./batchCreativeCopy"
 import tableConfig from './logTableConfig'
@@ -26,11 +27,13 @@ const Log: React.FC<Props> = (props) => {
     const [selectedRowKeys, setSelectedRowKeys] = useState<any[]>([])
     const [visibleCopy, setVisibleCopy] = useState<boolean>(false)
     const [data, setData] = useState<any>({})
+    const [lookVisible, setLookVisible] = useState<boolean>(false)
+    const [logData, setLogData] = useState<{ taskId: number, campaignName: string } | number>({ taskId: 0, campaignName: '' })
 
     const { getAdAccount } = useModel('useLaunchAdq.useAdAuthorize')
     const getTaskLogList = useAjax((params) => getTaskLogListApi(params), { formatResult: true })
     /*****************************/
-    
+
     useEffect(() => {
         getAdAccount.run()
     }, [])
@@ -51,16 +54,21 @@ const Log: React.FC<Props> = (props) => {
         setVisibleCopy(true)
     }
 
-    return <Drawer bodyStyle={{ padding: 0 }} title={campaignName + ' 日志'} width={1200} placement="right" onClose={() => { onClose && onClose() }} visible={visible}>
+    const callback = (data: any) => {
+        setLogData(data)
+        setLookVisible(true)
+    }
+
+    return <Drawer bodyStyle={{ padding: 0 }} title={campaignName + ' 日志'} width={1400} placement="right" onClose={() => { onClose && onClose() }} visible={visible}>
         <Space>
             <Button></Button>
         </Space>
         <TableData
-            columns={() => tableConfig(copyCreative)}
+            columns={() => tableConfig(copyCreative, callback)}
             ajax={getTaskLogList}
             dataSource={getTaskLogList?.data?.data?.records}
             loading={getTaskLogList?.loading}
-            scroll={{ y: 600 }}
+            scroll={{ x: 1200, y: 600 }}
             total={getTaskLogList?.data?.data?.total}
             page={getTaskLogList?.data?.data?.current}
             pageSize={getTaskLogList?.data?.data?.size}
@@ -114,7 +122,9 @@ const Log: React.FC<Props> = (props) => {
         />
 
         {/* 批量复制 */}
-        {visibleCopy && <BatchCreativeCopy data={data} publicData={allData} visible={visibleCopy} onClose={() => setVisibleCopy(false)} onChange={() => {  }}/>}
+        {visibleCopy && <BatchCreativeCopy data={data} publicData={allData} visible={visibleCopy} onClose={() => setVisibleCopy(false)} onChange={() => { }} />}
+        {/* 查看落地页 */}
+        {lookVisible && <LookLanding visible={lookVisible} onClose={() => setLookVisible(false)} id={logData as any} />}
     </Drawer>
 }
 

+ 46 - 4
src/pages/launchSystemNew/launchManage/taskList/logTableConfig.tsx

@@ -1,15 +1,16 @@
 import { copy } from "@/utils/utils";
-import { DownOutlined } from "@ant-design/icons";
+import { DownOutlined, EyeOutlined } from "@ant-design/icons";
 import { Badge, Button, Dropdown, Menu, Space } from "antd"
 import React from "react"
-function tableConfig(copyCreative: (data: any) => void): any {
+import AdcreativePopover from "../../components/adcreativePopover";
+function tableConfig(copyCreative: (data: any) => void, callback: (data: any) => void): any {
     return [
         {
             title: 'ID',
             dataIndex: 'id',
             key: 'id',
             align: 'center',
-            width: 45,
+            width: 50,
         },
         {
             title: '媒体账户',
@@ -42,6 +43,47 @@ function tableConfig(copyCreative: (data: any) => void): any {
                 return <span style={{ fontSize: "12px" }}>{a || '--'}</span>
             }
         },
+        {
+            title: '创意',
+            dataIndex: 'sysAdcreativeId',
+            key: 'sysAdcreativeId',
+            align: 'center',
+            width: 80,
+            ellipsis: true,
+            render: (a: any, b: any) => {
+                if (a) {
+                    return <AdcreativePopover id={a} name={b?.sysAdcreativeInfo?.adcreativeName}/>
+                } else {
+                    return <span>--</span>
+                }
+            }
+        },
+        {
+            title: '任务反馈',
+            dataIndex: 'count',
+            key: 'count',
+            width: 250,
+            render: (a: any, b: any) => {
+                return <Space style={{ fontSize: "12px" }} size={20}>
+                    <span><Badge status="processing" />总条数:{a}条</span>
+                    <span><Badge status="success" />成功:{b?.successCount || 0}条</span>
+                </Space>
+            }
+        },
+        {
+            title: '落地页ID',
+            dataIndex: 'sysPageId',
+            key: 'sysPageId',
+            align: 'center',
+            width: 80,
+            render: (a: any, b: any) => {
+                if (a) {
+                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback(b.sysPageId) }}><EyeOutlined /></a></Space>
+                } else {
+                    return <span>--</span>
+                }
+            }
+        },
         {
             title: '创建状态',
             dataIndex: 'createStatus',
@@ -61,7 +103,7 @@ function tableConfig(copyCreative: (data: any) => void): any {
             dataIndex: 'createTime',
             key: 'createTime',
             align: 'center',
-            width: 150,
+            width: 160,
             ellipsis: true,
             render: (a: any, b: any) => {
                 return <span style={{ fontSize: "12px" }}>{a || '--'}</span>

+ 26 - 41
src/pages/launchSystemNew/launchManage/taskList/tableConfig.tsx

@@ -1,12 +1,22 @@
 import React from "react"
-import { Space } from "antd"
+import { Badge, Space } from "antd"
 import { AdStatus, PromotedObjectType, SpeedMode } from "@/services/launchAdq/enum"
 import TargetingPopover from "../../components/targetingPopover"
-import { EyeOutlined } from "@ant-design/icons"
 import AdPopover from "../../components/adPopover"
-import AdcreativePopover from "../../components/adcreativePopover"
 function tableConfig(callback: (data: any, type: 'log' | 'page', allData?: any) => void): any {
     return [
+        {
+            title: '操作',
+            dataIndex: 'taskName',
+            key: 'taskName',
+            width: 60,
+            align: 'center',
+            render: (a: any, b: any) => {
+                return <Space>
+                    <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback({ taskId: b.id, campaignName: b.campaignName }, 'log', b) }}>日志</a>
+                </Space>
+            }
+        },
         {
             title: 'ID',
             dataIndex: 'id',
@@ -82,14 +92,15 @@ function tableConfig(callback: (data: any, type: 'log' | 'page', allData?: any)
             }
         },
         {
-            title: '广告ID',
+            title: '广告',
             dataIndex: 'sysAdgroupId',
             key: 'sysAdgroupId',
             align: 'center',
-            width: 80,
+            width: 90,
+            ellipsis: true,
             render: (a: any, b: any) => {
                 if (a) {
-                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><AdPopover id={a}/></Space>
+                    return <AdPopover name={b?.sysAdgroupInfo?.adgroupName} id={a} />
                 } else {
                     return <span>--</span>
                 }
@@ -103,35 +114,7 @@ function tableConfig(callback: (data: any, type: 'log' | 'page', allData?: any)
             width: 80,
             render: (a: any, b: any) => {
                 if (a) {
-                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><TargetingPopover id={b.sysTargetingId}/></Space> 
-                } else {
-                    return <span>--</span>
-                }
-            }
-        },
-        {
-            title: '创意ID',
-            dataIndex: 'sysAdcreativeId',
-            key: 'sysAdcreativeId',
-            align: 'center',
-            width: 80,
-            render: (a: any, b: any) => {
-                if (a) {
-                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><AdcreativePopover id={a}/></Space>
-                } else {
-                    return <span>--</span>
-                }
-            }
-        },
-        {
-            title: '落地页ID',
-            dataIndex: 'sysPageId',
-            key: 'sysPageId',
-            align: 'center',
-            width: 80,
-            render: (a: any, b: any) => {
-                if (a) {
-                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback(b.sysPageId, 'page') }}><EyeOutlined /></a></Space>
+                    return <Space><span style={{ fontSize: "12px" }}>{a}</span><TargetingPopover id={b.sysTargetingId} /></Space>
                 } else {
                     return <span>--</span>
                 }
@@ -148,13 +131,15 @@ function tableConfig(callback: (data: any, type: 'log' | 'page', allData?: any)
             }
         },
         {
-            title: <span style={{ marginLeft: 10 }}>操作</span>,
-            dataIndex: 'taskName',
-            key: 'taskName',
-            fixed: 'right',
+            title: <span style={{ marginLeft: 10 }}>任务反馈</span>,
+            dataIndex: 'total',
+            key: 'total',
             render: (a: any, b: any) => {
-                return <Space style={{ marginLeft: 10 }}>
-                    <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback({ taskId: b.id, campaignName: b.campaignName }, 'log', b) }}>日志</a>
+                let errCount = a - (b?.successCount || 0)
+                return <Space style={{ fontSize: "12px", marginLeft: 10 }} size={20}>
+                    <span><Badge status="processing" />总条数:{a}条</span>
+                    {b?.successCount ? <span><Badge status="success" />成功:{b?.successCount || 0}条</span> : null}
+                    {errCount ? <span><Badge status="error" />失败:{errCount}条</span> : null}
                 </Space>
             }
         }