From 23994eb72ac0475cac571646a09435ec21516017 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 15 二月 2025 11:09:58 +0800
Subject: [PATCH] 设备修改

---
 src/components/view/b4-site-hours-statistics.vue |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/components/view/b4-site-hours-statistics.vue b/src/components/view/b4-site-hours-statistics.vue
index f14c36f..b8f9791 100644
--- a/src/components/view/b4-site-hours-statistics.vue
+++ b/src/components/view/b4-site-hours-statistics.vue
@@ -247,12 +247,8 @@
     }
   },
   mounted(){
-    const year = new Date().getFullYear();
-    const month = new Date().getMonth();
-    // 璁剧疆璧峰鏃ユ湡鍜岀粨鏉熸棩鏈�
-    this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 鏈堝垵
-    this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 鏈堟湯
-    this.init()
+    this.month = new Date()
+    this.changeTime()
   },
   methods:{
     init(){
@@ -297,10 +293,11 @@
     },
     changeTime(){
       const year = new Date(this.month).getFullYear();
-      const month = new Date(this.month).getMonth();
+      const month = new Date(this.month).getMonth()+1;
+      const day = new Date(year, month + 1, 0).getDate(); //
       // 璁剧疆璧峰鏃ユ湡鍜岀粨鏉熸棩鏈�
-      this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 鏈堝垵
-      this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 鏈堟湯
+      this.startTime = `${year}-${month>9?'0'+month:month}-01`
+      this.endTime = `${year}-${month>9?'0'+month:month}-${day}` // 鏈堟湯
       this.siteList.forEach(item=>{
         item.page.current = 1
       })

--
Gitblit v1.9.3