Эх сурвалжийг харах

历史数据统计-商家统计

ssvfdn 3 сар өмнө
parent
commit
2ad484b3d5

+ 15 - 0
apps/web-antd/src/api/data_statistics/history_agent.ts

@@ -0,0 +1,15 @@
+import {requestClient} from "#/api/request";
+
+interface ApiResultListData {
+    data: Object;
+    status: number;
+    total: number;
+    list: Array<any>;
+}
+
+/**
+ * 获取转账记录列表
+ */
+export async function getHistoryAgentList() {
+    return requestClient.get<ApiResultListData>('/merchant_statis/history');
+}

+ 2 - 0
apps/web-antd/src/locales/langs/zh-CN/data_statistics.json

@@ -3,6 +3,8 @@
     "daily_title": "每日数据",
     "agent_title": "商户每日数据",
     "game_title": "游戏每日数据",
+    "history_title": "历史数据统计",
+    "history_agent_title": "商户统计",
     "search": {
 
     },

+ 21 - 0
apps/web-antd/src/router/routes/modules/data_statistics.ts

@@ -33,6 +33,27 @@ const routes: RouteRecordRaw[] = [
                         component: () => import('#/views/data_statistics/daily/agent/index.vue'),
                     },
                 ]
+            },
+            {
+                meta: {
+                    title: $t('data_statistics.history_title'),
+                    icon:'solar:sort-by-time-outline',
+                    keepAlive: true
+                },
+                name: 'History',
+                path: '/data-statistics/history',
+                children: [
+                    {
+                        meta: {
+                            title: $t('data_statistics.history_agent_title'),
+                            // icon:'solar:file-text-outline',
+                            keepAlive: true
+                        },
+                        name: 'HistoryAgent',
+                        path: '/data-statistics/history/agent',
+                        component: () => import('#/views/data_statistics/history/agent/index.vue'),
+                    },
+                ]
             }
         ],
     },

+ 80 - 0
apps/web-antd/src/views/data_statistics/history/agent/index.vue

@@ -0,0 +1,80 @@
+<script setup>
+import {Page} from "@vben/common-ui";
+import dayjs from "dayjs";
+import {useVbenForm} from "#/adapter/form.js";
+import {$t} from "@vben/locales";
+import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
+import {Avatar, Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
+import {getHistoryAgentList} from "#/api/data_statistics/history_agent.js";
+
+// 列表
+const gridOptions = {
+	border: true,
+	stripe: true,
+	scrollbarConfig: {
+		x: {
+			visible: 'visible'
+		},
+		y: {
+			visible: 'auto'
+		}
+	},
+	columns: [
+		{ fixed: 'left',  title: $t('common.serial'), type: 'seq', width: 50},
+		{ field: 'rtp', title: $t('data_statistics.daily_agent.rtp'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.rtp_desc')}},
+		{ field: 'bet_count', title: $t('data_statistics.daily_agent.bet_count'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_count_desc')}},
+		{ field: 'bet_amount', title: $t('data_statistics.daily_agent.bet_amount'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_amount_desc')}},
+		{ field: 'game_profit', title: $t('data_statistics.daily_agent.game_profit'), width:160, titlePrefix: {'content':$t('data_statistics.daily_agent.game_profit_desc')}, slots:{'default':'game_profit'}},
+		{ field: 'login_users', title: $t('data_statistics.daily_agent.login_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.login_users_desc')}},
+		{ field: 'register_users', title: $t('data_statistics.daily_agent.register_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.register_users_desc')}},
+		{ field: 'bet_users', title: $t('data_statistics.daily_agent.bet_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_users_desc')}},
+		{ field: 'commission_amount', title: $t('data_statistics.daily_agent.commission_amount'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.commission_amount_desc')}},
+		{ field: 'buy_free_bet', title: $t('data_statistics.daily_agent.buy_free_bet'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.buy_free_bet_desc')}},
+		// { field: 'platform_fee', title: $t('data_statistics.daily_agent.platform_fee'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.platform_fee_desc')}},
+	],
+	keepSource: true,
+	proxyConfig: {
+		ajax: {
+			query: async ({ page }) => {
+				const list = await getHistoryAgentList();
+				return {
+					total: list.total,
+					items: list.list
+				}
+			},
+		},
+	},
+	rowConfig: {
+		isHover: true,
+	},
+	toolbarConfig: {
+		custom: true,
+		export: true,
+		// import: true,
+		refresh: true,
+		zoom: true,
+	},
+};
+const [Grid, gridApi] = useVbenVxeGrid({
+	gridOptions,
+});
+</script>
+
+<template>
+	<Page>
+		<Card>
+			<div class="vp-raw w-full">
+				<Grid>
+					<template #game_profit="{ row }">
+						<span style="color:green" v-if="row.game_profit >= 0">{{row.game_profit}}</span>
+						<span style="color:red" v-else>{{row.game_profit}}</span>
+					</template>
+				</Grid>
+			</div>
+		</Card>
+	</Page>
+</template>
+
+<style scoped>
+
+</style>