Browse Source

添加导出功能444

master
MoQingYu 3 months ago
parent
commit
ed847962aa
  1. 4
      backmanage/src/components/global/m_table/src/m_table.vue
  2. 39
      backmanage/src/views/betRecord/index.vue
  3. 31
      backmanage/src/views/person/records/ChangeRealBet.vue
  4. 33
      backmanage/src/views/person/records/changeGold.vue

4
backmanage/src/components/global/m_table/src/m_table.vue

@ -353,7 +353,7 @@ const handleFetchDataAAA = debounce(async (parama = {}) => {
if (!handleLoadDownloadData) return;
loading.value = true;
export_loading.value = true;
try {
const response: any = await handleLoadDownloadData(param);
// const response: any = await request.post(`/event/export-event-details`, param, { responseType: 'blob' })
@ -363,7 +363,7 @@ const handleFetchDataAAA = debounce(async (parama = {}) => {
const type = error ? "success" : "error";
ElMessage({ type, message });
} finally {
loading.value = false;
export_loading.value = false;
}
}, 300);

39
backmanage/src/views/betRecord/index.vue

@ -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>

31
backmanage/src/views/person/records/ChangeRealBet.vue

@ -1,11 +1,12 @@
<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, Switch } from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
import { initPage, GamesRoomsInfo, optionsRealBet } from '@/api/module/common_params'
import { initPage, GamesRoomsInfo, optionsRealBet, ExportExcel } from '@/api/module/common_params'
import CustomPaginate from '@/components/common/CustomPaginate.vue'
import { debounce } from "lodash";
const route = useRoute()
@ -46,6 +47,27 @@ const handleSearch = () => {
getRecord()
}
const loading = ref(false);
const handleExport = debounce(async () => {
const params = {
user_no: data.search.user_no,
reason: data.search.reason,
page: 1,
limit: data.page.size,
}
loading.value = true;
try {
const response: any = await request.post(`/person/exportChangeRealBet`, 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) {
data.search.user_no = route.query.user_no
@ -58,7 +80,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">
@ -68,6 +90,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>

33
backmanage/src/views/person/records/changeGold.vue

@ -1,11 +1,12 @@
<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, Switch } from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
import { initPage, GamesRoomsInfo } from '@/api/module/common_params'
import { initPage, GamesRoomsInfo, ExportExcel, } from '@/api/module/common_params'
import CustomPaginate from '@/components/common/CustomPaginate.vue'
import { debounce } from "lodash";
const route = useRoute()
@ -75,6 +76,29 @@ const handleSearch = () => {
getRecord()
}
const loading = ref(false);
const handleExport = debounce(async () => {
const params = {
user_no: data.search.user_no,
reason: data.search.reason,
start_time: data.search.time_range[0],
end_time: data.search.time_range[1],
page: 1,
limit: data.page.size,
}
loading.value = true;
try {
const response: any = await request.post(`/person/exportChangeGold`, 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) {
data.search.user_no = route.query.user_no
@ -87,7 +111,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">
@ -111,6 +135,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>

Loading…
Cancel
Save