trying setup store
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
AddEmployeeModal(
|
||||
|
||||
:searchData="rows"
|
||||
:searchData="store.rows"
|
||||
:searchFields="['first_name', 'last_name']"
|
||||
:searchRow="addEmployeeRow"
|
||||
:modalId="modalId"
|
||||
@@ -69,7 +69,7 @@ AddEmployeeModal(
|
||||
import { watch, computed, ref } from 'vue'
|
||||
import type { Ref, ComputedRef } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useEmployees } from '@/stores/employees'
|
||||
import useEmployees from '@/stores/employees'
|
||||
import { addMonths, eachMonthOfInterval, subDays, addDays, format, getISODay, getYear, getMonth, getDaysInMonth } from 'date-fns'
|
||||
import { de } from 'date-fns/locale'
|
||||
import AddEmployeeModal from '@/components/Schedule/AddEmployeeModal.vue'
|
||||
@@ -145,7 +145,7 @@ AddEmployeeModal(
|
||||
const addEmployeeRow : Ref<number> = ref(-1)
|
||||
const addEmployeeMonth : Ref<number> = ref(-1)
|
||||
const scheduleData : Ref<ScheduleData> = ref(getScheduleData())
|
||||
const { rows } = storeToRefs(store)
|
||||
// const { rows } = storeToRefs(store)
|
||||
|
||||
const selected : Ref<string[]> = ref([])
|
||||
const shiftAnchor : Ref<Coordinates | undefined> = ref(undefined)
|
||||
|
||||
@@ -61,12 +61,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import { useEmployees } from '@/stores/employees'
|
||||
import { computed } from 'vue'
|
||||
import _inRange from 'lodash/inRange'
|
||||
|
||||
const store = useEmployees()
|
||||
|
||||
const props = defineProps({
|
||||
radius: {
|
||||
type: Number,
|
||||
@@ -101,7 +98,7 @@ const hasOnlyOnePage = computed(() => props.lastPage === props.firstPage)
|
||||
const displayedPages = computed(() => {
|
||||
const pages = []
|
||||
const firstPage = props.page - props.radius > props.firstPage ? props.page - props.radius : props.firstPage
|
||||
const lastPage = store.page + props.radius < props.lastPage ? props.page + props.radius : props.lastPage
|
||||
const lastPage = props.page + props.radius < props.lastPage ? props.page + props.radius : props.lastPage
|
||||
|
||||
for (let i = firstPage; i <= lastPage; i++) {
|
||||
pages.push(i)
|
||||
|
||||
Reference in New Issue
Block a user