wjx 7 місяців тому
батько
коміт
aa1e3a93e3

+ 7 - 4
src/components/QueryForm/index.tsx

@@ -4,6 +4,7 @@ import { getPutUserListApi } from "@/services/iaaData"
 import { Button, Col, Form, Row, Space, DatePicker, Select, Input, InputNumber } from "antd"
 import { RangePickerProps } from "antd/lib/date-picker"
 import React, { useEffect, useState } from "react"
+import { useModel } from "umi"
 
 interface Props {
     onChange?: (data: any) => void
@@ -48,18 +49,20 @@ interface Props {
 const QueryForm: React.FC<Props> = (props) => {
 
     /**************************/
+    const { initialState } = useModel('@@initialState');
     const {
         onChange, initialValues, isAccountId, isPromotionName, isPromotionId, isDynamicCreativeId, isCpaBid, isPutUserIdList, isPricing, isTTPricing, isStatus, isTTStatus, isDeleted, day1, day2, day3
     } = props
     const [form] = Form.useForm()
     const [putUserList, setPutUserList] = useState<{ label: string, value: string }[]>([])
 
-    const getPutUserList = useAjax(() => getPutUserListApi())
+    const getPutUserList = useAjax((params) => getPutUserListApi(params))
     /**************************/
 
     useEffect(() => {
-        if (isPutUserIdList) {
-            getPutUserList.run().then(res => {
+        if (isPutUserIdList && initialState?.iaaApp) {
+            const [_, productType] = initialState.iaaApp.split('||')
+            getPutUserList.run({ productType }).then(res => {
                 if (res?.data) {
                     setPutUserList(Object.keys(res.data).map(key => ({ value: key, label: res.data[key] })))
                 }
@@ -68,7 +71,7 @@ const QueryForm: React.FC<Props> = (props) => {
         () => {
 
         }
-    }, [isPutUserIdList])
+    }, [isPutUserIdList, initialState?.iaaApp])
 
     const onFinish = (data: any) => {
         console.log('更新了字段---->', data);

+ 7 - 4
src/components/QueryForm/queryFormNovel.tsx

@@ -4,6 +4,7 @@ import { getPutUserListApi } from "@/services/iaaData"
 import { Button, Col, Form, Row, Space, DatePicker, Select, Input, InputNumber } from "antd"
 import { RangePickerProps } from "antd/lib/date-picker"
 import React, { useEffect, useState } from "react"
+import { useModel } from "umi"
 
 interface Props {
     onChange?: (data: any) => void
@@ -84,6 +85,7 @@ interface Props {
 const QueryFormNovel: React.FC<Props> = (props) => {
 
     /**************************/
+    const { initialState } = useModel('@@initialState');
     const {
         onChange, initialValues, isAccountId, isAdgroupName, isAdgroupId, isDynamicCreativeName, isDynamicCreativeId, isMemo, isRemark, isCpaBid, isPutUserId, isPricing, isStatus, isMarketingGoal, isMarketingTargetType, isPromotedObjectType, isPromotedObjectName, isOptimizationGoal, isDeliveryMode, isDeleted, isDeepConversionSpec, isConfiguredStatus, day1, day2, day3,
         isCostTotalMin, isThousandDisplayPriceTotalMin, isConversionsCountTotalMin, isIncomeRoi1, isRegCost, isRegCostPla, isCpc
@@ -91,12 +93,13 @@ const QueryFormNovel: React.FC<Props> = (props) => {
     const [form] = Form.useForm()
     const [putUserList, setPutUserList] = useState<{ label: string, value: string }[]>([])
 
-    const getPutUserList = useAjax(() => getPutUserListApi())
+    const getPutUserList = useAjax((params) => getPutUserListApi(params))
     /**************************/
 
     useEffect(() => {
-        if (isPutUserId) {
-            getPutUserList.run().then(res => {
+        if (isPutUserId && initialState?.iaaApp) {
+            const [_, productType] = initialState.iaaApp.split('||')
+            getPutUserList.run({ productType }).then(res => {
                 if (res?.data) {
                     setPutUserList(Object.keys(res.data).map(key => ({ value: key, label: res.data[key] })))
                 }
@@ -105,7 +108,7 @@ const QueryFormNovel: React.FC<Props> = (props) => {
         () => {
 
         }
-    }, [isPutUserId])
+    }, [isPutUserId, initialState?.iaaApp])
 
     const onFinish = (data: any) => {
         console.log('更新了字段---->', data);

+ 7 - 11
src/pages/iaaData/novel/tencent/dynamic/tableConfig.tsx

@@ -87,10 +87,6 @@ function columns12(dayHandle: (data: any) => void, onChange?: () => void): { lab
                         }
                         return null
                     }
-                },
-                {
-                    title: '业务单元类型', dataIndex: 'adUnitType', label: '广告基本信息', align: 'center', width: 75, default: 15,
-                    render: (a: string) => (<WidthEllipsis value={AdUnitType_Enum[a as keyof typeof AdUnitType_Enum]} />)
                 }
             ]
         },
@@ -98,7 +94,7 @@ function columns12(dayHandle: (data: any) => void, onChange?: () => void): { lab
             label: '广告消耗信息',
             data: [
                 {
-                    title: '消耗', dataIndex: 'cost', label: '广告消耗信息', align: 'center', width: 100, default: 16, sorter: true, 
+                    title: '消耗', dataIndex: 'cost', label: '广告消耗信息', align: 'center', width: 100, default: 15, sorter: true, 
                     className: 'padding_0',
                     render: (a: number) => <div style={{ height: 27, position: 'relative' }}>
                         <Progress
@@ -114,27 +110,27 @@ function columns12(dayHandle: (data: any) => void, onChange?: () => void): { lab
                     </div>
                 },
                 {
-                    title: '曝光量', dataIndex: 'viewCount', label: '广告消耗信息', align: 'center', width: 90, default: 17, sorter: true,
+                    title: '曝光量', dataIndex: 'viewCount', label: '广告消耗信息', align: 'center', width: 90, default: 16, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告消耗信息', align: 'right', width: 65, default: 18, sorter: true,
+                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告消耗信息', align: 'right', width: 65, default: 17, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '点击量', dataIndex: 'clickCount', label: '广告消耗信息', align: 'center', width: 90, default: 19, sorter: true,
+                    title: '点击量', dataIndex: 'clickCount', label: '广告消耗信息', align: 'center', width: 90, default: 18, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击均价', dataIndex: 'cpc', label: '广告消耗信息', align: 'center', width: 65, default: 20, sorter: true,
+                    title: '点击均价', dataIndex: 'cpc', label: '广告消耗信息', align: 'center', width: 65, default: 19, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '点击率', dataIndex: 'ctr', label: '广告消耗信息', align: 'center', width: 70, default: 21, sorter: true,
+                    title: '点击率', dataIndex: 'ctr', label: '广告消耗信息', align: 'center', width: 70, default: 20, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告消耗信息', align: 'center', width: 65, sorter: true,
+                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告消耗信息', align: 'center', width: 65, sorter: true, default: 21,
                     render: (a: string) => <Statistic value={a || 0} />
                 }
             ]

+ 7 - 11
src/pages/iaaData/novel/tencent/dynamic/tableConfigDay.tsx

@@ -45,10 +45,6 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                 {
                     title: '投手', dataIndex: 'pitcherName', label: '腾讯创意基本信息', align: 'center', width: 60, default: 9,
                     render: (a: string) => (<WidthEllipsis value={a} />)
-                },
-                {
-                    title: '业务单元类型', dataIndex: 'adUnitType', label: '广告基本信息', align: 'center', width: 75, default: 10,
-                    render: (a: string) => (<WidthEllipsis value={AdUnitType_Enum[a as keyof typeof AdUnitType_Enum]} />)
                 }
             ]
         },
@@ -56,7 +52,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '广告消耗信息',
             data: [
                 {
-                    title: '消耗', dataIndex: 'cost', label: '广告消耗信息', align: 'center', width: 85, default: 11, sorter: true, 
+                    title: '消耗', dataIndex: 'cost', label: '广告消耗信息', align: 'center', width: 85, default: 10, sorter: true, 
                     className: 'padding_0',
                     render: (a: number) => <div style={{ height: 27, position: 'relative' }}>
                         <Progress
@@ -72,27 +68,27 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     </div>
                 },
                 {
-                    title: '曝光量', dataIndex: 'viewCount', label: '广告消耗信息', align: 'center', width: 70, default: 12, sorter: true,
+                    title: '曝光量', dataIndex: 'viewCount', label: '广告消耗信息', align: 'center', width: 70, default: 11, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告消耗信息', align: 'right', width: 65, default: 13, sorter: true,
+                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告消耗信息', align: 'right', width: 65, default: 12, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '点击量', dataIndex: 'clickCount', label: '广告消耗信息', align: 'center', width: 70, default: 14, sorter: true,
+                    title: '点击量', dataIndex: 'clickCount', label: '广告消耗信息', align: 'center', width: 70, default: 13, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击均价', dataIndex: 'cpc', label: '广告消耗信息', align: 'center', width: 65, default: 15, sorter: true,
+                    title: '点击均价', dataIndex: 'cpc', label: '广告消耗信息', align: 'center', width: 65, default: 14, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '点击率', dataIndex: 'ctr', label: '广告消耗信息', align: 'center', width: 70, default: 16, sorter: true,
+                    title: '点击率', dataIndex: 'ctr', label: '广告消耗信息', align: 'center', width: 70, default: 15, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告消耗信息', align: 'center', width: 65, sorter: true,
+                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告消耗信息', align: 'center', width: 65, sorter: true, default: 16,
                     render: (a: string) => <Statistic value={a || 0} />
                 }
             ]

+ 3 - 2
src/services/iaaData/index.ts

@@ -25,9 +25,10 @@ export interface SortProps {
  * 投手列表
  * @returns 
  */
-export async function getPutUserListApi() {
+export async function getPutUserListApi(params: { productType: string }) {
     return request(wapi + `/condition/putUserList`, {
-        method: 'POST'
+        method: 'POST',
+        params
     });
 }