const elevators = {
  state: {},

  mutations: {
    PUT_ELEVATOR: (state, elevator) => {
      state[elevator.id] = elevator
    },
    DEL_ELEVATOR: (state, elevator) => {
      delete state[elevator.id]
      console.log('删除缓存电梯信息',elevator.id)
      console.log('删除后缓存电梯信息',state)
    },
  },

  actions: {
    addElevator({commit}, elevator) {
      return new Promise(() => {
        commit('PUT_ELEVATOR', elevator)
      })
    },
  }
}

export default elevators
