wzh před 2 roky
rodič
revize
bcd2e808f9
2 změnil soubory, kde provedl 2293 přidání a 557 odebrání
  1. 218 0
      api/device/device2.js
  2. 2075 557
      pages/device/detail1.vue

+ 218 - 0
api/device/device2.js

@@ -0,0 +1,218 @@
+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'
+    })
+}
+
+

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2075 - 557
pages/device/detail1.vue