Pārlūkot izejas kodu

输赢,返奖,商户每日。三个走势

ssvfdn 3 mēneši atpakaļ
vecāks
revīzija
25de46f173

BIN
apps/web-antd/dist.zip


+ 17 - 0
apps/web-antd/src/api/data_statistics/trend_agent.ts

@@ -0,0 +1,17 @@
+import {requestClient} from "#/api/request";
+
+interface ApiResultListData {
+    data: Object;
+    status: number;
+    total: number;
+    list: Array<any>;
+}
+
+/**
+ * 获取转账记录列表
+ */
+export async function getTrendAgentDailyList(data:any) {
+    const params = new URLSearchParams(data); // 创建一个新的URLSearchParams对象
+    const queryString = params.toString(); // 转换为查询字符串
+    return requestClient.get<ApiResultListData>('/trend_statis/merchant_daily?' + queryString);
+}

+ 17 - 0
apps/web-antd/src/api/data_statistics/trend_rewards.ts

@@ -0,0 +1,17 @@
+import {requestClient} from "#/api/request";
+
+interface ApiResultListData {
+    data: Object;
+    status: number;
+    total: number;
+    list: Array<any>;
+}
+
+/**
+ * 获取转账记录列表
+ */
+export async function getTrendRewardsList(data:any) {
+    const params = new URLSearchParams(data); // 创建一个新的URLSearchParams对象
+    const queryString = params.toString(); // 转换为查询字符串
+    return requestClient.get<ApiResultListData>('/trend_statis/prize_multiple?' + queryString);
+}

+ 17 - 0
apps/web-antd/src/api/data_statistics/trend_win_lose.ts

@@ -0,0 +1,17 @@
+import {requestClient} from "#/api/request";
+
+interface ApiResultListData {
+    data: Object;
+    status: number;
+    total: number;
+    list: Array<any>;
+}
+
+/**
+ * 获取转账记录列表
+ */
+export async function getTrendWinLoseList(data:any) {
+    const params = new URLSearchParams(data); // 创建一个新的URLSearchParams对象
+    const queryString = params.toString(); // 转换为查询字符串
+    return requestClient.get<ApiResultListData>('/trend_statis/win?' + queryString);
+}

+ 8 - 1
apps/web-antd/src/locales/langs/zh-CN/data_statistics.json

@@ -10,8 +10,15 @@
     "rank_win_title": "赢分榜",
     "rank_lose_title": "输分榜",
     "rank_bet_title": "注单分榜",
+    "trend_title": "走势数据",
+    "trend_win_lose_title": "输赢走势",
+    "trend_rewards_title": "返奖倍数走势",
+    "trend_agent_title": "商户每日走势",
     "search": {
-
+        "data_type": "数据",
+        "total_bet": "注单分数",
+        "bet_count": "注单数",
+        "bet_users": "投注用户"
     },
     "daily_agent": {
         "date": "日期",

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

@@ -75,6 +75,48 @@ const routes: RouteRecordRaw[] = [
                     },
                 ]
             },
+            {
+                meta: {
+                    title: $t('data_statistics.trend_title'),
+                    icon:'solar:chart-square-outline',
+                    keepAlive: true
+                },
+                name: 'Trend',
+                path: '/data-statistics/trend',
+                children: [
+                    {
+                        meta: {
+                            title: $t('data_statistics.trend_win_lose_title'),
+                            // icon:'solar:file-text-outline',
+                            keepAlive: true
+                        },
+                        name: 'TrendWinLose',
+                        path: '/data-statistics/trend/win_lose',
+                        component: () => import('#/views/data_statistics/trend/win_lose/index.vue'),
+                    },
+                    {
+                        meta: {
+                            title: $t('data_statistics.trend_rewards_title'),
+                            // icon:'solar:file-text-outline',
+                            keepAlive: true
+                        },
+                        name: 'TrendRewards',
+                        path: '/data-statistics/trend/rewards',
+                        component: () => import('#/views/data_statistics/trend/rewards/index.vue'),
+                    },
+                    {
+                        meta: {
+                            title: $t('data_statistics.trend_agent_title'),
+                            // icon:'solar:file-text-outline',
+                            keepAlive: true
+                        },
+                        name: 'TrendAgent',
+                        path: '/data-statistics/trend/agent',
+                        component: () => import('#/views/data_statistics/trend/agent/index.vue'),
+                    },
+                ]
+            },
+
             {
                 meta: {
                     title: $t('data_statistics.rank_title'),

+ 1 - 0
apps/web-antd/src/views/data_statistics/daily/game/index.vue

@@ -44,6 +44,7 @@ const formOptions = {
 				placeholder: $t('common.placeholder_select'),
 				showSearch: true,
 				mode:"tags",
+				maxTagCount: 3
 			},
 			fieldName: 'game_id',
 			label: $t('game_control.game'),

+ 187 - 0
apps/web-antd/src/views/data_statistics/trend/agent/index.vue

@@ -0,0 +1,187 @@
+<script setup>
+import {Page, useVbenForm} from "@vben/common-ui";
+import {Avatar, Tag, RadioGroup, RadioButton, Card, message} from "ant-design-vue";
+import {onMounted, reactive, ref, toRaw} from 'vue';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
+import {getGameMinList} from "#/api/game_control/game_config.js";
+import {$t} from "@vben/locales";
+import dayjs from "dayjs";
+import {getTrendAgentDailyList} from "#/api/data_statistics/trend_agent.js";
+const chartRef = ref();
+const { renderEcharts } = useEcharts(chartRef);
+
+const filterGameList = ref([]);
+getGameMinList().then((data) => {
+	data.forEach((game) => {
+		filterGameList.value.push({
+			'label': `【${game.game_id}】${game.title}`,
+			'value': game.game_id,
+		})
+	})
+})
+const disabledDate = (current) => {
+	return current && current > dayjs().endOf('day');
+};
+const [QueryForm, formApi] = useVbenForm({
+	// 默认展开
+	collapsed: false,
+	// 所有表单项共用,可单独在表单内覆盖
+	commonConfig: {
+		// 所有表单项
+		componentProps: {
+			class: 'w-full',
+		},
+	},
+	// 提交函数
+	handleSubmit: onSubmit,
+	// 垂直布局,label和input在不同行,值为vertical
+	// 水平布局,label和input在同一行
+	layout: 'horizontal',
+	schema: [
+		{
+			component: 'Select',
+			componentProps: {
+				allowClear: true,
+				filterOption: true,
+				name:'game_id',
+				options: filterGameList,
+				placeholder: $t('common.placeholder_select'),
+				showSearch: true,
+				mode:"tags",
+				maxTagCount: 3
+			},
+			fieldName: 'game_id',
+			label: $t('game_control.game'),
+		},
+		{
+			component: 'Select',
+			defaultValue:'rtp',
+			componentProps: {
+				filterOption: true,
+				name:'data_type',
+				options: [
+					{'label':"RTP", "value":"rtp"},
+					{'label':$t('data_statistics.search.total_bet'), "value": "total_bet"},
+					{'label':$t('data_statistics.search.bet_count'), "value": "bet_count"},
+					{'label':$t('data_statistics.search.bet_users'), "value": "bet_users"},
+				],
+				placeholder: $t('common.placeholder_select'),
+			},
+			fieldName: 'data_type',
+			label: $t('data_statistics.search.data_type'),
+		},
+		{
+			label:$t("common.day_range_time"),
+			component: 'RangePicker',
+			defaultValue: [dayjs(), dayjs()],
+			fieldName: 'range_time',
+			componentProps: {
+				disabledDate: disabledDate,
+			}
+		},
+	],
+	// 是否可展开
+	showCollapseButton: false,
+	submitButtonOptions: {
+		content: '查询',
+	},
+	wrapperClass: 'grid-cols-1 md:grid-cols-3',
+});
+
+let echartsOptions ={
+	grid: {
+		bottom: 0,
+		containLabel: true,
+		left: '1%',
+		right: '1%',
+		top: '2 %',
+	},
+	xAxis: {
+		axisTick: {
+			show: false,
+		},
+		// boundaryGap: false,
+		splitLine: {
+			lineStyle: {
+				type: 'solid',
+				width: 1,
+			},
+			show: true,
+		},
+		type: 'category',
+		data: []
+	},
+	yAxis: {
+		axisTick: {
+			show: false,
+		},
+		splitArea: {
+			show: true,
+		},
+		type: 'value'
+	},
+	series: [
+		{
+			areaStyle: {},
+			itemStyle: {
+				color: '#5ab1ef',
+			},
+			data: [],
+			type: 'line',
+			smooth: true
+		}
+	],
+	cacheOptions:'',
+	tooltip: {
+		axisPointer: {
+			lineStyle: {
+				color: '#019680',
+				width: 1,
+			},
+		},
+		trigger: 'axis',
+	},
+}
+async function onSubmit(search) {
+	let form = {};
+	if(search.range_time) {
+		form['start_time'] = search.range_time[0].format('YYYY-MM-DD');
+		form['end_time'] = search.range_time[1].format('YYYY-MM-DD');
+	}
+	if (search.game_id) {
+		form['game_id'] = search.game_id;
+	}
+	if(search.data_type) {
+		form['data_type'] = search.data_type;
+	}
+	const res = await getTrendAgentDailyList(form);
+	let xAxisData = [];
+	let yAxisData = [];
+	res.forEach((item) => {
+		xAxisData.push(item.date);
+		yAxisData.push(item[search.data_type]);
+	})
+	echartsOptions.xAxis.data = xAxisData;
+	echartsOptions.series[0]['data'] = yAxisData;
+	console.log(echartsOptions);
+	await renderEcharts(echartsOptions);
+}
+onMounted(() => {
+	formApi.submitForm();
+})
+</script>
+
+<template>
+	<Page>
+		<Card class="mb-5">
+			<QueryForm />
+		</Card>
+		<Card>
+			<EchartsUI ref="chartRef" />
+		</Card>
+	</Page>
+</template>
+
+<style scoped>
+
+</style>

+ 159 - 0
apps/web-antd/src/views/data_statistics/trend/rewards/index.vue

@@ -0,0 +1,159 @@
+<script setup>
+import {Page, useVbenForm} from "@vben/common-ui";
+import {Avatar, Tag, RadioGroup, RadioButton, Card, message} from "ant-design-vue";
+import {onMounted, reactive, ref, toRaw} from 'vue';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
+import {getGameMinList} from "#/api/game_control/game_config.js";
+import {$t} from "@vben/locales";
+import dayjs from "dayjs";
+import {getTrendRewardsList} from "#/api/data_statistics/trend_rewards.js";
+const chartRef = ref();
+const { renderEcharts } = useEcharts(chartRef);
+
+const filterGameList = ref([]);
+getGameMinList().then((data) => {
+	data.forEach((game) => {
+		filterGameList.value.push({
+			'label': `【${game.game_id}】${game.title}`,
+			'value': game.game_id,
+		})
+	})
+})
+const [QueryForm, formApi] = useVbenForm({
+	// 默认展开
+	collapsed: false,
+	// 所有表单项共用,可单独在表单内覆盖
+	commonConfig: {
+		// 所有表单项
+		componentProps: {
+			class: 'w-full',
+		},
+	},
+	// 提交函数
+	handleSubmit: onSubmit,
+	// 垂直布局,label和input在不同行,值为vertical
+	// 水平布局,label和input在同一行
+	layout: 'horizontal',
+	schema: [
+		{
+			component: 'Select',
+			componentProps: {
+				allowClear: true,
+				filterOption: true,
+				name:'game_id',
+				options: filterGameList,
+				placeholder: $t('common.placeholder_select'),
+				showSearch: true,
+				mode:"tags",
+				maxTagCount: 3
+			},
+			fieldName: 'game_id',
+			label: $t('game_control.game'),
+		},
+		{
+			component: 'DatePicker',
+			fieldName: 'date',
+			label:$t("common.day_range_time"),
+			defaultValue: dayjs(),
+		},
+	],
+	// 是否可展开
+	showCollapseButton: false,
+	submitButtonOptions: {
+		content: '查询',
+	},
+	wrapperClass: 'grid-cols-1 md:grid-cols-2',
+});
+
+let echartsOptions ={
+	grid: {
+		bottom: 0,
+		containLabel: true,
+		left: '1%',
+		right: '1%',
+		top: '2 %',
+	},
+	xAxis: {
+		axisTick: {
+			show: false,
+		},
+		// boundaryGap: false,
+		splitLine: {
+			lineStyle: {
+				type: 'solid',
+				width: 1,
+			},
+			show: true,
+		},
+		type: 'category',
+		data: []
+	},
+	yAxis: {
+		axisTick: {
+			show: false,
+		},
+		splitArea: {
+			show: true,
+		},
+		type: 'value'
+	},
+	series: [
+		{
+			areaStyle: {},
+			itemStyle: {
+				color: '#5ab1ef',
+			},
+			data: [],
+			type: 'line',
+			smooth: true
+		}
+	],
+	cacheOptions:'',
+	tooltip: {
+		axisPointer: {
+			lineStyle: {
+				color: '#019680',
+				width: 1,
+			},
+		},
+		trigger: 'axis',
+	},
+}
+async function onSubmit(search) {
+	let form = {};
+	if (search.date) {
+		form['date'] = search.date.format('YYYY-MM-DD');
+	}
+	if (search.game_id) {
+		form['game_id'] = search.game_id;
+	}
+	const res = await getTrendRewardsList(form);
+	let xAxisData = [];
+	let yAxisData = [];
+	res.forEach((item) => {
+		xAxisData.push(item.hour + ":00");
+		yAxisData.push(item.total_multiple);
+	})
+	echartsOptions.xAxis.data = xAxisData;
+	echartsOptions.series[0]['data'] = yAxisData;
+	await renderEcharts(echartsOptions);
+}
+onMounted(() => {
+	formApi.submitForm();
+})
+</script>
+
+<template>
+	<Page>
+		<Card class="mb-5">
+			<QueryForm />
+		</Card>
+		<Card>
+			<EchartsUI ref="chartRef" />
+		</Card>
+	</Page>
+</template>
+
+<style scoped>
+
+</style>

+ 159 - 0
apps/web-antd/src/views/data_statistics/trend/win_lose/index.vue

@@ -0,0 +1,159 @@
+<script setup>
+import {Page, useVbenForm} from "@vben/common-ui";
+import {Avatar, Tag, RadioGroup, RadioButton, Card, message} from "ant-design-vue";
+import {onMounted, reactive, ref, toRaw} from 'vue';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
+import {getGameMinList} from "#/api/game_control/game_config.js";
+import {$t} from "@vben/locales";
+import dayjs from "dayjs";
+import {getTrendWinLoseList} from "#/api/data_statistics/trend_win_lose.js";
+const chartRef = ref();
+const { renderEcharts } = useEcharts(chartRef);
+
+const filterGameList = ref([]);
+getGameMinList().then((data) => {
+	data.forEach((game) => {
+		filterGameList.value.push({
+			'label': `【${game.game_id}】${game.title}`,
+			'value': game.game_id,
+		})
+	})
+})
+const [QueryForm, formApi] = useVbenForm({
+	// 默认展开
+	collapsed: false,
+	// 所有表单项共用,可单独在表单内覆盖
+	commonConfig: {
+		// 所有表单项
+		componentProps: {
+			class: 'w-full',
+		},
+	},
+	// 提交函数
+	handleSubmit: onSubmit,
+	// 垂直布局,label和input在不同行,值为vertical
+	// 水平布局,label和input在同一行
+	layout: 'horizontal',
+	schema: [
+		{
+			component: 'Select',
+			componentProps: {
+				allowClear: true,
+				filterOption: true,
+				name:'game_id',
+				options: filterGameList,
+				placeholder: $t('common.placeholder_select'),
+				showSearch: true,
+				mode:"tags",
+				maxTagCount: 3
+			},
+			fieldName: 'game_id',
+			label: $t('game_control.game'),
+		},
+		{
+			component: 'DatePicker',
+			fieldName: 'date',
+			label:$t("common.day_range_time"),
+			defaultValue: dayjs(),
+		},
+	],
+	// 是否可展开
+	showCollapseButton: false,
+	submitButtonOptions: {
+		content: '查询',
+	},
+	wrapperClass: 'grid-cols-1 md:grid-cols-2',
+});
+
+let echartsOptions ={
+	grid: {
+		bottom: 0,
+		containLabel: true,
+		left: '1%',
+		right: '1%',
+		top: '2 %',
+	},
+	xAxis: {
+		axisTick: {
+			show: false,
+		},
+		// boundaryGap: false,
+		splitLine: {
+			lineStyle: {
+				type: 'solid',
+				width: 1,
+			},
+			show: true,
+		},
+		type: 'category',
+		data: []
+	},
+	yAxis: {
+		axisTick: {
+			show: false,
+		},
+		splitArea: {
+			show: true,
+		},
+		type: 'value'
+	},
+	series: [
+		{
+			areaStyle: {},
+			itemStyle: {
+				color: '#5ab1ef',
+			},
+			data: [],
+			type: 'line',
+			smooth: true
+		}
+	],
+	cacheOptions:'',
+	tooltip: {
+		axisPointer: {
+			lineStyle: {
+				color: '#019680',
+				width: 1,
+			},
+		},
+		trigger: 'axis',
+	},
+}
+async function onSubmit(search) {
+	let form = {};
+	if (search.date) {
+		form['date'] = search.date.format('YYYY-MM-DD');
+	}
+	if (search.game_id) {
+		form['game_id'] = search.game_id;
+	}
+	const res = await getTrendWinLoseList(form);
+	let xAxisData = [];
+	let yAxisData = [];
+	res.forEach((item) => {
+		xAxisData.push(item.hour + ":00");
+		yAxisData.push(item.total_win);
+	})
+	echartsOptions.xAxis.data = xAxisData;
+	echartsOptions.series[0]['data'] = yAxisData;
+	await renderEcharts(echartsOptions);
+}
+onMounted(() => {
+	formApi.submitForm();
+})
+</script>
+
+<template>
+	<Page>
+		<Card class="mb-5">
+			<QueryForm />
+		</Card>
+		<Card>
+			<EchartsUI ref="chartRef" />
+		</Card>
+	</Page>
+</template>
+
+<style scoped>
+
+</style>