Ver código fonte

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

wjx 2 anos atrás
pai
commit
4e79c1266c

+ 1 - 1
src/components/EarlyWarning/addEdit.tsx

@@ -143,7 +143,7 @@ const AddEdit: React.FC<Props> = (props) => {
                                     allowClear
                                     placeholder="选择要设置的字段"
                                     filterOption={(input, option) =>
-                                        ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                                        ((option?.children ?? '') as any).toLowerCase().includes(input.toLowerCase())
                                     }
                                 >
                                     {Object.keys(MonitorFieldEnum).map((item, index) => <Select.Option disabled={rules?.[key]?.['field']?.length >= 3 && !rules?.[key]['field'].includes(item)} value={item} key={index}>{MonitorFieldEnum[item]}</Select.Option>)}

+ 33 - 0
src/components/EarlyWarning/look.tsx

@@ -0,0 +1,33 @@
+import { RuleProps } from "@/services/adMonitor/earlyWarning"
+import { EyeOutlined } from "@ant-design/icons"
+import { Tooltip } from "antd"
+import React from "react"
+import { MonitorFieldEnum } from "./config"
+
+/**
+ * 查看规则
+ */
+interface Props {
+    rules: {
+        rule: RuleProps[]
+    }[]
+}
+const Look: React.FC<Props> = ({ rules }) => {
+
+    return <Tooltip
+        color="#FFF"
+        title={<span
+            style={{ color: '#000' }}
+            dangerouslySetInnerHTML={{
+                __html: rules.map((item, index) => `<span style="color: red; ">(</span> ${item.rule.map(rule => `${MonitorFieldEnum[rule.field]}${rule.condition}${rule.value}`)
+                    .join(' <span style="color: #1890ff; ">并且</span> ')} <span style="color: red; ">)</span>`)
+                    .join(` <span style="color: red; font-weight: 700; font-size: 16px ">或者</span> `)
+            }}
+        ></span>}
+    >
+        <a><EyeOutlined /></a>
+    </Tooltip>
+}
+
+
+export default React.memo(Look)

+ 14 - 3
src/components/EarlyWarning/tableConfig.tsx

@@ -1,6 +1,7 @@
 import { Badge, Popconfirm, Space, Tag } from 'antd'
 import React from 'react'
 import { WarningTypeEnum } from './config'
+import Look from './look'
 function tableConfig(edit: (data: any) => void, del: (id: number) => void): any {
     return [
         {
@@ -8,7 +9,7 @@ function tableConfig(edit: (data: any) => void, del: (id: number) => void): any
             dataIndex: 'id',
             key: 'id',
             align: 'center',
-            width: 55,
+            width: 50,
         },
         {
             title: '规则名称',
@@ -32,7 +33,7 @@ function tableConfig(edit: (data: any) => void, del: (id: number) => void): any
             dataIndex: 'warningType',
             key: 'warningType',
             align: 'center',
-            width: 90,
+            width: 100,
             render: (a: string[], b: any) => {
                 return a?.map((item, index) => <Tag color={['#f50', '#2db7f5'][index]} key={index}>{WarningTypeEnum[item]}</Tag>)
             }
@@ -42,7 +43,7 @@ function tableConfig(edit: (data: any) => void, del: (id: number) => void): any
             dataIndex: 'defaultRule',
             key: 'defaultRule',
             align: 'center',
-            width: 70,
+            width: 80,
             render: (a: 0 | 1, b: any) => {
                 return <Badge status={{ '0': 'error', '1': 'success' }[a] as any} text={{ '0': '否', '1': '是' }[a]} />
             }
@@ -57,6 +58,16 @@ function tableConfig(edit: (data: any) => void, del: (id: number) => void): any
                 return <Badge status={{ '0': 'error', '1': 'success' }[a] as any} text={{ '0': '否', '1': '是' }[a]} />
             }
         },
+        {
+            title: '查看',
+            dataIndex: 'rules',
+            key: 'rules',
+            align: 'center',
+            width: 60,
+            render: (a: any, b: any) => {
+                return <Look rules={a}/>
+            }
+        },
         {
             title: '操作',
             dataIndex: 'cz',

+ 16 - 9
src/pages/adMonitor/adMonitorList/config.ts

@@ -87,9 +87,10 @@ const qiliangpaihang = [
             { title: '公众号关注人数', dataIndex: 'mpFollowUvDay', label: '公众号转化', default: 6, width: 85 },
             { title: '公众号关注率', dataIndex: 'mpFollowRateDay', label: '公众号转化', width: 70 },
             { title: '公众号关注成本', dataIndex: 'mpFollowCostDay', label: '公众号转化', width: 85 },
-            // { title: '注册人数', dataIndex: 'mpRegisterUserCount', label: '公众号转化' },
-            // { title: '注册次数', dataIndex: 'mpRegisterCount', label: '公众号转化' },
-            // { title: '注册成本', dataIndex: 'mpRegisterCost', label: '公众号转化' },
+            { title: '加粉成本', dataIndex: 'addFansCost', label: '公众号转化' },
+            { title: '公众号关注次数成本', dataIndex: 'mpFollowPvCost', label: '公众号转化' },
+            { title: '加粉数', dataIndex: 'addFansCount', label: '公众号转化' },
+            { title: '公众号关注次数', dataIndex: 'mpFollowPv', label: '公众号转化' },
         ]
     },
 ]
@@ -183,9 +184,10 @@ const qiliangpaihanghour = [
             { title: '公众号关注人数', dataIndex: 'mpFollowUvDay', label: '公众号转化', default: 6, width: 85 },
             { title: '公众号关注率', dataIndex: 'mpFollowRateDay', label: '公众号转化', width: 70 },
             { title: '公众号关注成本', dataIndex: 'mpFollowCostDay', label: '公众号转化', width: 85 },
-            // { title: '注册人数', dataIndex: 'mpRegisterUserCount', label: '公众号转化' },
-            // { title: '注册次数', dataIndex: 'mpRegisterCount', label: '公众号转化' },
-            // { title: '注册成本', dataIndex: 'mpRegisterCost', label: '公众号转化' },
+            { title: '加粉成本', dataIndex: 'addFansCost', label: '公众号转化' },
+            { title: '公众号关注次数成本', dataIndex: 'mpFollowPvCost', label: '公众号转化' },
+            { title: '加粉数', dataIndex: 'addFansCount', label: '公众号转化' },
+            { title: '公众号关注次数', dataIndex: 'mpFollowPv', label: '公众号转化' },
         ]
     },
 ]
@@ -279,9 +281,10 @@ const qiliangpaihangminute = [
             { title: '公众号关注人数', dataIndex: 'mpFollowUvDay', label: '公众号转化', default: 6, width: 85 },
             { title: '公众号关注率', dataIndex: 'mpFollowRateDay', label: '公众号转化', width: 85 },
             { title: '公众号关注成本', dataIndex: 'mpFollowCostDay', label: '公众号转化', width: 85 },
-            // { title: '注册人数', dataIndex: 'mpRegisterUserCount', label: '公众号转化' },
-            // { title: '注册次数', dataIndex: 'mpRegisterCount', label: '公众号转化' },
-            // { title: '注册成本', dataIndex: 'mpRegisterCost', label: '公众号转化' },
+            { title: '加粉成本', dataIndex: 'addFansCost', label: '公众号转化' },
+            { title: '公众号关注次数成本', dataIndex: 'mpFollowPvCost', label: '公众号转化' },
+            { title: '加粉数', dataIndex: 'addFansCount', label: '公众号转化' },
+            { title: '公众号关注次数', dataIndex: 'mpFollowPv', label: '公众号转化' },
         ]
     },
 ]
@@ -369,6 +372,10 @@ const guanggao = [
             { title: '公众号关注人数', dataIndex: 'mpFollowUser', label: '公众号转化', width: 85 },
             { title: '公众号关注率', dataIndex: 'mpFollowRate', label: '公众号转化', width: 85 },
             { title: '公众号关注成本', dataIndex: 'mpFollowCost', label: '公众号转化', width: 85 },
+            { title: '加粉成本(今日)', dataIndex: 'addFansCostDay', label: '公众号转化' },
+            { title: '公众号关注次数成本(今日)', dataIndex: 'mpFollowPvCostDay', label: '公众号转化' },
+            { title: '加粉数(今日)', dataIndex: 'addFansCountDay', label: '公众号转化' },
+            { title: '公众号关注次数(今日)', dataIndex: 'mpFollowPvDay', label: '公众号转化' },
         ]
     },
 ]

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

@@ -31,7 +31,7 @@ const AdMonitorList: React.FC = () => {
             <Tabs.TabPane tab="广告列表" key="list" />
             <Tabs.TabPane tab="广告列表2" key="list2" />
         </Tabs>
-        {tab === 'monitor' ? <Monitor onChange={() => { setTab('list') }} /> : tab === 'list' ? <PlanList /> : <Card><Ad userId={userId}  Ts={()=>{
+        {tab === 'monitor' ? <Monitor onChange={() => { setTab('list') }} /> : tab === 'list' ? <PlanList /> : <Card bodyStyle={{ padding: '12px 16px' }}><Ad userId={userId}  Ts={()=>{
             return <Select
             showSearch
             value={userId ? Number(userId) : undefined}

+ 44 - 33
src/pages/adMonitor/adMonitorList/tableMonitorConfig.tsx

@@ -623,39 +623,50 @@ function columnsMonitor(planDetail: (id: number) => void, getDetailList: (adId:
                     return <Statistic value={a || 0} />
                 }
             },
-            // {
-            //     title: '注册人数',
-            //     dataIndex: 'mpRegisterUserCount',
-            //     key: 'mpRegisterUserCount',
-            //     align: 'center',
-            //     width: 115,
-            // sorter: true,
-            //     render: (a: any) => {
-            //         return a
-            //     }
-            // },
-            // {
-            //     title: '注册次数',
-            //     dataIndex: 'mpRegisterCount',
-            //     key: 'mpRegisterCount',
-            //     align: 'center',
-            //     width: 115,
-            // sorter: true,
-            //     render: (a: any) => {
-            //         return a
-            //     }
-            // },
-            // {
-            //     title: '注册成本',
-            //     dataIndex: 'mpRegisterCost',
-            //     key: 'mpRegisterCost',
-            //     align: 'center',
-            //     width: 115,
-            // sorter: true,
-            //     render: (a: any) => {
-            //         return <Statistic value={a || 0} />
-            //     }
-            // },
+            {
+                title: '加粉成本',
+                dataIndex: 'addFansCost',
+                key: 'addFansCost',
+                align: 'center',
+                width: 75,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '公众号关注次数成本',
+                dataIndex: 'mpFollowPvCost',
+                key: 'mpFollowPvCost',
+                align: 'center',
+                width: 80,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '加粉数',
+                dataIndex: 'addFansCount',
+                key: 'addFansCount',
+                align: 'center',
+                width: 75,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '公众号关注次数',
+                dataIndex: 'mpFollowPv',
+                key: 'mpFollowPv',
+                align: 'center',
+                width: 75,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
             {
                 title: '操作',
                 dataIndex: 'event',

+ 44 - 0
src/pages/adMonitor/adMonitorList/tablePlanListConfig.tsx

@@ -536,6 +536,50 @@ function columnsMonitor(details: (id: number) => void) {
                     return <Statistic value={a ? a?.toFixed(2) : 0} />
                 }
             },
+            {
+                title: '加粉成本(今日)',
+                dataIndex: 'addFansCostDay',
+                key: 'addFansCostDay',
+                align: 'center',
+                width: 80,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '公众号关注次数成本(今日)',
+                dataIndex: 'mpFollowPvCostDay',
+                key: 'mpFollowPvCostDay',
+                align: 'center',
+                width: 105,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '加粉数(今日)',
+                dataIndex: 'addFansCountDay',
+                key: 'addFansCountDay',
+                align: 'center',
+                width: 80,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
+            {
+                title: '公众号关注次数(今日)',
+                dataIndex: 'mpFollowPvDay',
+                key: 'mpFollowPvDay',
+                align: 'center',
+                width: 100,
+                // sorter: true,
+                render: (a: any) => {
+                    return <Statistic value={a || 0} />
+                }
+            },
             {
                 title: '操作',
                 dataIndex: 'event',

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

@@ -7,7 +7,7 @@ import { getTagsList, get_adcreative_template } from "@/services/launchAdq/globa
 import { getSysAdgroupsInfo } from "@/services/launchAdq/localAd"
 import { getsysTargetingInfo } from "@/services/launchAdq/targeting"
 import { CheckOutlined, CloseOutlined, SearchOutlined } from "@ant-design/icons"
-import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification } from "antd"
+import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification, Divider, Checkbox, Modal } from "antd"
 import React, { useCallback, useEffect, useState } from "react"
 import { useModel } from "umi"
 import Ad from "./ad"
@@ -73,6 +73,7 @@ const CreateAd: React.FC = () => {
     const [usesArr, setUsersArr] = useState<any>(localStorage.getItem('ADQUSERS' + userId) ? JSON.parse(localStorage.getItem('ADQUSERS' + userId) as any) : [])
     const { init, get } = useModel('useLaunchAdq.useBdMediaPup')
     const [cloudParams, setCloudParams] = useState<{ adcreativeTemplateId?: number }>({})
+    const [accSearch, setAccSearch] = useState<string>()
 
 
     const tagsList_REGION = useAjax((params) => getTagsList(params))
@@ -662,9 +663,19 @@ const CreateAd: React.FC = () => {
         console.log('paramsSubmit====>', params)
         createAdBatch.run(params).then(res => {
             if (res) {
-                sessionStorage.setItem('CAMP', props?.campaignName)
-                message.success('创建成功')
-                window.location.href = '/#/launchSystemNew/launchManage/taskList'
+                Modal.success({
+                    content: '任务提交成功',
+                    bodyStyle: { fontWeight: 700 },
+                    okText: '跳转任务列表',
+                    closable: true,
+                    onOk: () => {
+                        sessionStorage.setItem('CAMP', props?.campaignName)
+                        window.location.href = '/#/launchSystemNew/launchManage/taskList'
+                    },
+                    onCancel: () => {
+                        setSubVisible(false)
+                    }
+                })
             }
         })
     }
@@ -858,8 +869,8 @@ const CreateAd: React.FC = () => {
             setAccountCreateLogs([])
         }
     }
-    console.log('accountCreateLogs', accountCreateLogs);
-    
+
+
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Card
             title={<Space>
@@ -891,13 +902,13 @@ const CreateAd: React.FC = () => {
                         }}
                         onChange={(e, option) => { getGroupAccountList(e) }}
                     >
-                        {getGroupList.data?.map((item: any) => <Select.Option value={item.groupId} key={item.groupId}>{item.groupName}</Select.Option>)}
+                        {getGroupList?.data?.map((item: any) => <Select.Option value={item.groupId} key={item.groupId}>{item.groupName}</Select.Option>)}
                     </Select>
                 </Selector>
                 <Selector label="媒体账户">
                     <Select
                         mode="multiple"
-                        style={{ minWidth: 200 }}
+                        style={{ minWidth: 200, maxWidth: 500 }}
                         placeholder="请选择媒体账户"
                         maxTagCount={1}
                         allowClear
@@ -906,16 +917,42 @@ const CreateAd: React.FC = () => {
                             <span>+{accountCreateLogs?.length > 1 ? accountCreateLogs.length - 1 : 0}</span>
                         </Tooltip>}
                         dropdownMatchSelectWidth={false}
+                        autoClearSearchValue={false}
                         filterOption={(input: any, option: any) => {
-                            return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
+                            let newInput: string[] = input ? input?.split(/[,,\n\s]+/ig) : []
+                            return newInput?.some(val => option!.children?.toString().toLowerCase()?.includes(val))
                         }}
                         value={accountCreateLogs?.map((item: { id: number }) => item?.id)}
                         onChange={(e, option) => {
-                            console.log(option)
                             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 })))
                             clearData()
                         }}
+                        searchValue={accSearch}
+                        onSearch={(val) => {
+                            setAccSearch(val)
+                        }}
+                        dropdownRender={menu => (
+                            <>
+                                {menu}
+                                <Divider style={{ margin: '8px 0' }} />
+                                <Space style={{ padding: '0 8px 4px' }}>
+                                    <Checkbox onChange={(e) => {
+                                        let data = []
+                                        if (e.target.checked) {
+                                            data = JSON.parse(JSON.stringify(getAllUserAccount?.data?.data))
+                                            if (accSearch) {
+                                                let newAccSearch = accSearch?.split(/[,,\n\s]+/ig)
+                                                data = data?.filter((item: any) => newAccSearch?.some(val => item!.accountId?.toString().toLowerCase()?.includes(val)))
+                                            }
+                                        }
+                                        setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
+                                        setAccountCreateLogs(data?.map((item: any) => ({ adAccountId: item?.accountId, id: item?.id })))
+                                        clearData()
+                                    }}>全选</Checkbox>
+                                </Space>
+                            </>
+                        )}
                     >
                         {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>