From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示

---
 src/store/modules/home.js |   91 ++++++++-------------------------------------
 1 files changed, 16 insertions(+), 75 deletions(-)

diff --git a/src/store/modules/home.js b/src/store/modules/home.js
index d68f039..a19f23c 100644
--- a/src/store/modules/home.js
+++ b/src/store/modules/home.js
@@ -11,37 +11,17 @@
 		currentAreaPosition:getStore({ name: 'currentAreaPosition' }) || {},
     singleUavHome: {},
 		footActiveIndex: 0,
-    singleTotal: {}, // 统计单个机巢数据
-    // 项目id
-    selectedWorkSpaceId: window.localStorage.getItem('bs_workspace_id'),
-    wsMessage: {},
-    deviceState: {
-      gatewayInfo: {},
-      deviceInfo: {},
-      timestamp: '',
-      dockInfo: {},
-      currentSn: '',
-      currentType: -1,
-      drone_charge_state_new: {},
-      psdk_widget_values: {},
-      speakerAudioPlayStartProgress: {},
-    },
-    osdVisible: {
-      // osd 显示设备相关信息
-      sn: '',
-      callsign: '',
-      model: '',
-      visible: false,
-      gateway_sn: '',
-      is_dock: false,
-      payloads: null,
-      device_domain: '',
-      device_sub_type: '',
-      device_type: '',
-    },
+    // 事件 日 周 月 年
+    eventTimeType: 'day',
+    eventTimeParams: 'CURRENT_WEEK',
+    eventTimeRang: '',
+		flySuggest:{},//飞行建议
   },
   actions: {},
   mutations: {
+		setFlySuggest: (state, data) => {
+			state.flySuggest = data;
+		},
 		setUserAreaPosition: (state, data) => {
 			setStore({ name: 'userAreaPosition', content: data })
 			state.userAreaPosition = data;
@@ -52,6 +32,9 @@
 		},
 		setFootActiveIndex: (state, index) => {
 			state.footActiveIndex = index;
+			state.isEventOverviewDetail = false
+			state.singleUavHome = {}
+			state.machineNestDetail = false
 		},
 		setIsEventOverviewDetail: (state, data) => {
 			state.isEventOverviewDetail = data;
@@ -62,55 +45,13 @@
     setSingleUavHome: (state, data) => {
       state.singleUavHome = data;
     },
-    setSingleTotal: (state, data) => {
-      state.singleTotal = data;
+    setEventTimeType: (state, [timeType, timeParams]) => {
+      state.eventTimeType = timeType
+      state.eventTimeParams = timeParams
     },
-    setSelectedWorkSpaceId: (state, id) => {
-      state.selectedWorkSpaceId = id
-      window.localStorage.setItem('bs_workspace_id', id)
+    setEventTimeRang : (state, time) => {
+      state.eventTimeRang = time
     },
-    setOsdVisibleInfo: (state, info) => {
-      state.osdVisible = Object.assign({}, info)
-      window.localStorage.setItem('bs_osd', JSON.stringify(info))
-    },
-    setWsMessage: (state, data) => {
-      console.log(data, '看看值')
-      state.wsMessage = data.host;
-    },
-    setDeviceInfo: (state, data) => {
-      const info = data.data
-      state.deviceState.timestamp = data.timestamp
-      state.deviceState.deviceInfo[info.sn] = info.host
-      state.deviceState.currentSn = info.sn
-      state.deviceState.currentType = EDeviceTypeName.Aircraft
-    },
-    setGatewayInfo: (state, info) => {
-      state.deviceState.gatewayInfo[info.sn] = info.host
-      state.deviceState.currentSn = info.sn
-      state.deviceState.currentType = EDeviceTypeName.Gateway
-    },
-    setDockOnfo: (state, info) => {
-      if (Object.keys(info.host).length === 0) return
-
-			if (!state.deviceState.dockInfo[info.sn]) {
-				state.deviceState.dockInfo[info.sn] = {}
-			}
-			state.deviceState.currentSn = info.sn
-			state.deviceState.currentType = EDeviceTypeName.Dock
-			const dock = state.deviceState.dockInfo[info.sn]
-			if (info.host.mode_code !== undefined) {
-				dock.basic_osd = info.host
-				state.deviceState.drone_charge_state_new = dock.basic_osd.drone_charge_state
-				return
-			}
-			if (info.host.sdr) {
-				dock.link_osd = info.host
-				return
-			}
-			if (info.host.job_number !== undefined) {
-				dock.work_osd = info.host
-			}
-		},
 	},
 	getters: {
 		test(state) {

--
Gitblit v1.9.3