wjx 1 неделя назад
Родитель
Сommit
faa1985c6f

+ 4 - 1
src/pages/iaaData/novel/tencent/appEveryDayData/index.tsx

@@ -1,4 +1,4 @@
-import { getNovelAppListApi, getNovelAppTotalApi, GetNovelPutUserListProps } from "@/services/iaaData";
+import { downloadNovelAppListApi, getNovelAppListApi, getNovelAppTotalApi, GetNovelPutUserListProps } from "@/services/iaaData";
 import React, { useEffect, useState } from "react"
 import { useModel } from "umi";
 import moment from "moment";
@@ -6,6 +6,7 @@ import { useAjax } from "@/Hook/useAjax";
 import TablePro from "@/components/TablePro";
 import columns12 from "./tableConfig";
 import QueryFormNovel from "@/components/QueryForm/queryFormNovel";
+import DownloadExcel from "@/components/DownloadExcel";
 
 /**
  * 应用每日数据
@@ -25,6 +26,7 @@ const AppEveryDayData: React.FC<{ configName?: string }> = ({ configName }) => {
 
     const getNovelAppList = useAjax((params) => getNovelAppListApi(params))
     const getNovelAppTotal = useAjax((params) => getNovelAppTotalApi(params))
+    const downloadNovelAppList = useAjax((params) => downloadNovelAppListApi(params))
     /****************************************/
 
     useEffect(() => {
@@ -48,6 +50,7 @@ const AppEveryDayData: React.FC<{ configName?: string }> = ({ configName }) => {
 
     return <div>
         <TablePro
+            czChild={(initialState && initialState.iaaApp && initialState.productType) && <DownloadExcel api={downloadNovelAppList} querys={{ ...queryForm, appId: initialState.iaaApp, productType: initialState.productType }} />}
             leftChild={<QueryFormNovel
                 initialValues={{ day1: [moment(), moment()] }}
                 day1={{ placeholder: ['消耗日期开始', '消耗日期结束'] }}

+ 42 - 42
src/pages/iaaData/novel/tencent/pitcherEveryDayGroup/tableConfig.tsx

@@ -9,28 +9,28 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
         {
             label: '基础信息',
             data: [
-                {
-                    title: '应用', dataIndex: 'appName', label: '基础信息', align: 'center', width: 120, default: 1,
-                    render: (a: string) => (<WidthEllipsis value={a} />)
-                },
-                {
-                    title: '应用ID', dataIndex: 'appId', label: '基础信息', align: 'center', width: 80,
-                    render: (a: string) => (<WidthEllipsis value={a} />)
-                },
-                {
-                    title: '小程序名称', dataIndex: 'mpName', label: '基础信息', align: 'center', width: 85, default: 2,
-                    render: (a: string) => (<WidthEllipsis value={a} />)
-                },
+                // {
+                //     title: '应用', dataIndex: 'appName', label: '基础信息', align: 'center', width: 120, default: 1,
+                //     render: (a: string) => (<WidthEllipsis value={a} />)
+                // },
+                // {
+                //     title: '应用ID', dataIndex: 'appId', label: '基础信息', align: 'center', width: 80,
+                //     render: (a: string) => (<WidthEllipsis value={a} />)
+                // },
+                // {
+                //     title: '小程序名称', dataIndex: 'mpName', label: '基础信息', align: 'center', width: 85, default: 2,
+                //     render: (a: string) => (<WidthEllipsis value={a} />)
+                // },
                 {
                     title: '小程序ID', dataIndex: 'mpId', label: '基础信息', align: 'center', width: 80,
                     render: (a: string) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投手名称', dataIndex: 'pitcherName', label: '基础信息', align: 'center', width: 80, default: 3,
+                    title: '投手名称', dataIndex: 'pitcherName', label: '基础信息', align: 'center', width: 80, default: 1,
                     render: (a: string) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '每日消耗', dataIndex: 'todayCost', label: '基础信息', align: 'right', width: 85, default: 4, sorter: true,
+                    title: '每日消耗', dataIndex: 'todayCost', label: '基础信息', align: 'right', width: 85, default: 2, sorter: true,
                     className: 'padding_0',
                     render: (a: number) => <div style={{ height: 25.5, position: 'relative' }}>
                         <Progress
@@ -46,15 +46,15 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     </div>
                 },
                 {
-                    title: '推广广告账号数量', dataIndex: 'acountCount', label: '基础信息', align: 'center', width: 80, default: 5, sorter: true,
+                    title: '推广广告账号数量', dataIndex: 'acountCount', label: '基础信息', align: 'center', width: 80, default: 3, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '推广广告数量', dataIndex: 'adgroupCount', label: '基础信息', align: 'center', width: 80, default: 6, sorter: true,
+                    title: '推广广告数量', dataIndex: 'adgroupCount', label: '基础信息', align: 'center', width: 80, default: 4, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '每日真实消耗', dataIndex: 'cost', label: '基础信息', align: 'right', width: 95, default: 7, sorter: true,
+                    title: '每日真实消耗', dataIndex: 'cost', label: '基础信息', align: 'right', width: 95, default: 5, sorter: true,
                     className: 'padding_0',
                     render: (a: number) => <div style={{ height: 25.5, position: 'relative' }}>
                         <Progress
@@ -70,7 +70,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     </div>
                 },
                 {
-                    title: '赔付金', dataIndex: 'payout', label: '基础信息', align: 'right', width: 80, default: 8, sorter: true,
+                    title: '赔付金', dataIndex: 'payout', label: '基础信息', align: 'right', width: 80, default: 6, sorter: true,
                     render: (a: number) => <Statistic value={a || 0} precision={2} />
                 },
             ]
@@ -79,35 +79,35 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '广告曝光指标(媒体)',
             data: [
                 {
-                    title: '点击量', dataIndex: 'clickCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, default: 9, sorter: true,
+                    title: '点击量', dataIndex: 'clickCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, default: 7, sorter: true,
                     render: (a: number) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '曝光量', dataIndex: 'viewCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, default: 10, sorter: true,
+                    title: '曝光量', dataIndex: 'viewCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, default: 8, sorter: true,
                     render: (a: number) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告曝光指标(媒体)', align: 'right', width: 65, default: 11, sorter: true,
+                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '广告曝光指标(媒体)', align: 'right', width: 65, default: 9, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '点击率', dataIndex: 'ctr', label: '广告曝光指标(媒体)', align: 'center', width: 70, default: 12, sorter: true,
+                    title: '点击率', dataIndex: 'ctr', label: '广告曝光指标(媒体)', align: 'center', width: 70, default: 10, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '点击均价', dataIndex: 'cpc', label: '广告曝光指标(媒体)', align: 'center', width: 65, default: 13, sorter: true,
+                    title: '点击均价', dataIndex: 'cpc', label: '广告曝光指标(媒体)', align: 'center', width: 65, default: 11, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告曝光指标(媒体)', align: 'center', width: 65, default: 14, sorter: true,
+                    title: '不感兴趣点击次数', dataIndex: 'noInterestCount', label: '广告曝光指标(媒体)', align: 'center', width: 65, default: 12, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '转化量', dataIndex: 'conversionsCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, sorter: true, default: 15,
+                    title: '转化量', dataIndex: 'conversionsCount', label: '广告曝光指标(媒体)', align: 'center', width: 80, sorter: true, default: 13,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '转化成本', dataIndex: 'conversionsCost', label: '广告曝光指标(媒体)', align: 'right', width: 65, sorter: true, default: 16,
+                    title: '转化成本', dataIndex: 'conversionsCost', label: '广告曝光指标(媒体)', align: 'right', width: 65, sorter: true, default: 14,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
             ]
@@ -116,35 +116,35 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '广告转化指标(媒体)',
             data: [
                 {
-                    title: '注册人数', dataIndex: 'regDedupPv', label: '广告转化指标(媒体)', width: 65, align: 'center', sorter: true, default: 17,
+                    title: '注册人数', dataIndex: 'regDedupPv', label: '广告转化指标(媒体)', width: 65, align: 'center', sorter: true, default: 15,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '注册次数', dataIndex: 'regPv', label: '广告转化指标(媒体)', align: 'center', width: 80, sorter: true, default: 18,
+                    title: '注册次数', dataIndex: 'regPv', label: '广告转化指标(媒体)', align: 'center', width: 80, sorter: true, default: 16,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '注册成本(人数)', dataIndex: 'regDedupCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 19,
+                    title: '注册成本(人数)', dataIndex: 'regDedupCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 17,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '注册成本(次数)', dataIndex: 'regCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 20,
+                    title: '注册成本(次数)', dataIndex: 'regCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 18,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '注册率', dataIndex: 'regRate', label: '广告转化指标(媒体)', align: 'center', width: 70, default: 21, sorter: true,
+                    title: '注册率', dataIndex: 'regRate', label: '广告转化指标(媒体)', align: 'center', width: 70, default: 19, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '注册人数(平台上报+广告主上报)', dataIndex: 'regAllDedupPv', label: '广告转化指标(媒体)', align: 'center', width: 110, sorter: true, default: 22,
+                    title: '注册人数(平台上报+广告主上报)', dataIndex: 'regAllDedupPv', label: '广告转化指标(媒体)', align: 'center', width: 110, sorter: true, default: 20,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '注册成本(平台上报+广告主上报)', dataIndex: 'regCostPla', label: '广告转化指标(媒体)', align: 'right', width: 110, sorter: true, default: 23,
+                    title: '注册成本(平台上报+广告主上报)', dataIndex: 'regCostPla', label: '广告转化指标(媒体)', align: 'right', width: 110, sorter: true, default: 21,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '注册率(平台上报+广告主上报)', dataIndex: 'regClickRatePla', label: '广告转化指标(媒体)', align: 'center', width: 110, default: 24, sorter: true,
+                    title: '注册率(平台上报+广告主上报)', dataIndex: 'regClickRatePla', label: '广告转化指标(媒体)', align: 'center', width: 110, default: 22, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
             ]
@@ -169,7 +169,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '激活首日广告变现ROI', dataIndex: 'incomeRoi1', label: '广告变现指标(媒体)', align: 'center', width: 85, sorter: true, default: 25,
+                    title: '激活首日广告变现ROI', dataIndex: 'incomeRoi1', label: '广告变现指标(媒体)', align: 'center', width: 85, sorter: true, default: 23,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -189,7 +189,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '激活首24小时广告变现ROI', dataIndex: 'incomeRoi24h', label: '广告变现指标(媒体)', align: 'center', width: 90, sorter: true, default: 26,
+                    title: '激活首24小时广告变现ROI', dataIndex: 'incomeRoi24h', label: '广告变现指标(媒体)', align: 'center', width: 90, sorter: true, default: 24,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -217,7 +217,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '激活3日广告变现ROI', dataIndex: 'incomeRoi3', label: '广告变现指标(媒体)', align: 'center', width: 75, sorter: true, default: 27,
+                    title: '激活3日广告变现ROI', dataIndex: 'incomeRoi3', label: '广告变现指标(媒体)', align: 'center', width: 75, sorter: true, default: 25,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -257,23 +257,23 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '广告变现人数', dataIndex: 'appAdPayingUsers', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 28,
+                    title: '广告变现人数', dataIndex: 'appAdPayingUsers', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 26,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '广告变现成本', dataIndex: 'appAdPayingCost', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 29,
+                    title: '广告变现成本', dataIndex: 'appAdPayingCost', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 27,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '广告变现金额', dataIndex: 'adMonetizationAmount', label: '广告变现指标(媒体)', align: 'right', width: 90, sorter: true, default: 30,
+                    title: '广告变现金额', dataIndex: 'adMonetizationAmount', label: '广告变现指标(媒体)', align: 'right', width: 90, sorter: true, default: 28,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '广告变现ARPPU', dataIndex: 'adMonetizationArppu', label: '广告变现指标(媒体)', width: 70, align: 'center', sorter: true, default: 31,
+                    title: '广告变现ARPPU', dataIndex: 'adMonetizationArppu', label: '广告变现指标(媒体)', width: 70, align: 'center', sorter: true, default: 29,
                     render: (a: string) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '广告变现ROI', dataIndex: 'adMonetizationRoi', label: '广告变现指标(媒体)', align: 'center', width: 70, sorter: true, default: 32,
+                    title: '广告变现ROI', dataIndex: 'adMonetizationRoi', label: '广告变现指标(媒体)', align: 'center', width: 70, sorter: true, default: 30,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 }
             ]

+ 13 - 6
src/pages/iaaSystem/manage/useApp/index.tsx

@@ -1,7 +1,7 @@
 import { useAjax } from "@/Hook/useAjax"
-import { getAppAllApi } from "@/services/iaaSystem/application"
+import { getApp1ListApi, getAppAllApi, getCpAllListApi } from "@/services/iaaSystem/application"
 import ProTable from "@ant-design/pro-table"
-import React from "react"
+import React, { useEffect, useState } from "react"
 import tableConfig from "./tableConfig"
 
 
@@ -13,21 +13,28 @@ const UseApp: React.FC = () => {
 
 
     /********************************/
-    const getAppAll = useAjax(() => getAppAllApi(), { type: 'noPage' })
+    const getApp1List = useAjax((params) => getApp1ListApi(params), { type: 'table' })
+    const getCpAllList = useAjax(() => getCpAllListApi())
     /********************************/
 
+    useEffect(() => {
+        getCpAllList.run()
+    }, [])
+
     return <>
         <ProTable<any>
-            columns={tableConfig()}
+            columns={tableConfig(getCpAllList?.data?.data || {})}
             cardBordered
             request={async (params) => {
-                return await getAppAll.run(params)
+                return await getApp1List.run(params)
             }}
             editable={{
                 type: 'multiple',
             }}
             rowKey="id"
-            search={false}
+            search={{
+                labelWidth: 'auto',
+            }}
             headerTitle={<strong>应用管理</strong>}
         />
     </>

+ 10 - 5
src/pages/iaaSystem/manage/useApp/tableConfig.tsx

@@ -5,7 +5,7 @@ import React from "react";
 import { APPTYPE } from "../const";
 
 
-const tableConfig = () => {
+const tableConfig = (cpList: any) => {
 
     const columns: ProColumns<any>[] = [
         {
@@ -20,7 +20,6 @@ const tableConfig = () => {
             title: '应用',
             dataIndex: 'name',
             key: 'name',
-            search: false,
             width: 250,
             render(_, entity, index, action) {
                 return <Space>
@@ -46,6 +45,15 @@ const tableConfig = () => {
             align: 'center',
             width: 80
         },
+        {
+            title: 'CP',
+            dataIndex: 'cpId',
+            hideInTable: true,
+            valueEnum: cpList,
+            fieldProps: {
+                showSearch: true
+            }
+        },
         {
             title: '应用标识',
             key: 'appKey',
@@ -73,7 +81,6 @@ const tableConfig = () => {
             title: '应用类型',
             key: 'appType',
             dataIndex: 'appType',
-            search: false,
             width: 90,
             align: 'center',
             valueEnum: APPTYPE
@@ -82,7 +89,6 @@ const tableConfig = () => {
             title: '业务类型',
             key: 'productType',
             dataIndex: 'productType',
-            search: false,
             width: 90,
             align: 'center',
             valueEnum: {
@@ -95,7 +101,6 @@ const tableConfig = () => {
             title: '媒体平台',
             key: 'mediaPlatform',
             dataIndex: 'mediaPlatform',
-            search: false,
             width: 90,
             align: 'center',
             valueEnum: {

+ 13 - 0
src/services/iaaData/index.ts

@@ -640,6 +640,19 @@ export async function getNovelAppTotalApi(data: GetNovelAppListProps) {
     });
 }
 
+/**
+ * 下载
+ * @param data 
+ * @returns 
+ */
+export async function downloadNovelAppListApi(data: GetNovelAppListProps) {
+    return request(`${wapi}/monitor/novel/app/listOfPage/excel`, {
+        method: 'POST',
+        data,
+        responseType: 'blob'
+    })
+}
+
 export interface GetByteAppTrendRoiListApi extends Paging, SortProps {
     costDayBegin?: string
     costDayEnd?: string

+ 21 - 0
src/services/iaaSystem/application.ts

@@ -62,6 +62,27 @@ export async function getAppAllApi() {
     });
 }
 
+/**
+ * 查询系统所有应用列表 分页
+ * @returns 
+ */
+export async function getApp1ListApi(data: any) {
+    return request(iaaApi + `/app/listOfPage`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * cp
+ * @returns 
+ */
+export async function getCpAllListApi() {
+    return request(iaaApi + `/app/cp/all/map`, {
+        method: 'GET'
+    });
+}
+
 
 /**
  * 查询应用授权成员列表