/*
 * @Author: sjl
 * @Date: 2023-05-08 19:23:23
 * @Descripttion:
 */
import { defineStore } from 'pinia';
import { store } from '/@/store';

interface MapState {
  sideMenu: boolean;
  leftSideMenu: boolean;
  rightSideMenu: boolean;
  // 跳转站点详情
  stInfo:Object;
}
export const useMapStore = defineStore({
  id: 'map',
  state: (): MapState => ({
    sideMenu: true,
    leftSideMenu: true,
    rightSideMenu: true,
    stInfo:[]
  }),
  getters: {
    getSideMenu(): boolean {
      return this.sideMenu;
    },
    getLeftSideMenu(): boolean {
      return this.leftSideMenu;
    },
    getRightSideMenu(): boolean {
      return this.rightSideMenu;
    },
    getstInfo(): Object {
      return this.stInfo;
    },
  },
  actions: {
    setSideMenu(): void {
      this.sideMenu = !this.sideMenu;
    },
    setLeftSideMenu(): void {
      this.leftSideMenu = !this.leftSideMenu;
    },
    setRightSideMenu(): void {
      this.rightSideMenu = !this.rightSideMenu;
    },
    setstInfo(item): void {
      this.stInfo = item;
    },
  },
});
// Need to be used outside the setup
export function useMapStoreWithOut() {
  return useMapStore(store);
}
