wjx 8 月之前
父节点
当前提交
45b7cc0869

+ 3 - 4
src/pages/adMonitor/adMonitorList/columnTrend.tsx

@@ -30,9 +30,8 @@ const ColumnTrend: React.FC<Props> = ({ data: { field, dataTimeMin, dataTimeMax,
             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];
+                    let value: any = { legendName: LineField[field as keyof typeof LineField] }
+                    res?.data?.forEach((item: any) => {
                         value[item?.trend_unit] = item?.[field] || 0
                     });
                     return value
@@ -67,7 +66,7 @@ const ColumnTrend: React.FC<Props> = ({ data: { field, dataTimeMin, dataTimeMax,
                     }}
                 >
                     {Object.keys(LineField).map((key) => <Select.Option value={key} key={key}>
-                        {LineField[key]}
+                        {LineField[key as keyof typeof LineField]}
                     </Select.Option>)}
                 </Select>
                 <DatePicker.RangePicker

+ 1 - 2
src/pages/adMonitor/adMonitorList/components/Details.tsx

@@ -40,9 +40,8 @@ const Details: React.FC<Props> = ({ data, onClose, visible }) => {
             if (res?.data) {
                 let trendColumns = queryColumnTrend.trendColumns
                 let data = trendColumns.map((field) => {
-                    let value: any = {}
+                    let value: any = { legendName: LineField[field as keyof typeof LineField] }
                     res?.data?.forEach((item: any, index: number) => {
-                        if (index === 0) value.legendName = LineField[field as keyof typeof LineField];
                         value[item?.trend_unit] = item?.[field]
                     });
                     return value

+ 1 - 1
src/pages/adMonitor/adMonitorList/components/FilterQuery.tsx

@@ -132,7 +132,7 @@ const FilterQuery: React.FC<Props> = ({ onChange }) => {
                 onChange={(e) => setQueryForm({ ...queryForm, adgroupName: e.target.value })}
             />
             <Popover
-                visible={visible}
+                open={visible}
                 content={<div style={{ width: 500, height: 400, overflowY: 'auto', padding: '10px 16px' }}>
                     <Form
                         name="FilterQuery"

+ 3 - 3
src/pages/launchSystemV3/adMonitorListV3/adPlanList.tsx

@@ -92,7 +92,7 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
     }, [getAdList.data])
 
     useEffect(() => {
-        let localData = localStorage.getItem('myAdMonitorConfig1.0.1_广告列表New')
+        let localData = localStorage.getItem('myAdMonitorConfig1.0.1_广告列表3.0')
         let data: any[] = []
         if (localData) {
             data = JSON.parse(localData)
@@ -110,7 +110,7 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
         data.unshift({ title: '选择框', dataIndex: 'xzk' })
         data.unshift({ title: '总计', dataIndex: 'zj' })
         setTableField(data)
-    }, [localStorage.getItem('myAdMonitorConfig1.0.1_广告列表New')])
+    }, [localStorage.getItem('myAdMonitorConfig1.0.1_广告列表3.0')])
 
     useEffect(() => {
         getPutUser.run({ userId })
@@ -366,7 +366,7 @@ const AdPlanList: React.FC<{ userId: string }> = (props) => {
                                     return <Table.Summary.Cell index={index} key={item.dataIndex} align="center">
                                         <Space size={4}>
                                             <strong>
-                                                {value !== '--' ? <Statistic value={value} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" /> : '--'}
+                                                {value !== '--' ? <Statistic value={value ? value * 100 : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" /> : '--'}
                                             </strong>
                                             {value !== '--' && <a onClick={() => handleColumnTrend(item.dataIndex)}><LineChartOutlined /></a>}
                                         </Space>

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

@@ -70,7 +70,7 @@ const planAdConfig = [
             { 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: '下单ROI', dataIndex: 'order_roi_total', label: '商品转化', width: 100 },
             { title: '客单价', dataIndex: 'atv_total', label: '商品转化', width: 95 },
             { title: '转化量', dataIndex: 'conversions_count_total', label: '商品转化', width: 95 },
             { title: '转化成本', dataIndex: 'conversions_cost_total', label: '商品转化', width: 100 },

+ 18 - 15
src/pages/launchSystemV3/adMonitorListV3/tablePlanListConfig.tsx

@@ -303,7 +303,7 @@ function tablePlanConfig(
             ellipsis: true,
             render: (_: any, b: any) => {
                 // return <BoxOther creativeComponents={b?.creative_preview?.[0] || {}} />
-                return <CreativePreview creativePreview={b?.creative_preview || []} deliveryMode={b?.delivery_mode}/>
+                return <CreativePreview creativePreview={b?.creative_preview || []} deliveryMode={b?.delivery_mode} />
             }
         },
         {
@@ -314,12 +314,15 @@ function tablePlanConfig(
             align: 'center',
             render: (a: any, b: any) => {
                 if (b?.account_id === '总计') return '--';
+                let items = [
+                    { label: <a style={{ fontSize: 12 }} onClick={() => log(b)}>告警日志</a>, key: '1' },
+                    { label: <a style={{ fontSize: 12 }} onClick={() => handleTag(b)}>打标记</a>, key: '2' }
+                ]
+                if (b?.tag_value) {
+                    items.push({ label: <a style={{ color: 'red', fontSize: 12 }} onClick={() => delTag(b)}>删除标记</a>, key: '3' })
+                }
                 return <Space>
-                    <Dropdown overlay={<Menu>
-                        <Menu.Item><a onClick={() => log(b)}>告警日志</a></Menu.Item>
-                        <Menu.Item><a onClick={() => handleTag(b)}>打标记</a></Menu.Item>
-                        {b?.tag_value ? <Menu.Item><a style={{ color: 'red' }} onClick={() => delTag(b)}>删除标记</a></Menu.Item> : undefined}
-                    </Menu>}>
+                    <Dropdown menu={{ items }}>
                         <a><Space size={2}>更多 <DownOutlined /></Space></a>
                     </Dropdown>
                     <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.account_id}/admanage/index?tab=adgroup&query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroup_id}%22}`)} target="_blank">腾讯广告</a>
@@ -382,7 +385,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.ctr_total !== undefined && b?.ctr_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -485,7 +488,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.mp_follow_rate_total !== undefined && b?.mp_follow_rate_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -510,7 +513,7 @@ function tablePlanConfig(
             width: 120,
             sorter: true,
             render: (a: any, b: any) => {
-                return <StatisticNull data={b} field='mp_follow_pv_cost_total' precision={2}/>
+                return <StatisticNull data={b} field='mp_follow_pv_cost_total' precision={2} />
             }
         },
         {
@@ -544,7 +547,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.add_quick_app_rate_total !== undefined && b?.add_quick_app_rate_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -581,7 +584,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.scan_follow_rate_total !== undefined && b?.scan_follow_rate_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -620,7 +623,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.first_day_order_roi_total !== undefined && b?.first_day_order_roi_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -668,7 +671,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.order_rate_total !== undefined && b?.order_rate_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -683,7 +686,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.order_roi_total !== undefined && b?.order_roi_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }
@@ -742,7 +745,7 @@ function tablePlanConfig(
             sorter: true,
             render: (a: any, b: any) => {
                 if (b?.conversions_rate_total !== undefined && b?.conversions_rate_total !== null) {
-                    return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
+                    return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
                 } else {
                     return '--'
                 }