新增 - 用户游戏数据明细

This commit is contained in:
2025-08-21 19:14:15 +08:00
parent cff55051b1
commit 26fb33c8f6
2 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import request from "@/utils/request";
// 列表
export const getMiniGameLudoList = query => {
return request({
url: '/admin/miniGame/ludo/stat',
method: 'get',
params: query,
});
}

View File

@@ -0,0 +1,185 @@
<template>
<div class="box">
<div class="inquire">
<span>分区</span>
<partition-select v-model:partition-id="formData.partitionId" />
</div>
<div class="inquire">
<span>用户ID</span>
<el-input
v-model="formData.erbanNo"
placeholder="请输入用户ID"
class="input"
></el-input>
</div>
<div class="inquire">
<span class="demonstration">游戏渠道</span>
<el-select v-model="formData.entrance" placeholder="请选择">
<el-option label="全部" :value="''"></el-option>
<el-option label="首页" :value="1"></el-option>
<el-option label="房间" :value="2"></el-option>
</el-select>
</div>
<div class="inquire" style="margin-top: 20px">
<span class="demonstration">日期</span>
<el-date-picker
v-model="dataTime"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
<el-button style="" type="primary" @click="getData()">查询</el-button>
<div class="title_txt">
<span>游戏总耗时:{{ totalDurationFormatter }} </span>
<span>游戏次数:{{ roundCount }} </span>
<span>消耗钻石完成次数:{{ paidRoundCount }} </span>
</div>
<!-- 表格数据 -->
<el-table
v-loading="tableData.loading"
:data="tableData.data"
ref="multipleTable"
@selection-change="handleSelectionChange"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="partitionDesc" align="center" label="分区" />
<el-table-column prop="mgName" align="center" label="游戏昵称" />
<el-table-column prop="mgId" align="center" label="游戏ID" />
<el-table-column prop="startTime" align="center" label="游戏开始时间" />
<el-table-column prop="playerNum" align="center" label="游戏参与人数" />
<el-table-column prop="durationFormatter" align="center" label="游戏耗时" />
<el-table-column prop="erbanNo" align="center" label="用户ID" />
<el-table-column prop="nick" align="center" label="用户昵称" />
<el-table-column prop="entranceDesc" align="center" label="游戏渠道" />
<el-table-column prop="ticket" align="center" label="消耗钻石" />
<el-table-column prop="isWinner" align="center" label="赢家" >
<template v-slot="scope">
{{ scope.row.isWinner? '' : '' }}
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
:current-page="formData.pageNo"
:page-size="formData.pageSize"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import PartitionSelect from "../common/partitionSelect.vue";
export default {
name: "userGameDataDetails",
components: { PartitionSelect },
};
</script>
<script setup>
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import {getMiniGameLudoList } from "@/api/users/userGameDataDetails.js";
const dataTime = ref("");
const formData = reactive({
partitionId: undefined,
pageNo: 1,
pageSize: 10,
erbanNo: "",
startTime: "",
endTime: "",
entrance:''
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const paidRoundCount = ref('0');
const roundCount = ref('0');
const totalDurationFormatter = ref('0');
const getData = () => {
tableData.loading = true;
if (dataTime.value && dataTime.value.length > 0) {
formData.startTime = dateFormat(dataTime.value[0], "yyyy-MM-dd");
formData.endTime = dateFormat(dataTime.value[1], "yyyy-MM-dd");
} else {
formData.startTime = dataTime.value;
formData.endTime = dataTime.value;
}
getMiniGameLudoList(formData).then((res) => {
if (res.code === 200) {
tableData.data = res.data.page.records;
tableData.total = res.data.page.total;
tableData.loading = false;
if(formData.pageNo == 1){
paidRoundCount.value = res.data.paidRoundCount;
roundCount.value = res.data.roundCount;
totalDurationFormatter.value = res.data.totalDurationFormatter;
}
} else {
tableData.loading = false;
ElMessage.error(res.message);
}
});
};
const handleSizeChange = (val) => {
formData.pageSize = val;
getData();
};
const handleCurrentChange = (val) => {
formData.pageNo = val;
getData();
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
.selectBox {
display: flex;
height: 35px;
line-height: 35px;
margin-bottom: 20px;
}
.title_txt{
font-weight: 600;
margin-top: 20px;
span{
margin-right: 20px;
}
}
</style>