import { defineStore } from 'pinia'

export const useSidebarStore = defineStore('sidebar', {
  state: (): any => {
    return {
      collapse: false,
      isEquipment: true,
      equipmentName: '1F车间欧式葫芦',
      equipmentInfo: {},
      // 设备id
      equipmentId: ''
    }
  },
  getters: {},
  actions: {
    handleCollapse() {
      this.collapse = !this.collapse
    },
    setIsEquipment(e: boolean) {
      this.isEquipment = e
    },
    setEquipmentName(e: string) {
      this.equipmentName = e
    },
    setEquipmentId(e: string) {
      this.equipmentId = e
    },
    setEquipmentInfo(e: any) {
      this.equipmentInfo = e
    }
  }
})
