forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
src/store/modules/common.js
@@ -4,13 +4,15 @@
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2025-04-03 12:01:58
 * @FilePath: \command-center-dashboard\src\store\modules\common.js
 * @Description:
 *
 * Copyright (c) 2025 by shuishen, All Rights Reserved.
 * @Description:
 *
 * Copyright (c) 2025 by shuishen, All Rights Reserved.
 */
import { setStore, getStore, removeStore } from 'utils/store'
import website from '@/config/website'
import cesiumOptions from '@/utils/cesium-tsa'
const { loadLAYER } = cesiumOptions()
const common = {
  state: {
    language: getStore({ name: 'language' }) || 'zh-cn',
@@ -19,6 +21,8 @@
    isMenu: true,
    isSearch: false,
    isRefresh: true,
    mqttState: null, // mqtt 实例
    clientId: null, // 客户端ID实例
    isLock: getStore({ name: 'isLock' }),
    colorName: getStore({ name: 'colorName' }) || '#2C77F1',
    themeName: getStore({ name: 'themeName' }) || 'theme-go',
@@ -32,8 +36,22 @@
      visual: '3D',
      isDark: false,
    },
    isHideBottomIcon: true,
  },
  mutations: {
    setHideBottomIcon (state, data) {
      state.isHideBottomIcon = data
    },
    setMapSetting: (state, data) => {
      state.mapSetting = data
      loadLAYER()
    },
    SET_MQTT_STATE (state, mqttState) {
      state.mqttState = mqttState
    },
    SET_CLIENT_ID (state, id) {
      state.clientId = id
    },
    SET_LANGUAGE: (state, language) => {
      state.language = language
      setStore({