wjx 1 year ago
parent
commit
8e5f851e9b

+ 18 - 0
src/components/QueryForm/const.tsx

@@ -33,6 +33,9 @@ export enum TYPE {
     'BYTE' = '头条'
 }
 
+/**
+ * 游戏类型
+ */
 export const gameClassifyEnum = {
     '1': 'APP',
     '2': '抖音小游戏',
@@ -42,9 +45,24 @@ export const gameClassifyEnum = {
     '6': '微信小游戏'
 }
 
+/**
+ * 支付状态
+ */
 export const PayStatus = {
     '0': <Badge status="default" text="预下单" />,
     '1': <Badge status="processing" text="待支付" />,
     '2': <Badge status="success" text="支付成功" />,
     '3': <Badge status="error" text="已取消" />,
+}
+
+/**
+ * 支付方式
+ */
+export const PayType = {
+    '1': '支付宝',
+    '2': '微信',
+    '3': '米大师',
+    'alipay': '支付宝',
+    'wxpay': '微信支付',
+    'mpay': '米大师'
 }

+ 5 - 5
src/global.less

@@ -89,20 +89,20 @@ select:-webkit-autofill {
 
 ::-webkit-scrollbar {
   // display: none; /* Chrome Safari */
-  width: 6px;
-  height: 8px;
+  width: 2px;
+  height: 2px;
 }
 
 ::-webkit-scrollbar-thumb {
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
+  border-radius: 1px;
+  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0);
   background-color: #ddd;
   background: rgba(0, 0, 0, 0);
 }
 
 :hover::-webkit-scrollbar-thumb {
   background: rgba(82, 82, 82, 0.3);
-  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
+  -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
 }
 
 #notificationPop {

+ 3 - 3
src/pages/gameDataStatistics/components/TableData/index.tsx

@@ -67,7 +67,7 @@ function TableData(props: Prosp) {
     /*************************/
 
     useEffect(() => {
-        if (isZj && originalColumns.length > 0) {
+        if (originalColumns.length > 0) {
             if (sortData?.field && sortData.order) {
                 setNewColumns(originalColumns.map((item: any) => {
                     if (item.dataIndex === sortData?.field) {
@@ -82,7 +82,7 @@ function TableData(props: Prosp) {
                 }))
             }
         }
-    }, [originalColumns, sortData, isZj])
+    }, [originalColumns, sortData])
 
     const { run: runSet } = useThrottleFn((newArr, newConfig, fixedData) => {
         console.log('设置配置改变重新赋值')
@@ -119,7 +119,7 @@ function TableData(props: Prosp) {
                 }
             })
             setOriginalColumns(c)
-            setNewColumns(c)
+            // setNewColumns(c)
             // setNewColumns(newArr.map((newItem: any, index: number) => {
             //     let oldItem = newConfig.find((c: { dataIndex: any }) => c.dataIndex === newItem.dataIndex)
             //     if (newItem?.width !== oldItem?.width) {

+ 1 - 1
src/pages/gameDataStatistics/order/index.tsx

@@ -11,7 +11,7 @@ import { getPresets } from "@/components/QueryForm/const"
 const Order: React.FC = () => {
 
     /***************************/
-    const [queryForm, setQueryForm] = useState<OrderListType>({ pageNum: 1, pageSize: 100, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<OrderListType>({ pageNum: 1, pageSize: 100, sourceSystem: 'ZX_ONE', sortFiled: 'orderCreateTime', sortType: 'desc' })
     const getOrderList = useAjax((params) => getOrderListApi(params))
     /***************************/
 

+ 7 - 7
src/pages/gameDataStatistics/order/tableConfig.tsx

@@ -1,4 +1,4 @@
-import { PayStatus, gameClassifyEnum } from "@/components/QueryForm/const"
+import { PayStatus, PayType, gameClassifyEnum } from "@/components/QueryForm/const"
 import WidthEllipsis from "@/components/widthEllipsis"
 import { Statistic } from "antd"
 import React from "react"
@@ -32,7 +32,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '玩家注册时间', dataIndex: 'regTime', label: '订单明细', align: 'center', width: 135, default: 7,
+                    title: '玩家注册时间', dataIndex: 'regTime', label: '订单明细', align: 'center', width: 135, default: 7, sorter: true,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
@@ -80,11 +80,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '订单金额', dataIndex: 'amount', label: '订单明细', align: 'center', width: 80, default: 16,
+                    title: '订单金额', dataIndex: 'amount', label: '订单明细', align: 'center', width: 80, default: 16, sorter: true,
                     render: (a: any) => <Statistic value={a || 0} precision={2} />
                 },
                 {
-                    title: '订单实付金额', dataIndex: 'realAmount', label: '订单明细', align: 'center', width: 80, default: 17,
+                    title: '订单实付金额', dataIndex: 'realAmount', label: '订单明细', align: 'center', width: 80, default: 17, sorter: true,
                     render: (a: any) => <Statistic value={a || 0} precision={2} />
                 },
                 {
@@ -93,7 +93,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                 },
                 {
                     title: '支付方式', dataIndex: 'payway', label: '订单明细', align: 'center', width: 65, default: 19,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    render: (a: string, b: any) => (<WidthEllipsis value={PayType[a]} />)
                 },
                 {
                     title: '支付场景', dataIndex: 'payScene', label: '订单明细', align: 'center', width: 95, default: 20,
@@ -125,11 +125,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '下单时间', dataIndex: 'orderCreateTime', label: '订单明细', align: 'center', width: 135, default: 28,
+                    title: '下单时间', dataIndex: 'orderCreateTime', label: '订单明细', align: 'center', width: 135, default: 28, sorter: true,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '支付时间', dataIndex: 'payTime', label: '订单明细', align: 'center', width: 135, default: 29,
+                    title: '支付时间', dataIndex: 'payTime', label: '订单明细', align: 'center', width: 135, default: 29, sorter: true,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {

+ 2 - 2
src/services/gameData/order.ts

@@ -1,6 +1,6 @@
 import { request } from 'umi';
 import { api } from '../api';
-import { Paging } from './rankingList';
+import { Paging, SortProps } from './rankingList';
 let wapi = api + '/gameData'
 
 /**
@@ -8,7 +8,7 @@ let wapi = api + '/gameData'
  * @param data 
  * @returns 
  */
-export interface OrderListType extends Paging {
+export interface OrderListType extends Paging, SortProps {
     // 广告账号
     accountId?: string,
     // 归属渠道ID