| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- import request from '@/utils/request'
- // 查询设备分组
- export function listDeviceGroup(userId) {
- return request({
- url: '/iot/group/list?pageSize=30&pageNum=1&userId='+userId,
- method: 'get'
- })
- }
- // 查询设备
- export function listDevice(pageNum,deviceName,deptId) {
- let url = '/iot/device/shortList?pageNum='+pageNum+'&pageSize=12';
- if(deviceName){
- url = url +"&deviceName="+encodeURIComponent(deviceName)
- }
- if(deptId){
- url = url +"&deptId="+deptId
- }
- return request({
- url: url,
- method: 'get'
- })
- }
- //获取设备详情
- export function getDetail(id){
- return request({
- url: '/iot/device/'+id,
- method: 'get'
- })
- }
- //获取设备状态
- export function getDeviceStatus(id,childId){
- let url = '/iot/device/runningStatus/'+id;
- if(childId){
- url = url+"?childId="+childId;
- }
- return request({
- url: url,
- method: 'get'
- })
- }
- //物模型缓存
- export function cacheJsonThingsModel(id){
- let url = '/iot/model/cache/'+id;
- return request({
- url: url,
- method: 'get'
- })
- }
- //获取设备消息列表
- export function getDeviceMsg(){
- let url = '/iot/configqrcode/list?pageSize=10';
- return request({
- url: url,
- method: 'get'
- })
- }
- //绑定设备码
- export function bindDeviceQrcode(qrcode,deviceNo){
- let url = '/iot/device/bind?deviceNo='+deviceNo+"&qrcode="+qrcode;
- return request({
- url: url,
- method: 'get',
- })
- }
- //获取警报列表
- export function getAlertList(pageNum,pageSize){
- let url = '/iot/alertLog/list?pageNum='+pageNum+'&pageSize='+pageSize;
- return request({
- url: url,
- method: 'get',
- })
- }
- //处理报警
- export function handleAlert(alertLog){
- return request({
- url: '/iot/alertLog',
- data:alertLog,
- method: 'put',
- })
- }
- //查询详情
- export function getAlertLog(id){
- return request({
- url: '/iot/alertLog/'+id,
- method: 'get',
- })
- }
- //根据二维码找到设备详情
- export function getDevcieByQrcode(id){
- return request({
- url: '/iot/device/getDeviceByQrcode?qrcode='+id,
- method: 'get',
- })
- }
- //绑定设备
- export function bindDevice(device){
- return request({
- url: '/iot/device/bindDevice',
- data:device,
- method: 'post',
- })
- }
- //注销设备
- export function resetDevice(device){
- return request({
- url: '/iot/device/resetDevice',
- data:device,
- method: 'post',
- })
- }
- export function bingDeviceDept(device){
- return request({
- url: '/iot/device',
- data:device,
- method: 'put',
- })
- }
- //根据二维码找到设备详情
- export function editDeviceName(device){
- return request({
- url: '/iot/device/editDevice',
- data:device,
- method: 'post',
- })
- }
- //主动上报错误
- export function reportError(err){
- return request({
- url: '/iot/desc',
- data:err,
- method: 'post',
- })
- }
- /**
- * 主动上报列表
- * @param pageNum
- * @param pageSize
- * @returns {*}
- */
- export function errorList(pageNum,pageSize){
- let url = '/iot/desc/list?pageNum='+pageNum+'&pageSize='+pageSize;
- return request({
- url: url,
- method: 'get',
- })
- }
- //设备注销记录
- export function resetList(pageNum,pageSize,deviceName){
- let url = '/iot/reset/list?pageNum='+pageNum+'&pageSize='+pageSize;
- if(deviceName){
- url = url +"&deviceName="+encodeURIComponent(deviceName)
- }
- return request({
- url: url,
- method: 'get',
- })
- }
- //获取设备运行时间统计
- export function getDeviceRunTime(deviceid){
- let url = '/iot/device/getDeviceRunTime/'+deviceid
- return request({
- url: url,
- method: 'get',
- })
- }
- //获取所有runtime事件排序
- export function getAllDeviceRunTime(){
- let url = '/iot/device/rankRunTime'
- return request({
- url: url,
- method: 'get',
- })
- }
- // 查询设备最新固件
- export function getLatestFirmware(deviceId) {
- return request({
- url: '/iot/firmware/getLatest/' + deviceId,
- method: 'get'
- })
- }
- // 添加设备预约
- export function addDevicePlan(plan) {
- return request({
- url: '/iot/plan?minute='+plan.minute,
- method: 'post',
- data:plan
- })
- }
- // 获取设备的预约信息
- export function getDevicePlan(deviceId) {
- return request({
- url: '/iot/plan/' + deviceId,
- method: 'get'
- })
- }
- // 删除设备预约
- export function delDevicePlan(deviceId) {
- return request({
- url: '/iot/plan/' + deviceId,
- method: 'delete'
- })
- }
|