From a7e6761ba0cfccdf33ed552eb2d3b783c8e4ab4a Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 16 Apr 2025 20:49:12 +0800
Subject: [PATCH] feat:事件弹窗显示调整
---
src/store/modules/home.js | 157 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 99 insertions(+), 58 deletions(-)
diff --git a/src/store/modules/home.js b/src/store/modules/home.js
index ccf7e2a..f4b0ca8 100644
--- a/src/store/modules/home.js
+++ b/src/store/modules/home.js
@@ -1,68 +1,102 @@
-import { set } from 'lodash'
import { EDeviceTypeName } from '@/utils/staticData/enums'
+import { getStore, setStore } from '@/utils/store'
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: {},
+ 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'),
+ // 事件 日 周 月 年
+ eventTimeType: 'day',
+ eventTimeParams: 'CURRENT_WEEK',
+ eventTimeRang: '',
+ 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: {
+ setUserAreaPosition: (state, data) => {
+ setStore({ name: 'userAreaPosition', content: data })
+ state.userAreaPosition = data;
},
- osdVisible: {
- // osd 显示设备相关信息
- sn: '',
- callsign: '',
- model: '',
- visible: false,
- gateway_sn: '',
- is_dock: false,
- payloads: null,
- device_domain: '',
- device_sub_type: '',
- device_type: '',
+ setCurrentAreaPosition: (state, data) => {
+ setStore({ name: 'currentAreaPosition', content: data })
+ state.currentAreaPosition = data;
},
- },
- actions: {},
- mutations: {
- setSingleUavHome: (state, data) => {
- state.singleUavHome = data
+ setFootActiveIndex: (state, index) => {
+ state.footActiveIndex = index;
+ state.isEventOverviewDetail = false
+ state.singleUavHome = {}
+ state.machineNestDetail = false
},
- setSelectedWorkSpaceId: (state, id) => {
- state.selectedWorkSpaceId = id
- window.localStorage.setItem('bs_workspace_id', id)
+ setIsEventOverviewDetail: (state, data) => {
+ state.isEventOverviewDetail = data;
},
- 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
+ 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) => {
+ state.osdVisible = Object.assign({}, info)
+ window.localStorage.setItem('bs_osd', JSON.stringify(info))
+ },
+ setWsMessage: (state, data) => {
+ state.wsMessage = data.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] = {}
@@ -83,6 +117,13 @@
dock.work_osd = info.host
}
},
+ setEventTimeType: (state, [timeType, timeParams]) => {
+ state.eventTimeType = timeType
+ state.eventTimeParams = timeParams
+ },
+ setEventTimeRang : (state, time) => {
+ state.eventTimeRang = time
+ },
},
getters: {
test(state) {
--
Gitblit v1.9.3