From ca36328a890d59e66d9f5f6eba48300f5d53caed Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Mon, 29 May 2023 17:38:37 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=9D=D0=B0=D0=B1=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=B0=D0=BB=D0=B0=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0=D1=80?= =?UTF-8?q?=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/BaseCalendar.vue | 118 ++++++++++++++++++ src/pages/newCalendar/TheCalendar.vue | 2 + .../newCalendar/components/CalendarHeader.vue | 48 ++++--- src/store/index.js | 2 + src/store/modules/calendar.js | 17 +++ 5 files changed, 173 insertions(+), 14 deletions(-) create mode 100644 src/components/base/BaseCalendar.vue create mode 100644 src/store/modules/calendar.js diff --git a/src/components/base/BaseCalendar.vue b/src/components/base/BaseCalendar.vue new file mode 100644 index 0000000..fcdbe2d --- /dev/null +++ b/src/components/base/BaseCalendar.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/pages/newCalendar/TheCalendar.vue b/src/pages/newCalendar/TheCalendar.vue index ce0caab..f892637 100644 --- a/src/pages/newCalendar/TheCalendar.vue +++ b/src/pages/newCalendar/TheCalendar.vue @@ -9,6 +9,7 @@ import CalendarSidebar from "@/pages/newCalendar/components/CalendarSidebar"; import CalendarOpenSidebar from "@/pages/newCalendar/components/CalendarOpenSidebar"; import CalendarWrapper from "@/pages/newCalendar/components/CalendarWrapper"; +import * as moment from "moment/moment"; export default { name: "TheCalendar", @@ -16,6 +17,7 @@ export default { data() { return { isOpen: false, + currentDate: moment(), }; }, methods: { diff --git a/src/pages/newCalendar/components/CalendarHeader.vue b/src/pages/newCalendar/components/CalendarHeader.vue index a420d50..0f0b16a 100644 --- a/src/pages/newCalendar/components/CalendarHeader.vue +++ b/src/pages/newCalendar/components/CalendarHeader.vue @@ -24,22 +24,34 @@ :width="300", fontSize="16px", lineHeight="19px", - iconRight + iconRight, + id="calendarIcon" ) - q-icon.text(name="app:calendar", size="20px") - q-popup-proxy( + q-icon.text(name="app:calendar", size="20px", ref="calendarIcon", @click="changeCalendarVisibility(false)") + //q-popup-proxy( cover, transition-show="scale", transition-hide="scale" - ) - q-date(v-model="date", minimal) - .flex.items-center.justify-end - q-btn( - v-close-popup, - label="Закрыть", - color="primary", - flat - ) + anchor="bottom middle", self="top middle" + //) + //q-date(v-model="date", minimal, range) + .flex.items-center.justify-end + q-btn( + v-close-popup, + label="Закрыть", + color="primary", + flat + ) + q-menu( + :style="{'margin-top': '4px !important'}" + target="#calendarIcon" + v-model="calendarVisibility", + transition-show="scale", + transition-hide="scale" + anchor="bottom middle", + self="top middle" + ) + base-calendar(v-model="date") q-btn( color="secondary", icon="arrow_forward_ios", @@ -61,9 +73,10 @@ diff --git a/src/store/index.js b/src/store/index.js index 7a0d8f0..576b379 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,5 +1,6 @@ import { createStore } from "vuex"; import medical from "./modules/medicalCard"; +import calendar from "./modules/calendar"; export default createStore({ state: { @@ -9,6 +10,7 @@ export default createStore({ }, modules: { medical, + calendar, }, getters: { getUrl(state) { diff --git a/src/store/modules/calendar.js b/src/store/modules/calendar.js new file mode 100644 index 0000000..b34864f --- /dev/null +++ b/src/store/modules/calendar.js @@ -0,0 +1,17 @@ +import * as moment from "moment/moment"; +const state = () => ({ + currentDate: moment(), +}); + +const getters = {}; + +const actions = {}; + +const mutations = {}; + +export default { + state, + getters, + actions, + mutations, +};