From 91513e171078ed6b0887f87b9fced33895d6d3fb Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 08 七月 2025 08:35:50 +0800
Subject: [PATCH] 2025.7.8

---
 src/stores/area.js |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/stores/area.js b/src/stores/area.js
index 638389f..59e5d8e 100644
--- a/src/stores/area.js
+++ b/src/stores/area.js
@@ -6,6 +6,9 @@
 export const useAreaStore = defineStore('area', {
   state: () => {
     return {
+      locations: {},
+      sceneType: {},
+      time: '',
       area: {
         provincecode: undefined,
         provincename: undefined,
@@ -28,16 +31,34 @@
       this.area.cityname = location.cName
       this.area.districtcode = location.dCode
       this.area.districtname = location.dName
+
+      this.locations = {
+        pCode: location.pCode,
+        pName: location.pName,
+        cCode: location.cCode,
+        cName: location.cName,
+        dCode: location.dCode,
+        dName: location.dName
+      }
+    },
+    setTimePeriod(time, type) {
+      this.time = time ? time : new Date()
+      const d = dayjs(this.time)
+      this.area.starttime = d.startOf(type).format('YYYY-MM-DD HH:mm:ss')
+      this.area.endtime = d.endOf(type).format('YYYY-MM-DD HH:mm:ss')
     },
     // 璁剧疆鏃堕棿涓虹粰瀹氭椂闂村搴斿綋鏃ョ殑澶村熬
     setTimeOneDay(time) {
-      const d = time ? dayjs(time) : dayjs()
-      this.area.starttime = d.startOf('day').format('YYYY-MM-DD HH:mm:ss')
-      this.area.endtime = d.endOf('day').format('YYYY-MM-DD HH:mm:ss')
+      this.setTimePeriod(time, 'day')
+    },
+    // 璁剧疆鏃堕棿涓虹粰瀹氭椂闂村搴斿綋鏈堢殑澶村熬
+    setTimeOneMonth(time) {
+      this.setTimePeriod(time, 'month')
     },
     // 璁剧疆鍦烘櫙绫诲瀷
     setSceneType(t) {
-      this.area.scensetypeid = t
+      this.sceneType = t
+      this.area.scensetypeid = t.value
     }
   }
 })

--
Gitblit v1.9.3