wjx 1 gadu atpakaļ
vecāks
revīzija
ba36f45bdc

+ 15 - 0
src/components/BaseTable/index.less

@@ -1,4 +1,19 @@
 .pagination {
     padding: 16px 0;
     text-align: right;
+}
+
+.BaseTable__table-main {
+    outline: 1px solid #e0e0e0;
+    border-radius: 6px;
+}
+
+.BaseTable__header-row,
+.BaseTable__row {
+    border-bottom: 1px solid #e0e0e0;
+}
+
+.BaseTable__row-cell,
+.BaseTable__header-cell {
+    border-right: 1px solid #e0e0e0;
 }

+ 31 - 19
src/components/BaseTable/index.tsx

@@ -4,8 +4,12 @@ import Table, { Column, ColumnShape } from 'react-base-table'
 import 'react-base-table/styles.css'
 import './index.less'
 import { Pagination } from "antd";
+import { PaginationProps } from "antd/es/pagination";
 
-const BaseTable: React.FC = () => {
+interface Props {
+    pagination?: PaginationProps
+}
+const BaseTable: React.FC<Props> = ({ pagination }) => {
 
     /***************************************/
     const ref = useRef(null);
@@ -118,22 +122,30 @@ const BaseTable: React.FC = () => {
             sortable: true,
         },
         {
-            title: '操作',
-            key: 'action',
-            width: 100,
-            align: Column.Alignment.CENTER,
-            frozen: Column.FrozenDirection.RIGHT,
+            key: 'description',
+            title: 'Description',
+            dataKey: 'description',
+            width: 200,
+            resizable: true,
+            sortable: true,
+        },
+        // {
+        //     title: '操作',
+        //     key: 'action',
+        //     width: 100,
+        //     align: Column.Alignment.CENTER,
+        //     frozen: Column.FrozenDirection.RIGHT,
 
-            cellRenderer: ({ rowData }: any) => (
-                <button
-                    onClick={() => {
+        //     cellRenderer: ({ rowData }: any) => (
+        //         <button
+        //             onClick={() => {
 
-                    }}
-                >
-                    Remove
-                </button>
-            ),
-        },
+        //             }}
+        //         >
+        //             Remove
+        //         </button>
+        //     ),
+        // },
     ]
 
     const defaultData = Array.from({ length: 10000 }, (_, key) => ({
@@ -145,15 +157,15 @@ const BaseTable: React.FC = () => {
         },
         birthday: 222,
         attachments: 111,
-        description: '3333',
         email: '7787@qq.com',
-        country: 'aaasdsad',
+        country: '22',
+        description: '11',
     }));
 
     return <div ref={ref}>
-        <Table fixed columns={columns} data={defaultData} width={size.width || 900} height={600} />
+        <Table  fixed columns={columns} data={defaultData} width={size.width || 900} height={600} rowHeight={26}/>
         <div className="pagination">
-            <Pagination defaultCurrent={6} total={500} />
+            <Pagination {...pagination} />
         </div>
     </div>
 }

+ 9 - 6
src/pages/gameDataStatistics/extensionData/everyday/tableConfig.tsx

@@ -262,7 +262,7 @@ function columns12(rechargeTrendHandle: (data: any) => void): { label: string, f
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 { title: '毛利额', dataIndex: 'grossMargin', label: '付费数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                
+
                 ...roiC,
                 {
                     title: '60日ROI', dataIndex: 'roiDay60', label: '付费数据', align: 'center', width: 70, sorter: true,
@@ -292,10 +292,13 @@ function columns12(rechargeTrendHandle: (data: any) => void): { label: string, f
                     title: '买量用户付费率', dataIndex: 'buyUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
-                { title: '新用户付费比', dataIndex: 'newUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '首日客单价', dataIndex: 'avgFirstUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '买量客单价', dataIndex: 'avgBuyUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '账面客单价', dataIndex: 'avgShowUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                {
+                    title: '新用户付费比', dataIndex: 'newUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                { title: '首日客单价', dataIndex: 'avgFirstUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
+                { title: '买量客单价', dataIndex: 'avgBuyUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
+                { title: '账面客单价', dataIndex: 'avgShowUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 { title: '首日充值成本', dataIndex: 'firstRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 { title: '买量充值成本', dataIndex: 'buyUserRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 { title: '首日充值次数成本', dataIndex: 'firstRechargeCountCost', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
@@ -333,7 +336,7 @@ function columns12(rechargeTrendHandle: (data: any) => void): { label: string, f
             label: '时间区间跨度',
             data: [
                 ...zC,
-                ...Mc, 
+                ...Mc,
                 {
                     title: "总",
                     default: 111,

+ 1 - 1
src/services/gameData/medium.ts

@@ -32,7 +32,7 @@ export async function getMediaPromotionTotalListApi(data: MediaPromotionTotalPro
  * @returns 
  */
 export async function getMediaPromotionTotalSumApi(data: MediaPromotionTotalProps) {
-    return request(wapi + `/media/pitcherGame/dayTotal`, {
+    return request(wapi + `/media/pitcherGame/totalSum`, {
         method: 'POST',
         data
     });