From e14358f85a7d32a753225f253ff223d17cf36c25 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 02 Apr 2025 19:10:00 +0800
Subject: [PATCH] style: 风格处理

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

diff --git a/src/store/modules/home.js b/src/store/modules/home.js
index cc572bd..ccf7e2a 100644
--- a/src/store/modules/home.js
+++ b/src/store/modules/home.js
@@ -1,95 +1,94 @@
-import { set } from "lodash";
+import { set } from 'lodash'
 import { EDeviceTypeName } from '@/utils/staticData/enums'
 
 const home = {
-  state: {
-    singleUavHome: {},
-    // 项目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: '',
-    },
-  },
-  actions: {},
-  mutations: {
-    setSingleUavHome: (state, data) => {
-      state.singleUavHome = data;
-    },
-    setSelectedWorkSpaceId: (state, id) => {
-      state.selectedWorkSpaceId = id
-      window.localStorage.setItem('bs_workspace_id', id)
-    },
-    setOsdVisibleInfo: (state, info) => {
-      console.log(info, '哒哒哒')
-      state.osdVisible = Object.assign({}, info)
-      window.localStorage.setItem('bs_osd', JSON.stringify(info))
-    },
-    setWsMessage: (state, 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) {
-      return state.singleUavHome.id.toString() + '65'
-    }
-  }
-};
+	state: {
+		singleUavHome: {},
+		// 项目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: '',
+		},
+	},
+	actions: {},
+	mutations: {
+		setSingleUavHome: (state, data) => {
+			state.singleUavHome = data
+		},
+		setSelectedWorkSpaceId: (state, id) => {
+			state.selectedWorkSpaceId = id
+			window.localStorage.setItem('bs_workspace_id', id)
+		},
+		setOsdVisibleInfo: (state, info) => {
+			console.log(info, '哒哒哒')
+			state.osdVisible = Object.assign({}, info)
+			window.localStorage.setItem('bs_osd', JSON.stringify(info))
+		},
+		setWsMessage: (state, 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
 
-export default home;
+			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) {
+			return state.singleUavHome.id.toString() + '65'
+		},
+	},
+}
+
+export default home

--
Gitblit v1.9.3