完成后台统计

This commit is contained in:
dragon
2025-02-17 14:45:50 +08:00
parent a68859bbaa
commit 1b2f64d42d
4 changed files with 453 additions and 108 deletions

View File

@@ -0,0 +1,31 @@
import request from '@/utils/request';
import qs from 'qs';
import { genQueryParam } from '@/utils/maintainer';
// ==================================用户新增====================================
// 列表
export const dnuPage = query => {
return request({
url: '/admin/stats/dnu/page',
method: 'get',
params: query
});
};
// ==================================用户活跃====================================
// 列表
export const dauPage = query => {
return request({
url: '/admin/stats/dau/page',
method: 'get',
params: query
});
};
// ==================================工会数据统计====================================
// 列表
export const guiildPage = query => {
return request({
url: '/admin/stats/guild/page',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,329 @@
<template>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column
prop="totalNewCount"
align="center"
label="全服公会总新增"
/>
<el-table-column align="center" label="阿拉伯公会总新增" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '阿拉伯公会总新增' + scope.row.date;
edi(scope.row.arNewCountDetail, false);
"
type="text"
size="small"
>
{{ scope.row.arNewCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="英语区总新增" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '英语区总新增' + scope.row.date;
edi(scope.row.enNewCountDetail, false);
"
type="text"
size="small"
>
{{ scope.row.enNewCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="华语区总新增" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '华语区总新增' + scope.row.date;
edi(scope.row.zhNewCountDetail, false);
"
type="text"
size="small"
>
{{ scope.row.zhNewCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="土耳其区总新增" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '土耳其区总新增' + scope.row.date;
edi(scope.row.trNewCountDetail, false);
"
type="text"
size="small"
>
{{ scope.row.trNewCount }}
</el-button>
</template>
</el-table-column>
<el-table-column
prop="totalActiveCount"
align="center"
label="全服公会活跃度"
/>
<el-table-column align="center" label="阿拉伯公会活跃度" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '阿拉伯公会活跃度' + scope.row.date;
edi(scope.row.arActiveCountDetail, true);
"
type="text"
size="small"
>
{{ scope.row.arActiveCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="英语区活跃度" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '英语区活跃度' + scope.row.date;
edi(scope.row.enActiveCountDetail, true);
"
type="text"
size="small"
>
{{ scope.row.enActiveCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="华语区活跃度" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '华语区活跃度' + scope.row.date;
edi(scope.row.zhActiveCountDetail, true);
"
type="text"
size="small"
>
{{ scope.row.zhActiveCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="土耳其区活跃度" width="">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '土耳其区活跃度' + scope.row.date;
edi(scope.row.trActiveCountDetail, true);
"
type="text"
size="small"
>
{{ scope.row.trActiveCount }}
</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="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/> -->
<!-- 详情 -->
<el-dialog v-model="detailsDialog" :title="detailsTitle" width="50%" center>
<!-- 内表格 -->
<el-table
v-loading="loading"
:data="tableDataIn"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="endDate" align="center" label="结束时间" />
<el-table-column prop="guildId" align="center" label="公会ID" />
<el-table-column prop="x" align="center" label="公会长ID" />
<el-table-column
prop="activeMemberCount"
align="center"
label="本周收礼主播数"
/>
<el-table-column
prop="guildGoldFlow"
align="center"
label="本周公会钻石流水"
/>
<el-table-column
prop="guildDiamondFlow"
align="center"
label="本周公会金币流水"
/>
<el-table-column
prop="lastGuildGoldFlow"
align="center"
label="上周公会钻石流水"
v-if="detailsIsShow"
/>
<el-table-column
prop="guildGoldFlowWow"
align="center"
label="周环比"
v-if="detailsIsShow"
>
<template v-slot="scope">
{{ scope.row.guildGoldFlow / scope.row.lastGuildGoldFlow }}
</template>
</el-table-column>
</el-table>
<!-- 操作 -->
<template #footer>
<span class="dialog-footer">
<el-button type="primary" class="primary" @click="detailsDialog = false"
>关闭</el-button
>
</span>
</template>
</el-dialog>
</template>
<script>
import { guiildPage } from "@/api/statistics/statistics";
import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus";
export default {
name: "guildStatisticsData",
data() {
return {
loading: false,
// 查询条件
inquire: {
time: [],
},
// 表格
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 内表格
detailsDialog: false,
detailsTitle: "金币明细",
tableDataIn: [],
detailsIsShow: false,
};
},
created() {
this.getData();
},
methods: {
// 查询
getData() {
this.loading = true;
let time = this.inquire.time;
let startTime = null;
let endTime = null;
if (time.length > 0) {
startTime = this.inquire.time[0]
? dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss")
: null;
endTime = this.inquire.time[1]
? dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss")
: null;
}
guiildPage({
page: this.currentPage,
pageSize: this.pageSize,
}).then((res) => {
if (res.code == 200) {
this.total = res.data.total;
this.tableData = res.data.rows;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 详情
edi(res, type) {
this.detailsIsShow = type;
console.log(JSON.parse(res));
this.tableDataIn = JSON.parse(res);
this.detailsDialog = true;
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.outer {
padding-top: 20px;
background: #ecf0f5;
border-top: 3px solid #d2d6de;
.demonstration {
margin-right: 20px;
}
.inquire {
display: flex;
justify-content: space-between;
white-space: nowrap;
float: left;
margin-right: 20px;
}
.search {
width: 100%;
height: 41px;
.searchLeft,
.searchRight {
width: 20%;
float: left;
span {
margin-right: 10px;
}
.input {
width: 75%;
}
}
}
.buttonBox {
margin-top: 10px;
}
.authorityBox {
.authoritySpan {
margin-right: 20px;
}
.authorityInpput {
width: 50%;
}
}
.dialogTableVisibleBut {
margin: -25px 0 20px 0px;
}
}
</style>

View File

@@ -6,22 +6,22 @@
border border
style="width: 100%; margin-top: 25px" style="width: 100%; margin-top: 25px"
> >
<el-table-column prop="x" align="center" label="日期" /> <el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="x" align="center" label="新总注册" /> <el-table-column prop="accountCount" align="center" label="新总注册" />
<el-table-column prop="x" align="center" label="新完善资料" /> <el-table-column prop="userCount" align="center" label="新完善资料" />
<el-table-column prop="x" align="center" label="完善率" /> <el-table-column prop="userRatio" align="center" label="完善率" />
<el-table-column align="center" label="阿拉伯区新注册(完善资料)" width=""> <el-table-column align="center" label="阿拉伯区新注册(完善资料)" width="">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '阿拉伯区注册明细'; detailsTitle = '阿拉伯区注册明细' + scope.row.date;
edi(scope.row, 2); edi(scope.row.arCountDetail, 2);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.arDiamond }} {{ scope.row.arCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -29,13 +29,13 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '英语区注册明细'; detailsTitle = '英语区注册明细' + scope.row.date;
edi(scope.row, 1); edi(scope.row.enCountDetail, 1);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.enDiamond }} {{ scope.row.enCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -43,13 +43,13 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '华语区注册明细'; detailsTitle = '华语区注册明细' + scope.row.date;
edi(scope.row, 4); edi(scope.row.zhCountDetail, 4);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.zhDiamond }} {{ scope.row.zhCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -57,20 +57,20 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '土耳其区注册明细'; detailsTitle = '土耳其区注册明细' + scope.row.date;
edi(scope.row, 8); edi(scope.row.trCountDetailt, 8);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.trDiamond }} {{ scope.row.trCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<!-- <el-pagination <el-pagination
style="margin-top: 10px" style="margin-top: 10px"
class="paginationClass" class="paginationClass"
v-model:current-page="currentPage" v-model:current-page="currentPage"
@@ -80,7 +80,7 @@
:total="total" :total="total"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> --> />
<!-- 详情 --> <!-- 详情 -->
<el-dialog v-model="detailsDialog" :title="detailsTitle" width="30%" center> <el-dialog v-model="detailsDialog" :title="detailsTitle" width="30%" center>
@@ -91,10 +91,9 @@
border border
style="width: 100%; margin-top: 25px" style="width: 100%; margin-top: 25px"
> >
<el-table-column prop="x" align="center" label="日期" /> <el-table-column prop="regionDesc" align="center" label="国家" />
<el-table-column prop="x" align="center" label="国家" /> <el-table-column prop="count" align="center" label="新注册(完善资料)" />
<el-table-column prop="x" align="center" label="新注册(完善资料)" /> <el-table-column prop="ratio" align="center" label="占比" />
<el-table-column prop="x" align="center" label="占比" />
</el-table> </el-table>
<!-- 操作 --> <!-- 操作 -->
<template #footer> <template #footer>
@@ -107,7 +106,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
// import { diamondStatList } from "@/api/dailyCoinStatistics/dailyCoinStatistics"; import { dnuPage } from "@/api/statistics/statistics";
import { dateFormat } from "@/utils/system-helper"; import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
export default { export default {
@@ -120,7 +119,7 @@ export default {
time: [], time: [],
}, },
// 表格 // 表格
tableData: [{ x: "x" }], tableData: [],
// 分页 // 分页
total: 10, //总页数 total: 10, //总页数
currentPage: 1, //页码 currentPage: 1, //页码
@@ -132,41 +131,28 @@ export default {
}; };
}, },
created() { created() {
// this.getData(); this.getData();
}, },
methods: { methods: {
// 查询 // 查询
getData() { getData() {
this.loading = true; this.loading = true;
let time = this.inquire.time; dnuPage({
let startTime = null; page: this.currentPage,
let endTime = null; pageSize: this.pageSize,
if (time.length > 0) { }).then((res) => {
startTime = this.inquire.time[0] if (res.code == 200) {
? dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss") this.total = res.data.total;
: null; this.tableData = res.data.rows;
endTime = this.inquire.time[1] this.loading = false;
? dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss") } else {
: null; ElMessage({
} showClose: true,
// diamondStatList({ message: res.message,
// startDate: startTime, type: "error",
// endDate: endTime, });
// // pageNo: this.currentPage, }
// // pageSize: this.pageSize, });
// }).then((res) => {
// if (res.code == 200) {
// // this.total = res.data.total;
// this.tableData = res.data;
// this.loading = false;
// } else {
// ElMessage({
// showClose: true,
// message: res.message,
// type: "error",
// });
// }
// });
}, },
// 详情 // 详情
edi(res, type) { edi(res, type) {
@@ -182,7 +168,7 @@ export default {
// : type == 8 // : type == 8
// ? res.trDomainDetail // ? res.trDomainDetail
// : `"[""]"`; // : `"[""]"`;
// this.tableDataIn = JSON.parse(jsonArr); (this.tableDataIn = JSON.parse(res));
this.detailsDialog = true; this.detailsDialog = true;
}, },
// 分页导航 // 分页导航

View File

@@ -6,20 +6,33 @@
border border
style="width: 100%; margin-top: 25px" style="width: 100%; margin-top: 25px"
> >
<el-table-column prop="x" align="center" label="日期" /> <el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="x" align="center" label="当天总活跃度" /> <el-table-column prop="totalCount" align="center" label="当天总活跃度">
<template v-slot="scope">
<el-button
@click="
detailsTitle = '当天总活跃度' + scope.row.date;
edi(scope.row.totalCountDetail, 2);
"
type="text"
size="small"
>
{{ scope.row.arCount }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="阿拉伯区总活跃度" width=""> <el-table-column align="center" label="阿拉伯区总活跃度" width="">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '阿拉伯区总活跃度'; detailsTitle = '阿拉伯区总活跃度' + scope.row.date;
edi(scope.row, 2); edi(scope.row.arCountDetail, 2);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.arDiamond }} {{ scope.row.arCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -27,13 +40,13 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '英语区总活跃度'; detailsTitle = '英语区总活跃度' + scope.row.date;
edi(scope.row, 1); edi(scope.row.enCountDetail, 1);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.enDiamond }} {{ scope.row.enCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -41,13 +54,13 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '华语区总活跃度'; detailsTitle = '华语区总活跃度' + scope.row.date;
edi(scope.row, 4); edi(scope.row.zhCountDetail, 4);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.zhDiamond }} {{ scope.row.zhCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -55,20 +68,20 @@
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@click=" @click="
detailsTitle = '土耳其区总活跃度'; detailsTitle = '土耳其区总活跃度' + scope.row.date;
edi(scope.row, 8); edi(scope.row.trCountDetail, 8);
" "
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.trDiamond }} {{ scope.row.trCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<!-- <el-pagination <el-pagination
style="margin-top: 10px" style="margin-top: 10px"
class="paginationClass" class="paginationClass"
v-model:current-page="currentPage" v-model:current-page="currentPage"
@@ -78,7 +91,7 @@
:total="total" :total="total"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> --> />
<!-- 详情 --> <!-- 详情 -->
<el-dialog v-model="detailsDialog" :title="detailsTitle" width="30%" center> <el-dialog v-model="detailsDialog" :title="detailsTitle" width="30%" center>
@@ -89,10 +102,9 @@
border border
style="width: 100%; margin-top: 25px" style="width: 100%; margin-top: 25px"
> >
<el-table-column prop="x" align="center" label="日期" /> <el-table-column prop="regionDesc" align="center" label="国家" />
<el-table-column prop="x" align="center" label="国家" /> <el-table-column prop="count" align="center" label="活跃度" />
<el-table-column prop="x" align="center" label="活跃度" /> <el-table-column prop="ratio" align="center" label="占比" />
<el-table-column prop="x" align="center" label="占比" />
</el-table> </el-table>
<!-- 操作 --> <!-- 操作 -->
<template #footer> <template #footer>
@@ -105,7 +117,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
// import { diamondStatList } from "@/api/dailyCoinStatistics/dailyCoinStatistics"; import { dauPage } from "@/api/statistics/statistics";
import { dateFormat } from "@/utils/system-helper"; import { dateFormat } from "@/utils/system-helper";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
export default { export default {
@@ -118,7 +130,7 @@ export default {
time: [], time: [],
}, },
// 表格 // 表格
tableData: [{ x: "x" }], tableData: [],
// 分页 // 分页
total: 10, //总页数 total: 10, //总页数
currentPage: 1, //页码 currentPage: 1, //页码
@@ -130,41 +142,28 @@ export default {
}; };
}, },
created() { created() {
// this.getData(); this.getData();
}, },
methods: { methods: {
// 查询 // 查询
getData() { getData() {
this.loading = true; this.loading = true;
let time = this.inquire.time; dauPage({
let startTime = null; page: this.currentPage,
let endTime = null; pageSize: this.pageSize,
if (time.length > 0) { }).then((res) => {
startTime = this.inquire.time[0] if (res.code == 200) {
? dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss") this.total = res.data.total;
: null; this.tableData = res.data.rows;
endTime = this.inquire.time[1] this.loading = false;
? dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss") } else {
: null; ElMessage({
} showClose: true,
// diamondStatList({ message: res.message,
// startDate: startTime, type: "error",
// endDate: endTime, });
// // pageNo: this.currentPage, }
// // pageSize: this.pageSize, });
// }).then((res) => {
// if (res.code == 200) {
// // this.total = res.data.total;
// this.tableData = res.data;
// this.loading = false;
// } else {
// ElMessage({
// showClose: true,
// message: res.message,
// type: "error",
// });
// }
// });
}, },
// 详情 // 详情
edi(res, type) { edi(res, type) {
@@ -180,7 +179,7 @@ export default {
// : type == 8 // : type == 8
// ? res.trDomainDetail // ? res.trDomainDetail
// : `"[""]"`; // : `"[""]"`;
// this.tableDataIn = JSON.parse(jsonArr); (this.tableDataIn = JSON.parse(res));
this.detailsDialog = true; this.detailsDialog = true;
}, },
// 分页导航 // 分页导航