Sfoglia il codice sorgente

Merge branch 'develop' of http://git.zanxiangnet.com/wjx/ad-manage

wjx 1 anno fa
parent
commit
647fe2389b

+ 0 - 9
config/routerConfig.ts

@@ -32,15 +32,6 @@ function headrRouter(initialState: any, history: any) {
             }
         })
     }
-    if (history?.location?.pathname === '/launchSystemV3') { //当切换一级菜单的辅助跳转
-        history?.goBack()
-        initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
-            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/launchSystemV3'))) {
-                let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
-                isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
-            }
-        })
-    }
 }
 //返回按钮路由
 function btnFun(items: any) {

+ 2 - 0
src/pages/launchSystemV3/adMonitorListV3/config.ts

@@ -24,6 +24,7 @@ const planAdConfig = [
             { title: '广告状态', dataIndex: 'system_status', serverIndex: 'adgroup.system_status', label: '广告详情', default: 20, width: 70 },
             { title: '广告详情', dataIndex: 'cost_speed', label: '广告详情', default: 21, width: 80 },
             { title: '标记备注', dataIndex: 'tag_remark', label: '广告详情', width: 80, serverIndex: 'adgroup_user_tag.tag_remark' },
+            { title: '创意预览', dataIndex: 'creative_ids', serverIndex: 'adgroup_data.creative_ids', label: '设置信息', width: 130 },
             { title: '操作', dataIndex: 'cz', label: '广告详情', default: 22, width: 116 },
         ]
     },
@@ -89,6 +90,7 @@ const qiliangpaihanghour = [
             { title: '广告名称', dataIndex: 'adgroup_name', label: '设置信息', default: 2, width: 170 },
             { title: '广告ID', dataIndex: 'adgroup_id', label: '设置信息', default: 9, width: 90 },
             { title: '广告账户', dataIndex: 'account_id', label: '设置信息', default: 10, width: 70 },
+            { title: '创意预览', dataIndex: 'creative_ids', serverIndex: 'adgroup_data.creative_ids', label: '设置信息', width: 130 },
             { 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 },

+ 10 - 0
src/pages/launchSystemV3/adMonitorListV3/tableMonitorConfig.tsx

@@ -8,6 +8,7 @@ import '@/pages/adMonitor/adMonitorList/index.less'
 import { CHUJIAFANGSHI, YOUHUAMUBIAO } from '@/pages/adMonitor/adMonitorList/enum'
 import { copy } from '@/utils/utils'
 import { ADGROUP_STATUS } from '../adqv3/const'
+import BoxOther from '../adqv3/creative/boxOther'
 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() {
@@ -58,6 +59,15 @@ function columnsMonitor(planDetail: (id: number) => void, details: (id: number)
                 ellipsis: true,
                 width: 65
             },
+            {
+                title: '创意预览',
+                dataIndex: 'creative_ids',
+                key: 'creative_ids',
+                width: 110,
+                render: (_: any, b: any) => {
+                    return <BoxOther creativeComponents={b?.creative_preview?.[0] || {}} />
+                }
+            },
             {
                 title: '投放时间',
                 dataIndex: 'begin_date',

+ 10 - 0
src/pages/launchSystemV3/adMonitorListV3/tablePlanListConfig.tsx

@@ -10,6 +10,7 @@ import { DownOutlined } from '@ant-design/icons'
 import TimeSeriesLook from '../../launchSystemNew/adq/ad/timeSeriesLook'
 import SwitchStatus from '../adqv3/ad/switchStatus'
 import { ADGROUP_STATUS } from '../adqv3/const'
+import BoxOther from '../adqv3/creative/boxOther'
 function tablePlanConfig(
     onChange: () => void,
     details: (data: any) => void,
@@ -294,6 +295,15 @@ function tablePlanConfig(
                 </div>
             }
         },
+        {
+            title: '创意预览',
+            dataIndex: 'creative_ids',
+            key: 'creative_ids',
+            width: 110,
+            render: (_: any, b: any) => {
+                return <BoxOther creativeComponents={b?.creative_preview?.[0] || {}} />
+            }
+        },
         {
             title: '操作',
             dataIndex: 'cz',

+ 1 - 1
src/pages/launchSystemV3/adqv3/ad/index.tsx

@@ -211,7 +211,7 @@ const Ad: React.FC<ADQV3.AdProps> = ({ userId, creativeHandle }) => {
             columns={() => tableConfig(() => getAdqV3AdList.refresh(), creativeHandle)}
             ajax={getAdqV3AdList}
             syncAjax={sync}
-            fixed={{ left: 2, right: 4 }}
+            fixed={{ left: 2, right: 5 }}
             dataSource={getAdqV3AdList?.data?.data?.records}
             loading={getAdqV3AdList?.loading || syncBatch?.loading}
             scroll={{ y: 560 }}

+ 5 - 5
src/pages/launchSystemV3/adqv3/ad/tableConfig.tsx

@@ -6,6 +6,7 @@ import { copy } from '@/utils/utils'
 import { ADGROUP_STATUS } from '../const'
 import SwitchStatus from './switchStatus'
 import TimeSeriesLook from '@/pages/launchSystemNew/adq/ad/timeSeriesLook'
+import BoxOther from '../creative/boxOther'
 function tableConfig(onChange: () => void, creativeHandle?: (id: number) => void): any {
     return [
         {
@@ -16,7 +17,7 @@ function tableConfig(onChange: () => void, creativeHandle?: (id: number) => void
             width: 40,
             fixed: 'left',
             render: (a: string, b: any) => {
-                return <SwitchStatus configuredStatus={a} accountId={b?.accountId} isDeleted={b?.isDeleted} adgroupId={b?.adgroupId} onChange={onChange}/>
+                return <SwitchStatus configuredStatus={a} accountId={b?.accountId} isDeleted={b?.isDeleted} adgroupId={b?.adgroupId} onChange={onChange} />
             }
         },
         {
@@ -220,11 +221,10 @@ function tableConfig(onChange: () => void, creativeHandle?: (id: number) => void
             title: '创意预览',
             dataIndex: 'dynamicCreativeList',
             key: 'dynamicCreativeList',
-            width: 70,
-            align: 'center',
+            width: 150,
             fixed: 'right',
-            render: (_: any, b: any) => {
-                return <a onClick={() => { creativeHandle?.(b?.adgroupId) }}>创意预览</a>
+            render: (a: any, b: any) => {
+                return <Space><BoxOther creativeComponents={a?.[0]?.creativeComponents || {}} /><a onClick={() => { creativeHandle?.(b?.adgroupId) }}>详情</a></Space>
             }
         },
         {

+ 1 - 1
src/pages/launchSystemV3/adqv3/config.ts

@@ -23,7 +23,7 @@ const txAdConfig = [
             { title: '创建时间', dataIndex: 'createdTime', label: '广告详情', default: 18, width: 140 },
             { title: '是否已删除', dataIndex: 'isDeleted', label: '广告详情', default: 19, width: 60 },
             { title: '广告状态', dataIndex: 'systemStatus', label: '广告详情', default: 20, width: 80 },
-            { title: '创意预览', dataIndex: 'dynamicCreativeList', label: '广告详情', default: 21, width: 70 },
+            { title: '创意预览', dataIndex: 'dynamicCreativeList', label: '广告详情', default: 21, width: 150 },
             { title: '操作', dataIndex: 'cz', label: '广告详情', default: 22, width: 65 },
         ]
     }

+ 3 - 3
src/pages/launchSystemV3/adqv3/creative/box.tsx

@@ -55,8 +55,8 @@ const Box: React.FC<Props> = ({ creativeComponents }) => {
                     mouseEnterDelay={0.5}
                 >
                     <Space style={{ width: '100%' }}>
-                        <video src={video} style={{ maxHeight: 20, maxWidth: 30 }} />
-                        <a>{titles?.[0]?.value?.brandName}</a>
+                        <video src={video} style={{ maxHeight: 18, maxWidth: 28 }} />
+                        <span>{titles?.[0]?.value?.brandName}</span>
                     </Space>
                 </Popover>
             </div>
@@ -82,7 +82,7 @@ const Box: React.FC<Props> = ({ creativeComponents }) => {
                 mouseEnterDelay={0.5}
             >
                 <Space style={{ width: '100%' }}>
-                    {imageUrl?.map((item, index) => <img key={index} src={item?.value?.imageUrl} height={20} />)}
+                    {imageUrl?.map((item, index) => <img key={index} src={item?.value?.imageUrl} height={18} />)}
                 </Space>
             </Popover>
         } else if (titles && titles?.length > 0) {

+ 101 - 0
src/pages/launchSystemV3/adqv3/creative/boxOther.tsx

@@ -0,0 +1,101 @@
+import { Popover, Space } from 'antd'
+import React, { useMemo } from 'react'
+
+interface Props {
+    creativeComponents: {
+        brand?: {
+            value: {
+                brandName: string
+            }
+        }[],
+        description?: {
+            value: {
+                content: string
+            }
+        }[],
+        video?: {
+            value: {
+                videoUrl: string
+            }
+        }[],
+        image?: {
+            value: {
+                imageUrl: string
+            }
+        }[]
+    }
+}
+/**
+ * 预览
+ */
+const BoxOther: React.FC<Props> = ({ creativeComponents }) => {
+
+
+    let el = useMemo(() => {
+        let video = creativeComponents?.video?.[0]?.value?.videoUrl
+        let imageUrl = creativeComponents?.image
+        let titles = creativeComponents?.brand
+        let descriptions = creativeComponents?.description
+        if (video) {
+            return <div>
+                <Popover
+                    placement='right'
+                    content={<div>
+                        {titles && titles?.length > 0 && <Space direction="vertical">
+                            {titles.map((item, index) => <div key={index} style={{ maxWidth: 300 }}><strong style={{ fontSize: 15 }}>标题:</strong>{item?.value?.brandName}</div>)}
+                        </Space>}
+                        {descriptions && descriptions?.length > 0 && <Space direction="vertical">
+                            {descriptions.map((item, index) => <small key={index} style={{ fontSize: 10, maxWidth: 300, display: 'inline-block' }}><strong style={{ fontSize: 13 }}>描述:</strong>{item?.value?.content}</small>)}
+                        </Space>}
+                        <Space style={{ maxWidth: 300, display: 'flex', flexFlow: 'row wrap', margin: '10px 0' }}>
+                            <video src={video} style={{ width: 250 }} controls />
+                        </Space>
+                    </div>}
+                    destroyTooltipOnHide
+                    mouseEnterDelay={0.5}
+                >
+                    <Space style={{ width: '100%' }}>
+                        <video src={video} style={{ maxHeight: 18, maxWidth: 25 }} />
+                        <span>{titles?.[0]?.value?.brandName}</span>
+                    </Space>
+                </Popover>
+            </div>
+        } else if (imageUrl && imageUrl?.length > 0) {
+            return <Popover
+                placement='right'
+                content={<div
+                    style={{ maxHeight: 450, overflow: 'hidden', overflowY: 'auto' }}
+                >
+                    <Space direction="vertical">
+                        {titles && titles?.length > 0 && <Space direction="vertical">
+                            {titles.map((item, index) => <div key={index} style={{ maxWidth: 300 }}><strong style={{ fontSize: 15 }}>标题:</strong>{item?.value?.brandName}</div>)}
+                        </Space>}
+                        {descriptions && descriptions?.length > 0 && <Space direction="vertical">
+                            {descriptions.map((item, index) => <small key={index} style={{ fontSize: 10, maxWidth: 300, display: 'inline-block' }}><strong style={{ fontSize: 13 }}>描述:</strong>{item?.value?.content}</small>)}
+                        </Space>}
+                        <Space wrap style={{ maxWidth: 500 }}>
+                            {imageUrl?.map((item, index) => <img key={index} src={item?.value?.imageUrl} height={100} />)}
+                        </Space>
+                    </Space>
+                </div>}
+                destroyTooltipOnHide
+                mouseEnterDelay={0.5}
+            >
+                {imageUrl?.[0]?.value?.imageUrl ? <img src={imageUrl?.[0]?.value?.imageUrl} height={18} /> : <span>无图片地址</span>}
+            </Popover>
+        } else if (titles && titles?.length > 0) {
+            return <span>{titles?.[0]?.value?.brandName}</span>
+        } else if (descriptions && descriptions?.length > 0) {
+            return <span>{descriptions?.[0]?.value?.content}</span>
+        } else {
+            return <span>--</span>
+        }
+
+    }, [creativeComponents])
+
+    return <div style={{ overflow: 'hidden', overflowX: 'auto' }}>
+        {el}
+    </div>
+}
+
+export default React.memo(BoxOther)