Compare commits

..

5 Commits

7 changed files with 18 additions and 353 deletions

View File

@@ -1,2 +1,2 @@
VUE_APP_API_BASE_URL=http://admin.web.pekolive.com
VUE_APP_API_BASE_URL=http://admin.web.moliparty.com
VUE_APP_DEBUG_MODE=false

View File

@@ -1,44 +0,0 @@
import request from '@/utils/request';
// 获取游戏列表
export const mgList = query => {
return request({
url: '/admin/miniGame/statis/mgList',
method: 'get',
params: query
});
};
// 获取休闲游戏时长统计列表
export const getMinigameListStat = query => {
return request({
url: '/admin/minigame/sud/stat/listStat',
method: 'get',
params: query
});
};
// 获取休闲游戏时长明细列表
export const getMinigamePageDetail = query => {
return request({
url: '/admin/minigame/sud/stat/pageDetail',
method: 'get',
params: query
});
};
// 导出休闲游戏时长统计
export const exportMiniGameStat = query => {
return request({
url: `/admin/minigame/sud/stat/exportStat`,
method: 'get',
params: query,
responseType: 'blob'
});
}
// 导出休闲游戏时长明细
export const exportMiniGameDetail = query => {
return request({
url: `/admin/minigame/sud/stat/exportDetail`,
method: 'get',
params: query,
responseType: 'blob'
});
}

View File

@@ -6,7 +6,7 @@
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>M</b>S</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>molistar</b>管理系统</span>
<span class="logo-lg"><b>MoliParty</b>管理系统</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">

View File

@@ -1,304 +0,0 @@
<template>
<div class="box">
<div class="inquire">
<span>游戏名称</span>
<el-select v-model="formData.gameId" placeholder="请选择">
<el-option
v-for="item in gameList"
:key="item.mgId"
:label="JSON.parse(item.name).zh"
:value="item.mgId"
>
</el-option>
</el-select>
</div>
<div class="inquire">
<span class="demonstration">月份</span>
<el-config-provider :locale="zhCn">
<el-date-picker
v-model="formData.month"
type="month"
placeholder="选择月"
value-format="YYYY-MM"
:clearable="false"
>
</el-date-picker
></el-config-provider>
</div>
<el-button style="" type="primary" @click="getData()">查询</el-button>
<el-button class="primary" type="primary" @click="resetFormData()"
>重置</el-button
>
<el-button class="primary" type="primary" @click="confirmExport2Excel()"
>导出</el-button
>
<!-- 表格数据 -->
<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="statMonth" align="center" label="月份" />
<el-table-column prop="gameName" align="center" label="游戏名称" />
<el-table-column prop="totalDuration" align="center" label="总时长(秒)">
<template v-slot="scope">
<el-button @click="detailFun(scope.row)" type="text" size="small">
{{ scope.row.totalDuration }}
</el-button>
</template>
</el-table-column>
<el-table-column prop="arDuration" align="center" label="阿拉伯时长(秒)" />
<el-table-column prop="enDuration" align="center" label="英语区时长(秒)" />
<el-table-column prop="en2Duration" align="center" label="英语2区时长(秒)" />
<el-table-column prop="trDuration" align="center" label="土耳其区时长(秒)" />
<el-table-column prop="zhDuration" align="center" label="华语区时长(秒)" />
</el-table>
<!-- 明细弹窗 -->
<el-dialog
v-model="dailydetailDialog"
title="休闲游戏时长明细"
width="30%"
center
>
<el-button style="" type="primary" @click="confirmExport2ExcelDetail()"
>导出</el-button
>
<el-table
:data="detailtableData.data"
style="width: 100%;margin-top: 20px;"
ref="multipleTable"
border
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="gameName" align="center" label="游戏名称" />
<el-table-column prop="erbanNo" align="center" label="房间号" />
<el-table-column prop="partitionDesc" align="center" label="分区" />
<el-table-column prop="duration" align="center" label="游戏时长(秒)" />
</el-table>
<el-pagination
style="margin-top: 10px"
class="paginationClass"
:current-page="detailData.page"
:page-size="detailData.size"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="detailtableData.total"
@size-change="handleSizeChangeDetail"
@current-change="handleCurrentChangeDetail"
/>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="dailydetailDialog = false">
关闭
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
name: "statisticsIeisureGameDuration",
};
</script>
<script setup>
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { formatDate } from "@/utils/relDate";
import { dateFormat } from "@/utils/system-helper";
import {
mgList,
getMinigameListStat,
getMinigamePageDetail,
exportMiniGameStat,
exportMiniGameDetail,
} from "@/api/statisticsIeisureGameDuration/statisticsIeisureGameDuration";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
const formData = reactive({
month: "",
gameId: "",
});
const tableData = reactive({
data: [],
total: 0,
loading: false,
});
const detailData = reactive({
month: "",
gameId: "",
page: 1,
size: 10,
});
const detailtableData = reactive({
data: [],
total: 0,
loading: false,
});
const gameList = ref([]);
const dailydetailDialog = ref(false);
// 查询
const getData = () => {
if (formData.month == "" && !formData.month) {
ElMessage.warning("请选择月份");
return;
}
tableData.loading = true;
getMinigameListStat(formData).then((res) => {
if (res.code == 200) {
tableData.data = res.data;
tableData.loading = false;
tableData.total = res.total;
} else {
tableData.loading = false;
ElMessage.error(res.message);
}
});
};
// 明细
const detailFun = (row) => {
if(row){
detailData.gameId = row.gameId;
detailData.month = row.statMonth;
}
getMinigamePageDetail(detailData).then((res) => {
if (res.code == 200) {
detailtableData.data = res.data.records;
detailtableData.loading = false;
detailtableData.total = res.data.total;
dailydetailDialog.value = true;
} else {
ElMessage.error(res.message);
}
});
};
//重置
const resetFormData = () => {
Object.assign(formData.value, {
gameId: "",
});
};
// 导出
const confirmExport2Excel = async () => {
try {
const res = await exportMiniGameStat(formData)
if (res) {
ElMessage({
message: '导出成功',
type: 'success',
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `休闲游戏时长统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: 'error',
});
}
};
// 导出
const confirmExport2ExcelDetail = async () => {
try {
const res = await exportMiniGameDetail(detailData)
if (res) {
ElMessage({
message: '导出成功',
type: 'success',
});
let time = formatDate(new Date());
let alink = document.createElement("a");
alink.download = `休闲游戏时长明细统计${time}.xls`;
alink.style.display = "none";
const blob = new Blob([res]);
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
}
} catch (error) {
ElMessage({
message: error.message,
type: 'error',
});
}
};
const handleSizeChangeDetail = (val) => {
detailData.size = val;
detailFun();
};
const handleCurrentChangeDetail = (val) => {
detailData.page = val;
detailFun();
};
onMounted(() => {
mgList().then((res) => {
if (res.code == 200) {
gameList.value = res.data;
} else {
ElMessage.error(res.message);
}
});
});
</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;
}
.selectBoxImg {
height: 150px;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

View File

@@ -4,7 +4,7 @@
:style="[smsSwitch ? 'height: 350px' : '']">
<div class="login_box">
<div class="login_logo">
<span style="font-size:24px;color:#222;font-weight:bold;">&nbsp;&nbsp;MOLISTAR&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span style="font-size:24px;color:#222;font-weight:bold;">&nbsp;&nbsp;MoliParty&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
<div class="login_form">
<form id="loginForm"

View File

@@ -163,6 +163,14 @@
label="可见用户"
:formatter="ruleJsonFormatter" />
<el-table-column align="center"
prop="USER_LEVEL"
label="用户等级"
:formatter="ruleJsonFormatter" />
<el-table-column align="center"
prop="USER_LEVEL_LIMIT_ROLE"
label="财富等级限制生效范围"
:formatter="ruleJsonFormatter" />
<el-table-column align="center"
prop="panelType"
label="游戏第三方" >
<template v-slot="scope">{{ scope.row.code=='BAISHUN'?'百顺':scope.row.code=='LEADERCC'?'灵仙':'Joy'}}</template>
@@ -585,6 +593,8 @@ export default {
if (!value) {
if (key == 'NOT_CHANNELS' || key == 'NOT_UIDS') {
value = '-';
} else if (key == 'USER_LEVEL_LIMIT_ROLE') {
value = '全部用户';
} else {
value = '全部';
}
@@ -594,6 +604,9 @@ export default {
} else if (key == 'ANDROID') {
value = ruleObj['ANDROID_LOW_VERSION'] + '~' + ruleObj['ANDROID_HIGH_VERSION'];
}
if (key == 'USER_LEVEL_LIMIT_ROLE') {
value = ruleObj['USER_LEVEL_LIMIT_ROLE']?ruleObj['USER_LEVEL_LIMIT_ROLE'] == 1?'全部用户':'非公会成员':'全部用户';
}
return value;
},
getData () {
@@ -689,7 +702,7 @@ export default {
}
this.resource.ruleValue[ruleCode] = rule;
}
this.resource.ruleValue['USER_LEVEL_LIMIT_ROLE'] = "1";
this.resource.ruleValue['USER_LEVEL_LIMIT_ROLE'] = this.resource.ruleValue['USER_LEVEL_LIMIT_ROLE'] ?this.resource.ruleValue['USER_LEVEL_LIMIT_ROLE']:"1";
this.resource.partitionId = row.partitionId;
this.editDialog = true;
},

View File

@@ -19,7 +19,7 @@ module.exports = defineConfig({
config
.plugin('html') // 配置 html-webpack-plugin 插件
.tap(args => {
args[0].title = 'MOLISTAR管理后台' // 设置网页标题
args[0].title = 'MoliParty管理后台' // 设置网页标题
return args
})
},