wjx 6 kuukautta sitten
vanhempi
commit
e8367b6800

+ 20 - 0
config/routerConfig.ts

@@ -126,6 +126,11 @@ const iaaGameData = [
         path: '/iaaData/game/tencent',
         name: '腾讯',
         routes: [
+            {
+                path: '/iaaData/game/tencent/home',
+                name: '首页',
+                component: './iaaData/game/tencent/home',
+            },
             {
                 path: '/iaaData/game/tencent/adList',
                 name: '广告列表',
@@ -167,6 +172,11 @@ const iaaGameData = [
         path: '/iaaData/game/ocenaengine',
         name: '头条',
         routes: [
+            {
+                path: '/iaaData/game/ocenaengine/home',
+                name: '首页',
+                component: './iaaData/game/ocenaengine/home'
+            },
             {
                 path: '/iaaData/game/ocenaengine/adList',
                 name: '广告列表',
@@ -202,6 +212,11 @@ const iaaNovelData = [
         path: '/iaaData/novel/tencent',
         name: '腾讯',
         routes: [
+            {
+                path: '/iaaData/novel/tencent/home',
+                name: '首页',
+                component: './iaaData/novel/tencent/home',
+            },
             {
                 path: '/iaaData/novel/tencent/adList',
                 name: '广告列表',
@@ -232,6 +247,11 @@ const iaaPlayletData = [
         path: '/iaaData/playlet/tencent',
         name: '腾讯',
         routes: [
+            {
+                path: '/iaaData/playlet/tencent/home',
+                name: '首页',
+                component: './iaaData/playlet/tencent/home',
+            },
             {
                 path: '/iaaData/playlet/tencent/adList',
                 name: '广告列表',

+ 75 - 0
src/pages/iaaData/game/ocenaengine/home/index.tsx

@@ -0,0 +1,75 @@
+import QueryForm from "@/components/QueryForm"
+import { Card, Space, Spin } from "antd"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { useModel } from "umi"
+import { useAjax } from "@/Hook/useAjax"
+import { getByteHomePageApi } from "@/services/iaaData"
+import useEcharts from "@/Hook/useEcharts"
+
+
+/**
+ * 头条首页
+ * @returns 
+ */
+const Home: React.FC = () => {
+
+
+    /********************************************/
+    const { initialState } = useModel('@@initialState');
+    const [queryForm, setQueryForm] = useState<{ costDayBegin: string, costDayEnd: string }>({
+        costDayBegin: moment().subtract(30, 'days').format('YYYY-MM-DD'),
+        costDayEnd: moment().format('YYYY-MM-DD'),
+    })
+    const { LineMonitor } = useEcharts()
+    const [lineDis, setLineDis] = useState<HOME.ConsumptionData[]>([])
+
+    const getByteHomePage = useAjax((params) => getByteHomePageApi(params))
+    /********************************************/
+
+    useEffect(() => {
+        if (initialState?.iaaApp) {
+            const [appId, productType] = initialState.iaaApp.split('||')
+            getByteHomePage.run({ ...queryForm, appId, productType }).then(res => {
+                if (res?.data) {
+                    let newCostLine: HOME.ConsumptionData = { legendName: '每日真实消耗' }
+                    let newAdMonRevenue: HOME.ConsumptionData = { legendName: '广告收入(广告位总数据(账面))' }
+                    res.data.forEach((item: { dt: string, costDruth: number, totalRealCost: number }) => {
+                        newCostLine[item.dt as any] = item.costDruth
+                        newAdMonRevenue[item.dt as any] = item.totalRealCost
+                    })
+                    setLineDis([newCostLine, newAdMonRevenue])
+                }
+            })
+        }
+
+    }, [queryForm, initialState?.iaaApp])
+
+
+    return <Space direction="vertical" style={{ width: '100%' }}>
+        <Card bodyStyle={{ padding: 10 }}>
+            <QueryForm
+                initialValues={{ day3: [moment().subtract(30, 'days'), moment()] }}
+                day3={{ placeholder: ['消耗日期开始', '消耗日期结束'], allowClear: false }}
+                onChange={(data: any) => {
+                    const { day3, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    if (day3 && day3?.length === 2) {
+                        newQueryForm['costDayBegin'] = moment(day3[0]).format('YYYY-MM-DD')
+                        newQueryForm['costDayEnd'] = moment(day3[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['costDayBegin']
+                        delete newQueryForm['costDayEnd']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />
+        </Card>
+        <Card bodyStyle={{ padding: 10, height: 'calc(100vh - 160px)', display: 'flex', justifyContent: 'center', alignContent: 'center' }}>
+            {getByteHomePage?.loading ? <Spin /> : <LineMonitor style={{ width: '100%', height: '100%' }} series smooth data={lineDis} />}
+        </Card>
+    </Space>
+}
+
+export default Home

+ 75 - 0
src/pages/iaaData/game/tencent/home/index.tsx

@@ -0,0 +1,75 @@
+import QueryForm from "@/components/QueryForm"
+import { Card, Space, Spin } from "antd"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { useModel } from "umi"
+import { useAjax } from "@/Hook/useAjax"
+import { getGDTHomePageApi } from "@/services/iaaData"
+import useEcharts from "@/Hook/useEcharts"
+
+
+
+/**
+ * 游戏腾讯 首页
+ * @returns 
+ */
+const Home: React.FC = () => {
+
+    /********************************************/
+    const { initialState } = useModel('@@initialState');
+    const [queryForm, setQueryForm] = useState<{ costDayBegin: string, costDayEnd: string }>({
+        costDayBegin: moment().subtract(30, 'days').format('YYYY-MM-DD'),
+        costDayEnd: moment().format('YYYY-MM-DD'),
+    })
+    const { LineMonitor } = useEcharts()
+    const [lineDis, setLineDis] = useState<HOME.ConsumptionData[]>([])
+
+    const getGDTHomePage = useAjax((params) => getGDTHomePageApi(params))
+    /********************************************/
+
+    useEffect(() => {
+        if (initialState?.iaaApp) {
+            const [appId, productType] = initialState.iaaApp.split('||')
+            getGDTHomePage.run({ ...queryForm, appId, productType }).then(res => {
+                if (res?.data) {
+                    let newCostLine: HOME.ConsumptionData = { legendName: '消耗' }
+                    let newAdMonRevenue: HOME.ConsumptionData = { legendName: '广告变现金额' }
+                    res.data.forEach((item: { dt: string, cost: number, adMonRevenue: number }) => {
+                        newCostLine[item.dt as any] = item.cost
+                        newAdMonRevenue[item.dt as any] = item.adMonRevenue
+                    })
+                    setLineDis([newCostLine, newAdMonRevenue])
+                }
+            })
+        }
+
+    }, [queryForm, initialState?.iaaApp])
+
+
+    return <Space direction="vertical" style={{ width: '100%' }}>
+        <Card bodyStyle={{ padding: 10 }}>
+            <QueryForm
+                initialValues={{ day3: [moment().subtract(30, 'days'), moment()] }}
+                day3={{ placeholder: ['消耗日期开始', '消耗日期结束'], allowClear: false }}
+                onChange={(data: any) => {
+                    const { day3, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    if (day3 && day3?.length === 2) {
+                        newQueryForm['costDayBegin'] = moment(day3[0]).format('YYYY-MM-DD')
+                        newQueryForm['costDayEnd'] = moment(day3[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['costDayBegin']
+                        delete newQueryForm['costDayEnd']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />
+        </Card>
+        <Card bodyStyle={{ padding: 10, height: 'calc(100vh - 160px)', display: 'flex', justifyContent: 'center', alignContent: 'center' }}>
+            {getGDTHomePage?.loading ? <Spin /> : <LineMonitor style={{ width: '100%', height: '100%' }} series smooth data={lineDis} />}
+        </Card>
+    </Space>
+}
+
+export default Home

+ 2 - 2
src/pages/iaaData/novel/tencent/adList/tableConfig.tsx

@@ -16,7 +16,7 @@ function columns12(dayHandle: (data: any) => void, onChange?: () => void): { lab
             data: [
                 {
                     title: '广告账号', dataIndex: 'accountId', label: '广告基本信息', align: 'center', width: 80, default: 2,
-                    render: (a: string) => (<WidthEllipsis value={a} />)
+                    render: (a: string) => (<WidthEllipsis value={a} isCopy />)
                 },
                 {
                     title: '腾讯备注', dataIndex: 'memo', label: '广告基本信息', width: 80, default: 3,
@@ -40,7 +40,7 @@ function columns12(dayHandle: (data: any) => void, onChange?: () => void): { lab
                 },
                 {
                     title: '广告ID', dataIndex: 'adgroupId', label: '广告基本信息', align: 'center', width: 80, default: 7,
-                    render: (a: string) => (<WidthEllipsis value={a} />)
+                    render: (a: string) => (<WidthEllipsis value={a} isCopy />)
                 },
                 {
                     title: '统计日', dataIndex: 'day', label: '广告基本信息', width: 100,

+ 75 - 0
src/pages/iaaData/novel/tencent/home/index.tsx

@@ -0,0 +1,75 @@
+import QueryForm from "@/components/QueryForm"
+import { Card, Space, Spin } from "antd"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { useModel } from "umi"
+import { useAjax } from "@/Hook/useAjax"
+import { getHomePageApi } from "@/services/iaaData"
+import useEcharts from "@/Hook/useEcharts"
+
+
+
+/**
+ * 小说腾讯 首页
+ * @returns 
+ */
+const HomeNovel: React.FC = () => {
+
+    /********************************************/
+    const { initialState } = useModel('@@initialState');
+    const [queryForm, setQueryForm] = useState<{ costDayBegin: string, costDayEnd: string }>({
+        costDayBegin: moment().subtract(30, 'days').format('YYYY-MM-DD'),
+        costDayEnd: moment().format('YYYY-MM-DD'),
+    })
+    const { LineMonitor } = useEcharts()
+    const [lineDis, setLineDis] = useState<HOME.ConsumptionData[]>([])
+
+    const getHomePage = useAjax((params) => getHomePageApi(params))
+    /********************************************/
+
+    useEffect(() => {
+        if (initialState?.iaaApp) {
+            const [appId, productType] = initialState.iaaApp.split('||')
+            getHomePage.run({ ...queryForm, appId, productType }).then(res => {
+                if (res?.data) {
+                    let newCostLine: HOME.ConsumptionData = { legendName: '消耗' }
+                    let newAdMonRevenue: HOME.ConsumptionData = { legendName: '广告变现金额' }
+                    res.data.forEach((item: { day: string, cost: number, adMonetizationAmount: number }) => {
+                        newCostLine[item.day as any] = item.cost
+                        newAdMonRevenue[item.day as any] = item.adMonetizationAmount
+                    })
+                    setLineDis([newCostLine, newAdMonRevenue])
+                }
+            })
+        }
+
+    }, [queryForm, initialState?.iaaApp])
+
+
+    return <Space direction="vertical" style={{ width: '100%' }}>
+        <Card bodyStyle={{ padding: 10 }}>
+            <QueryForm
+                initialValues={{ day3: [moment().subtract(30, 'days'), moment()] }}
+                day3={{ placeholder: ['消耗日期开始', '消耗日期结束'], allowClear: false }}
+                onChange={(data: any) => {
+                    const { day3, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    if (day3 && day3?.length === 2) {
+                        newQueryForm['costDayBegin'] = moment(day3[0]).format('YYYY-MM-DD')
+                        newQueryForm['costDayEnd'] = moment(day3[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['costDayBegin']
+                        delete newQueryForm['costDayEnd']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />
+        </Card>
+        <Card bodyStyle={{ padding: 10, height: 'calc(100vh - 160px)', display: 'flex', justifyContent: 'center', alignContent: 'center' }}>
+            {getHomePage?.loading ? <Spin /> : <LineMonitor style={{ width: '100%', height: '100%' }} series smooth data={lineDis} />}
+        </Card>
+    </Space>
+}
+
+export default HomeNovel

+ 13 - 0
src/pages/iaaData/playlet/tencent/home/index.tsx

@@ -0,0 +1,13 @@
+import HomeNovel from "@/pages/iaaData/novel/tencent/home"
+import React from "react"
+
+/**
+ * 短剧腾讯 首页
+ * @returns 
+ */
+const Home: React.FC = () => {
+
+    return <HomeNovel />
+}
+
+export default Home

+ 7 - 0
src/pages/iaaData/typings.d.ts

@@ -0,0 +1,7 @@
+declare namespace HOME {
+    // 定义数据对象的类型  
+    interface ConsumptionData {
+        [key: number]: number; // 动态键值对,键为数字类型,值为数字类型  
+        legendName: string; // 固定属性,值为字符串类型  
+    }
+}

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

@@ -661,4 +661,51 @@ export async function getByteAppTrendRetainedTotalApi(data: GetByteAppTrendRoiLi
         method: 'POST',
         data
     });
+}
+
+
+export interface HomePageProps {
+    productType: string  // 业务类型
+    appId: string        // 应用
+    costDayBegin: string
+    costDayEnd: string
+}
+
+/**
+ * 游戏腾讯应用首页
+ * @param data 
+ * @returns 
+ */
+export async function getGDTHomePageApi(data: HomePageProps) {
+    return request(wapi + `/monitor/app/gdt/homePage`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+/**
+ * 游戏头条应用首页
+ * @param data 
+ * @returns 
+ */
+export async function getByteHomePageApi(data: HomePageProps) {
+    return request(wapi + `/monitor/byte/app/homePage`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+
+/**
+ * 小说短剧 腾讯应用首页
+ * @param data 
+ * @returns 
+ */
+export async function getHomePageApi(data: HomePageProps) {
+    return request(wapi + `/monitor/novel/app/homePage`, {
+        method: 'POST',
+        data
+    });
 }

+ 0 - 2
tsconfig.json

@@ -1,6 +1,5 @@
 {
   "compilerOptions": {
-    "ignoreDeprecations": "5.0",
     "outDir": "build/dist",
     "module": "esnext",
     "target": "esnext",
@@ -12,7 +11,6 @@
     "moduleResolution": "node",
     "forceConsistentCasingInFileNames": true,
     "noImplicitReturns": true,
-    "suppressImplicitAnyIndexErrors": true,
     "noUnusedLocals": true,
     "allowJs": true,
     "skipLibCheck": true,