Browse Source

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

wjx 2 years ago
parent
commit
7444dfe0bd

+ 2 - 1
src/pages/adMonitor/adMonitorList/tableMonitorConfig.tsx

@@ -681,7 +681,8 @@ function columnsMonitor(planDetail: (id: number) => void, getDetailList: (adId:
                                 </div>
                                 </div>
                             </Menu.Item>
                             </Menu.Item>
                             <Menu.Item key="3">
                             <Menu.Item key="3">
-                                <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adcreative?adgroupid=${b?.adgroupId}&query={%22configured_status%22:[%22AD_STATUS_EXCLUDE_DELETED%22],%22status%22:[]}`)} target="_blank">腾讯广告</a>
+                                {/* <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adcreative?adgroupid=${b?.adgroupId}&query={%22configured_status%22:[%22AD_STATUS_EXCLUDE_DELETED%22],%22status%22:[]}`)} target="_blank">腾讯广告</a> */}
+                                <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
                             </Menu.Item>
                             </Menu.Item>
                         </Menu>
                         </Menu>
                     } trigger={['click']}>
                     } trigger={['click']}>

+ 1 - 1
src/pages/adMonitor/adMonitorList/tablePlanListConfig.tsx

@@ -543,7 +543,7 @@ function columnsMonitor(details: (id: number) => void) {
                 align: 'center',
                 align: 'center',
                 width: 90,
                 width: 90,
                 render: (a: any, b: any) => {
                 render: (a: any, b: any) => {
-                    return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adcreative?adgroupid=${b?.adgroupId}&query={%22configured_status%22:[%22AD_STATUS_EXCLUDE_DELETED%22],%22status%22:[]}`)} target="_blank">腾讯广告</a>
+                    return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%2${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
                 }
                 }
             }
             }
         ]
         ]

+ 1 - 1
src/pages/launchSystemNew/account/index.tsx

@@ -68,7 +68,7 @@ const AdAuthorize: React.FC = () => {
 
 
     useEffect(() => {
     useEffect(() => {
         getList()
         getList()
-    }, [])
+    }, [queryForm])
 
 
     /** 获取账号列表 */
     /** 获取账号列表 */
     const getList = () => {
     const getList = () => {

+ 2 - 1
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -22,6 +22,7 @@ function tableConfig(
             adcreativeId?: string,//创意ID
             adcreativeId?: string,//创意ID
             pageId?: string,//落地页ID
             pageId?: string,//落地页ID
             targetingId?: string,//定向ID
             targetingId?: string,//定向ID
+            
         }
         }
     }) => void): any {
     }) => void): any {
     return [
     return [
@@ -276,7 +277,7 @@ function tableConfig(
             align: 'center',
             align: 'center',
             fixed: 'right',
             fixed: 'right',
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adcreative?adgroupid=${b?.adgroupId}&query={%22configured_status%22:[%22AD_STATUS_EXCLUDE_DELETED%22],%22status%22:[]}`)} target="_blank">腾讯广告</a>
+                return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
             }
             }
         },
         },
     ]
     ]

+ 1 - 1
src/pages/launchSystemNew/adq/adAccount/index.tsx

@@ -43,7 +43,7 @@ function AdAccount(props: Props) {
     const syncAjax = useAjax((params) => putAdqAdAccountSyncByIds(params))
     const syncAjax = useAjax((params) => putAdqAdAccountSyncByIds(params))
     useEffect(() => {
     useEffect(() => {
         getList(queryForm)
         getList(queryForm)
-    }, [accountId])
+    }, [accountId, userId])
     // 获取列表
     // 获取列表
     const getList = useCallback((params?: any) => {
     const getList = useCallback((params?: any) => {
         listAjax.run({ ...params, putUserId: userId })
         listAjax.run({ ...params, putUserId: userId })

+ 19 - 10
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -89,7 +89,6 @@ const CreateAd: React.FC = () => {
     useEffect(() => {
     useEffect(() => {
         getGroupList.run()
         getGroupList.run()
     }, [])
     }, [])
-  
 
 
     /** 判断出价方式,优化目标 “二方包”人群包仅能在出价方式为CPC(包含oCPM点击优化目标)、CPM场景下使用 */
     /** 判断出价方式,优化目标 “二方包”人群包仅能在出价方式为CPC(包含oCPM点击优化目标)、CPM场景下使用 */
     // useEffect(() => {
     // useEffect(() => {
@@ -141,7 +140,7 @@ const CreateAd: React.FC = () => {
                         type = 1
                         type = 1
                     }
                     }
                 } else {
                 } else {
-                    if (adCreateLogs?.every((item: { sysAdcreative: { adcreativeTemplateId: number }, pageId: number }) => item.sysAdcreative.adcreativeTemplateId === adcreativeTemplateId && item.pageId === pageId)) {
+                    if (adCreateLogs?.every((item: { sysAdcreative: { adcreativeTemplateId: number }, pageId: number }) => item.sysAdcreative.adcreativeTemplateId === adcreativeTemplateId)) {
                         type = 2
                         type = 2
                     } else {
                     } else {
                         type = 1
                         type = 1
@@ -219,11 +218,17 @@ const CreateAd: React.FC = () => {
                         pageList = [null]
                         pageList = [null]
                     }
                     }
                     if (adCreateLog?.pageId) {
                     if (adCreateLog?.pageId) {
-                        adqPageList = [[{
-                            pageList: [{ ...adCreateLog.page, id: adCreateLog.page.pageId }],
-                            adAccountId: adCreateLog?.accountId,
-                            id: adCreateLog?.adAccountId,
-                        }]]
+                        adqPageList = groupBy(adCreateLogs, (item) => [item.sysAdcreativeId])?.map((item: any[]) => {
+                            if (item.some((item1: { pageId: number }) => item1.pageId)) {
+                                return item.map((item1: any) => ({
+                                    pageList: [{ ...item1.page, id: item1.page.pageId }],
+                                    adAccountId: item1?.accountId,
+                                    id: item1?.adAccountId,
+                                }))
+                            } else {
+                                return null
+                            }
+                        })
                     } else {
                     } else {
                         adqPageList = [null]
                         adqPageList = [null]
                     }
                     }
@@ -852,7 +857,8 @@ const CreateAd: React.FC = () => {
             setAccountCreateLogs([])
             setAccountCreateLogs([])
         }
         }
     }
     }
-
+    console.log('accountCreateLogs', accountCreateLogs);
+    
     return <Space direction="vertical" style={{ width: '100%' }}>
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Card
         <Card
             title={<Space>
             title={<Space>
@@ -895,6 +901,9 @@ const CreateAd: React.FC = () => {
                         maxTagCount={1}
                         maxTagCount={1}
                         allowClear
                         allowClear
                         bordered={false}
                         bordered={false}
+                        maxTagPlaceholder={<Tooltip color="#FFF" title={accountCreateLogs.filter((item, index) => index !== 0).map(item => <div key={item.id} style={{ color: '#000' }}>{item.adAccountId}</div>)}>
+                            <span>+{accountCreateLogs?.length > 1 ? accountCreateLogs.length - 1 : 0}</span>
+                        </Tooltip>}
                         dropdownMatchSelectWidth={false}
                         dropdownMatchSelectWidth={false}
                         filterOption={(input: any, option: any) => {
                         filterOption={(input: any, option: any) => {
                             return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
                             return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
@@ -903,11 +912,11 @@ const CreateAd: React.FC = () => {
                         onChange={(e, option) => {
                         onChange={(e, option) => {
                             console.log(option)
                             console.log(option)
                             setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
                             setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
-                            setAccountCreateLogs(option?.map((item: any) => ({ adAccountId: item?.children?.toString()?.split('——')[0], id: item?.value })))
+                            setAccountCreateLogs(option?.map((item: any) => ({ adAccountId: item?.children?.toString()?.split('_')[0], id: item?.value })))
                             clearData()
                             clearData()
                         }}
                         }}
                     >
                     >
-                        {getAllUserAccount?.data?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.remark ? item.accountId + '——' + item.remark : item.accountId}</Select.Option>)}
+                        {getAllUserAccount?.data?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.remark ? item.accountId + '_' + item.remark : item.accountId}</Select.Option>)}
                     </Select>
                     </Select>
                 </Selector>
                 </Selector>
                 <Selector label="推广目标">
                 <Selector label="推广目标">