wjx 1 рік тому
батько
коміт
3a7f2188ac

+ 83 - 6
src/pages/gameDataStatistics/adlist/tencentMonitor/index.tsx

@@ -4,23 +4,28 @@ import columns12 from "./tableConfig"
 import { getPresets } from "@/components/QueryForm/const"
 import TableData from "../../components/TableData"
 import QueryForm from "@/components/QueryForm"
-import { PromotionDataDay, getPromotionDataTencentListApi, getPromotionDataTencentTotalApi } from "@/services/gameData/adlist"
+import { PromotionDataDay, getPromotionDataTencentListApi, getPromotionDataTencentTotalApi, newEditAdqAdgroupsDataApi } from "@/services/gameData/adlist"
 import { useAjax } from "@/Hook/useAjax"
 import moment from "moment"
+import { Button, Space, Switch, message, notification } from "antd"
+import { PauseCircleOutlined, PlayCircleOutlined } from "@ant-design/icons"
 
 
 
 const TencentMonitor: React.FC = () => {
 
     /***************************************/
-    const [queryForm, setQueryForm] = useState<PromotionDataDay>({ pageNum: 1, pageSize: 100, sourceSystem: 'ZX_ONE', costBeginDate: moment().format('YYYY-MM-DD'), costEndDate: moment().format('YYYY-MM-DD') })
+    const [queryForm, setQueryForm] = useState<PromotionDataDay>({ pageNum: 1, pageSize: 50, sourceSystem: 'ZX_ONE', costBeginDate: moment().format('YYYY-MM-DD'), costEndDate: moment().format('YYYY-MM-DD') })
     const [totalData, setTotalData] = useState<any[]>([])
     const [visible, setVisible] = useState<boolean>(false)
     const [promotionId, setPromotionId] = useState<number>()
     const [adName, setAdName] = useState<string>('')
+    const [selectedRows, setSelectedRows] = useState<any[]>([])
+    const [isZj, setIsZj] = useState<boolean>(true)
 
     const getPromotionDataTencentList = useAjax((params) => getPromotionDataTencentListApi(params))
     const getPromotionDataTencentTotal = useAjax((params) => getPromotionDataTencentTotalApi(params))
+    const editAdqAdgroupsData = useAjax((params) => newEditAdqAdgroupsDataApi(params))
     /***************************************/
 
     useEffect(() => {
@@ -38,8 +43,44 @@ const TencentMonitor: React.FC = () => {
         setPromotionId(data.promotionId)
     }
 
+    // 批量启停
+    const adStatus = (type: 'play' | 'suspend') => {
+        let params: any = {}
+        if (type === 'play') {
+            params.configuredStatus = 'AD_STATUS_NORMAL'
+            params.adgroupIds = selectedRows.filter((item: { configuredStatus: string, promotionId: number }) => item.configuredStatus === 'AD_STATUS_SUSPEND').map(item => item.promotionId)
+        } else {
+            params.configuredStatus = 'AD_STATUS_SUSPEND'
+            params.adgroupIds = selectedRows.filter((item: { configuredStatus: string, promotionId: number }) => item.configuredStatus === 'AD_STATUS_NORMAL').map(item => item.promotionId)
+        }
+        if (params.adgroupIds.length === 0) {
+            message.warn(`所以账号都是${type === 'play' ? '启动' : '暂停'}状态,无需${type === 'play' ? '启动' : '暂停'}操作`)
+            return
+        }
+        editAdqAdgroupsData.run(params).then(res => {
+            message.success(`${type === 'play' ? '启动' : '暂停'}成功: ${res.success},失败: ${res.fail}`)//
+            if (res?.fail) {
+                notification.error({
+                    message: `${type === 'play' ? '启动' : '暂停'}失败`,
+                    description: `成功: ${res.success},修改失败${res.fail}条,失败的请到任务列表查看`,
+                    duration: 0
+                });
+            }
+            getPromotionDataTencentList.refresh()
+            setSelectedRows([])
+        })
+    }
+
     return <div>
         <TableData
+            czChild={<Space>
+                <Switch checkedChildren="开启操作" unCheckedChildren="关闭操作" checked={!isZj} onChange={(e) => { setIsZj(!e); }} />
+                {!isZj && <>
+                    <Button type='primary' size="small" style={{ background: '#67c23a', borderColor: '#67c23a' }} loading={editAdqAdgroupsData.loading} icon={<PlayCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('play')}>启动</Button>
+                    <Button type='primary' size="small" style={{ background: '#e6a23c', borderColor: '#e6a23c' }} loading={editAdqAdgroupsData.loading} icon={<PauseCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('suspend')}>暂停</Button>
+                </>}
+                <span style={{ color: 'red' }}>操作完数据结果延时5分钟之内,及时结果去腾讯后台查看</span>
+            </Space>}
             leftChild={<QueryForm
                 initialValues={{ sourceSystem: 'ZX_ONE', consumeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
@@ -56,7 +97,6 @@ const TencentMonitor: React.FC = () => {
                         delete newQueryForm.costBeginDate
                         delete newQueryForm.costEndDate
                     }
-
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
@@ -75,12 +115,12 @@ const TencentMonitor: React.FC = () => {
                 isPromotionName
                 isAdTXStatus
             />}
-            isZj
+            isZj={isZj}
             totalData={totalData}
             scroll={{ x: 1000, y: 600 }}
             ajax={getPromotionDataTencentList}
             fixed={{ left: 3, right: 1 }}
-            dataSource={getPromotionDataTencentList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            dataSource={getPromotionDataTencentList?.data?.records?.map((item: any) => ({ ...item, id: Number(item.promotionId) }))}
             total={getPromotionDataTencentList?.data?.total}
             page={queryForm.pageNum}
             pageSize={queryForm.pageSize}
@@ -104,7 +144,44 @@ const TencentMonitor: React.FC = () => {
                 newQueryForm.pageSize = pageSize
                 setQueryForm({ ...newQueryForm })
             }}
-            config={columns12(dayHandle)}
+            rowSelection={{
+                selectedRowKeys: selectedRows.map(item => item.promotionId + ''),
+                getCheckboxProps: (record: any) => ({
+                    disabled: record.status === 'STATUS_DELETED' || record?.accountName === '总计'
+                }),
+                onSelect: (record: { promotionId: number }, selected: boolean) => {
+                    if (selected) {
+                        selectedRows.push({ ...record })
+                        setSelectedRows([...selectedRows])
+                    } else {
+                        let newSelectAccData = selectedRows.filter((item: { promotionId: number }) => item.promotionId !== record.promotionId)
+                        setSelectedRows([...newSelectAccData])
+                    }
+                },
+                onSelectAll: (selected: boolean, selectedRowss: { promotionId: number }[], changeRows: { promotionId: number }[]) => {
+                    if (selected) {
+                        let newSelectAccData = [...selectedRows]
+                        changeRows.forEach((item: { promotionId: number }) => {
+                            let index = newSelectAccData.findIndex((ite: { promotionId: number }) => ite.promotionId === item.promotionId)
+                            if (index === -1) {
+                                newSelectAccData.push({ ...item })
+                            }
+                        })
+                        setSelectedRows([...newSelectAccData])
+                    } else {
+                        let newSelectAccData = selectedRows.filter((item: { promotionId: number }) => {
+                            let index = changeRows.findIndex((ite: { promotionId: number }) => ite.promotionId === item.promotionId)
+                            if (index !== -1) {
+                                return false
+                            } else {
+                                return true
+                            }
+                        })
+                        setSelectedRows([...newSelectAccData])
+                    }
+                }
+            }}
+            config={columns12(dayHandle, () => { getPromotionDataTencentList.refresh() })}
             configName={'腾讯广告监控'}
         />
 

+ 40 - 0
src/pages/gameDataStatistics/adlist/tencentMonitor/switchStatus.tsx

@@ -0,0 +1,40 @@
+import { useAjax } from "@/Hook/useAjax"
+import { newEditAdqAdgroupsDataApi } from "@/services/gameData/adlist"
+import { message, notification, Switch } from "antd"
+import React from "react"
+
+
+
+/**
+ * 修改启停
+ */
+interface Props {
+    configuredStatus: string,
+    isDeleted?: boolean,
+    adgroupId: number,
+    onChange?: () => void
+}
+const SwitchStatus: React.FC<Props> = (prosp) => {
+
+    const { configuredStatus, isDeleted, adgroupId, onChange } = prosp
+    const editAdqAdgroupsData = useAjax((params) => newEditAdqAdgroupsDataApi(params))
+    
+    const switchHandle = (adgroupIds: number[], configuredStatus: string) => {
+        editAdqAdgroupsData.run({ adgroupIds, configuredStatus }).then(res => {
+            message.success(`${configuredStatus === 'AD_STATUS_NORMAL' ? '启动' : '暂停'}成功`)
+            if (res?.fail) {
+                notification.error({
+                    message: `${configuredStatus === 'AD_STATUS_NORMAL' ? '启动' : '暂停'}失败`,
+                    description: `修改失败${res.fail}条,失败的请到任务列表查看`,
+                    duration: 0
+                });
+            }
+            onChange?.()
+        })
+    }
+
+    return <Switch size="small" checked={configuredStatus === 'AD_STATUS_NORMAL'} loading={editAdqAdgroupsData.loading} disabled={isDeleted} onChange={(checked) => switchHandle([adgroupId] ,checked ? 'AD_STATUS_NORMAL' : 'AD_STATUS_SUSPEND')}/>
+}
+
+
+export default React.memo(SwitchStatus)

+ 57 - 42
src/pages/gameDataStatistics/adlist/tencentMonitor/tableConfig.tsx

@@ -4,8 +4,9 @@ import { Space, Statistic } from "antd"
 import React from "react"
 import { ADSTATUSEnum, LANDINGTYPEEnum, PRICINGEnum } from './const'
 import './index.less'
+import SwitchStatus from "./switchStatus"
 
-function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+function columns12(dayHandle: (data: any) => void, onChange?: () => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
     const data = [{ lable: '次日', value: 2 }, { lable: 'D3', value: 3 }, { lable: 'D7', value: 7 }, { lable: 'D15', value: 15 }]
     let date = data.map(item => {
@@ -72,11 +73,11 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '账户信息',
             data: [
                 {
-                    title: '推广账号名称', dataIndex: 'accountName', label: '账户信息', align: 'center', width: 100, default: 1,
+                    title: '推广账号名称', dataIndex: 'accountName', label: '账户信息', align: 'center', width: 100, default: 2,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '推广账号ID', dataIndex: 'accountId', label: '账户信息', align: 'center', width: 120, default: 2,
+                    title: '推广账号ID', dataIndex: 'accountId', label: '账户信息', align: 'center', width: 120, default: 3,
                     render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
@@ -88,7 +89,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投放渠道', dataIndex: 'agentName', label: '账户信息', align: 'center', width: 75, default: 3,
+                    title: '投放渠道', dataIndex: 'agentName', label: '账户信息', align: 'center', width: 75, default: 4,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
@@ -122,11 +123,11 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '广告信息',
             data: [
                 {
-                    title: '推广广告名称', dataIndex: 'promotionName', label: '广告信息', align: 'center', width: 130, default: 4,
+                    title: '推广广告名称', dataIndex: 'promotionName', label: '广告信息', align: 'center', width: 130, default: 5,
                     render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '广告ID', dataIndex: 'promotionId', label: '广告信息', align: 'center', width: 90, default: 5,
+                    title: '广告ID', dataIndex: 'promotionId', label: '广告信息', align: 'center', width: 90, default: 6,
                     render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
@@ -138,7 +139,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '广告状态', dataIndex: 'status', label: '广告信息', align: 'left', width: 120, default: 6,
+                    title: '广告状态', dataIndex: 'status', label: '广告信息', align: 'left', width: 120, default: 7,
                     render: (a: string, b: any) => (<WidthEllipsis value={ADSTATUSEnum[a]} />)
                 },
                 {
@@ -146,11 +147,11 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: string, b: any) => (<WidthEllipsis value={LANDINGTYPEEnum[a]} />)
                 },
                 {
-                    title: '出价方式', dataIndex: 'pricing', label: '广告信息', align: 'center', width: 100, default: 7,
+                    title: '出价方式', dataIndex: 'pricing', label: '广告信息', align: 'center', width: 100, default: 8,
                     render: (a: string, b: any) => (<WidthEllipsis value={PRICINGEnum[a]} />)
                 },
                 {
-                    title: '当前出价', dataIndex: 'cpaBid', label: '广告信息', align: 'center', width: 70, default: 8,
+                    title: '当前出价', dataIndex: 'cpaBid', label: '广告信息', align: 'center', width: 70, default: 9,
                     render: (a: any) => <Statistic value={a || '--'} />
                 },
                 {
@@ -158,11 +159,11 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '日预算', dataIndex: 'budget', label: '广告信息', align: 'center', width: 70, default: 9, sorter: true,
+                    title: '日预算', dataIndex: 'budget', label: '广告信息', align: 'center', width: 70, default: 10, sorter: true,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投放时间', dataIndex: 'scheduleTime', label: '广告信息', align: 'center', width: 135, default: 10,
+                    title: '投放时间', dataIndex: 'scheduleTime', label: '广告信息', align: 'center', width: 135, default: 11,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 }
             ]
@@ -171,7 +172,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '消耗',
             data: [
                 {
-                    title: '今日消耗', dataIndex: 'todayCost', label: '消耗', align: 'center', width: 85, sorter: true, default: 11,
+                    title: '今日消耗', dataIndex: 'todayCost', label: '消耗', align: 'center', width: 85, sorter: true, default: 12,
                     render: (a: any) => <Statistic valueStyle={{ fontWeight: 'bold', fontSize: 14 }} value={a || 0} />
                 },
                 {
@@ -184,23 +185,23 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '广告媒体端数据',
             data: [
                 {
-                    title: '曝光量', dataIndex: 'showCount', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, default: 12, className: "adDataBackColorClass",
+                    title: '曝光量', dataIndex: 'showCount', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, default: 13, className: "adDataBackColorClass",
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告媒体端数据', align: 'center', width: 65, sorter: true, className: "adDataBackColorClass", default: 14,
+                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告媒体端数据', align: 'center', width: 70, sorter: true, className: "adDataBackColorClass", default: 15,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击量', dataIndex: 'clickCount', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, className: "adDataBackColorClass", default: 13,
+                    title: '点击量', dataIndex: 'clickCount', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, className: "adDataBackColorClass", default: 14,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击均价', dataIndex: 'avgClickCost', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, className: "adDataBackColorClass", default: 15,
+                    title: '点击均价', dataIndex: 'avgClickCost', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, className: "adDataBackColorClass", default: 16,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击率', dataIndex: 'ctr', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, className: "adDataBackColorClass", default: 16,
+                    title: '点击率', dataIndex: 'ctr', label: '广告媒体端数据', align: 'center', width: 70, sorter: true, className: "adDataBackColorClass", default: 17,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -220,35 +221,35 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '小游戏注册人数', dataIndex: 'miniGameRegisterUsers', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 17,
+                    title: '小游戏注册人数', dataIndex: 'miniGameRegisterUsers', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 18,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏注册成本', dataIndex: 'miniGameRegisterCost', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 18,
+                    title: '小游戏注册成本', dataIndex: 'miniGameRegisterCost', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 19,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏注册率', dataIndex: 'miniGameRegisterRate', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 95, sorter: true, default: 19,
+                    title: '小游戏注册率', dataIndex: 'miniGameRegisterRate', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 95, sorter: true, default: 20,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '小游戏付费次数', dataIndex: 'miniGamePayingCount', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 20,
+                    title: '小游戏付费次数', dataIndex: 'miniGamePayingCount', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 80, sorter: true, default: 21,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏付费金额', dataIndex: 'miniGamePayingAmount', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 21,
+                    title: '小游戏付费金额', dataIndex: 'miniGamePayingAmount', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 22,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏首日付费人数', dataIndex: 'miniGamePayingUsersD1', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 22,
+                    title: '小游戏首日付费人数', dataIndex: 'miniGamePayingUsersD1', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 23,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏首日付费金额', dataIndex: 'miniGamePayingAmountD1', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 23,
+                    title: '小游戏首日付费金额', dataIndex: 'miniGamePayingAmountD1', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 24,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '小游戏3日付费金额', dataIndex: 'miniGamePayingAmountD3', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 24,
+                    title: '小游戏3日付费金额', dataIndex: 'miniGamePayingAmountD3', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 85, sorter: true, default: 25,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -336,7 +337,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     align: 'center',
                     width: 70,
                     sorter: true,
-                    default: 29,
+                    default: 30,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -344,7 +345,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 60, sorter: true, default: 31,
+                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 60, sorter: true, default: 32,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -356,7 +357,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 30,
+                    title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 31,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -364,7 +365,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 60, sorter: true, default: 32,
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 60, sorter: true, default: 33,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -376,7 +377,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true, default: 33,
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true, default: 34,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -393,15 +394,15 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '付费数据',
             data: [
                 {
-                    title: '首日充值次数', tips: "新增付费次数(首次注册并充值的总次数)", dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 80, sorter: true, className: 'payDataBackColorClass', default: 25,
+                    title: '首日充值次数', tips: "新增付费次数(首次注册并充值的总次数)", dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 80, sorter: true, className: 'payDataBackColorClass', default: 26,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日充值人数', tips: '新增付费人数(首次注册并充值人数)', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 80, sorter: true, className: 'payDataBackColorClass', default: 26,
+                    title: '首日充值人数', tips: '新增付费人数(首次注册并充值人数)', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 80, sorter: true, className: 'payDataBackColorClass', default: 27,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日充值金额', tips: '新增付费金额(首次注册并充值金额)', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 90, sorter: true, className: 'payDataBackColorClass', default: 27,
+                    title: '首日充值金额', tips: '新增付费金额(首次注册并充值金额)', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 90, sorter: true, className: 'payDataBackColorClass', default: 28,
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -433,11 +434,11 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 65, sorter: true, default: 34, className: 'payDataBackColorClass',
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 65, sorter: true, default: 35, className: 'payDataBackColorClass',
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '24小时ROI', dataIndex: 'twentyFourHoursRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 35, className: 'payDataBackColorClass',
+                    title: '24小时ROI', dataIndex: 'twentyFourHoursRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 36, className: 'payDataBackColorClass',
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -449,7 +450,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '首日充值成本', tips: '新增付费成本(首次注册并充值的用户成本)', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, default: 28, className: 'payDataBackColorClass',
+                    title: '首日充值成本', tips: '新增付费成本(首次注册并充值的用户成本)', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, default: 29, className: 'payDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -461,7 +462,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '首日付费用户ARPPU', tips: '首日充值金额/首日充值人数', dataIndex: 'firstNewUserArppu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 37, className: 'payDataBackColorClass',
+                    title: '首日付费用户ARPPU', tips: '首日充值金额/首日充值人数', dataIndex: 'firstNewUserArppu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 38, className: 'payDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -549,7 +550,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 36, className: 'payDataBackColorClass',
+                    title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 37, className: 'payDataBackColorClass',
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -557,15 +558,15 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '至今客单价', dataIndex: 'newUserTotalAvgPrice', label: '付费数据', align: 'center', width: 60, default: 38, sorter: true, className: 'payDataBackColorClass',
+                    title: '至今客单价', dataIndex: 'newUserTotalAvgPrice', label: '付费数据', align: 'center', width: 60, default: 39, sorter: true, className: 'payDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '每日扣单数', dataIndex: 'subOrderNum', label: '付费数据', align: 'center', width: 60, sorter: true, default: 39, className: 'payDataBackColorClass',
+                    title: '每日扣单数', dataIndex: 'subOrderNum', label: '付费数据', align: 'center', width: 60, sorter: true, default: 40, className: 'payDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '每日扣单金额', dataIndex: 'subOrderAmount', label: '付费数据', align: 'center', width: 60, sorter: true, default: 40, className: 'payDataBackColorClass',
+                    title: '每日扣单金额', dataIndex: 'subOrderAmount', label: '付费数据', align: 'center', width: 60, sorter: true, default: 41, className: 'payDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
@@ -587,7 +588,7 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
             label: '操作',
             data: [
                 {
-                    title: '操作', dataIndex: 'cz', label: '操作', align: 'center', width: 150, default: 41,
+                    title: '操作', dataIndex: 'cz', label: '操作', align: 'center', width: 150, default: 42,
                     render: (_: number, b: any) => {
                         if (b?.accountName === '总计') return '--'
                         return <Space>
@@ -603,6 +604,20 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                         </Space>
                     }
                 },
+                {
+                    title: '启停',
+                    dataIndex: 'configuredStatus', 
+                    label: '操作', 
+                    align: 'center', 
+                    width: 40, 
+                    default: 1,
+                    render: (a: string, b: any) => {
+                        if (b?.accountName === '总计') {
+                            return '--'
+                        }
+                        return <SwitchStatus configuredStatus={a} isDeleted={b?.isDeleted} adgroupId={b?.promotionId} onChange={onChange} />
+                    }
+                }
             ]
         }
     ]

+ 1 - 0
src/pages/gameDataStatistics/components/TableData/index.tsx

@@ -374,6 +374,7 @@ const Tab = React.memo((props: any) => {
                     current={page}
                     pageSize={pageSize}
                     loading={ajax?.loading}
+                    rowSelection={rowSelection}
                     className={`all_table header_table_body header_table_body_${ran} ${className ? className : ''}`}
                     sortDirections={['ascend', 'descend', null]}
                     handelResize={((columns: any) => handelResize(columns, 'antd'))}

+ 1 - 0
src/pages/gameDataStatistics/roleOperate/roleRechargeRanking/index.tsx

@@ -137,6 +137,7 @@ const RoleRechargeRanking: React.FC = () => {
                 isGsId
                 isVipLevel
                 isServerIds
+                isIsMergeServer
             />}
             scroll={{ x: 1000, y: 600 }}
             isVirtually={false}

+ 52 - 1
src/services/gameData/adlist.ts

@@ -1,5 +1,5 @@
 import { request } from 'umi';
-import { api } from '../api';
+import { api, erpApi } from '../api';
 import { Paging, SortProps } from './rankingList';
 let wapi = api + '/gameData'
 
@@ -120,4 +120,55 @@ export async function getPromotionDataTencentDayTotalApi(data: PromotionDataDay)
         method: 'POST',
         data
     });
+}
+
+export interface EditAdqAdgroupsProps {
+    /** 广告组id列表 */
+    adgroupIds: number[],
+    /** 广告名称 */
+    adgroupName?: string,
+    /** 出价 */
+    adgroupsUpdateBidAmountDTO?: {
+        bidAmount: number,  // 出价
+        bidMode: string,    // 出价方式
+        bidStrategy: string,// 出价策略
+        optimizationGoal: string,  // 出价目标
+    },
+    /** 排期 */
+    adgroupsUpdateDatetimeDTO?: {
+        beginDate: string,
+        endDate?: string,
+        firstDayBeginTime?: string,
+        timeSeries?: string
+    },
+    /** 深度优化 */
+    deepConversionSpec?: {
+        deepConversionType: string,
+        deepConversionBehaviorSpec?: {
+            bidAmount: number,
+            goal: string
+        },
+        deepConversionWorthAdvancedSpec?: {
+            expectedRoi: number,
+            goal: string
+        },
+        deepConversionWorthSpec?: {
+            expectedRoi: number,
+            goal: string
+        }
+    },
+    /** 启停状态 */
+    configuredStatus?: string
+}
+
+/**
+ * 腾讯广告启停
+ * @param data 
+ * @returns 
+ */
+export async function newEditAdqAdgroupsDataApi(data: EditAdqAdgroupsProps) {
+    return request(erpApi + `/adq/adgroups/configStatus/update/batch`, {
+        method: 'POST',
+        data
+    });
 }