2023-09-19 10:55:46 +08:00
|
|
|
<template>
|
|
|
|
<section class="content">
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-body">
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
<section class="content-header">
|
|
|
|
<h1 id="itemTitle"></h1>
|
|
|
|
</section>
|
|
|
|
<div id="toolbar">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<label for="startTime" class="col-sm-4 control-label">开始日期:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input type="text" class="input-sm form-control" name="startTime" id="startTime">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<label for="endTime" class="col-sm-4 control-label">结束日期:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input type="text" class="input-sm form-control" name="endTime" id="endTime">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<button class="btn btn-default js-quick-search js-quick-search-1" data-days="1">
|
|
|
|
昨天
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
|
|
|
|
最近7天
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
|
|
|
|
最近30天
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<button id="btnSearch" class="btn btn-default">
|
|
|
|
<i class="glyphicon glyphicon-search"></i>查询
|
|
|
|
</button>
|
|
|
|
<button id="btnExport" class="btn btn-default">
|
|
|
|
<i class="glyphicon glyphicon-export"></i>导出
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- .content -->
|
|
|
|
<div id="table"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import TableHelper from '@/utils/bootstrap-table-helper';
|
|
|
|
import { formatTime }from '@/utils/maintainer.js';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "LuckySeaPlatformAdminView",
|
|
|
|
setup() {
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.$nextTick(function () {
|
|
|
|
this.initData();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
initData() {
|
|
|
|
$(function () {
|
|
|
|
$('.js-quick-search').on('click', function () {
|
|
|
|
$('.js-quick-search').removeClass('active')
|
|
|
|
$(this).addClass('active');
|
|
|
|
setSearchTimeUseQuickWay($(this));
|
|
|
|
|
|
|
|
TableHelper.doRefresh('#table');
|
|
|
|
});
|
|
|
|
|
|
|
|
function setSearchTimeUseQuickWay(quickDom) {
|
|
|
|
const days = quickDom.attr("data-days");
|
|
|
|
const today = new Date(new Date().setHours(0, 0, 0, 0));
|
|
|
|
const todayStr = formatTime(today);
|
|
|
|
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
|
|
|
|
|
|
|
|
$('#startTime').val(startTime);
|
|
|
|
$('#endTime').val(todayStr);
|
|
|
|
}
|
|
|
|
|
|
|
|
const quickDom = $('.js-quick-search-7');
|
|
|
|
quickDom.addClass('active');
|
|
|
|
setSearchTimeUseQuickWay(quickDom);
|
|
|
|
|
|
|
|
|
|
|
|
// 查询刷新
|
|
|
|
$('#btnSearch').on('click', function () {
|
|
|
|
TableHelper.doRefresh('#table');
|
|
|
|
});
|
|
|
|
var chargeStart = $('#startTime').datepicker({
|
|
|
|
format: 'yyyy-mm-dd 00:00:00',
|
|
|
|
autoclose: true
|
|
|
|
});
|
|
|
|
|
|
|
|
var chargeEnd = $('#endTime').datepicker({
|
|
|
|
format: 'yyyy-mm-dd 00:00:00',
|
|
|
|
autoclose: true
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#btnExport').on('click', function () {
|
|
|
|
const startTime = $('#startTime').val();
|
|
|
|
const endTime = $('#endTime').val();
|
|
|
|
window.location.href = `/admin/luckySea/exportPlatformStat?startTime=${startTime}&endTime=${endTime}`
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#table').bootstrapTable('destroy');
|
|
|
|
$('#table').bootstrapTable({
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
field: 'queryDate', title: '日期', align: 'center', width: '5%',
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
if (val) {
|
|
|
|
var date = new Date(val);
|
|
|
|
return date.format('yyyy-MM-dd');
|
|
|
|
} else {
|
|
|
|
return '-';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ field: 'memberNum', title: '总人数', align: 'center', width: '10%' },
|
|
|
|
{ field: 'totalPlayTimes', title: '总人次', align: 'center', width: '10%', valign: 'center' },
|
|
|
|
{ field: 'roundNum', title: '总轮数', align: 'center', width: '5%', },
|
|
|
|
{ field: 'totalPiece', title: '总投入', align: 'center', width: '5%', },
|
|
|
|
{ field: 'totalPlatformValue', title: '总平台价值', align: 'center', width: '5%', },
|
|
|
|
{ field: 'totalTicket', title: '门票', align: 'center', width: '5%', },
|
|
|
|
],
|
|
|
|
undefinedText: 0,
|
|
|
|
cache: false,
|
|
|
|
striped: true,
|
|
|
|
showRefresh: false,
|
|
|
|
pageSize: 20,
|
|
|
|
pagination: true,
|
|
|
|
pageList: [20, 50, 100, 200, 300, 500],
|
|
|
|
search: false,
|
|
|
|
sidePagination: "server", //表示服务端请求
|
|
|
|
queryParamsType: "undefined",
|
|
|
|
queryParams: function queryParams(params) { //设置查询参数
|
|
|
|
var param = {
|
|
|
|
page: params.pageNumber,
|
|
|
|
pageSize: params.pageSize,
|
|
|
|
startTime: $('#startTime').val(),
|
|
|
|
endTime: $('#endTime').val()
|
|
|
|
};
|
|
|
|
return param;
|
|
|
|
},
|
|
|
|
toolbar: '#toolbar',
|
2024-04-22 10:44:52 +08:00
|
|
|
url: '/admin/luckySea/listPlatformStat',
|
2023-09-19 10:55:46 +08:00
|
|
|
onLoadSuccess: function () { //加载成功时执行
|
|
|
|
console.log("load success");
|
|
|
|
},
|
|
|
|
onLoadError: function () { //加载失败时执行
|
|
|
|
console.log("load fail");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
2023-11-14 17:59:51 +08:00
|
|
|
|
2023-09-19 10:55:46 +08:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
#teamDetailModal .modal-dialog,
|
|
|
|
#userDetailModal .modal-dialog {
|
|
|
|
width: 50%;
|
|
|
|
}
|
|
|
|
</style>
|