小游戏周奖励

This commit is contained in:
khalil
2025-03-05 19:12:04 +08:00
parent d93fa6f57b
commit 38fba3eca3
3 changed files with 226 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import request from '@/utils/request';
// 分区接口
export const listPartitionInfo = query => {
return request({
url: '/partition/listPartitionInfo',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,23 @@
import request from '@/utils/request';
import {genQueryParam} from "@/utils/maintainer";
export const pageRecord = query => {
return request({
url: '/admin/miniGameWeekJackpot/pageRecord',
method: 'get',
params: query
});
};
export const exportRecord = query => {
window.location.href = `/admin/miniGameWeekJackpot/exportRecord?${genQueryParam(query)}`;
return;
}
export const listUserRecord = query => {
return request({
url: '/admin/miniGameWeekJackpot/listUserRecord',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,193 @@
<template>
<div class="box">
<!-- ID -->
<div class="condition">
<!-- 分区 -->
<div class="inquire">
<span>分区</span>
<el-select
v-model="inquire.partitionId"
placeholder="请选择"
@change="handleChange"
>
<el-option
v-for="item in partitionOptions"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
<!-- 按钮 -->
<div class="but">
<el-button class="primary" type="primary" @click="getData()">查询</el-button>
<el-button class="primary" type="primary" @click="exportData()">导出</el-button>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="table.tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="startDate" align="center" label="开始时间" />
<el-table-column prop="endDate" align="center" label="结束时间" />
<el-table-column prop="partitionDesc" align="center" label="区域" />
<el-table-column prop="totalInput" align="center" label="本周游戏投入" />
<el-table-column prop="jackpotPool" align="center" label="奖池金币数" />
<el-table-column prop="receivedJackpot" align="center" label="已领取金币" />
<el-table-column prop="luckyFellowNum" align="center" label="瓜分人数">
<template v-slot="scope">
<el-button
@click="list(scope.row)"
class="primary"
type="primary"
size="small"
>{{scope.row.luckyFellowNum}}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 编辑弹窗 -->
<el-dialog v-model="detailTable.enable" width="72%" center destroy-on-close show-close="true">
<!-- 表格 -->
<el-table
:data="detailTable.tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="erbanNo" align="center" label="用户ID" />
<el-table-column prop="nick" align="center" label="昵称" />
<el-table-column prop="totalInput" align="center" label="本周游戏投入" />
<el-table-column prop="rank" align="center" label="排名" />
<el-table-column prop="jackpot" align="center" label="瓜分金币数" />
<el-table-column prop="receivedJackpot" align="center" label="已领取金币" />
</el-table>
</el-dialog>
</div>
</template>
<script>
import { listPartitionInfo } from "@/api/common/partition";
import { pageRecord, exportRecord, listUserRecord } from "@/api/miniGame/miniGameWeekJackpot";
import { ElMessage, ElMessageBox } from 'element-plus'
export default {
name: "MiniGameWeekJackpotView",
data() {
return {
loading: false,
partitionOptions: [],
//查询所需条件对象
inquire: {
partitionId: undefined,
},
table: {
tableData: [],
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
},
detailTable: {
enable: false,
tableData: [],
},
editDialog: false,
obj : {},
};
},
created() {
listPartitionInfo().then((res) => {
if (res.code !== 200) {
throw new Error(res.msg);
}
this.partitionOptions = res.data;
this.inquire.partitionId = res.data[0].id;
}).then(() =>{
this.getData();
});
},
methods: {
// 查询接口
getData() {
this.loading = true;
pageRecord({
partitionId: this.inquire.partitionId,
pageNo: this.table.currentPage,
pageSize: this.table.pageSize,
}).then((res) => {
this.loading = false;
if (res.code !== 200){
throw new Error(res.msg);
}
this.table.total = res.data.total;
this.table.tableData = res.data.rows;
});
},
exportData() {
exportRecord({
partitionId: this.inquire.partitionId,
})
},
list(obj){
this.loading = true;
listUserRecord({
startDate: obj.startDate,
partitionId: obj.partitionId,
}).then((res) => {
this.loading = false;
if (res.code !== 200){
throw new Error(res.msg);
}
this.detailTable.tableData = res.data;
this.detailTable.enable = true;
});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.condition {
margin-bottom: 20px;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
}
.but {
margin-bottom: 20px;
}
}
</style>