diff --git a/public/img/monitoring/electricity/dianBiao.png b/public/img/monitoring/electricity/dianBiao.png new file mode 100644 index 0000000..7cd519f Binary files /dev/null and b/public/img/monitoring/electricity/dianBiao.png differ diff --git a/src/components/monitoring/electricity.vue b/src/components/monitoring/electricity.vue index dc3b593..5fd00ae 100644 --- a/src/components/monitoring/electricity.vue +++ b/src/components/monitoring/electricity.vue @@ -409,6 +409,7 @@ import { onClick, getObjectDataById, clearDrawableContainer, + removeGlowEffectById, zoomToBoundingBox, cameraPosition, mapUpdate, @@ -488,7 +489,9 @@ export default { tataiTotal: "", isMapViewer: 0, alarmAlert: true, //鼠标悬停在报警列表里查看详情和确认告警是否出现 - dialogItem: {} + dialogItem: {}, + items: Array.from({ length: 15 }, (_, i) => i + 1), // 生成一个包含 1 到 15 的数组 + dianXiangData: null }; }, created() { @@ -496,6 +499,9 @@ export default { window["handleDetail"] = () => { this.handleDetail() }; + window["handleCloseDialog"] = () => { + this.handleCloseDialog() + }; }, beforeDestroy() { if (this.setInterval) { @@ -634,6 +640,94 @@ export default { setOpacityFun(false,0.3); this.comeBim(); } + bfHelper.onClick((data) => { + if (this.tower == '03' && this.layer == '01') { + if (bfHelper.getCondition(data.objectId).family == '低压配电柜' || bfHelper.getCondition(data.objectId).family == '高压配电柜') { + if (this.dianXiangData && this.dianXiangData.objectId == data.objectId) { + clearDrawableContainer(); + this.dianXiangData = null + return + } + this.dianXiangData = data + clearDrawableContainer(); + // 构件id/设备名称/设备状态/设备位置/累计电量 + // 获取当前点击坐标 + let zb = getBoxMessage(data.objectId, true); + console.log('zb', zb) + // //引线标签的顶点 + let position = zb.max; + let content = + `
+
+ +
+
+ 配电箱 + +
+
+
+
+
+
+
`; + customTag(position, null, content); + this.$nextTick(() => { + const imageContainer = document.getElementById('image-container'); + console.log(imageContainer) + if (imageContainer) { + for(let i = 0; i < 15; i++) { + const img = document.createElement('img'); + img.src = require("../../../public/img/monitoring/electricity/dianBiao.png"); + img.style.width = '30px'; + img.style.height = '30px'; + img.style.margin = '10px 0 0 0'; + imageContainer.appendChild(img); + } + } + }) + } else { + clearDrawableContainer() + } + } + }) } else { // 查看管线 window.sessionStorage.setItem( @@ -900,6 +994,12 @@ export default { handleDetail() { this.$router.push(`/equipment/operationDetails?code=${this.dialogItem.code}&type=电&area=${this.bimModel}`) }, + handleCloseDialog() { + console.log('handleCloseDialog') + bfHelper.clearGlowEffect() + bfHelper.cancelSelected() + clearDrawableContainer() + }, // 构件点击(暂定不用) onClick() { onClick((data) => { diff --git a/src/util/bfHelper.js b/src/util/bfHelper.js index b3d663c..036c365 100644 --- a/src/util/bfHelper.js +++ b/src/util/bfHelper.js @@ -3006,6 +3006,7 @@ const onSDKLoadSucceeded = (viewMetaData) => { function (e) { console.log(e); let condition = viewer3D.getObjectDataById(e.objectId); + getCondition(condition) console.log('condition', condition); } ); @@ -3023,6 +3024,11 @@ const onSDKLoadSucceeded = (viewMetaData) => { } }; +const getCondition = (objectId) => { + let condition = viewer3D.getObjectDataById(objectId); + return condition +} + // 获取点击构件的筛选条件 const getObjectDataById = (objectId) => { // console.log(objectId) @@ -6063,5 +6069,6 @@ export { ttequipmentCondition2, cameraPosition, buildBoxbounding, - settoumingdu + settoumingdu, + getCondition }; \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index f123b3d..4d32f77 100644 --- a/vue.config.js +++ b/vue.config.js @@ -30,7 +30,7 @@ module.exports = { // target: 'http://192.168.3.58:8001', // target: 'http://192.168.1.105:8001', // target: 'http://192.168.1.34:8001', - target: 'http://192.168.1.5:8001', + target: 'http://192.168.1.4:8001', // target: 'http://192.168.1.106:8001', // target: 'http://192.168.0.115:8001', ws: true, @@ -53,7 +53,7 @@ module.exports = { // target: 'http://192.168.79.129', // target: "http://192.168.1.106", // target: "http://192.168.1.105:80", - target: "http://192.168.1.5:80", + target: "http://192.168.1.4:80", // target: "http://192.168.1.34:80", // target: "http://192.168.0.115", // target: "http://10.90.100.204", @@ -66,14 +66,14 @@ module.exports = { }, }, "/monitor-system": { - target: "http://192.168.1.5:8080", + target: "http://192.168.1.4:8080", ws: true, // pathRewrite: { // "^/monitor-system": "/", // }, }, "/monitor-business": { - target: "http://192.168.1.5:8080", + target: "http://192.168.1.4:8080", ws: true, // pathRewrite: { // "^/monitor-system": "/",