/*
 * @Author: Z 1518051043@qq.com
 * @Date: 2025-09-12 13:51:43
 * @LastEditors: Z 1518051043@qq.com
 * @LastEditTime: 2025-12-26 09:06:43
 * @FilePath: \yuanxinPro\src\store\module\app.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Cookies from 'js-cookie'
import { ElMessage } from 'element-plus';
import { tr } from 'element-plus/es/locales.mjs';

const useAppStore = defineStore(
  'app',
  {
    state: () => ({
      subsystemSocket: null,
      subsystemSocketContent: '',
      HeartbeatInterval: null,
      isTimeLineShow: true,
      islegendShow: true,
      isSourceLegendShow: true,
      isdataPanelShow: true,
      issatelliteOrbitShow: true,
      issatelliteBeamShow: true,
      iscontrolPanelShow: true,

      globaleAutoPlay: true,
      globalIntervalTime: 3000,
      globalStartWss: false,
      globalSatelliteSearchID: "4097",
      globalSubsystemActiveIndex: "0",
      globalSubsystemIsFastForward: false,
      globalSubsystemSpeed: 1,
      globalSubsystemTaskCode: 0,
      globalSubsystemSelectedStartTime: '2025-11-03 00:00:00',
      globalSubsystemSelectedEndTime: '2025-11-04 00:00:00',
      globalDisableTimeLine: true,
   
    }),
    actions: {
      setSubsystemSocket(socket) {
        this.subsystemSocket = socket;
      },
      setSubsystemSocketContent(content) {
        this.subsystemSocketContent = content;
      },
      setHeartbeatInterval(interval) {
        this.HeartbeatInterval = interval;
      },
      setisTimeLineShow(status) {
         this.isTimeLineShow = status
      },
      setislegendShow(status) {
         this.islegendShow = status
         
      },
      setisSourceLegendShow(status) {
         this.isSourceLegendShow = status
      },
      setisdataPanelShow(status) {
         this.isdataPanelShow = status
      },
      setissatelliteOrbitShow(status) {
         this.issatelliteOrbitShow = status
      },

      setissatelliteBeamShow(status) {
         this.issatelliteBeamShow = status
      },
       setiscontrolPanelShow(status) {
         this.iscontrolPanelShow = status
      },
      setglobaleAutoPlay(status) {
         this.globaleAutoPlay = status
      },
      setglobalIntervalTime(status) {
      //   console.log("开始执行间隔时间");
        
         this.globalIntervalTime = status
      },
      setglobalStartWss(status) {
         // console.log("同步socket数据");
         
         this.globalStartWss = status
      },
      setglobalSatelliteSearchID(status) {
      //   console.log("设置卫星搜索ID");
        
         this.globalSatelliteSearchID = status
      },
      setglobalSubsystemActiveIndex(status) {
        this.globalSubsystemActiveIndex = status
      },
      setglobalSubsystemIsFastForward(status) {
        this.globalSubsystemIsFastForward = status
      },
      setglobalSubsystemSpeed(status) {
        this.globalSubsystemSpeed = status
      },
      setglobalSubsystemTaskCode(status) {
        this.globalSubsystemTaskCode = status
      },

      setglobalSubsystemSelectedStartTime(status) {
        this.globalSubsystemSelectedStartTime = status
      },
      setglobalSubsystemSelectedEndTime(status) {
        this.globalSubsystemSelectedEndTime = status
      },
    }
  })

export default useAppStore
