diff --git a/src/api/alarm/alarm.js b/src/api/alarm/alarm.js index 308ec70..3d0ac2e 100644 --- a/src/api/alarm/alarm.js +++ b/src/api/alarm/alarm.js @@ -48,3 +48,24 @@ export const getAlarm = (query) => { params: query, }); }; + +// 获取故障报警记录 +export const getAlarmList = (query) => { + return request({ + url: "/api/appData/list", + method: "get", + params: query, + }); +}; + +// 故障上报处理 +export const disposeAlarm = (data) => { + return request({ + url: "/api/appData/handle", + method: "post", + headers: { + "Content-Type": "application/json;charset=UTF-8", + }, + data, + }); +}; diff --git a/src/router/views/index.js b/src/router/views/index.js index 323cd41..75f1bcf 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -155,4 +155,14 @@ export default [ isAuth: false, }, }, + { + path: "/alarmList", + name: "诊间报警列表", + component: () => + import(/* webpackChunkName: "views" */ "@/views/alarmList/index"), + meta: { + isTab: false, + isAuth: false, + }, + }, ]; diff --git a/src/views/alarmList/index.vue b/src/views/alarmList/index.vue new file mode 100644 index 0000000..d888cf9 --- /dev/null +++ b/src/views/alarmList/index.vue @@ -0,0 +1,214 @@ + + + + + \ No newline at end of file diff --git a/src/views/alarmcenter/index.vue b/src/views/alarmcenter/index.vue index 1910a94..5c7bf36 100644 --- a/src/views/alarmcenter/index.vue +++ b/src/views/alarmcenter/index.vue @@ -239,68 +239,78 @@ export default { }, // 视频联动按钮 linkVideo(row) { - let token = window.sessionStorage.getItem('bizToken'); - if (token == 'undefined' || !token) { - bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { - if(res.status == 200){ - if(res.data.code == 0){ - window.sessionStorage.setItem('bizToken', res.data.data.token); - bizDeviceList(res.data.data.token, { 'params[pmac]': row.deviceId }).then(res2 => { - const data = res2.data; - this.videoData = data.rows; - if(this.videoData.length === 0){ - this.$message.warning('未查询到该报警点摄像头'); - } - else{ - // this.dialogVisible = true; - const routeData = this.$router.resolve({ - path: '/videoPlayer', // 跳转的路径 - query: { - list: JSON.stringify(this.videoData), // 携带的的参数信息 - showLeft:true - } - }) - console.log('href ===>',routeData.href) - window.open(routeData.href, '_blank') - } - }); - }else{ - this.$message.error('物联网平台访问超时!') - } - }else{ - this.$message.error('物联网平台访问超时!') - } + this.videoData = row.cameraCode + const routeData = this.$router.resolve({ + path: '/videoPlayer', // 跳转的路径 + query: { + list: JSON.stringify(this.videoData), // 携带的的参数信息 + showLeft:true + } + }) + console.log('href ===>',routeData.href) + window.open(routeData.href, '_blank') + // let token = window.sessionStorage.getItem('bizToken'); + // if (token == 'undefined' || !token) { + // bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { + // if(res.status == 200){ + // if(res.data.code == 0){ + // window.sessionStorage.setItem('bizToken', res.data.data.token); + // bizDeviceList(res.data.data.token, { 'params[pmac]': row.deviceId }).then(res2 => { + // const data = res2.data; + // this.videoData = data.rows; + // if(this.videoData.length === 0){ + // this.$message.warning('未查询到该报警点摄像头'); + // } + // else{ + // // this.dialogVisible = true; + // const routeData = this.$router.resolve({ + // path: '/videoPlayer', // 跳转的路径 + // query: { + // list: JSON.stringify(this.videoData), // 携带的的参数信息 + // showLeft:true + // } + // }) + // console.log('href ===>',routeData.href) + // window.open(routeData.href, '_blank') + // } + // }); + // }else{ + // this.$message.error('物联网平台访问超时!') + // } + // }else{ + // this.$message.error('物联网平台访问超时!') + // } - }) - } else { - bizDeviceList(token, { 'params[pmac]': row.deviceId }).then(res2 => { - if (res2.data.code == 401) { - window.sessionStorage.removeItem('bizToken'); - this.linkVideo(row); - } - else if (res2.data.code == 200) { - const data = res2.data; - this.videoData = data.rows; - if(this.videoData.length === 0){ - this.$message.warning('未查询到该报警点摄像头'); - } - else{ - // this.dialogVisible = true; - const routeData = this.$router.resolve({ - path: '/videoPlayer', // 跳转的路径 - query: { - list: JSON.stringify(this.videoData), // 携带的的参数信息 - showLeft:true - } - }) - console.log('href ===>',routeData.href) - window.open(routeData.href, '_blank') - } - }else{ - this.$message.error('物联网平台访问超时!') - } - }); - } + // }) + // } else { + // bizDeviceList(token, { 'params[pmac]': row.deviceId }).then(res2 => { + // if (res2.data.code == 401) { + // window.sessionStorage.removeItem('bizToken'); + // this.linkVideo(row); + // } + // else if (res2.data.code == 200) { + // const data = res2.data; + // this.videoData = data.rows; + // if(this.videoData.length === 0){ + // this.$message.warning('未查询到该报警点摄像头'); + // } + // else{ + // // this.dialogVisible = true; + // const routeData = this.$router.resolve({ + // path: '/videoPlayer', // 跳转的路径 + // query: { + // list: JSON.stringify(this.videoData), // 携带的的参数信息 + // showLeft:true + // } + // }) + // console.log('href ===>',routeData.href) + // window.open(routeData.href, '_blank') + // } + // }else{ + // this.$message.error('物联网平台访问超时!') + // } + // }); + // } }, renderCode(tags) { let obj = JSON.parse(tags); diff --git a/src/views/alarmcenter/sosAlarm/list.vue b/src/views/alarmcenter/sosAlarm/list.vue index 1df676e..b8c6e55 100644 --- a/src/views/alarmcenter/sosAlarm/list.vue +++ b/src/views/alarmcenter/sosAlarm/list.vue @@ -444,6 +444,16 @@ export default { } }); } + // this.videoData = row.cameraCode + // const routeData = this.$router.resolve({ + // path: '/videoPlayer', // 跳转的路径 + // query: { + // list: JSON.stringify(this.videoData), // 携带的的参数信息 + // showLeft:true + // } + // }) + // console.log('href ===>',routeData.href) + // window.open(routeData.href, '_blank') }, // 导出 handleExport() { diff --git a/src/views/h5Player/player.vue b/src/views/h5Player/player.vue index 18e7a74..99ade46 100644 --- a/src/views/h5Player/player.vue +++ b/src/views/h5Player/player.vue @@ -165,36 +165,52 @@ export default { showLeft:true, videoList:[], isOrder:false, + code:'' }; }, created() { - // this.qrcodeData1 = this.$route.query.category - // console.log('list ===============>',JSON.parse(this.$route.query.list), this.$route.query.showLeft) - // console.log('list ===>',this.list) - this.list = JSON.parse(this.$route.query.list); + // // this.qrcodeData1 = this.$route.query.category + // // console.log('list ===============>',JSON.parse(this.$route.query.list), this.$route.query.showLeft) + // // console.log('list ===>',this.list) this.showLeft = this.$route.query.showLeft - this.cameraList = [] - let isTags = this.list.find(item => item.tags) - if(isTags){ - this.list.map(item =>{ - console.log('code ====>',JSON.parse(item.tags).cameraIndexCode) - if(JSON.parse(item.tags).cameraCode){ - if(JSON.parse(item.tags).cameraCode.indexOf('-') > -1){ - JSON.parse(item.tags).cameraCode.split('-').map(item1=>{ - this.cameraList.push({name:item.name,code:item1}) - }) + if(this.showLeft){ + this.code = JSON.parse(this.$route.query.list); + this.cameraList = [] + if(this.code != ''){ + this.code.split('-').map(item1=>{ + this.cameraList.push({name:'',code:item1}) + }) + }else{ + this.cameraList = [] + } + }else{ + this.list = JSON.parse(this.$route.query.list); + this.showLeft = this.$route.query.showLeft + this.cameraList = [] + let isTags = this.list.find(item => item.tags) + if(isTags){ + this.list.map(item =>{ + console.log('code ====>',JSON.parse(item.tags).cameraIndexCode) + if(JSON.parse(item.tags).cameraCode){ + if(JSON.parse(item.tags).cameraCode.indexOf('-') > -1){ + JSON.parse(item.tags).cameraCode.split('-').map(item1=>{ + this.cameraList.push({name:item.name,code:item1}) + }) + }else{ + this.cameraList.push({name:item.name,code:item.cameraCode}) + } }else{ - this.cameraList.push({name:item.name,code:item.cameraCode}) - } - }else{ - this.cameraList.push({name:item.name,code:JSON.parse(item.tags).cameraIndexCode}) + this.cameraList.push({name:item.name,code:JSON.parse(item.tags).cameraIndexCode}) - } - }) - }else{ - this.cameraList = this.list + } + }) + }else{ + this.cameraList = this.list + } } + + console.log('cameraList =====>',this.cameraList) // this.timeRange = [this.getYestDayOrNextDay() + ' 00:00:00',new Date().toLocaleString()] // 海康h5插件初始化 diff --git a/src/views/map/index.vue b/src/views/map/index.vue index 2ef9941..1e789c9 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -58,15 +58,17 @@ export default { console.log('x ====>',this.x,'y ====>',this.y) if(this.sn && this.floorNo && this.x && this.y) { window.map._map.focusFloorId = this.floorNo; - coordinateToWGS84({ x:this.x, y:this.y, minX: 13439311, maxY:3667244.25 }).then(res => { - //点位标注 + coordinateToWGS84({ x:this.x, y:this.y, minX: 13404877.3, maxY:4316313.34 }).then(res => { + console.log('res ====>',res) + // //点位标注 if(res.data.code == 200) { var imagerMarker = new jsmapbase.JSImageMarker({ id: 'iamgeMareker1',//id image: Img,//图片路径 position: new jsmapbase.JSPoint(res.data.data.lng, res.data.data.lat, 0),//坐标位置 - width: 55,//尺寸-宽 - height: 55,//尺寸-高 + // position: {x: 120.73009403024408,y: 31.263550654413432,z: 0},//坐标位置 + width: 120,//尺寸-宽 + height: 120,//尺寸-高 floorId: this.floorNo,//楼层id offset: jsmapbase.JSControlPosition.RIGHT_BOTTOM,//偏移位置 depthTest: false,//是否开启深度检测 @@ -87,6 +89,26 @@ export default { window.map.on('mapClickNode', event => { console.log(map._map.focusFloorId, map._map.allLayers); console.log('===========', event); + // var imagerMarker = new jsmapbase.JSImageMarker({ + // id: 'iamgeMareker1',//id + // image: Img,//图片路径 + // // position: new jsmapbase.JSPoint(res.data.data.lng, res.data.data.lat, 0),//坐标位置 + // // position: new jsmapbase.JSPoint(event.x,event.y, 0),//坐标位置 + // position: {x:event.x,y:event.y, z:0},//坐标位置 + // width: 120,//尺寸-宽 + // height: 120,//尺寸-高 + // floorId: this.floorNo,//楼层id + // offset: jsmapbase.JSControlPosition.RIGHT_BOTTOM,//偏移位置 + // depthTest: false,//是否开启深度检测 + // show: true, //是否显示 + // properties: { + // name: 'test' + // },//属性设置 + // callback: (node) => { + // console.log(node); + // }//回调 + // }); + // window.map.addMarker(imagerMarker); }); }, methods: { diff --git a/src/views/wirelessintrusion/deployment/list.vue b/src/views/wirelessintrusion/deployment/list.vue index 199d8f4..5c2e6da 100644 --- a/src/views/wirelessintrusion/deployment/list.vue +++ b/src/views/wirelessintrusion/deployment/list.vue @@ -209,6 +209,14 @@ export default { this.loadDict(); }, methods: { + handleSizeChange(val){ + this.diaPage.pageSize = val + this.queryDeviceList(this.diaPage) + }, + handleCurrentChange(val){ + this.diaPage.currentPage = val + this.queryDeviceList(this.diaPage) + }, //字典加载 loadDict() { let token = window.sessionStorage.getItem('bizToken'); diff --git a/src/views/wirelessintrusion/oneClick/list.vue b/src/views/wirelessintrusion/oneClick/list.vue index 84fea42..ab3aa7d 100644 --- a/src/views/wirelessintrusion/oneClick/list.vue +++ b/src/views/wirelessintrusion/oneClick/list.vue @@ -223,6 +223,14 @@ export default { this.loadDict(); }, methods: { + handleSizeChange(val){ + this.diaPage.pageSize = val + this.queryDeviceList(this.diaPage) + }, + handleCurrentChange(val){ + this.diaPage.currentPage = val + this.queryDeviceList(this.diaPage) + }, //字典加载 loadDict() { let token = window.sessionStorage.getItem('bizToken'); diff --git a/src/views/wirelessintrusion/warn/record.vue b/src/views/wirelessintrusion/warn/record.vue index d8dab00..d1d2681 100644 --- a/src/views/wirelessintrusion/warn/record.vue +++ b/src/views/wirelessintrusion/warn/record.vue @@ -284,7 +284,7 @@ export default { if (row.systemNum < 0) { return; } - warnSysClear({ id: row.id, systemNum: row.systemNum, hostSerialNumber: row.hostSerialNumber }).then(res => { + warnSysClear({ id: row.id, systemNum: row.systemNum, hostSerialNumber: row.hostSerialNumber,deviceId:row.deviceId}).then(res => { this.onLoad(this.page); this.$message({ type: "success", @@ -423,68 +423,78 @@ export default { }, // 视频联动按钮 linkVideo(row) { - let token = window.sessionStorage.getItem('bizToken'); - if (token == 'undefined' || !token) { - bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { - if(res.status == 200){ - if(res.data.code == 0){ - window.sessionStorage.setItem('bizToken', res.data.data.token); - bizDeviceList(res.data.data.token, { 'params[pmac]': row.deviceId }).then(res2 => { - const data = res2.data; - this.videoData = data.rows; - if (this.videoData.length === 0) { - this.$message.warning('未查询到该报警点摄像头'); - } - else { - // this.dialogVisible = true; - const routeData = this.$router.resolve({ - path: '/videoPlayer', // 跳转的路径 - query: { - list: JSON.stringify(this.videoData), // 携带的的参数信息 - showLeft:true - } - }) - console.log('href ===>',routeData.href) - window.open(routeData.href, '_blank') - } - }); - }else{ - this.$message.error('物联网平台访问超时!') - } - }else{ - this.$message.error('物联网平台访问超时!') - } + this.videoData = row.cameraCode + const routeData = this.$router.resolve({ + path: '/videoPlayer', // 跳转的路径 + query: { + list: JSON.stringify(this.videoData), // 携带的的参数信息 + showLeft:true + } + }) + console.log('href ===>',routeData.href) + window.open(routeData.href, '_blank') + // let token = window.sessionStorage.getItem('bizToken'); + // if (token == 'undefined' || !token) { + // bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { + // if(res.status == 200){ + // if(res.data.code == 0){ + // window.sessionStorage.setItem('bizToken', res.data.data.token); + // bizDeviceList(res.data.data.token, { 'params[pmac]': row.deviceId }).then(res2 => { + // const data = res2.data; + // this.videoData = data.rows; + // if (this.videoData.length === 0) { + // this.$message.warning('未查询到该报警点摄像头'); + // } + // else { + // // this.dialogVisible = true; + // const routeData = this.$router.resolve({ + // path: '/videoPlayer', // 跳转的路径 + // query: { + // list: JSON.stringify(this.videoData), // 携带的的参数信息 + // showLeft:true + // } + // }) + // console.log('href ===>',routeData.href) + // window.open(routeData.href, '_blank') + // } + // }); + // }else{ + // this.$message.error('物联网平台访问超时!') + // } + // }else{ + // this.$message.error('物联网平台访问超时!') + // } - }) - } else { - bizDeviceList(token, { 'params[pmac]': row.deviceId }).then(res2 => { - if (res2.data.code == 401) { - window.sessionStorage.removeItem('bizToken'); - this.linkVideo(row); - } - else if (res2.data.code == 200) { - const data = res2.data; - this.videoData = data.rows; - if (this.videoData.length === 0) { - this.$message.warning('未查询到该报警点摄像头'); - } - else { - // this.dialogVisible = true; - const routeData = this.$router.resolve({ - path: '/videoPlayer', // 跳转的路径 - query: { - list: JSON.stringify(this.videoData), // 携带的的参数信息 - showLeft:true - } - }) - console.log('href ===>',routeData.href) - window.open(routeData.href, '_blank') - } - }else{ - this.$message.error('物联网平台访问超时!') - } - }); - } + // }) + // } else { + // bizDeviceList(token, { 'params[pmac]': row.deviceId }).then(res2 => { + // if (res2.data.code == 401) { + // window.sessionStorage.removeItem('bizToken'); + // this.linkVideo(row); + // } + // else if (res2.data.code == 200) { + // const data = res2.data; + // this.videoData = data.rows; + // if (this.videoData.length === 0) { + // this.$message.warning('未查询到该报警点摄像头'); + // } + // else { + // // this.dialogVisible = true; + // const routeData = this.$router.resolve({ + // path: '/videoPlayer', // 跳转的路径 + // query: { + // list: JSON.stringify(this.videoData), // 携带的的参数信息 + // showLeft:true + // } + // }) + // console.log('href ===>',routeData.href) + // window.open(routeData.href, '_blank') + // } + // }else{ + // this.$message.error('物联网平台访问超时!') + // } + // }); + // } }, renderCode(tags) { let obj = JSON.parse(tags); diff --git a/vocalldemo/report.html b/vocalldemo/report.html index a0feb5e..902e486 100644 --- a/vocalldemo/report.html +++ b/vocalldemo/report.html @@ -157,13 +157,44 @@ // const baseUrl = "http://152.136.119.150:81";//外网测试环境 //本地测试 // const baseUrl = "http://192.168.1.102:81";//本地测试环境-上报 - // const iotBaseUrl = "http://182.139.182.190:60032";//物联网平台测试 + const baseUrl = "http://192.168.1.34:81";//本地测试环境-上报 + const iotBaseUrl = "http://182.139.182.190:60032";//物联网平台测试 //现场测试 - const baseUrl = "http://171.16.8.51:81";//上报 - const iotBaseUrl = "http://171.16.8.58:8080"//物联网平台环境 + // const baseUrl = "http://171.16.8.51:81";//上报 + // const iotBaseUrl = "http://171.16.8.58:8080"//物联网平台环境 //上报报警 document.getElementById('alarmBtn').onclick = function () { - reportIot(); + reportSaveIot(); + } + + //报警信息上报 + function reportSaveIot() { + let ip = $('#ip').val(); + if(ip == '') { + layer.msg('未成功获取本机IP,请联系运维人员'); + return; + } + let txt = $('#volTxt').val() + let formdata = new FormData(); + formdata.append('type', '5'); + formdata.append('deviceId', ip); + formdata.append('content', txt); + var loadingIndex = layer.load(0, {shade: false}); + $.ajax({ + url: baseUrl + "/appData/putFile", type: "post", contentType: false, processData: false, + timeout: 6000, dataType: 'json', data: formdata, success: function (res) { + layer.close(loadingIndex); + if (res.code === 200) { + console.log('上报成功'); + reportIot(); + }else{ + layer.msg('报警失败,请联系运维人员'); + } + },error: function() { + layer.close(loadingIndex); + layer.msg('报警失败,请联系运维人员'); + } + }); } //报警信息上报