41 lines
1.1 KiB
Vue
41 lines
1.1 KiB
Vue
<template>
|
|
<div class="mobile-journal-view common-mobile-view">
|
|
<journal-calendar />
|
|
|
|
<draggable-button @click="addClick"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import JournalCalendar from '@/components/Home/Journal/JournalCalendar.vue'
|
|
import DraggableButton from '@/components/Mobile/DraggableButton.vue'
|
|
import { useJournalStore } from '@/store/journal.ts'
|
|
import { useRouter } from 'vue-router'
|
|
import { onMounted } from 'vue'
|
|
import { getCurrentMonth, getStartEndDate } from 'vue3-common/utils/dateUtil'
|
|
|
|
const journalStore = useJournalStore()
|
|
const router = useRouter()
|
|
|
|
onMounted(async () => {
|
|
const dateInfo = getStartEndDate(getCurrentMonth(), 'month')
|
|
journalStore.queryInfo.startDate = dateInfo[0]
|
|
journalStore.queryInfo.endDate = dateInfo[1]
|
|
await journalStore.refreshInfo()
|
|
})
|
|
|
|
const addClick = () => {
|
|
journalStore.journalApiType = 'ADD'
|
|
journalStore.currentJournal = journalStore.getEmptyJournal()
|
|
router.push({ name: 'MobileHomeJournalDetailId', params: { id: 0 } })
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.mobile-journal-view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
</style>
|