diff --git a/src/stores/time/time.ts b/src/stores/time/time.ts index c7ef73e..bd23c21 100644 --- a/src/stores/time/time.ts +++ b/src/stores/time/time.ts @@ -20,6 +20,8 @@ export const useTimeStore = defineStore("time", () => { const months:Ref = ref(now.getMonth() + 1); const days:Ref=ref(now.getDate()); const nowDays:Ref = ref(dates); + + const allDates:any = reactive({years: years, months: months, days:days}) const setYears = (year:any) => { years.value = year; }; @@ -59,5 +61,5 @@ export const useTimeStore = defineStore("time", () => { return titles }) - return { years, months,days,nowDays, setYears, setMounths,setDays,setNowDays,computDate,nowTitle }; + return { years, months,days,nowDays, setYears, setMounths,setDays,setNowDays,computDate,nowTitle,allDates }; }); diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 697d748..5fd8482 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -14,7 +14,7 @@ import { useTimeStore } from "@/stores/index"; import { storeToRefs } from "pinia"; const timeStore = useTimeStore(); -const { nowTitle, years, months, days } = storeToRefs(timeStore); +const { nowTitle, years, months, days,allDates } = storeToRefs(timeStore); import { AdminPCIndex, WeekPay, StatisticsReportedRanking, GetBatch } from "@/api"; import { useDataStore } from "@/stores/index"; @@ -138,7 +138,15 @@ const getAdminPCIndex = () => { }) }; -watch(years,()=>{ +watch(allDates,()=>{ + console.log('allDates',allDates.value); + payData() + getAdminPCIndex() +},{ + deep: true +}) + +/* watch(years,()=>{ // console.log('years.value',years.value); payData() getAdminPCIndex() @@ -153,8 +161,7 @@ watch(days,()=>{ // console.log('days.value',days.value); payData() getAdminPCIndex() - -}) +}) */ const batchs = ref() // 获取学历层次