|
|
@ -137,13 +137,15 @@ |
|
|
|
<el-tab-pane label="金币消费" name="consume"></el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-col> |
|
|
|
<div style="margin-top:5px;width:40vw">合计 |
|
|
|
<div style="margin-top:5px;width:35vw">合计 |
|
|
|
永久金币 {{ 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' : ''">今日 |
|
|
|
<div @change="handleDatePickerChange" style="width:20vw"> |
|
|
|
<el-button @click="getYes()" :type="activeTimeRange === 'yes' ? 'primary' : ''">昨天 |
|
|
|
</el-button> |
|
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''">今天 |
|
|
|
</el-button> |
|
|
|
<el-button @click="getWeek()" :type="activeTimeRange === 'week' ? 'primary' : ''">本周 |
|
|
|
</el-button> |
|
|
@ -298,6 +300,17 @@ const formatDate = function (date) { |
|
|
|
const seconds = String(date.getSeconds()).padStart(2, '0'); |
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
|
|
|
} |
|
|
|
// 昨天 |
|
|
|
const getYes = function () { |
|
|
|
const yesterday = dayjs().subtract(1, 'day') |
|
|
|
const startTime = yesterday.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
const endTime = yesterday.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
dateRange.value = [startTime, endTime] |
|
|
|
console.log('看看dateRange', dateRange.value) |
|
|
|
activeTimeRange.value = 'yes' // 标记当前激活状态 |
|
|
|
|
|
|
|
getChartData() |
|
|
|
} |
|
|
|
// 今天 |
|
|
|
const getToday = function () { |
|
|
|
const today = dayjs() |
|
|
|