|
|
@@ -0,0 +1,163 @@
|
|
|
+<script setup>
|
|
|
+import {Page} from "@vben/common-ui";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import {$t} from "@vben/locales";
|
|
|
+import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
|
|
|
+import {getDailyGameList} from "#/api/data_statistics/daily_game.js";
|
|
|
+import {ref} from "vue";
|
|
|
+import {getGameMinList} from "#/api/game_control/game_config.js";
|
|
|
+import {Avatar, Tag} from "ant-design-vue";
|
|
|
+
|
|
|
+const disabledDate = (current) => {
|
|
|
+ return current && current > dayjs().endOf('day');
|
|
|
+};
|
|
|
+const filterGameList = ref([]);
|
|
|
+getGameMinList().then((data) => {
|
|
|
+ data.forEach((game) => {
|
|
|
+ filterGameList.value.push({
|
|
|
+ 'label': `【${game.game_id}】${game.title}`,
|
|
|
+ 'value': game.game_id,
|
|
|
+ })
|
|
|
+ })
|
|
|
+})
|
|
|
+const formOptions = {
|
|
|
+ // 默认展开
|
|
|
+ collapsed: false,
|
|
|
+ // 所有表单项共用,可单独在表单内覆盖
|
|
|
+ commonConfig: {
|
|
|
+ // 所有表单项
|
|
|
+ componentProps: {
|
|
|
+ class: 'w-full',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ // 垂直布局,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",
|
|
|
+ },
|
|
|
+ fieldName: 'game_id',
|
|
|
+ label: $t('game_control.game'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:$t("common.day_range_time"),
|
|
|
+ component: 'RangePicker',
|
|
|
+ defaultValue: [dayjs(), dayjs()],
|
|
|
+ fieldName: 'range_time',
|
|
|
+ componentProps: {
|
|
|
+ disabledDate: disabledDate,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 是否可展开
|
|
|
+ submitButtonOptions: {
|
|
|
+ content: '查询',
|
|
|
+ },
|
|
|
+ showCollapseButton: false,
|
|
|
+ wrapperClass: 'grid-cols-1 md:grid-cols-3',
|
|
|
+}
|
|
|
+
|
|
|
+// 列表
|
|
|
+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: 'date', title: $t('data_statistics.daily_agent.date'), width: 200},
|
|
|
+ { align: 'left', field: 'game_title', title: $t('game_control.game_list.game_title'), width: 200, slots: {'default':'game_title'}},
|
|
|
+ { 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: 'rtp', title: $t('data_statistics.daily_agent.rtp'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.rtp_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: 'bet_count', title: $t('data_statistics.daily_agent.bet_count'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_count_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: 'register_users', title: $t('data_statistics.daily_agent.register_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.register_users_desc')}},
|
|
|
+ { field: 'login_users', title: $t('data_statistics.daily_agent.login_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.login_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: 'platform_fee', title: $t('data_statistics.daily_agent.platform_fee'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.platform_fee_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')}},
|
|
|
+ ],
|
|
|
+ keepSource: true,
|
|
|
+ proxyConfig: {
|
|
|
+ ajax: {
|
|
|
+ query: async ({ page }) => {
|
|
|
+ let form = {
|
|
|
+ page: page.currentPage,
|
|
|
+ limit: page.pageSize,
|
|
|
+ compress: 0
|
|
|
+ };
|
|
|
+ const search = await gridApi.formApi.getValues();
|
|
|
+ for (let key in search) {
|
|
|
+ if(search[key]) {
|
|
|
+ form[key] = search[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(search.range_time) {
|
|
|
+ if(form.range_time) {
|
|
|
+ delete form.range_time;
|
|
|
+ }
|
|
|
+ form['start_time'] = search.range_time[0].format('YYYY-MM-DD');
|
|
|
+ form['end_time'] = search.range_time[1].format('YYYY-MM-DD');
|
|
|
+ }
|
|
|
+ const list = await getDailyGameList(form);
|
|
|
+ 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({
|
|
|
+ formOptions,
|
|
|
+ gridOptions,
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <Page>
|
|
|
+ <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>
|
|
|
+ <template #game_title="{ row }">
|
|
|
+ <div>
|
|
|
+ <Tag color="blue" size="large">{{row.game_type_text}}</Tag>
|
|
|
+ <Avatar shape="square" :src="row.game_image_url"></Avatar>
|
|
|
+ <span style="margin-left: .5rem;display: inline-block;">{{row.game_title}}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </Grid>
|
|
|
+ </Page>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|