wjx 1 年之前
父節點
當前提交
94c890c8ba

+ 2 - 2
src/components/QueryForm/index.tsx

@@ -216,7 +216,7 @@ const QueryForm: React.FC<Props> = (props) => {
                 // } else {
                 //     setUserIdList(res)
                 // }
-                setUserIdList(res)
+                setUserIdList(res ? Object.keys(res)?.map(key => ({ userId: key, nickname: res[key] })) : [])
             })
         }
     }, [isSysUserId])
@@ -840,7 +840,7 @@ const QueryForm: React.FC<Props> = (props) => {
 
             {/* 单个充值日期搜索 */}
             {isPayIntervalTime && <Col><Form.Item name='regPayIntervalTime'>
-                <IntervalTime {...isPayIntervalTime}/>
+                <IntervalTime {...isPayIntervalTime} />
             </Form.Item></Col>}
 
             <Col>

+ 1 - 2
src/components/Tables/index.tsx

@@ -165,8 +165,7 @@ function Tables(props: Props) {
                         return style.unfollow
                     }
                 } : rowClassName
-            }
-            }
+            }}
         />
     </div>
 }

+ 38 - 33
src/components/VirtualTable/index.tsx

@@ -1,17 +1,20 @@
 import React, { useEffect, useRef, useState } from "react";
 import "antd/dist/antd.css";
 import "./index.less";
-import { Table } from "antd";
+import { Pagination, Space, Table } from "antd";
 import type { TableProps } from "antd";
 import classNames from "classnames";
 import ResizeObserver from "rc-resize-observer";
 import type { ColumnsType } from "antd/es/table";
 import { VariableSizeGrid as Grid } from "react-window";
 
-const VirtualTable = <RecordType extends object>(
-    props: TableProps<RecordType>
-) => {
-    const { columns, scroll, className } = props;
+interface Props<RecordType extends object> extends TableProps<RecordType> {
+    rowHeight: number
+}
+
+const VirtualTable = <RecordType extends object>(props: Props<RecordType>) => {
+
+    const { columns, scroll, className, rowHeight } = props;
     const [tableWidth, setTableWidth] = useState(0);
 
     //   const widthColumnCount = columns!.filter(({ width }) => !width).length;
@@ -19,7 +22,6 @@ const VirtualTable = <RecordType extends object>(
         if (column.width) {
             return column;
         }
-
         return {
             ...column,
             //   width: Math.floor(tableWidth / widthColumnCount)
@@ -76,7 +78,7 @@ const VirtualTable = <RecordType extends object>(
                 }}
                 height={scroll!.y as number}
                 rowCount={rawData.length}
-                rowHeight={() => 100}
+                rowHeight={() => rowHeight}
                 width={tableWidth}
                 onScroll={({ scrollLeft }: { scrollLeft: number }) => {
                     onScroll({ scrollLeft });
@@ -113,24 +115,22 @@ const VirtualTable = <RecordType extends object>(
         );
     };
 
-    return (
-        <ResizeObserver
-            onResize={({ width }) => {
-                setTableWidth(width);
+    return <ResizeObserver
+        onResize={({ width }) => {
+            setTableWidth(width);
+        }}
+    >
+        <Table
+            {...props}
+            bordered
+            className={`virtual-table ${className ? className : ''}`}
+            columns={mergedColumns}
+            pagination={false}
+            components={{
+                body: renderVirtualList as any
             }}
-        >
-            <Table
-                {...props}
-                bordered
-                className={`virtual-table all_table ${className ? className : ''}`}
-                columns={mergedColumns}
-                pagination={false}
-                components={{
-                    body: renderVirtualList as any
-                }}
-            />
-        </ResizeObserver>
-    );
+        />
+    </ResizeObserver>
 };
 
 // Usage
@@ -139,7 +139,7 @@ const columns: ColumnsType<any> = [
     { title: "B", dataIndex: "key" },
     { title: "C", dataIndex: "key" },
     { title: "D", dataIndex: "key" },
-    { title: "E", dataIndex: "key", width: 200 },
+    { title: "E", dataIndex: "key", width: 50 },
     { title: "F", dataIndex: "key", width: 100 },
     { title: "F", dataIndex: "key", width: 100 },
     { title: "F", dataIndex: "key", width: 100 },
@@ -189,17 +189,22 @@ const columns: ColumnsType<any> = [
     { title: "F", dataIndex: "dd", width: 100 }
 ];
 
-const data = Array.from({ length: 100000 }, (_, key) => ({
+const data = Array.from({ length: 100 }, (_, key) => ({
     key,
     dd: "啊大大撒旦啊实打实大苏打阿斯顿撒打算阿三打撒"
 }));
 
-const App1: React.FC = () => (
-    <VirtualTable
-        columns={columns}
-        dataSource={data}
-        scroll={{ y: 600, x: "100vw" }}
-    />
-);
+const App1: React.FC = () => {
+
+
+    return <Space >
+        <VirtualTable
+            rowHeight={26}
+            columns={columns}
+            dataSource={data}
+            scroll={{ y: 600, x: "100vw" }}
+        />
+    </Space>
+};
 
 export default App1;

+ 4 - 1
src/pages/gameDataStatistics/rankingList/gamer/index.tsx

@@ -44,12 +44,15 @@ const Gamer: React.FC = () => {
                     if (regPayIntervalTime?.length > 0 && (regPayIntervalTime[0] || regPayIntervalTime[1])) {
                         newQueryForm.latestAmountUntilNowTimeMin = regPayIntervalTime[0]
                         newQueryForm.latestAmountUntilNowTimeMax = regPayIntervalTime[1]
+                    } else {
+                        delete newQueryForm.latestAmountUntilNowTimeMin
+                        delete newQueryForm.latestAmountUntilNowTimeMax
                     }
                     setQueryForm({ ...newQueryForm, ...par })
                 }}
                 isSource
                 rechargeDay={{ ranges: getPresetsRanking() }}
-                isPayIntervalTime={{ tips: '最近充值时间距今的间隔时间' }}
+                isPayIntervalTime={{ tips: '最近充值时间距今的间隔时间(分)' }}
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getRechargeUserList}

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

@@ -1,6 +1,6 @@
 
 import { request } from 'umi';
-import { gameApi, api } from '../api';
+import { gameApi } from '../api';
 
 /**
  * 腾讯所有推广账号列表
@@ -39,7 +39,8 @@ export async function getGameChoiceListApi() {
  */
 export async function getSubUserWithSelfListApi() {
     // return request(gameApi + '/erp/user/subUserWithSelf');
-    return request(gameApi + '/erp/gameUserGroup/memberUser');
+    // return request(gameApi + '/erp/gameUserGroup/memberUser');
+    return request(gameApi + '/manage/choice/agent/user/list');
 }
 
 /**