From a689a913562bed23b72f0d1b75058502215def4c Mon Sep 17 00:00:00 2001 From: jinna Date: Fri, 8 Aug 2025 17:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9B=91=E6=8E=A7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=81=9A=E5=90=88=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/monitoring/backHome.vue | 5 +- src/components/monitoring/clickCp.vue | 3 + src/components/monitoring/monitoring.vue | 181 ++++++++++++++++++++++- src/page/index/sidebar/opsSidebar.vue | 67 +++++---- src/page/index/sidebar/sidebarItem.vue | 12 +- src/permission.js | 10 +- src/store/modules/user.js | 10 +- src/util/bfHelper.js | 79 +++++++++- src/views/garden/index.vue | 3 +- 9 files changed, 321 insertions(+), 49 deletions(-) diff --git a/src/components/monitoring/backHome.vue b/src/components/monitoring/backHome.vue index a709262..392abe9 100644 --- a/src/components/monitoring/backHome.vue +++ b/src/components/monitoring/backHome.vue @@ -95,7 +95,7 @@ bfHelper.clearTags() // } - console.log('返回') + console.log('返回-------------------------------') if (this.bimModel == 1) { window.sessionStorage.removeItem('build'); @@ -164,10 +164,11 @@ this.$parent.isControl = false; this.$parent.$refs.clickcp.tower = null; } else if (this.type == '监控') { - + console.log('监控------------------------------------') this.$parent.initial(); this.$parent.setTowerMonitor(); this.$parent.reload = 100; + this.$parent.getAllDevice(); if (this.bimModel == 1) { bfHelper.lookPipeline(null, null, this.condition, '监控'); this.$parent.$refs.clickcp.active = 25; diff --git a/src/components/monitoring/clickCp.vue b/src/components/monitoring/clickCp.vue index 5588070..5439a73 100644 --- a/src/components/monitoring/clickCp.vue +++ b/src/components/monitoring/clickCp.vue @@ -305,6 +305,7 @@ export default { this.active = this.active == '' ? 25 : this.active this.ttActive = this.ttActive == '' ? 20 : this.ttActive console.log('进入此方法111111111111111',this.type); + // bfHelper.clearCluster(); this.getTypeList(this.type) },500) @@ -340,6 +341,7 @@ export default { console.log('typeList ====>',this.typeList, this.page) }) }else if(type == 'floor'){ + bfHelper.clearCluster() this.typeList = []; let build = this.bimModel == 1 ? (this.tower + 1) :3; let layer = this.bimModel == 1 ? this.active : this.ttActive @@ -589,6 +591,7 @@ export default { } else if (this.sbType == '暖') { this.$parent.setTowerWarm(); } else if (this.sbType == '监控') { + console.log('11111111111111111111111111') this.$parent.$refs.backHome.clickBack(); } else if (this.sbType == '空调') { bfHelper.extObjMngClear(); //清除外部构件 diff --git a/src/components/monitoring/monitoring.vue b/src/components/monitoring/monitoring.vue index 6b00191..8fbecf6 100644 --- a/src/components/monitoring/monitoring.vue +++ b/src/components/monitoring/monitoring.vue @@ -319,7 +319,9 @@ export default { zoom: 1, }, isShowAll: true, //显示所有的摄像头 - dialogItem: {} + dialogItem: {}, + tagsArr:[], // 聚合标签数组 + changeBim:false //是否切换bim }; }, created() { @@ -346,6 +348,8 @@ export default { watch: { bimModel: { handler(newVal, oldVal) { + console.log('bimModel-------------------------------',bimModel) + this.changeBim = true this.checkList = []; this.build = ""; this.current = 1; //当前页 @@ -384,8 +388,12 @@ export default { "$store.state.bfHelperState.bfState": { immediate: true, handler(newval, olval) { - console.log('bfState',newval) + bfHelper.resetStatus(2); + console.log('bfState--------------------------',newval) if (newval) { + bfHelper.clearCluster(); + bfHelper.clearDrawableContainer() + this.changeBim = false // 模型恢复全部状态 bfHelper.resetStatus(2); this.onClick(); @@ -394,10 +402,12 @@ export default { "camera", JSON.stringify(bfHelper.getCameraStatus()) ); - let build = sessionStorage.getItem("build"); + let build = sessionStorage.getItem("build") == 26 ? null : sessionStorage.getItem("build"); let floor = sessionStorage.getItem("floor"); let type = sessionStorage.getItem('type') ? sessionStorage.getItem('type') : 'build' this.getCameraPosi(); + console.log('build------------------------------',build) + if (build) { if (build == 10) { setTimeout(() => { @@ -415,10 +425,12 @@ export default { "监控" ); } else if (build == 26) { + console.log('bulid26----------------------------->') + bfHelper.lookPipeline(null, null, this.condition, "监控"); this.$refs.clickcp.active = 26; this.$refs.clickcp.type = 'build'; this.$refs.clickcp.area = 1; - bfHelper.lookPipeline(null, null, this.condition, "监控"); + console.log('bulid26-----------------------------') bfHelper.setOpacityFun(); setTimeout(() => { this.setTowerMonitor(); @@ -576,6 +588,7 @@ export default { this.comeBim() } } + this.getAllDevice() }, }, @@ -889,6 +902,7 @@ export default { this.$message.error('对不起,暂无该设备模型,请稍后点击'); } else { // bfHelper.resetStatus(2); + bfHelper.clearCluster() bfHelper.clearDrawableContainer(); id = bfHelper.disposeId(item.area, item.build, item.modelId); // let id = disposeId(item.area, item.build, item.modelId); @@ -935,9 +949,12 @@ export default { if (item.modelId == "") { this.$message.error('对不起,暂无该设备模型,请稍后点击'); } else { - bfHelper.mapDestroy(); + + // bfHelper.mapDestroy(); + bfHelper.clearCluster() bfHelper.clearDrawableContainer(); id = bfHelper.disposeId(item.area, item.build, item.modelId); + console.log('item-----------------------------',item) this.addLabel( id, item.name, @@ -1902,6 +1919,7 @@ export default { // 点击操作跳转监控页 getMonitorIds(build, floor, code) { getMonitoringList(this.bimModel, build, floor).then((res) => { + // bfHelper.clearDrawableContainer(); const data = res.data.data; let idArr = []; @@ -2195,6 +2213,159 @@ export default { }); }); }, + // 获取所有监控设备列表 + getAllDevice(){ + if(((!this.build && !this.floor) || (this.build == '' && this.floor == '') ) && !this.changeBim){ + getMonitoringList( + this.bimModel, + '', + '' + ).then(res =>{ + this.tagsArr = res.data.data + console.log('tagsArr----------------------',this.tagsArr) + this.initMonitTags(this.bimModel) + }) + } + }, + // 初次渲染监控标签 + monitorContent(id, status) { + //图标标签显示内容 + let content1 = `
+
+ +
+
`; + return content1; + }, + initMonitTags(bimModel) { + console.log('bimType-----------------------------',this.$refs.clickcp.type) + if(this.$refs.clickcp.type != 'floor'){ + + //初始化时显示所有监控标签 + for (let i = 0; i < this.tagsArr.length; i++) { + if(this.tagsArr[i].modelId != '' && this.tagsArr[i].modelId != '模型无'){ + let id = bfHelper.disposeId( + this.tagsArr[i].area, + this.tagsArr[i].build, + this.tagsArr[i].modelId + ); + + if (JSON.stringify(bfHelper.getBoxMessage(id, true))) { + let zb = bfHelper.getBoxMessage(id, true).max; + bfHelper.customTag( + zb, + null, + this.monitorContent(id, this.tagsArr[i].status) + ); + } + } + } + bfHelper.createClusterItem() + + window.addEventListener("click", (e) => { + //监听事件 + if (e.target.id.indexOf("minitoring") != -1) { + getmonData(this.bimModel, e.target.id.substring(25)).then((res) => { + const data = res.data.data; + this.bjClick(data) + }) + + // if(this.bimModel == 2){ + // getmonData(this.bimModel, e.target.id.substring(10)).then((res) => { + // this.bjClick(data) + // }) + // }else{ + // getmonData(this.bimModel, e.target.id.substring(25)).then((res) => { + // const data = res.data.data; + // this.bjClick(data) + // // if (res.data.data.status != 90001) { + // // console.log('data-----------------',data) + // // id = bfHelper.disposeId(data.area, data.build, data.modelId) + // // this.addLabel( + // // id, + // // data.name, + // // data.status, + // // data.location, + // // data.dataNum + // // ); + // // this.$refs.clickcp.active = commonValue.activeValue( + // // Number(data.build), + // // Number(data.floored) + // // ); + // // this.$refs.clickcp.tower = commonValue.towerValue(data.build); + // // let camera = bfHelper.cameraPosition[Number(data.build) - 1]; + // // window.sessionStorage.setItem("camera", JSON.stringify(camera)); + // // if (data.build == "00") { + // // bfHelper.navigationMap( + // // ".mapDom", + // // require("../../../public/img/monitoring/mapviewer/total.png"), + // // 8, + // // 1 + // // ); + // // this.buildMessage = "园区"; + // // bfHelper.lookPipeline(null, null, this.condition, "监控"); + // // } else if (data.build == "07") { + // // bfHelper.navigationMap( + // // ".mapDom", + // // require("../../../public/img/monitoring/mapviewer/electricity7b.png"), + // // 7, + // // 1 + // // ); + // // this.buildMessage = "地下室"; + // // let camera = bfHelper.cameraPosition[9]; + // // window.sessionStorage.setItem("camera", JSON.stringify(camera)); + // // bfHelper.lookPipeline2( + // // this.condition, + // // bfHelper.equipmentCopColors[0], + // // 9, + // // null, + // // "监控", + // // null, + // // null, + // // true + // // ); + // // } else { + // // bfHelper.navigationMap( + // // ".mapDom", + // // require("../../../public/img/monitoring/mapviewer/monitor" + + // // Number(data.build) + + // // "b" + + // // Number(data.floored) + + // // "f.png"), + // // Number(data.build), + // // Number(data.floored) + // // ); + // // this.buildMessage = + // // Number(data.build) + "号楼" + Number(data.floored) + "层"; + // // // let camera = bfHelper.cameraPosition[Number(data.build) - 1]; + // // // window.sessionStorage.setItem("camera", JSON.stringify(camera)); + // // bfHelper.lookPipeline2( + // // this.condition, + // // bfHelper.equipmentCopColors[0], + // // data.build - 1, + // // Number(data.floored), + // // "监控", + // // null, + // // null, + // // true + // // ); + // // } + + // // bfHelper.setOpacityFun(false); + // // } else { + // // this.$message.warning("设备离线,不可查看"); + // // } + // }) + // } + } + }) + + } + }, }, }; diff --git a/src/page/index/sidebar/opsSidebar.vue b/src/page/index/sidebar/opsSidebar.vue index ba0be65..7f494db 100644 --- a/src/page/index/sidebar/opsSidebar.vue +++ b/src/page/index/sidebar/opsSidebar.vue @@ -46,41 +46,52 @@