From ff82e86becbd200adabd2ce56fba1f6b3c6c37e1 Mon Sep 17 00:00:00 2001 From: Riku <risaku@163.com> Date: 星期一, 23 六月 2025 23:10:49 +0800 Subject: [PATCH] 2025.6.23 --- 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