|
|
@ -1,8 +1,8 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { onMounted, reactive } from 'vue' |
|
|
|
import { onMounted, reactive, ref } from 'vue' |
|
|
|
import request from '@/api/config' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import { Search } from '@element-plus/icons-vue' |
|
|
|
import { Search, ArrowLeft, ArrowRight, Switch } from '@element-plus/icons-vue' |
|
|
|
import { RouterLink, useRoute } from 'vue-router' |
|
|
|
import { |
|
|
|
initPage, |
|
|
@ -14,8 +14,10 @@ import { |
|
|
|
options3PattiBetArea, |
|
|
|
optionsTexasBetArea, |
|
|
|
optionsRummyBetArea, |
|
|
|
ExportExcel, |
|
|
|
} from '@/api/module/common_params' |
|
|
|
import CustomPaginate from '@/components/common/CustomPaginate.vue' |
|
|
|
import { debounce } from "lodash"; |
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
|
|
|
@ -124,6 +126,36 @@ const handleSearch = () => { |
|
|
|
|
|
|
|
getBetRecord() |
|
|
|
} |
|
|
|
const loading = ref(false); |
|
|
|
const handleExport = debounce(async () => { |
|
|
|
const params = { |
|
|
|
user_no: data.search.user_no, |
|
|
|
game_id: data.search.game_id, |
|
|
|
room_id: data.search.room_id.toString(), |
|
|
|
start_time: data.search.time_range[0], |
|
|
|
end_time: data.search.time_range[1], |
|
|
|
page: 1, |
|
|
|
limit: 1000000, |
|
|
|
} as any |
|
|
|
|
|
|
|
let str = '' |
|
|
|
for (const index in params) { |
|
|
|
str += `${index}=${params[index]}&` |
|
|
|
} |
|
|
|
|
|
|
|
str = str.slice(0, -1) |
|
|
|
loading.value = true; |
|
|
|
try { |
|
|
|
const response: any = await request.post(`/person/exportBetRecord`, params, { responseType: 'blob' }) |
|
|
|
ExportExcel(response, '游戏记录') |
|
|
|
} catch (error: any) { |
|
|
|
const message = error ? "导出成功" : "导出失败"; |
|
|
|
const type = error ? "success" : "error"; |
|
|
|
ElMessage({ type, message }); |
|
|
|
} finally { |
|
|
|
loading.value = false; |
|
|
|
} |
|
|
|
}, 300) |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
if (route.query.user_no != undefined) { |
|
|
@ -149,7 +181,7 @@ onMounted(async () => { |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div class="full-page p-20 page-content" style="position: relative"> |
|
|
|
<div class="full-page p-20 page-content" style="position: relative" v-loading="loading"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="21"> |
|
|
|
<el-form :inline="true"> |
|
|
@ -190,6 +222,7 @@ onMounted(async () => { |
|
|
|
</el-form> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" class="text-right"> |
|
|
|
<el-button type="warning" @click="handleExport" :icon="Switch">导出</el-button> |
|
|
|
<el-button type="primary" @click="handleSearch" :icon="Search">查询</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|