import { getAll, equipmentMonitoring, deleteEquipment } from '@/api/equipment'

const equipment = {
  state: {

  },
  mutations: {

  },
  actions: {
    EquipmentGetAll({ commit }, data) {
      return new Promise((resolve, reject) => {
        getAll(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    EquipmentMonitoring({ commit }, data) { // 提交设备数据
      return new Promise((resolve, reject) => {
        equipmentMonitoring(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DeleteEquipment({ commit }, data) { // 删除设备
      return new Promise((resolve, reject) => {
        deleteEquipment(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default equipment

