Compare commits
No commits in common. "d5c01d8d23c1133684a58b851110fa767cd4093e" and "7118b0649aebf08a3f975f379b9891e3fffb7a1d" have entirely different histories.
d5c01d8d23
...
7118b0649a
|
@ -11,51 +11,19 @@
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-col>
|
<v-col cols="2">
|
||||||
<v-btn
|
|
||||||
block
|
|
||||||
color="#3bb9f1"
|
|
||||||
dark
|
|
||||||
depressed
|
|
||||||
@click="getTodayStatistics"
|
|
||||||
>
|
|
||||||
오늘
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
<v-col>
|
|
||||||
<v-btn
|
|
||||||
block
|
|
||||||
color="#3bb9f1"
|
|
||||||
dark
|
|
||||||
depressed
|
|
||||||
@click="getYesterdayStatistics"
|
|
||||||
>
|
|
||||||
어제
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
<v-col>
|
|
||||||
<v-btn
|
|
||||||
block
|
|
||||||
color="#3bb9f1"
|
|
||||||
dark
|
|
||||||
depressed
|
|
||||||
@click="getWeekStatistics"
|
|
||||||
>
|
|
||||||
7일 전
|
|
||||||
</v-btn>
|
|
||||||
</v-col>
|
|
||||||
<v-spacer />
|
|
||||||
<v-col>
|
|
||||||
<datetime
|
<datetime
|
||||||
v-model="start_date"
|
v-model="start_date"
|
||||||
class="datepicker"
|
class="datepicker"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="1">
|
<v-col cols="1">
|
||||||
~
|
~
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
|
||||||
|
<v-col cols="2">
|
||||||
<datetime
|
<datetime
|
||||||
v-model="end_date"
|
v-model="end_date"
|
||||||
class="datepicker"
|
class="datepicker"
|
||||||
|
@ -63,6 +31,8 @@
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="1" />
|
||||||
|
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
|
@ -260,7 +230,25 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await this.getTodayStatistics();
|
const date = new Date();
|
||||||
|
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1);
|
||||||
|
const lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
let firstDateMonth = (firstDate.getMonth() + 1).toString()
|
||||||
|
if (firstDateMonth.length < 2) {
|
||||||
|
firstDateMonth = '0' + firstDateMonth
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let lastDateMonth = (lastDate.getMonth() + 1).toString()
|
||||||
|
if (lastDateMonth.length < 2) {
|
||||||
|
lastDateMonth = '0' + lastDateMonth
|
||||||
|
}
|
||||||
|
|
||||||
|
this.start_date = firstDate.getFullYear() + '-' + firstDateMonth + '-0' + firstDate.getDate()
|
||||||
|
this.end_date = lastDate.getFullYear() + '-' + lastDateMonth + '-' + lastDate.getDate()
|
||||||
|
|
||||||
|
await this.getStatistics()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -276,10 +264,6 @@ export default {
|
||||||
return this.items.reduce((a, b) => a + (b[key] || 0), 0)
|
return this.items.reduce((a, b) => a + (b[key] || 0), 0)
|
||||||
},
|
},
|
||||||
|
|
||||||
formatDate(date) {
|
|
||||||
return date.toISOString().split('T')[0];
|
|
||||||
},
|
|
||||||
|
|
||||||
async next() {
|
async next() {
|
||||||
await this.getStatistics()
|
await this.getStatistics()
|
||||||
},
|
},
|
||||||
|
@ -309,36 +293,6 @@ export default {
|
||||||
this.is_loading = false
|
this.is_loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async getTodayStatistics() {
|
|
||||||
const today = new Date();
|
|
||||||
|
|
||||||
this.start_date = this.formatDate(today);
|
|
||||||
this.end_date = this.formatDate(today);
|
|
||||||
|
|
||||||
await this.getStatistics()
|
|
||||||
},
|
|
||||||
|
|
||||||
async getYesterdayStatistics() {
|
|
||||||
const yesterday = new Date();
|
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
|
||||||
|
|
||||||
this.start_date = this.formatDate(yesterday);
|
|
||||||
this.end_date = this.formatDate(yesterday);
|
|
||||||
await this.getStatistics()
|
|
||||||
},
|
|
||||||
|
|
||||||
async getWeekStatistics() {
|
|
||||||
const week = new Date();
|
|
||||||
week.setDate(week.getDate() - 8);
|
|
||||||
|
|
||||||
const yesterday = new Date();
|
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
|
||||||
|
|
||||||
this.start_date = this.formatDate(week);
|
|
||||||
this.end_date = this.formatDate(yesterday);
|
|
||||||
await this.getStatistics()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue