From 308b8258690c6138f5ee0f230937c9857f7ecbb2 Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Tue, 16 May 2023 09:26:28 +0800 Subject: [PATCH] 20230516 --- src/App.vue | 58 +++++-- src/utils/mqttConfig.js | 28 +--- src/views/alarm.vue | 12 +- src/views/court.vue | 40 ++--- src/views/energySaving.vue | 172 +++++++++++--------- src/views/index.vue | 321 ++++++++++++++++++++++++++++++++----- src/views/security.vue | 260 ++++++++++++++++++------------ 7 files changed, 613 insertions(+), 278 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5ea6f63..bb1b99f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -135,13 +135,26 @@ export default { this.fun(); }, mounted() { - window.goPage = this.goPage(); + // window.goPage = function(e) { + // console.log(e) + // } + window['goPage'] = (b) => { + // alert("goPage:"+b); + console.log("b") + }; + // window['goIndex'] = (a) => { + // console.log(a) + // }; + // window.goPage = this.goPage(); this.menuChange(0, this.menuBtn[0].name); let week = new Date(this.$moment().format("YYYY-MM-DD")).getDay(); this.week = this.weekList[week]; - window.setInterval(() => { + setInterval(() => { this.time = this.$moment().format("YYYY-MM-DD HH:mm:ss"); }, 100); + // window.setInterval(() => { + // this.time = this.$moment().format("YYYY-MM-DD HH:mm:ss"); + // }, 100); const that = this; window.onresize = () => { return () => { @@ -155,11 +168,15 @@ export default { }; }, methods: { + goPage:function(name){ + goPage(name) + }, +// goIndex:function(){ +// goIndex(e) +// }, //菜单选中 menuChange(index, name) { - this.goPage(name); - this.menuAc = index; - this.menuBtn.forEach((item, index) => { + this.menuBtn.forEach((item, index) => { if (index == 0) { item.icon = require("./assets/images/shouYe.png"); } else if (index == 1) { @@ -175,27 +192,36 @@ export default { } }); if (index == 0) { + this.$router.push("/"); this.menuBtn[index].icon = require("./assets/images/shouYeAc.png"); - this.$router.push("/"); } else if (index == 1) { + this.$router.push("court"); this.menuBtn[index].icon = require("./assets/images/faTingAc.png"); - this.$router.push("court"); + } else if (index == 2) { + this.$router.push("energySaving"); this.menuBtn[index].icon = require("./assets/images/jieNengAc.png"); - this.$router.push("energySaving"); + } else if (index == 3) { - this.menuBtn[index].icon = require("./assets/images/anFangAc.png"); this.$router.push("security"); + this.menuBtn[index].icon = require("./assets/images/anFangAc.png"); + } else if (index == 4) { - this.menuBtn[index].icon = require("./assets/images/yunWeiAc.png"); - this.$router.push("operationMaintenance"); + this.$router.push("operationMaintenance"); + this.menuBtn[index].icon = require("./assets/images/yunWeiAc.png"); } else if (index == 5) { - this.menuBtn[index].icon = require("./assets/images/gaoJingAc.png"); this.$router.push("alarm"); + this.menuBtn[index].icon = require("./assets/images/gaoJingAc.png"); } - }, - goPage(name) { - console.log(name); + this.goPage(name); + // if (name!="首页"){ + // this.goPage(name); + // }else{ + // this.goIndex('进入首页'); + // } + + this.menuAc = index; + }, //选中楼层 @@ -244,7 +270,7 @@ export default { #app { // width: 6144px; // height: 1920px; - background: rgba(1, 1, 7, 0); + background: rgba(1, 1, 7, 1); // overflow: hidden; .header { height: 11%; diff --git a/src/utils/mqttConfig.js b/src/utils/mqttConfig.js index bac827a..0852717 100644 --- a/src/utils/mqttConfig.js +++ b/src/utils/mqttConfig.js @@ -36,21 +36,8 @@ class mqttHandle { // console.log("connectUrl",connectUrl) const { host, port, endpoint, ...options } = this.connect; console.log("this.connect.host", this.connect.host) - // const connectUrl = 'ws://138.227.111.141:8083/mqtt'; - // const connectUrl = 'ws://138.227.208.100:1884/mqtt'; - const connectUrl = 'ws://172.16.1.253:1884/mqtt'; - // const connectUrl = `ws://${this.connect.host}:${this.connect.port}`; - // if (!client.connected) { - // client.on('connect', function () { - // console.log('连接成功') - // }) - // } else { - // client.publish('test/clientE', ms, {'qos': 2}, function (err) { - // if (err) { - // console.log(err) - // } - // }) - // } + const connectUrl = 'ws://138.227.208.100:1884/mqtt'; + //const connectUrl = 'ws://172.16.1.253:1884/mqtt'; if (this.mqttClient == undefined) { this.mqttClient = mqtt.connect(connectUrl, options); this.mqttClient.on("connect", () => { @@ -64,17 +51,6 @@ class mqttHandle { console.log("Connection failed"); }); - //配置topic - // const { topic, qos } = this.subscription; - // console.log(topic, qos,'topic, qos'); - // this._client.subscribe(topic, { qos: qos }, (error, res) => { - // if (error) { - // console.log("Subscribe to topics error", error); - // return; - // } - // this.subscribeSuccess = true; - // console.log("Subscribe to topics res", res[0].qos, res[0].topic); - // }); } return this.mqttClient; diff --git a/src/views/alarm.vue b/src/views/alarm.vue index 944ab12..ec5d2d7 100644 --- a/src/views/alarm.vue +++ b/src/views/alarm.vue @@ -195,7 +195,9 @@ export default { risk: res.data.data[index].AlarmLevel, }; }); - }); + }).catch(err => { + + }); }, //获取二级告警 getSecondAlarm() { @@ -215,7 +217,9 @@ export default { risk: res.data.data[index].AlarmLevel, }; }); - }); + }).catch(err => { + + }); }, //获取三级告警 getThirdAlarm() { @@ -235,7 +239,9 @@ export default { risk: res.data.data[index].AlarmLevel, }; }); - }); + }).catch(err => { + + }); }, //获取mqtt数据 upmqttData(val) { diff --git a/src/views/court.vue b/src/views/court.vue index 6821925..5b6af98 100644 --- a/src/views/court.vue +++ b/src/views/court.vue @@ -22,21 +22,7 @@
案件统计
- - - - - + + + + +
@@ -441,7 +442,8 @@ export default { { name: "收案", type: "bar", - data: [22, 30, 50, 10], + // data: [22, 30, 50, 10], + data: [22, 30, 0, 0], itemStyle: { //定义柱子的样式 // color:params=>color[params.dataIndex],//定义每根柱子的不同颜色(不渐变) @@ -477,7 +479,8 @@ export default { { name: "结案", type: "bar", - data: [20, 34, 20, 30], + // data: [20, 34, 20, 30], + data: [20, 34, 0, 0], itemStyle: { //定义柱子的样式 // color:params=>color[params.dataIndex],//定义每根柱子的不同颜色(不渐变) @@ -513,7 +516,8 @@ export default { { name: "存案", type: "bar", - data: [12, 40, 20, 10], + // data: [12, 40, 20, 10], + data: [12, 40, 0, 0], itemStyle: { //定义柱子的样式 // color:params=>color[params.dataIndex],//定义每根柱子的不同颜色(不渐变) diff --git a/src/views/energySaving.vue b/src/views/energySaving.vue index a350f8f..c834a53 100644 --- a/src/views/energySaving.vue +++ b/src/views/energySaving.vue @@ -301,6 +301,9 @@ export default { }, ], //设备用能数据 equipmentBtnList: [ + { + name: "热回收空调", + }, { name: "电梯系统", }, @@ -313,40 +316,38 @@ export default { { name: "恒温恒湿空调", }, - { - name: "热回收空调", - }, + ], equipmentBtnAc: "", //点击预警 warnList: [ - { - id: "1", - icon: require("../assets/images/jieNengImg/warnRed.png"), - time: "2023年03月12日 15:45:10", - case: "设备故障", - grade: "三级", - }, - { - id: "2", - icon: require("../assets/images/jieNengImg/warnBlue.png"), - time: "2023年03月12日 15:45:10", - case: "设备故障", - grade: "三级", - }, - { - id: "3", - icon: require("../assets/images/jieNengImg/warnWhite.png"), - time: "2023年03月12日 15:45:10", - case: "设备故障", - grade: "三级", - }, - { - id: "4", - icon: require("../assets/images/jieNengImg/warnRed.png"), - time: "2023年03月12日 15:45:10", - case: "设备故障", - grade: "三级", - }, + // { + // id: "1", + // icon: require("../assets/images/jieNengImg/warnRed.png"), + // time: "2023年03月12日 15:45:10", + // case: "设备故障", + // grade: "三级", + // }, + // { + // id: "2", + // icon: require("../assets/images/jieNengImg/warnBlue.png"), + // time: "2023年03月12日 15:45:10", + // case: "设备故障", + // grade: "三级", + // }, + // { + // id: "3", + // icon: require("../assets/images/jieNengImg/warnWhite.png"), + // time: "2023年03月12日 15:45:10", + // case: "设备故障", + // grade: "三级", + // }, + // { + // id: "4", + // icon: require("../assets/images/jieNengImg/warnRed.png"), + // time: "2023年03月12日 15:45:10", + // case: "设备故障", + // grade: "三级", + // }, ], //故障数组 sunList: [ { @@ -396,9 +397,14 @@ export default { }, mounted() { this.getAllDevicesInfo(); - window.setInterval(() => { - this.getAllDevicesInfo(); - }, 10000); + + // setInterval(() => { + + // this.getAllDevicesInfo(); + // }, 10000); + setTimeout(()=> { + this.getAllDevicesInfo(); + }, 10000); this.getMqttData() window.alarmSecondLevel= this.alarmSecondLevel window.alarmThirdLevel= this.alarmThirdLevel @@ -448,7 +454,9 @@ export default { }; getAreaList(dataList).then((res)=>{ this.calculateEcharts(res.data.data.child); - }) + }).catch(err => { + + }) }, //获取能耗计量同比分析 getYOY() { @@ -463,7 +471,9 @@ export default { //接口调用 getAreaList(dataList).then((res)=>{ this.calculateEchartsTwo(res.data.data.values); - }) + }).catch(err => { + + }) }, // //mqtt订阅数据 // createMqtt() { @@ -586,6 +596,7 @@ export default { }, //获取所有设备信息 getAllDevicesInfo() { + console.log("getAllDevices") //调用接口数据 let allDevicesCode = []; getAllDevices().then((res) => { @@ -599,7 +610,7 @@ export default { ); res.data.dataResults.forEach((item, index) => { allDevicesCode.push(item.metercode); - }); + }) getRealData({ metercodes: allDevicesCode, }).then((response) => { @@ -624,53 +635,68 @@ export default { this.equipmentList1.push(this.equipmentList2.slice(i, i + 8)); } - }); - }); + }).catch(err => { + + });; + }).catch(err => { + + }); }, //预警点击 changeWarn(index) { this.equipmentBtnAc = index; - if (index == 0) { - let params = { - AlarmLevel: "", - DeviceTypes: "电梯", - }; - GetLevelAlarm(params).then((res) => { - this.upWainData(res); - }); - } else if (index == 1) { - let params = { - AlarmLevel: "", - DeviceTypes: "光伏", - }; - GetLevelAlarm(params).then((res) => { - this.upWainData(res); - }); - } else if (index == 2) { - let params = { - AlarmLevel: "", - DeviceTypes: "VRV", - }; - GetLevelAlarm(params).then((res) => { - this.upWainData(res); - }); - } else if (index == 3) { - let params = { - AlarmLevel: "", - DeviceTypes: "恒温恒湿", - }; - GetLevelAlarm(params).then((res) => { - this.upWainData(res); - }); - } else if (index == 4) { + if (index == 0) { let params = { AlarmLevel: "", DeviceTypes: "热回收", }; GetLevelAlarm(params).then((res) => { this.upWainData(res); - }); + }).catch(err => { + + });; } + if (index == 1) { + let params = { + AlarmLevel: "", + DeviceTypes: "电梯", + }; + GetLevelAlarm(params).then((res) => { + this.upWainData(res); + }).catch(err => { + + }); + } else if (index == 2) { + let params = { + AlarmLevel: "", + DeviceTypes: "光伏", + }; + GetLevelAlarm(params).then((res) => { + this.upWainData(res); + }).catch(err => { + + }); + } else if (index == 3) { + let params = { + AlarmLevel: "", + DeviceTypes: "VRV", + }; + GetLevelAlarm(params).then((res) => { + this.upWainData(res); + }).catch(err => { + + }); + } else if (index == 4) { + let params = { + AlarmLevel: "", + DeviceTypes: "恒温恒湿", + }; + GetLevelAlarm(params).then((res) => { + this.upWainData(res); + }).catch(err => { + + }); + } }, //获取mqtt数据 upmqttData(val) { diff --git a/src/views/index.vue b/src/views/index.vue index c077a0a..db5fe30 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -182,6 +182,37 @@ +
+ + + + + + +
Date.now(); + }, + shortcuts: [{ + text: '今天', + onClick(picker) { + picker.$emit('pick', new Date()); + } + }, { + text: '昨天', + onClick(picker) { + const date = new Date(); + date.setTime(date.getTime() - 3600 * 1000 * 24); + picker.$emit('pick', date); + } + }] + }, wisdomList: [ { name: "空闲中", @@ -343,6 +398,20 @@ export default { cause: "<空调设备>发生事故", risk: "三级", }, + { + id: "4", + icon: require("../assets/images/warnOrange.png"), + time: "2023年03月18日 15:26:08", + cause: "<空调设备>发生事故", + risk: "三级", + }, + { + id: "5", + icon: require("../assets/images/warnOrange.png"), + time: "2023年03月18日 15:26:08", + cause: "<空调设备>发生事故", + risk: "三级", + }, ], //报警数组 selectValue: { value: "79", @@ -359,19 +428,19 @@ export default { value: "2", }, ], - selectDate: "3", + selectDate: 1, dateOptions: [ { label: "年", - value: "3", + value: 3, }, { label: "月", - value: "2", + value: 2, }, { label: "日", - value: "1", + value: 1, }, ], cameraList: [ @@ -450,7 +519,7 @@ export default { console.log("alarmAllLevel", val); this.upmqttData(val); }, - + alarmFirstLevel(val) { // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 console.log("alarmFirstLevel", val); @@ -511,7 +580,78 @@ export default { }; getHikvision(dataList).then((res) => { console.log(res, "============="); - }); + }).catch(err => { + + }); + }, + selectTime(val){ + if(val){ + console.log("val",val) + this.value1 = val + let data = { + buildingId: this.selectValue.value, //建筑id + customerId: "12345678", + date: this.value1, + dateType: 1, + meterType: "1", //1.电,2.水 + pbuildingId: this.selectValue.parentId, //建组父id + }; + //接口获取区域 + getAreaList(data).then((res) => { + this.energyEcharts(res.data.data); + }).catch(err => { + + }); + }else{ + // this.filters.year = "" + // this.filters.month = "" + } + }, + selectTimeMM(val){ + if(val){ + console.log("val",val) + this.value2 = val + let data = { + buildingId: this.selectValue.value, //建筑id + customerId: "12345678", + date: this.value2, + dateType: 2, + meterType: "1", //1.电,2.水 + pbuildingId: this.selectValue.parentId, //建组父id + }; + //接口获取区域 + getAreaList(data).then((res) => { + this.energyEcharts(res.data.data); + }).catch(err => { + + }); + }else{ + // this.filters.year = "" + // this.filters.month = "" + } + }, + selectTimeDD(val){ + if(val){ + console.log("val",val) + this.value3 = val + let data = { + buildingId: this.selectValue.value, //建筑id + customerId: "12345678", + date: this.value3, + dateType: 3, + meterType: "1", //1.电,2.水 + pbuildingId: this.selectValue.parentId, //建组父id + }; + //接口获取区域 + getAreaList(data).then((res) => { + this.energyEcharts(res.data.data); + }).catch(err => { + + }); + }else{ + // this.filters.year = "" + // this.filters.month = "" + } }, //缩小变焦 reduceZoom() { @@ -527,7 +667,9 @@ export default { }; getHikvision(dataList).then((res) => { console.log(res, "============="); - }); + }).catch(err => { + + }); }, //获取视频流 getCamera() { @@ -555,7 +697,9 @@ export default { // dataList.data.cameraIndexCode; this.cameraList[0].video =res.data.result.data.url; console.log(this.cameraList[0].video,'视频地址'); - }); + }).catch(err => { + + }); let dataList1 = { path: pathUrl, @@ -571,7 +715,9 @@ export default { // "&code=" + // dataList1.data.cameraIndexCode; this.cameraList[1].video =res.data.result.data.url; - }); + }).catch(err => { + + }); let dataList2 = { path: pathUrl, data: { @@ -586,7 +732,9 @@ export default { // "&code=" + // dataList2.data.cameraIndexCode; this.cameraList[2].video =res.data.result.data.url; - }); + }).catch(err => { + + }); let dataList3 = { path: pathUrl, data: { @@ -601,11 +749,14 @@ export default { // "&code=" + // dataList3.data.cameraIndexCode; this.cameraList[3].video =res.data.result.data.url; - }); + }).catch(err => { + + }); }, //获取建筑Id getBuildingData() { getBuildinginfos().then((res) => { + console.log("res",res) // 接口取值 this.buildingList = res.data.dataResults; let buildArr = []; @@ -627,41 +778,69 @@ export default { parentId: this.buildingList[index].parentId, }; }); - }); + }).catch(err => { + + }); }, //智慧节能选择时间 + // selectDataList(val) { + // let nowTime = ""; + // if (val == 1) { + // nowTime = this.$moment().format("YYYYMMDD"); + // } else if (val == 2) { + // nowTime = this.$moment().format("YYYYMM"); + // } else { + // nowTime = this.$moment().format("YYYY"); + // } + // let data = { + // buildingId: this.selectValue.value, //建筑id + // customerId: "12345678", + // date: nowTime, + // dateType: val, + // meterType: "1", //1.电,2.水 + // pbuildingId: this.selectValue.parentId, //建组父id + // }; + // //接口获取区域 + // getAreaList(data).then((res) => { + // this.energyEcharts(res.data.data); + // }).catch(err => { + + // }); + // }, selectDataList(val) { - let nowTime = ""; - if (val == 1) { - nowTime = this.$moment().format("YYYYMMDD"); + this.selectDate = val + if (val == 1) { + this.dateShow = true + this.monthShow = false + this.yearShow = false } else if (val == 2) { - nowTime = this.$moment().format("YYYYMM"); + this.monthShow = true + this.yearShow = false + this.dateShow = false } else { - nowTime = this.$moment().format("YYYY"); + this.yearShow = true + this.monthShow = false + this.dateShow = false } - let data = { - buildingId: this.selectValue.value, //建筑id - customerId: "12345678", - date: nowTime, - dateType: val, - meterType: "1", //1.电,2.水 - pbuildingId: this.selectValue.parentId, //建组父id - }; - //接口获取区域 - getAreaList(data).then((res) => { - this.energyEcharts(res.data.data); - }); }, //智慧节能选择类型 selectMeterType(event) { let nowTime = ""; + console.log("selectDate",this.selectDate) if (this.selectDate == 1) { - nowTime = this.$moment().format("YYYYMMDD"); + // nowTime = this.$moment().format("YYYYMMDD"); + nowTime = this.value1 } else if (this.selectDate == 2) { - nowTime = this.$moment().format("YYYYMM"); - } else { - nowTime = this.$moment().format("YYYY"); + // nowTime = this.$moment().format("YYYYMM"); + nowTime = this.value2 + } else if (this.selectDate == 3){ + // nowTime = this.$moment().format("YYYY"); + nowTime = this.value3 } + console.log("this.value1",this.value1) + console.log("this.value2",this.value2) + console.log("this.value3",this.value3) + console.log("nowTime",nowTime) let data = { buildingId: event.value, //建筑id customerId: "12345678", @@ -674,7 +853,9 @@ export default { getAreaList(data).then((res) => { console.log(res.data.data, "sssssssssssssss"); this.energyEcharts(res.data.data); - }); + }).catch(err => { + + }); }, //选中图片 changeCamera(path) { @@ -703,7 +884,9 @@ export default { }; GetLevelAlarm(params).then((res) => { this.upWainData(res.data.data); - }); + }).catch(err => { + + }); } else { let params = { AlarmLevel: "", @@ -711,7 +894,9 @@ export default { }; GetLevelAlarm(params).then((res) => { this.upWainData(res.data.data); - }); + }).catch(err => { + + }); } }, //更新报警信息 @@ -1031,7 +1216,9 @@ export default { ], }; myChart.setOption(option); - }); + }).catch(err => { + + }); }, maintenanceLeft() { var myChart = this.$echarts.init( @@ -1570,7 +1757,8 @@ export default { } } .leftThree { - height: 48%; + // height: 48%; + height: 52%; width: 100%; .warnListTitle { height: 6%; @@ -1630,7 +1818,8 @@ export default { background-size: 100% 100%; overflow: auto; .warnListContent { - height: 27%; + // height: 27%; + height: 25%; width: 100%; border: 1px dashed #fff; color: #fff; @@ -1775,7 +1964,7 @@ export default { height: 10%; position: absolute; top: 22%; - right: 35%; + right: 60%; /deep/ .el-select { width: 100%; height: 100%; @@ -1808,6 +1997,58 @@ export default { align-items: center; } } + .selectChange1 { + width: 23%; + height: 10%; + position: absolute; + top: 22%; + right: 35%; + /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner { + width: 134px; + } + /deep/ .el-select { + width: 100%; + height: 100%; + border-radius: 15px; + } + /deep/ .el-input__inner { + width: 100%; + height: 100%; + background: transparent; + border: 1px solid rgb(1, 176, 202); + border-radius: 15px; + color: #fff; + } + /deep/ .el-select-dropdown { + background: transparent; + border: 1px solid rgb(1, 176, 202); + border-radius: 5px; + // left: -30px !important; + } + /deep/ .el-select-dropdown__item { + color: turquoise; + } + /deep/ .el-select .el-input .el-select__caret { + color: rgb(1, 176, 202); + font-size: 0.3rem; + font-weight: 500; + } + /deep/ .el-input__suffix { + display: flex; + align-items: center; + } + /deep/ .el-input__icon { + height: 100%; + width: 25px; + text-align: center; + -webkit-transition: all .3s; + transition: all .3s; + line-height: 22px; + } + /deep/ .el-input--suffix .el-input__inner { + padding-right: 18px; + } + } } .rightThree { height: 34%; diff --git a/src/views/security.vue b/src/views/security.vue index 14f0304..9ab906c 100644 --- a/src/views/security.vue +++ b/src/views/security.vue @@ -208,15 +208,15 @@ export default { }, { name: "摄像头总数", - count: "609", + count: "0", }, { name: "摄像头在线数量", - count: "602", + count: "0", }, { name: "摄像头离线数量", - count: "7", + count: "0", }, { name: "摄像头报警数", @@ -237,15 +237,15 @@ export default { }, { name: "门禁总数", - count: "609", + count: "0", }, { name: "门禁在线数量", - count: "602", + count: "0", }, { name: "门禁离线数量", - count: "7", + count: "0", }, { name: "门禁今日报警数", @@ -281,60 +281,60 @@ export default { }, ], fireWarnList: [ - { - icon: require("../assets/images/jieNengImg/warnBlue.png"), - time: "2023年03月12日 15:45:10", - position: "烟感", - status: "已解除", - }, - { - icon: require("../assets/images/jieNengImg/warnBlue.png"), - time: "2023年03月12日 15:45:10", - position: "烟感", - status: "已解除", - }, - { - icon: require("../assets/images/jieNengImg/warnWhite.png"), - time: "2023年03月12日 15:45:10", - position: "烟感", - status: "已解除", - }, - { - icon: require("../assets/images/jieNengImg/warnBlue.png"), - time: "2023年03月12日 15:45:10", - position: "烟感", - status: "已解除", - }, + // { + // icon: require("../assets/images/jieNengImg/warnBlue.png"), + // time: "2023年03月12日 15:45:10", + // position: "烟感", + // status: "已解除", + // }, + // { + // icon: require("../assets/images/jieNengImg/warnBlue.png"), + // time: "2023年03月12日 15:45:10", + // position: "烟感", + // status: "已解除", + // }, + // { + // icon: require("../assets/images/jieNengImg/warnWhite.png"), + // time: "2023年03月12日 15:45:10", + // position: "烟感", + // status: "已解除", + // }, + // { + // icon: require("../assets/images/jieNengImg/warnBlue.png"), + // time: "2023年03月12日 15:45:10", + // position: "烟感", + // status: "已解除", + // }, ], //故障数组 policeList: [ - { - id: "1", - icon: require("../assets/images/anFang/exclamatory.png"), - time: "2023年03月12日 15:45:10", - position: "306门禁故障", - status: "已解除", - }, - { - id: "2", - icon: require("../assets/images/anFang/exclamatory.png"), - time: "2023年03月12日 15:45:10", - position: "201门禁故障", - status: "已解除", - }, - { - id: "3", - icon: require("../assets/images/anFang/exclamatory.png"), - time: "2023年03月12日 15:45:10", - position: "206门禁故障", - status: "已解除", - }, - { - id: "4", - icon: require("../assets/images/anFang/exclamatory.png"), - time: "2023年03月12日 15:45:10", - position: "106门禁故障", - status: "已解除", - }, + // { + // id: "1", + // icon: require("../assets/images/anFang/exclamatory.png"), + // time: "2023年03月12日 15:45:10", + // position: "306门禁故障", + // status: "已解除", + // }, + // { + // id: "2", + // icon: require("../assets/images/anFang/exclamatory.png"), + // time: "2023年03月12日 15:45:10", + // position: "201门禁故障", + // status: "已解除", + // }, + // { + // id: "3", + // icon: require("../assets/images/anFang/exclamatory.png"), + // time: "2023年03月12日 15:45:10", + // position: "206门禁故障", + // status: "已解除", + // }, + // { + // id: "4", + // icon: require("../assets/images/anFang/exclamatory.png"), + // time: "2023年03月12日 15:45:10", + // position: "106门禁故障", + // status: "已解除", + // }, ], alarmFirstLevel: [], alarmSecondLevel: [], @@ -342,6 +342,66 @@ export default { }; }, mounted() { + window['getWarning'] = (name) => { + // alert("goPage:"+b); + // console.log("name",name) + if (name.indexOf("法院一层") != -1 ) { + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("自助立案") != -1|| name.indexOf("门厅") != -1|| name.indexOf("展厅") != -1) { + console.log("消防联动,主楼一层,公共区"); + }else{ + console.log("消防联动,主楼一层,办公区"); + } + + } else if(name.indexOf("法院四层") != -1) { + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("自助立案") != -1) { + console.log("消防联动,主楼四层,公共区"); + }else{ + console.log("消防联动,主楼四层,办公区"); + } + }else if(name.indexOf("法院二层") != -1) { + //console.log("消防联动 主楼二层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("自助立案") != -1) { + console.log("消防联动,主楼二层,公共区"); + }else{ + console.log("消防联动,主楼二层,办公区"); + } + }else if(name.indexOf("法院三层") != -1) { + // console.log("消防联动 主楼三层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("自助立案") != -1) { + console.log("消防联动,主楼三层,公共区"); + }else{ + console.log("消防联动,主楼三层,办公区"); + } + }else if(name.indexOf("辅楼1层") != -1) { + // console.log("消防联动 辅楼一层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("自助立案") != -1) { + console.log("消防联动,辅楼一层,公共区"); + }else{ + console.log("消防联动,辅楼一层,办公区"); + } + }else if(name.indexOf("辅楼2层") != -1) { + // console.log("消防联动 辅楼二层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1) { + console.log("消防联动,辅楼二层,公共区"); + }else{ + console.log("消防联动,辅楼二层,办公区"); + } + }else if(name.indexOf("辅楼3层") != -1) { + //console.log("消防联动 辅楼三层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("电梯") != -1) { + console.log("消防联动,辅楼三层,公共区"); + }else{ + console.log("消防联动,辅楼三层,办公区"); + } + }else if(name.indexOf("辅楼4层") != -1) { + //console.log("消防联动 辅楼四层"); + if (name.indexOf("走道") != -1 || name.indexOf("大厅") != -1|| name.indexOf("楼梯") != -1|| name.indexOf("电梯") != -1) { + console.log("消防联动,辅楼四层,公共区"); + }else{ + console.log("消防联动,辅楼四层,办公区"); + } + } + }; this.getAnfang(); //获取消防告警 this.getPoliceList(); @@ -356,6 +416,7 @@ export default { }, watch: { + alarmFirstLevel(val) { // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 console.log("alarmFirstLevel", val); @@ -374,27 +435,27 @@ export default { this.upmqttData(val); }, }, - watch: { - alarmFirstLevel(val) { + // watch: { + // alarmFirstLevel(val) { - // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 - console.log("alarmFirstLevel",val) - if(val.length!=0){ - this.upmqttData(val) - } + // // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 + // console.log("alarmFirstLevel",val) + // if(val.length!=0){ + // this.upmqttData(val) + // } - }, - alarmSecondLevel(val) { - // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 - console.log("alarmSecondLevel",val) - this.upmqttData(val) - }, - alarmThirdLevel(val) { - // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 - console.log("alarmThirdLevel",val) - this.upmqttData(val) - }, - }, + // }, + // alarmSecondLevel(val) { + // // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 + // console.log("alarmSecondLevel",val) + // this.upmqttData(val) + // }, + // alarmThirdLevel(val) { + // // 为了避免频繁触发resize函数导致页面卡顿,使用定时器 + // console.log("alarmThirdLevel",val) + // this.upmqttData(val) + // }, + // }, methods: { //获取昨天今天的报警数量 getAlarmCount() { @@ -405,7 +466,9 @@ export default { this.securityList[1].security[4].count = res.data.data.DoorTodayCount; this.securityList[1].security[5].count = res.data.data.DoorYesterdayCount; - }); + }).catch(err => { + + }); }, //获取设备离线在线数据 @@ -482,8 +545,12 @@ export default { this.securityList[1].security[3].count = offLineList.length; //门禁在线数数量 this.securityList[1].security[2].count = this.securityList[1].security[1].count - this.securityList[1].security[3].count; - }); - }); + }).catch(err => { + + }); + }).catch(err => { + + }); //获取视频状态 let cameraList = { @@ -527,7 +594,9 @@ export default { //门禁在线数数量 this.securityList[0].security[2].count = this.securityList[0].security[1].count - this.securityList[0].security[3].count; }); - }); + }).catch(err => { + + }); }, videoChange(index) { this.warnCameraList.forEach((item, i) => { @@ -567,7 +636,9 @@ export default { AlarmLevel: res.data.data[index].AlarmLevel, }; }); - }); + }).catch(err => { + + }); }, //获取安防报警、 getPoliceList() { @@ -597,7 +668,9 @@ export default { AlarmLevel: res.data.data[index].AlarmLevel, }; }); - }); + }).catch(err => { + + }); }, //获取mqtt数据 upmqttData(val) { @@ -642,25 +715,8 @@ export default { } } }, - getWarning(name) { - // console.log("name",name) - if (name.indexOf("法院一层") != -1) { - console.log("消防联动 主楼一层"); - } else if(name.indexOf("法院四层") != -1) { - console.log("消防联动 主楼四层"); - }else if(name.indexOf("法院二层") != -1) { - console.log("消防联动 主楼二层"); - }else if(name.indexOf("法院三层") != -1) { - console.log("消防联动 主楼三层"); - }else if(name.indexOf("辅楼1层") != -1) { - console.log("消防联动 辅楼一层"); - }else if(name.indexOf("辅楼2层") != -1) { - console.log("消防联动 辅楼二层"); - }else if(name.indexOf("辅楼3层") != -1) { - console.log("消防联动 辅楼三层"); - }else if(name.indexOf("辅楼4层") != -1) { - console.log("消防联动 辅楼四层"); - } + getWarning:function(name){ + getWarning(name) }, }, components: {},