From 228fd0a5c6f1453034878cc4b542b6f83a7ca0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=81?= <18339727226@163.com> Date: Fri, 5 Jul 2024 16:28:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9B=B4=E6=94=B9=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/time/time.ts | 4 +++- src/views/index/index.vue | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) 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() // 获取学历层次