From cc1aacf766bc902001f460fdfce20a9ec2ea097d Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 09 Apr 2025 17:56:11 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/drone/command-center-dashboard
---
src/store/modules/home.js | 88 ++++++++++++++++++++++++++++---------------
1 files changed, 57 insertions(+), 31 deletions(-)
diff --git a/src/store/modules/home.js b/src/store/modules/home.js
index cc572bd..e39501a 100644
--- a/src/store/modules/home.js
+++ b/src/store/modules/home.js
@@ -1,9 +1,17 @@
-import { set } from "lodash";
import { EDeviceTypeName } from '@/utils/staticData/enums'
+import { getStore, setStore } from '@/utils/store'
const home = {
state: {
+ machineNestDetail: false, // 机巢长列表
+ isEventOverviewDetail: false,//是事件概述详情
+ // 用户行政区划中心点
+ userAreaPosition: getStore({ name: 'userAreaPosition' }) || {},
+ // 用户切换后行政区划中心点
+ currentAreaPosition:getStore({ name: 'currentAreaPosition' }) || {},
singleUavHome: {},
+ footActiveIndex: 0,
+ singleTotal: {}, // 统计单个机巢数据
// 项目id
selectedWorkSpaceId: window.localStorage.getItem('bs_workspace_id'),
wsMessage: {},
@@ -34,15 +42,34 @@
},
actions: {},
mutations: {
+ setUserAreaPosition: (state, data) => {
+ setStore({ name: 'userAreaPosition', content: data })
+ state.userAreaPosition = data;
+ },
+ setCurrentAreaPosition: (state, data) => {
+ setStore({ name: 'currentAreaPosition', content: data })
+ state.currentAreaPosition = data;
+ },
+ setFootActiveIndex: (state, index) => {
+ state.footActiveIndex = index;
+ },
+ setIsEventOverviewDetail: (state, data) => {
+ state.isEventOverviewDetail = data;
+ },
+ setMachineNestDetail: (state, data) => {
+ state.machineNestDetail = data;
+ },
setSingleUavHome: (state, data) => {
state.singleUavHome = data;
+ },
+ setSingleTotal: (state, data) => {
+ state.singleTotal = 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))
},
@@ -63,33 +90,32 @@
},
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'
- }
- }
-};
-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