|
@ -23,17 +23,17 @@ |
|
|
{{ dailyChange / 100 }} |
|
|
{{ dailyChange / 100 }} |
|
|
<template v-if="dailyChange > 0"> |
|
|
<template v-if="dailyChange > 0"> |
|
|
<el-icon style="color:red"> |
|
|
<el-icon style="color:red"> |
|
|
<ArrowUpBold /> |
|
|
|
|
|
|
|
|
<ArrowUpBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else-if="dailyChange < 0"> |
|
|
<template v-else-if="dailyChange < 0"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<ArrowDownBold /> |
|
|
|
|
|
|
|
|
<ArrowDownBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else> |
|
|
<template v-else> |
|
|
<el-icon style="color:grey"> |
|
|
<el-icon style="color:grey"> |
|
|
<SemiSelect /> |
|
|
|
|
|
|
|
|
<SemiSelect/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
</div> |
|
|
</div> |
|
@ -89,34 +89,34 @@ |
|
|
<el-col class="center-card">周同比:{{ sumWow }}% |
|
|
<el-col class="center-card">周同比:{{ sumWow }}% |
|
|
<template v-if="sumWow > 0"> |
|
|
<template v-if="sumWow > 0"> |
|
|
<el-icon style="color:red"> |
|
|
<el-icon style="color:red"> |
|
|
<ArrowUpBold /> |
|
|
|
|
|
|
|
|
<ArrowUpBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else-if="sumWow < 0"> |
|
|
<template v-else-if="sumWow < 0"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<ArrowDownBold /> |
|
|
|
|
|
|
|
|
<ArrowDownBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else> |
|
|
<template v-else> |
|
|
<el-icon style="color:grey"> |
|
|
<el-icon style="color:grey"> |
|
|
<SemiSelect /> |
|
|
|
|
|
|
|
|
<SemiSelect/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col class="center-card">日环比:{{ sumDaily }}% |
|
|
<el-col class="center-card">日环比:{{ sumDaily }}% |
|
|
<template v-if="sumDaily > 0"> |
|
|
<template v-if="sumDaily > 0"> |
|
|
<el-icon style="color:red"> |
|
|
<el-icon style="color:red"> |
|
|
<ArrowUpBold /> |
|
|
|
|
|
|
|
|
<ArrowUpBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else-if="sumDaily < 0"> |
|
|
<template v-else-if="sumDaily < 0"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<el-icon style="color:forestgreen"> |
|
|
<ArrowDownBold /> |
|
|
|
|
|
|
|
|
<ArrowDownBold/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else> |
|
|
<template v-else> |
|
|
<el-icon style="color:grey"> |
|
|
<el-icon style="color:grey"> |
|
|
<SemiSelect /> |
|
|
|
|
|
|
|
|
<SemiSelect/> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
</template> |
|
|
</template> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -129,85 +129,91 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row style="margin-top: 20px"> |
|
|
<el-row style="margin-top: 20px"> |
|
|
<el-card> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
<el-tabs v-model="activeTab" @tab-change="handleTabChange"> |
|
|
|
|
|
<el-tab-pane label="金币充值" name="recharge"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="金币消费" name="consume"></el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<div style="margin-top:5px;width:40vw">合计 |
|
|
|
|
|
永久金币 {{ activeTab === 'recharge' ? sumRechargePermanent / 100 : sumConsumePermanent / 100 }} |
|
|
|
|
|
免费金币 {{ activeTab === 'recharge' ? sumRechargeFree / 100 : sumConsumeFree / 100 }} |
|
|
|
|
|
任务金币 {{ activeTab === 'recharge' ? sumRechargeTask / 100 : sumConsumeTask / 100 }} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div @change="handleDatePickerChange" style="width:15vw"> |
|
|
|
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今日 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getWeek()" :type="activeTimeRange === 'week' ? 'primary' : ''">本周 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getMonth()" :type="activeTimeRange === 'month' ? 'primary' : ''">本月 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getYear()" :type="activeTimeRange === 'year' ? 'primary' : ''">本年 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style="width:25vw"> |
|
|
|
|
|
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="→" start-placeholder="开始时间" |
|
|
|
|
|
end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss" style="width:20vw" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" /> |
|
|
|
|
|
<el-button type="primary" style="margin-left: 5px" @click="getChartData">查询</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-card> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
<el-tabs v-model="activeTab" @tab-change="handleTabChange"> |
|
|
|
|
|
<el-tab-pane label="金币充值" name="recharge"></el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="金币消费" name="consume"></el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<div style="margin-top:5px;width:40vw">合计 |
|
|
|
|
|
永久金币 {{ activeTab === 'recharge' ? sumRechargePermanent / 100 : sumConsumePermanent / 100 }} |
|
|
|
|
|
免费金币 {{ activeTab === 'recharge' ? sumRechargeFree / 100 : sumConsumeFree / 100 }} |
|
|
|
|
|
任务金币 {{ activeTab === 'recharge' ? sumRechargeTask / 100 : sumConsumeTask / 100 }} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div @change="handleDatePickerChange" style="width:15vw"> |
|
|
|
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今日 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getWeek()" :type="activeTimeRange === 'week' ? 'primary' : ''">本周 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getMonth()" :type="activeTimeRange === 'month' ? 'primary' : ''">本月 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button @click="getYear()" :type="activeTimeRange === 'year' ? 'primary' : ''">本年 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style="width:25vw"> |
|
|
|
|
|
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="→" start-placeholder="开始时间" |
|
|
|
|
|
end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss" style="width:20vw" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
|
:default-time="defaultTime" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-button type="primary" style="margin-left: 5px" @click="getChartData">查询</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20" style="margin-top: 20px"> |
|
|
|
|
|
<el-col :span="18"> |
|
|
|
|
|
<div class="bar"> |
|
|
|
|
|
<div ref="chartRef" style="width: 100%; height: 400px"></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="rank-card" style="width: 100%; height: 100%"> |
|
|
|
|
|
<div class="card-large margin-bottom">金币{{ activeTab === 'recharge' ? '充值' : '消费' }}排名</div> |
|
|
|
|
|
<el-select v-model="selectedType" style="width: 100%; margin-bottom: 15px"> |
|
|
|
|
|
<el-option label="全部类型" value="all"></el-option> |
|
|
|
|
|
<el-option label="永久金币" value="permanent"></el-option> |
|
|
|
|
|
<el-option label="免费金币" value="free"></el-option> |
|
|
|
|
|
<el-option label="任务金币" value="task"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-table :data="tableData" height="320px"> |
|
|
|
|
|
<el-table-column prop="rank" label="排名" width="60" align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="market" label="地区" align="center"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span>{{ marketMapping[scope.row.market] || scope.row.market }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="coinAmount" label="金币数量" align="center"> |
|
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
|
{{ row.coinAmount.toLocaleString() }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
<el-row :gutter="20" style="margin-top: 20px"> |
|
|
|
|
|
<el-col :span="18"> |
|
|
|
|
|
<div class="bar"> |
|
|
|
|
|
<div ref="chartRef" style="width: 100%; height: 400px"></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="rank-card" style="width: 100%; height: 100%"> |
|
|
|
|
|
<div class="card-large margin-bottom">金币{{ activeTab === 'recharge' ? '充值' : '消费' }}排名</div> |
|
|
|
|
|
<el-select v-model="selectedType" style="width: 100%; margin-bottom: 15px"> |
|
|
|
|
|
<el-option label="全部类型" value="all"></el-option> |
|
|
|
|
|
<el-option label="永久金币" value="permanent"></el-option> |
|
|
|
|
|
<el-option label="免费金币" value="free"></el-option> |
|
|
|
|
|
<el-option label="任务金币" value="task"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-table :data="tableData" height="320px"> |
|
|
|
|
|
<el-table-column prop="rank" label="排名" width="60" align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="market" label="地区" align="center"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span>{{ marketMapping[scope.row.market] || scope.row.market }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="coinAmount" label="金币数量" align="center"> |
|
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
|
{{ row.coinAmount.toLocaleString() }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-card> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup> |
|
|
<script setup> |
|
|
import * as echarts from 'echarts' |
|
|
import * as echarts from 'echarts' |
|
|
import { ref, onMounted, nextTick, watch, onUnmounted } from 'vue' |
|
|
|
|
|
|
|
|
import {ref, onMounted, nextTick, watch, onUnmounted} from 'vue' |
|
|
import API from '@/util/http' |
|
|
import API from '@/util/http' |
|
|
import { ElMessage } from 'element-plus' |
|
|
|
|
|
|
|
|
import {ElMessage} from 'element-plus' |
|
|
import dayjs from 'dayjs'; |
|
|
import dayjs from 'dayjs'; |
|
|
import utc from 'dayjs-plugin-utc' |
|
|
import utc from 'dayjs-plugin-utc' |
|
|
|
|
|
|
|
|
dayjs.extend(utc) |
|
|
dayjs.extend(utc) |
|
|
import { ArrowUpBold, ArrowDownBold, SemiSelect } from '@element-plus/icons-vue' |
|
|
|
|
|
import { marketMapping } from "@/utils/marketMap.js"; |
|
|
|
|
|
|
|
|
import {ArrowUpBold, ArrowDownBold, SemiSelect} from '@element-plus/icons-vue' |
|
|
|
|
|
import {marketMapping} from "@/utils/marketMap.js"; |
|
|
|
|
|
|
|
|
|
|
|
const defaultTime = [ |
|
|
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
|
|
new Date(2000, 2, 1, 23, 59, 59), |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
// 地区数据 |
|
|
// 地区数据 |
|
|
const markets = ref([]) |
|
|
const markets = ref([]) |
|
@ -308,7 +314,7 @@ const getToday = function () { |
|
|
// 本周 |
|
|
// 本周 |
|
|
const getWeek = function () { |
|
|
const getWeek = function () { |
|
|
const today = dayjs() |
|
|
const today = dayjs() |
|
|
const startTime = (today.startOf('week').add(1, 'day')).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
|
const startTime = (today.startOf('week').format('YYYY-MM-DD HH:mm:ss')) |
|
|
const endTime = today.endOf('week').format('YYYY-MM-DD HH:mm:ss') |
|
|
const endTime = today.endOf('week').format('YYYY-MM-DD HH:mm:ss') |
|
|
// const endTime = today.add(1, 'week').startOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss') |
|
|
// const endTime = today.add(1, 'week').startOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss') |
|
|
dateRange.value = [startTime, endTime] |
|
|
dateRange.value = [startTime, endTime] |
|
@ -605,7 +611,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'recharge', |
|
|
stack: 'recharge', |
|
|
data: chartData.rechargePermanent, |
|
|
data: chartData.rechargePermanent, |
|
|
itemStyle: { color: '#5470c6' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#5470c6'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -613,7 +619,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'recharge', |
|
|
stack: 'recharge', |
|
|
data: chartData.rechargeFree, |
|
|
data: chartData.rechargeFree, |
|
|
itemStyle: { color: '#91cc75' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#91cc75'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -621,7 +627,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'recharge', |
|
|
stack: 'recharge', |
|
|
data: chartData.rechargeTask, |
|
|
data: chartData.rechargeTask, |
|
|
itemStyle: { color: '#fac858' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#fac858'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
@ -633,7 +639,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'consume', |
|
|
stack: 'consume', |
|
|
data: chartData.consumePermanent, |
|
|
data: chartData.consumePermanent, |
|
|
itemStyle: { color: '#5470c6' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#5470c6'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -641,7 +647,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'consume', |
|
|
stack: 'consume', |
|
|
data: chartData.consumeFree, |
|
|
data: chartData.consumeFree, |
|
|
itemStyle: { color: '#91cc75' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#91cc75'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -649,7 +655,7 @@ const updateChart = (chartData) => { |
|
|
type: 'bar', |
|
|
type: 'bar', |
|
|
stack: 'consume', |
|
|
stack: 'consume', |
|
|
data: chartData.consumeTask, |
|
|
data: chartData.consumeTask, |
|
|
itemStyle: { color: '#fac858' }, |
|
|
|
|
|
|
|
|
itemStyle: {color: '#fac858'}, |
|
|
barWidth: 30 |
|
|
barWidth: 30 |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
@ -730,7 +736,7 @@ const handleTabChange = () => { |
|
|
|
|
|
|
|
|
const getAdminData = async function () { |
|
|
const getAdminData = async function () { |
|
|
try { |
|
|
try { |
|
|
const result = await API({ url: '/admin/userinfo', data: {} }) |
|
|
|
|
|
|
|
|
const result = await API({url: '/admin/userinfo', data: {}}) |
|
|
adminData.value = result |
|
|
adminData.value = result |
|
|
console.log('用户信息', adminData.value) |
|
|
console.log('用户信息', adminData.value) |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
@ -740,7 +746,7 @@ const getAdminData = async function () { |
|
|
// 获取卡片数据 |
|
|
// 获取卡片数据 |
|
|
const getCardData = async () => { |
|
|
const getCardData = async () => { |
|
|
try { |
|
|
try { |
|
|
const response = await API({ url: '/workbench/getCard', data: {} }) |
|
|
|
|
|
|
|
|
const response = await API({url: '/workbench/getCard', data: {}}) |
|
|
workDataUpdateTime.value = response.updateTime |
|
|
workDataUpdateTime.value = response.updateTime |
|
|
// 周同比 |
|
|
// 周同比 |
|
|
sumWow.value = response.sumWow.toFixed(2) |
|
|
sumWow.value = response.sumWow.toFixed(2) |
|
|