fix
This commit is contained in:
@@ -2,10 +2,34 @@
|
||||
<div class="recentNewUserChart admin_page">
|
||||
<div class="admin_table_search">
|
||||
<div class="admin_state">
|
||||
<div class="admin_state_item">
|
||||
<span>Select Time:</span>
|
||||
<a-range-picker
|
||||
style="width:250px"
|
||||
class="range_picker"
|
||||
v-model:value="rangePickerValue"
|
||||
:placeholder="[
|
||||
$t('HistoryPage.StartDate'),
|
||||
$t('HistoryPage.EndDate'),
|
||||
]"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
>
|
||||
<template #suffixIcon>
|
||||
<span
|
||||
class="icon iconfont range_picker_icon icon-rili"
|
||||
></span>
|
||||
</template>
|
||||
</a-range-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
|
||||
</div>
|
||||
<div class="admin_search">
|
||||
<div class="admin_search_item" @click="searchHistoryList">Search</div>
|
||||
</div>
|
||||
<div class="admin_state_list">
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
|
||||
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin_table_content" ref="pageChartDom"></div>
|
||||
@@ -43,9 +67,34 @@ export default defineComponent({
|
||||
let searchHistoryList = () => {
|
||||
gettrialList();
|
||||
};
|
||||
let lastGeTrialList = (str:string)=>{
|
||||
let currentDate = new Date();
|
||||
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
// 计算30天前的时间戳
|
||||
let thirtyDaysAgoTimestamp
|
||||
if(str == 'year'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
|
||||
}else if(str == 'month'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
|
||||
}else if(str == 'week'){
|
||||
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
|
||||
}
|
||||
filterData.rangePickerValue = [formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD'),formatTime(currentTimestamp,'YYYY-MM-DD')]
|
||||
gettrialList();
|
||||
}
|
||||
//获取列表
|
||||
let gettrialList = async () => {
|
||||
Https.axiosGet(Https.httpUrls.conversionRate).then((rv: any) => {
|
||||
let startDate: any = filterData.rangePickerValue?.[0]
|
||||
? filterData.rangePickerValue[0]+' '+'00:00:00'
|
||||
: "";
|
||||
let endDate: any = filterData.rangePickerValue?.[1]
|
||||
? filterData.rangePickerValue[1]+' '+'00:00:00'
|
||||
: "";
|
||||
let data = {
|
||||
endTime:endDate,
|
||||
startTime:startDate,
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.conversionRate,{params:data}).then((rv: any) => {
|
||||
if (rv) {
|
||||
let entries:any = Object.entries(rv);
|
||||
let data: any = [];
|
||||
@@ -99,7 +148,8 @@ export default defineComponent({
|
||||
},
|
||||
legend: {
|
||||
top: '10%',
|
||||
left: 'center'
|
||||
left: 'center',
|
||||
// formatter: '{a} <br/>{b}'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -120,10 +170,10 @@ export default defineComponent({
|
||||
show: true,
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
data: data
|
||||
}
|
||||
@@ -141,6 +191,7 @@ export default defineComponent({
|
||||
return {
|
||||
...toRefs(filter),
|
||||
...toRefs(filterData),
|
||||
lastGeTrialList,
|
||||
searchHistoryList,
|
||||
gettrialList,
|
||||
pageChartDom,
|
||||
|
||||
Reference in New Issue
Block a user