wjx vor 1 Jahr
Ursprung
Commit
1ee6544b6f

+ 103 - 0
src/pages/adMonitor/adMonitorList/columnTrend.tsx

@@ -0,0 +1,103 @@
+import { useAjax } from "@/Hook/useAjax"
+import { GetAdColumnTrendProps, getAdColumnTrendApi } from "@/services/adMonitor/adMonitor"
+import { DatePicker, Modal, Select, Space, Spin } from "antd"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { LineField } from "./config"
+import useEcharts from "@/Hook/useEcharts"
+
+
+interface Props {
+    data: any
+    visible?: boolean
+    onClose?: () => void
+}
+const ColumnTrend: React.FC<Props> = ({ data: { field, dataTimeMin, dataTimeMax, ...pageParams }, visible, onClose }) => {
+
+    /*********************************/
+    const { LineMonitor } = useEcharts()
+    const [lineDis, setLineDis] = useState<any[]>([])
+    const [queryParams, setQueryParams] = useState<GetAdColumnTrendProps>({ timeUnit: 'day', pageParams, trendColumns: [field], dataTimeMin, dataTimeMax })
+    const getAdColumnTrend = useAjax((params) => getAdColumnTrendApi(params), { formatResult: true })
+    /*********************************/
+
+    useEffect(() => {
+        getList()
+    }, [queryParams])
+
+    const getList = () => {
+        getAdColumnTrend.run(queryParams).then(res => {
+            if (res?.data) {
+                let trendColumns = queryParams.trendColumns
+                let data = trendColumns.map((field) => {
+                    let value: any = {}
+                    res?.data?.forEach((item: any, index: number) => {
+                        if (index === 0) value.legendName = LineField[field];
+                        value[item?.trend_unit] = item?.[field] || 0
+                    });
+                    return value
+                })
+                setLineDis(() => data)
+            }
+        }).catch(() => {
+            setLineDis([])
+        })
+    }
+
+    return <Modal
+        title={'趋势图'}
+        visible={visible}
+        onCancel={onClose}
+        footer={null}
+        width={1200}
+        bodyStyle={{ padding: 0 }}
+    >
+        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8, padding: '24px 24px 0' }}>
+            <Space>
+                <Select
+                    showSearch
+                    mode='multiple'
+                    maxTagCount={2}
+                    value={queryParams.trendColumns}
+                    style={{ minWidth: 200 }}
+                    allowClear
+                    placeholder="请选择图表字段"
+                    onChange={(value: string[]) => {
+                        setQueryParams({ ...queryParams, trendColumns: value?.length ? value : ['cost'] })
+                    }}
+                >
+                    {Object.keys(LineField).map((key) => <Select.Option value={key} key={key}>
+                        {LineField[key]}
+                    </Select.Option>)}
+                </Select>
+                <DatePicker.RangePicker
+                    placeholder={['数据时间筛选(起始)', '数据时间筛选(结束)']}
+                    value={(queryParams?.dataTimeMin && queryParams?.dataTimeMax) ? [moment(queryParams.dataTimeMin), moment(queryParams.dataTimeMax)] : undefined as any}
+                    style={{ width: 320 }}
+                    onChange={(_, o) => {
+                        setQueryParams({ ...queryParams, dataTimeMin: o[0], dataTimeMax: o[1] })
+                    }}
+                />
+                <Select
+                    value={queryParams.timeUnit}
+                    style={{ width: 78 }}
+                    onChange={(e) => {
+                        setQueryParams({ ...queryParams, timeUnit: e })
+                    }}
+                >
+                    <Select.Option value="day">天</Select.Option>
+                    <Select.Option value="hour">小时</Select.Option>
+                </Select>
+            </Space>
+            <Space align="center">
+                <span style={{ fontSize: 10, color: '#999' }}>刷新时间:{getAdColumnTrend?.data?.reqTime}</span>
+                <a onClick={() => getList()} style={{ fontSize: 14 }}>刷新</a>
+            </Space>
+        </div>
+        <div style={{ width: '100%', height: 400, textAlign: 'center' }}>
+            {getAdColumnTrend?.loading ? <div style={{ width: '100%', height: 400, display: 'flex', justifyContent: 'center', alignItems: 'center' }}><Spin /> </div> : <LineMonitor style={{ width: '100%', height: 400 }} series smooth data={lineDis} />}
+        </div>
+    </Modal>
+}
+
+export default React.memo(ColumnTrend)

+ 45 - 6
src/pages/launchSystemNew/adq/ad/adPlanList.tsx

@@ -4,7 +4,7 @@ import { Col, Row, message, Space, Button, Switch, notification, Modal, Tooltip,
 import React, { useEffect, useCallback, useState, useRef } from 'react'
 import TableData from '../../components/TableData'
 import { putAdqAdgroupsSync, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi, putAdqAdgroupsSyncBatch, putModifyCustomAudienceApi, getPutUserApi, delUserTagApi } from '@/services/launchAdq/adq'
-import { CopyOutlined, DeleteOutlined, DownOutlined, ExclamationCircleOutlined, FieldTimeOutlined, FormOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
+import { CopyOutlined, DeleteOutlined, DownOutlined, ExclamationCircleOutlined, FieldTimeOutlined, FormOutlined, LineChartOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
 import UpdateAd from './updateAd'
 import Copy from './copy'
 import { planAdConfig } from '../config'
@@ -21,6 +21,7 @@ import { useSize, useUpdateEffect } from 'ahooks'
 import RuleAccountLog from '@/components/EarlyWarning/ruleAccountLog'
 import PlanTag from './planTag'
 import moment from 'moment'
+import ColumnTrend from '@/pages/adMonitor/adMonitorList/columnTrend'
 
 const AdPlanList: React.FC<{ userId: string }> = (props) => {
 
@@ -61,6 +62,9 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
     const [scrollLeft, setScrollLeft] = useState<number>(0)
     const [totalData, setTotalData] = useState<any>({})
     const [tableField, setTableField] = useState<{ title: string, dataIndex: string }[]>([])
+
+    const [trendVisible, setTrendVisible] = useState<boolean>(false)
+    const [trendData, setTrendData] = useState<any>({})
     /************************/
 
     useEffect(() => {
@@ -301,7 +305,34 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
         })
     }
 
+    const handleColumnTrend = (value: string) => {
+        let message = localStorage.getItem(`myAdMonitorConfig1.0.0_${configName}`)
+        if (message) {
+            message = JSON.parse(message)
+        }
+        let columns: string[] = []
+        if (message && Array.isArray(message)) {
+            message.forEach((item: { serverIndex: any; dataIndex: string; }) => {
+                if (!['cz', 'cost_speed'].includes(item.dataIndex)) {
+                    columns.push(item?.serverIndex || 'adgroup_data.' + item.dataIndex)
+                }
+            })
+        } else {
+            planAdConfig.forEach((item: any) => {
+                item?.data?.forEach((d: { default: any, serverIndex: string, dataIndex: string }) => {
+                    if (d.default && !['cz', 'cost_speed'].includes(d.dataIndex)) {
+                        columns.push(d?.serverIndex || 'adgroup_data.' + d.dataIndex)
+                    }
+                })
+            })
+        }
+        setTrendData({ ...queryForm, ...filterForm, columns, field: value.replace('_total', '') })
+        setTrendVisible(true)
+    }
+
     return <div>
+        {/* 列表指标趋势 */}
+        {trendVisible && <ColumnTrend visible={trendVisible} data={trendData} onClose={() => { setTrendVisible(false) }} />}
         {/* 打标签 */}
         {tagVisible && <PlanTag
             visible={tagVisible}
@@ -510,7 +541,7 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
                 expandedRowRender={(data) => <AdExpandedRowRender data={data} scrollLeft={scrollLeft} width={size?.width} />}
                 summary={() => (
                     <Table.Summary fixed>
-                        <Table.Summary.Row>
+                        <Table.Summary.Row className='s_summary'>
                             {tableField.map((item, index) => {
                                 let data = totalData[item.dataIndex]
                                 let value = (data === 0 || data) ? data : '--'
@@ -522,12 +553,20 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
                                     'order_roi_total', 'conversions_rate_total'
                                 ].includes(item.dataIndex)) {
                                     return <Table.Summary.Cell index={index} key={item.dataIndex} align="center">
-                                        <strong>
-                                            {value !== '--' ? <Statistic value={value.toFixed(2)} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" /> : '--'}
-                                        </strong>
+                                        <Space size={4}>
+                                            <strong>
+                                                {value !== '--' ? <Statistic value={value.toFixed(2)} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" /> : '--'}
+                                            </strong>
+                                            {value !== '--' && <a onClick={() => handleColumnTrend(item.dataIndex)}><LineChartOutlined /></a>}
+                                        </Space>
                                     </Table.Summary.Cell>
                                 } else {
-                                    return <Table.Summary.Cell index={index} key={item.dataIndex} align="center"><strong><Statistic value={value} /></strong></Table.Summary.Cell>
+                                    return <Table.Summary.Cell index={index} key={item.dataIndex} align="center">
+                                        <Space size={4}>
+                                            <strong><Statistic value={value} /></strong>
+                                            {value !== '--' && <a onClick={() => handleColumnTrend(item.dataIndex)}><LineChartOutlined /></a>}
+                                        </Space>
+                                    </Table.Summary.Cell>
                                 }
                             })}
                         </Table.Summary.Row>

+ 4 - 0
src/pages/launchSystemNew/adq/ad/index.less

@@ -162,4 +162,8 @@
             gap: 8px;
         }
     }
+}
+
+.s_summary > td {
+    padding: 5px !important;
 }

+ 37 - 37
src/pages/launchSystemNew/adq/ad/tablePlanListConfig.tsx

@@ -362,7 +362,7 @@ function tablePlanConfig(
             dataIndex: 'cost_total',
             key: 'cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='cost_total' />
@@ -373,7 +373,7 @@ function tablePlanConfig(
             dataIndex: 'view_total',
             key: 'view_total',
             align: 'center',
-            width: 80,
+            width: 100,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='view_total' />
@@ -384,7 +384,7 @@ function tablePlanConfig(
             dataIndex: 'thousand_display_price_total',
             key: 'thousand_display_price_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='thousand_display_price_total' />
@@ -395,7 +395,7 @@ function tablePlanConfig(
             dataIndex: 'click_total',
             key: 'click_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='click_total' />
@@ -406,7 +406,7 @@ function tablePlanConfig(
             dataIndex: 'ctr_total',
             key: 'ctr_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.ctr_total !== undefined && b?.ctr_total !== null) {
@@ -421,7 +421,7 @@ function tablePlanConfig(
             dataIndex: 'cpc_total',
             key: 'cpc_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='cpc_total' />
@@ -432,7 +432,7 @@ function tablePlanConfig(
             dataIndex: 'no_interest_count_total',
             key: 'no_interest_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='no_interest_count_total' />
@@ -443,7 +443,7 @@ function tablePlanConfig(
             dataIndex: 'video_play_count_total',
             key: 'video_play_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='video_play_count_total' />
@@ -454,7 +454,7 @@ function tablePlanConfig(
             dataIndex: 'download_count_total',
             key: 'download_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='download_count_total' />
@@ -465,7 +465,7 @@ function tablePlanConfig(
             dataIndex: 'install_count_total',
             key: 'install_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='install_count_total' />
@@ -476,7 +476,7 @@ function tablePlanConfig(
             dataIndex: 'activated_count_total',
             key: 'activated_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='activated_count_total' />
@@ -487,7 +487,7 @@ function tablePlanConfig(
             dataIndex: 'mp_follow_uv_total',
             key: 'mp_follow_uv_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='mp_follow_uv_total' />
@@ -498,7 +498,7 @@ function tablePlanConfig(
             dataIndex: 'mp_follow_cost_total',
             key: 'mp_follow_cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='mp_follow_cost_total' />
@@ -509,7 +509,7 @@ function tablePlanConfig(
             dataIndex: 'mp_follow_rate_total',
             key: 'mp_follow_rate_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.mp_follow_rate_total !== undefined && b?.mp_follow_rate_total !== null) {
@@ -524,7 +524,7 @@ function tablePlanConfig(
             dataIndex: 'mp_follow_pv_total',
             key: 'mp_follow_pv_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='mp_follow_pv_total' />
@@ -535,7 +535,7 @@ function tablePlanConfig(
             dataIndex: 'mp_follow_pv_cost_total',
             key: 'mp_follow_pv_cost_total',
             align: 'center',
-            width: 100,
+            width: 120,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='mp_follow_pv_cost_total' />
@@ -546,7 +546,7 @@ function tablePlanConfig(
             dataIndex: 'add_quick_app_pv_total',
             key: 'add_quick_app_pv_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='add_quick_app_pv_total' />
@@ -557,7 +557,7 @@ function tablePlanConfig(
             dataIndex: 'add_quick_app_cost_total',
             key: 'add_quick_app_cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='add_quick_app_cost_total' />
@@ -568,7 +568,7 @@ function tablePlanConfig(
             dataIndex: 'add_quick_app_rate_total',
             key: 'add_quick_app_rate_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.add_quick_app_rate_total !== undefined && b?.add_quick_app_rate_total !== null) {
@@ -583,7 +583,7 @@ function tablePlanConfig(
             dataIndex: 'scan_follow_uv_total',
             key: 'scan_follow_uv_total',
             align: 'center',
-            width: 100,
+            width: 120,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='scan_follow_uv_total' />
@@ -594,7 +594,7 @@ function tablePlanConfig(
             dataIndex: 'scan_follow_cost_total',
             key: 'scan_follow_cost_total',
             align: 'center',
-            width: 100,
+            width: 120,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='scan_follow_cost_total' />
@@ -605,7 +605,7 @@ function tablePlanConfig(
             dataIndex: 'scan_follow_rate_total',
             key: 'scan_follow_rate_total',
             align: 'center',
-            width: 100,
+            width: 120,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.scan_follow_rate_total !== undefined && b?.scan_follow_rate_total !== null) {
@@ -622,7 +622,7 @@ function tablePlanConfig(
             dataIndex: 'first_day_order_count_total',
             key: 'first_day_order_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='first_day_order_count_total' />
@@ -633,7 +633,7 @@ function tablePlanConfig(
             dataIndex: 'first_day_order_amount_total',
             key: 'first_day_order_amount_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='first_day_order_amount_total' />
@@ -644,7 +644,7 @@ function tablePlanConfig(
             dataIndex: 'first_day_order_roi_total',
             key: 'first_day_order_roi_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.first_day_order_roi_total !== undefined && b?.first_day_order_roi_total !== null) {
@@ -659,7 +659,7 @@ function tablePlanConfig(
             dataIndex: 'order_count_total',
             key: 'order_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='order_count_total' />
@@ -670,7 +670,7 @@ function tablePlanConfig(
             dataIndex: 'order_amount_total',
             key: 'order_amount_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='order_amount_total' />
@@ -681,7 +681,7 @@ function tablePlanConfig(
             dataIndex: 'order_cost_total',
             key: 'order_cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='order_cost_total' />
@@ -692,7 +692,7 @@ function tablePlanConfig(
             dataIndex: 'order_rate_total',
             key: 'order_rate_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.order_rate_total !== undefined && b?.order_rate_total !== null) {
@@ -707,7 +707,7 @@ function tablePlanConfig(
             dataIndex: 'order_roi_total',
             key: 'order_roi_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.order_roi_total !== undefined && b?.order_roi_total !== null) {
@@ -722,7 +722,7 @@ function tablePlanConfig(
             dataIndex: 'atv_total',
             key: 'atv_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='atv_total' />
@@ -733,7 +733,7 @@ function tablePlanConfig(
             dataIndex: 'conversions_count_total',
             key: 'conversions_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='conversions_count_total' />
@@ -744,7 +744,7 @@ function tablePlanConfig(
             dataIndex: 'conversions_cost_total',
             key: 'conversions_cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='conversions_cost_total' />
@@ -755,7 +755,7 @@ function tablePlanConfig(
             dataIndex: 'deep_conversions_count_total',
             key: 'deep_conversions_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='deep_conversions_count_total' />
@@ -766,7 +766,7 @@ function tablePlanConfig(
             dataIndex: 'conversions_rate_total',
             key: 'conversions_rate_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.conversions_rate_total !== undefined && b?.conversions_rate_total !== null) {
@@ -781,7 +781,7 @@ function tablePlanConfig(
             dataIndex: 'add_fans_count_total',
             key: 'add_fans_count_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='add_fans_count_total' />
@@ -792,7 +792,7 @@ function tablePlanConfig(
             dataIndex: 'add_fans_cost_total',
             key: 'add_fans_cost_total',
             align: 'center',
-            width: 90,
+            width: 110,
             sorter: true,
             render: (a: any, b: any) => {
                 return <StatisticNull data={b} field='add_fans_cost_total' />

+ 37 - 37
src/pages/launchSystemNew/adq/config.ts

@@ -64,53 +64,53 @@ const planAdConfig = [
     {
         label: '广告消耗信息',
         data: [
-            { title: '消耗', dataIndex: 'cost_total', label: '广告消耗信息', width: 100 },
-            { title: '曝光量', dataIndex: 'view_total', label: '广告消耗信息', width: 90 },
-            { title: '千次曝光成本', dataIndex: 'thousand_display_price_total', label: '广告消耗信息', width: 100 },
-            { title: '点击量', dataIndex: 'click_total', label: '广告消耗信息', width: 90 },
-            { title: '点击率', dataIndex: 'ctr_total', label: '广告消耗信息', width: 90 },
-            { title: '点击均价', dataIndex: 'cpc_total', label: '广告消耗信息', width: 90 },
-            { title: '不感兴趣点击次数', dataIndex: 'no_interest_count_total', label: '广告消耗信息', width: 90 },
-            { title: '朋友圈视频播放次数', dataIndex: 'video_play_count_total', label: '广告消耗信息', width: 90 },
+            { title: '消耗', dataIndex: 'cost_total', label: '广告消耗信息', width: 110 },
+            { title: '曝光量', dataIndex: 'view_total', label: '广告消耗信息', width: 100 },
+            { title: '千次曝光成本', dataIndex: 'thousand_display_price_total', label: '广告消耗信息', width: 110 },
+            { title: '点击量', dataIndex: 'click_total', label: '广告消耗信息', width: 100 },
+            { title: '点击率', dataIndex: 'ctr_total', label: '广告消耗信息', width: 100 },
+            { title: '点击均价', dataIndex: 'cpc_total', label: '广告消耗信息', width: 100 },
+            { title: '不感兴趣点击次数', dataIndex: 'no_interest_count_total', label: '广告消耗信息', width: 100 },
+            { title: '朋友圈视频播放次数', dataIndex: 'video_play_count_total', label: '广告消耗信息', width: 100 },
         ]
     },
     {
         label: '广告转化信息',
         data: [
-            { title: '下载次数', dataIndex: 'download_count_total', label: '广告转化信息', width: 80 },
-            { title: '安装次数', dataIndex: 'install_count_total', label: '广告转化信息', width: 80 },
-            { title: '激活次数', dataIndex: 'activated_count_total', label: '广告转化信息', width: 80 },
-            { title: '公众号关注人数', dataIndex: 'mp_follow_uv_total', label: '广告转化信息', width: 80 },
-            { title: '公众号关注成本', dataIndex: 'mp_follow_cost_total', label: '广告转化信息', width: 90 },
-            { title: '公众号关注率', dataIndex: 'mp_follow_rate_total', label: '广告转化信息', width: 80 },
-            { title: '公众号关注次数', dataIndex: 'mp_follow_pv_total', label: '广告转化信息', width: 80 },
-            { title: '公众号关注次数成本', dataIndex: 'mp_follow_pv_cost_total', label: '广告转化信息', width: 100 },
-            { title: '快应用添加次数', dataIndex: 'add_quick_app_pv_total', label: '广告转化信息', width: 80 },
-            { title: '快应用添加成本', dataIndex: 'add_quick_app_cost_total', label: '广告转化信息', width: 90 },
-            { title: '快应用添加率', dataIndex: 'add_quick_app_rate_total', label: '广告转化信息', width: 80 },
-            { title: '加企业微信客服人数', dataIndex: 'scan_follow_uv_total', label: '广告转化信息', width: 90 },
-            { title: '加企业微信客服成本', dataIndex: 'scan_follow_cost_total', label: '广告转化信息', width: 100 },
-            { title: '加企业微信客服率', dataIndex: 'scan_follow_rate_total', label: '广告转化信息', width: 90 },
+            { title: '下载次数', dataIndex: 'download_count_total', label: '广告转化信息', width: 95 },
+            { title: '安装次数', dataIndex: 'install_count_total', label: '广告转化信息', width: 95 },
+            { title: '激活次数', dataIndex: 'activated_count_total', label: '广告转化信息', width: 95 },
+            { title: '公众号关注人数', dataIndex: 'mp_follow_uv_total', label: '广告转化信息', width: 95 },
+            { title: '公众号关注成本', dataIndex: 'mp_follow_cost_total', label: '广告转化信息', width: 100 },
+            { title: '公众号关注率', dataIndex: 'mp_follow_rate_total', label: '广告转化信息', width: 95 },
+            { title: '公众号关注次数', dataIndex: 'mp_follow_pv_total', label: '广告转化信息', width: 95 },
+            { title: '公众号关注次数成本', dataIndex: 'mp_follow_pv_cost_total', label: '广告转化信息', width: 110 },
+            { title: '快应用添加次数', dataIndex: 'add_quick_app_pv_total', label: '广告转化信息', width: 95 },
+            { title: '快应用添加成本', dataIndex: 'add_quick_app_cost_total', label: '广告转化信息', width: 110 },
+            { title: '快应用添加率', dataIndex: 'add_quick_app_rate_total', label: '广告转化信息', width: 95 },
+            { title: '加企业微信客服人数', dataIndex: 'scan_follow_uv_total', label: '广告转化信息', width: 105 },
+            { title: '加企业微信客服成本', dataIndex: 'scan_follow_cost_total', label: '广告转化信息', width: 110 },
+            { title: '加企业微信客服率', dataIndex: 'scan_follow_rate_total', label: '广告转化信息', width: 105 },
         ]
     },
     {
         label: '商品转化',
         data: [
-            { title: '首日新增下单量', dataIndex: 'first_day_order_count_total', label: '商品转化', width: 80 },
-            { title: '首日新增下单金额', dataIndex: 'first_day_order_amount_total', label: '商品转化', width: 90 },
-            { title: '首日新增下单ROI', dataIndex: 'first_day_order_roi_total', label: '商品转化', width: 80 },
-            { title: '订单量', dataIndex: 'order_count_total', label: '商品转化', width: 80},
-            { title: '订单金额', dataIndex: 'order_amount_total', label: '商品转化', width: 90 },
-            { title: '下单成本', dataIndex: 'order_cost_total', label: '商品转化', width: 85 },
-            { title: '下单率', dataIndex: 'order_rate_total', label: '商品转化', width: 80 },
-            { title: '下单ROI', dataIndex: 'order_roi_total', label: '商品转化', width: 80 },
-            { title: '客单价', dataIndex: 'atv_total', label: '商品转化', width: 80 },
-            { title: '转化量', dataIndex: 'conversions_count_total', label: '商品转化', width: 80 },
-            { title: '转化成本', dataIndex: 'conversions_cost_total', label: '商品转化', width: 85 },
-            { title: '深度转化', dataIndex: 'deep_conversions_count_total', label: '商品转化', width: 80 },
-            { title: '转化率', dataIndex: 'conversions_rate_total', label: '商品转化', width: 80 },
-            { title: '加粉数', dataIndex: 'add_fans_count_total', label: '商品转化', width: 80 },
-            { title: '加粉成本', dataIndex: 'add_fans_cost_total', label: '商品转化', width: 85 },
+            { title: '首日新增下单量', dataIndex: 'first_day_order_count_total', label: '商品转化', width: 95 },
+            { title: '首日新增下单金额', dataIndex: 'first_day_order_amount_total', label: '商品转化', width: 105 },
+            { title: '首日新增下单ROI', dataIndex: 'first_day_order_roi_total', label: '商品转化', width: 95 },
+            { title: '订单量', dataIndex: 'order_count_total', label: '商品转化', width: 95},
+            { title: '订单金额', dataIndex: 'order_amount_total', label: '商品转化', width: 105 },
+            { title: '下单成本', dataIndex: 'order_cost_total', label: '商品转化', width: 100 },
+            { title: '下单率', dataIndex: 'order_rate_total', label: '商品转化', width: 95 },
+            { title: '下单ROI', dataIndex: 'order_roi_total', label: '商品转化', width: 95 },
+            { title: '客单价', dataIndex: 'atv_total', label: '商品转化', width: 95 },
+            { title: '转化量', dataIndex: 'conversions_count_total', label: '商品转化', width: 95 },
+            { title: '转化成本', dataIndex: 'conversions_cost_total', label: '商品转化', width: 100 },
+            { title: '深度转化', dataIndex: 'deep_conversions_count_total', label: '商品转化', width: 95 },
+            { title: '转化率', dataIndex: 'conversions_rate_total', label: '商品转化', width: 95 },
+            { title: '加粉数', dataIndex: 'add_fans_count_total', label: '商品转化', width: 95 },
+            { title: '加粉成本', dataIndex: 'add_fans_cost_total', label: '商品转化', width: 100 },
         ]
     },
 ]

+ 18 - 0
src/services/adMonitor/adMonitor.ts

@@ -384,6 +384,24 @@ export async function getListForAdApi(data: GetListForAdProps) {
     })
 }
 
+
+/**
+ * 广告列表指标趋势
+ */
+export interface GetAdColumnTrendProps {
+    timeUnit: 'day' | 'hour',
+    pageParams: AdListProps,
+    trendColumns: string[]
+    dataTimeMin?: string,
+    dataTimeMax?: string,
+}
+export async function getAdColumnTrendApi(data: GetAdColumnTrendProps) {
+    return request(`${api}/tencentMonitor/ad/columnTrend`, {
+        method: 'POST',
+        data
+    })
+}
+
 export interface AdListProps {
     pageNum: number
     pageSize: number