|
@@ -24,22 +24,26 @@ import {onMounted} from "vue";
|
|
|
const today = new Date();
|
|
|
const yesterday = new Date(today);
|
|
|
yesterday.setDate(today.getDate() - 1);
|
|
|
-const monthDay = ["月度","每日"]
|
|
|
-const dateType = ref("每日")
|
|
|
+const monthDay = ["按年","按月","按日"]
|
|
|
+const dateType = ref("按日")
|
|
|
const dateValue = ref(yesterday)
|
|
|
const chartSort = ref(null)
|
|
|
onMounted(()=>{
|
|
|
changeDate()
|
|
|
})
|
|
|
async function changeDate(){
|
|
|
- if(dateType.value=="月度"){
|
|
|
+ if(dateType.value=="按月"){
|
|
|
const d=parseTime(dateValue.value,"{y}-{m}")
|
|
|
const res = await hlMonthDay("month",d)
|
|
|
initChart(res.data)
|
|
|
- }else{
|
|
|
+ }else if(dateType.value=="按日"){
|
|
|
const d=parseTime(dateValue.value,"{y}-{m}-{d}")
|
|
|
const res = await hlMonthDay("day",d)
|
|
|
initChart(res.data)
|
|
|
+ }else{
|
|
|
+ const d=parseTime(dateValue.value,"{y}")
|
|
|
+ const res = await hlMonthDay("year",d)
|
|
|
+ initChart(res.data)
|
|
|
}
|
|
|
}
|
|
|
|