import request from '@/utils/request'
import request5 from '@/utils/request5'

export function add(data) {
  return request({
    url: 'api/sDeviceWay',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: 'api/sDeviceWay/' + id,
    method: 'delete'
  })
}

export function deleteByDeviceid(deviceid) {
  return request({
    url: 'api/deleteByDeviceid/' + deviceid,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: 'api/sDeviceWay',
    method: 'put',
    data
  })
}

export function loadByDeviceid(data) {
  return request({
    url: 'api/loadByDeviceid',
    method: 'post',
    data
  })
}

export function loadTaskwayByDeviceid(relayid) {
  return request({
    url: 'api/loadTaskwayByDeviceid/' + relayid,
    method: 'get'
  })
}

export function controlWay(data) {
  return request({
    url: 'api/controlWay',
    method: 'post',
    data
  })
}

export function sDeviceWayNoPage() {
  return request({
    url: 'api/sDeviceWayNoPage',
    method: 'post'
  })
}


export function loadRemoteCtrl(data) {
  return request({
    url: 'api/loadByDeviceid',
    method: 'post',
    data
  })
}


export function getRemoteControl(param) {
  return request5({
    url: 'api/project/getProjectMachineVisitUrl',
    method: 'post',
    data: param
  })
}