|
@@ -1,5 +1,11 @@
|
|
|
<template>
|
|
|
<div id="distribution" class="distribution-index">
|
|
|
+ <div class="left-button">
|
|
|
+ <div :class="'menu-item pangmenzhengdao' + (node.id == pathNode.id ? ' active' :'')"
|
|
|
+ v-for="(node,index) in titleList" :key="node.id" @click="selectItem(node)">
|
|
|
+ {{node.name}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div :id="'previewBim'+_uid" class="previewBim"></div>
|
|
|
<div id="distribution-drap" class="distribution-drap" v-show="drapShow" @mousedown="dragStart"
|
|
|
@touchstart="dragStart">
|
|
@@ -7,19 +13,12 @@
|
|
|
<div id="title" class="distribution-drap-title-content">{{detail.title}}</div>
|
|
|
<i id="close" class="el-icon-circle-close" @click="drapShow = false"></i>
|
|
|
</div>
|
|
|
- <div class="distribution-drap-content">
|
|
|
+ <div class="distribution-drap-content" v-if="drapShow">
|
|
|
<organization v-if="type === 'organizationDetail'" :detail="detail" @clickName="clickName">
|
|
|
</organization>
|
|
|
<house v-else-if="type === 'roomDetail'" :detail="detail"></house>
|
|
|
+ <monitor v-else-if="type === 'monitor'" :detail="detail"></monitor>
|
|
|
</div>
|
|
|
- <div class="image-box" v-if="detail.imageBox">
|
|
|
- <el-carousel trigger="click" height="130px">
|
|
|
- <el-carousel-item v-for="item in detail.imageBox" :key="item.id">
|
|
|
- <img :src="item.url" :alt="item.url" />
|
|
|
- </el-carousel-item>
|
|
|
- </el-carousel>
|
|
|
- </div>
|
|
|
- <div style="padding: 5px;" v-else></div>
|
|
|
</div>
|
|
|
<el-dialog :close-on-click-modal="false" :title="noticeBoardType === '1' ? '企业看板':'设备看板'"
|
|
|
:visible.sync="modelVisible" width="1100px" :append-to-body="true">
|
|
@@ -38,10 +37,14 @@
|
|
|
import {
|
|
|
getOrganizationListByPage
|
|
|
} from '@/httpApi/business'
|
|
|
+ import {
|
|
|
+ getDevicePartListByQuery
|
|
|
+ } from '@/httpApi/property'
|
|
|
import bimView from '@/uitls/controls'
|
|
|
import noticeBoard from '@/components/work/common/noticeBoard'
|
|
|
import organization from '@/components/work/bim/modelDetail/organization'
|
|
|
import house from '@/components/work/bim/modelDetail/house'
|
|
|
+ import monitor from '@/components/work/bim/modelDetail/monitor'
|
|
|
export default {
|
|
|
props: ['target'],
|
|
|
data() {
|
|
@@ -54,7 +57,36 @@
|
|
|
roomList: [],
|
|
|
organizationObj: {},
|
|
|
type: '',
|
|
|
- item: {}
|
|
|
+ item: {},
|
|
|
+ titleList: [{
|
|
|
+ id: 1,
|
|
|
+ name: '企业'
|
|
|
+ }, {
|
|
|
+ id: 2,
|
|
|
+ name: '监控',
|
|
|
+ type: 'monitor'
|
|
|
+ }],
|
|
|
+ pathNode: {
|
|
|
+ id: 1,
|
|
|
+ name: '企业'
|
|
|
+ },
|
|
|
+ signList: [{
|
|
|
+ id: 1,
|
|
|
+ name: '摄像头',
|
|
|
+ iconPath: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/370f04b711094bebbf7623371678b426'
|
|
|
+ }, {
|
|
|
+ id: 2,
|
|
|
+ name: '门禁',
|
|
|
+ iconPath: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/2585f3b800b34181b6b36044ab517447'
|
|
|
+ }, {
|
|
|
+ id: 3,
|
|
|
+ name: '停车',
|
|
|
+ iconPath: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/1326f380e5c542c085899bde868358a8'
|
|
|
+ }, {
|
|
|
+ id: 4,
|
|
|
+ name: '照明',
|
|
|
+ iconPath: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/a8ad1d0f82bf453c8c972fcad32bf50e'
|
|
|
+ }]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -92,9 +124,28 @@
|
|
|
components: {
|
|
|
noticeBoard,
|
|
|
organization,
|
|
|
- house
|
|
|
+ house,
|
|
|
+ monitor
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectItem(item) {
|
|
|
+ if (this.pathNode.id === item.id) return;
|
|
|
+ this.pathNode = item;
|
|
|
+ this.drapShow = false;
|
|
|
+ this.clearAll();
|
|
|
+ if (item.id === 1) this.setFloor();
|
|
|
+ if (item.id === 2) this.getDeviceList('monitor')
|
|
|
+ },
|
|
|
+ clearAll() {
|
|
|
+ if (!this.bimViewer) return;
|
|
|
+ this.clearOrganization();
|
|
|
+ this.bimViewer.clear3DMaker();
|
|
|
+ },
|
|
|
+ clearOrganization() { //清除企业名称
|
|
|
+ let ids = this.roomList.filter(node => node.name).map(node => node.roomId);
|
|
|
+ let arr = ids.map(id => 'organization' + id);
|
|
|
+ this.bimViewer.clearDrawable(arr);
|
|
|
+ },
|
|
|
clickName(noticeBoardType) {
|
|
|
this.modelVisible = true;
|
|
|
this.noticeBoardType = noticeBoardType;
|
|
@@ -125,6 +176,46 @@
|
|
|
this.$loading.close();
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ getDeviceList(type) { //获取设备列表
|
|
|
+ this.deviceList = [];
|
|
|
+ let postData = {
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
+ sign: type
|
|
|
+ }
|
|
|
+ getDevicePartListByQuery(postData).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.sortDeviceList(res.data);
|
|
|
+ this.operationDevice();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sortDeviceList(data) {
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ this.deviceList = this.deviceList.concat(data[i].deviceList);
|
|
|
+ if (data[i].children && data[i].children.length > 0) this.sortDeviceList(data[i].children);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ operationDevice() {
|
|
|
+ let list = this.deviceList.filter(node => node.projectItemTargetId === this.item.id &&
|
|
|
+ node.type === 1);
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].modelBindType) {
|
|
|
+ if (list[i].modelBindType === 3 && list[i].modelBindContent && list[i].modelBindPosition) {
|
|
|
+ let item = this.signList.find(node => node.id == list[i].modelBindContent);
|
|
|
+ let position = JSON.parse(list[i].modelBindPosition);
|
|
|
+ this.bimViewer.add3DMaker('image', position, item.iconPath, (data) => {
|
|
|
+ let id = data.id.split('-')[1];
|
|
|
+ let item = list.find(node => node.id == id);
|
|
|
+ item['title'] = item.name;
|
|
|
+ this.showDrap(this.pathNode.type, item);
|
|
|
+ }, 'device-' + list[i].id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clickMark() {
|
|
|
+
|
|
|
},
|
|
|
changeTarget(data) {
|
|
|
this.clearFloor();
|
|
@@ -141,6 +232,9 @@
|
|
|
if (this.item.bimIntegrateId === '3102248339366592') this.modelRenderSuccess();
|
|
|
this.initFloor();
|
|
|
this.setFloor();
|
|
|
+ },
|
|
|
+ click: (data) => {
|
|
|
+ console.log(data);
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
@@ -176,8 +270,8 @@
|
|
|
},
|
|
|
clearFloor() { //清除房间
|
|
|
let ids = this.roomList.filter(node => node.name).map(node => node.roomId);
|
|
|
- let arr1 = ids.map(id => 'room' + id);
|
|
|
- let arr2 = ids.map(id => 'floor' + id);
|
|
|
+ let arr1 = ids.map(id => 'organization' + id);
|
|
|
+ let arr2 = ids.map(id => 'room' + id);
|
|
|
this.bimViewer.clearDrawable(arr1.concat(arr2));
|
|
|
this.bimViewer.clearAllRooms();
|
|
|
},
|
|
@@ -219,7 +313,6 @@
|
|
|
if (this.roomList[i].name) {
|
|
|
let house = this.roomList[i].data;
|
|
|
house['title'] = this.roomList[i].name;
|
|
|
- house['imageBox'] = house.picture ? JSON.parse(house.picture) : [];
|
|
|
this.bimViewer.addDrawable({
|
|
|
position: {
|
|
|
x: x,
|
|
@@ -229,7 +322,7 @@
|
|
|
offsetX: -30,
|
|
|
offsetY: 5,
|
|
|
html: ` <div class="floor-name">${this.roomList[i].name}</div>`,
|
|
|
- id: 'floor' + this.roomList[i].roomId
|
|
|
+ id: 'room' + this.roomList[i].roomId
|
|
|
}, data => {
|
|
|
this.showDrap('roomDetail', house);
|
|
|
})
|
|
@@ -246,7 +339,7 @@
|
|
|
offsetX: -75,
|
|
|
offsetY: -40,
|
|
|
html: ` <div class="tips-4"><div class="name">${organization.name}</div><i class="iconfont huifont-sanjiaojiantou-xia"></i></div>`,
|
|
|
- id: 'room' + this.roomList[i].roomId,
|
|
|
+ id: 'organization' + this.roomList[i].roomId,
|
|
|
visibleDistance: parseInt(this.roomList[i].distance)
|
|
|
}, data => {
|
|
|
this.showDrap('organizationDetail', organization);
|
|
@@ -283,61 +376,6 @@
|
|
|
overflow: hidden;
|
|
|
background: $--box-background;
|
|
|
|
|
|
- .video-toggle {
|
|
|
- position: fixed;
|
|
|
- width: 700px;
|
|
|
- height: 500px;
|
|
|
- background: #000;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- z-index: 999;
|
|
|
-
|
|
|
- .chart-title {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- width: 100%;
|
|
|
- background-size: contain;
|
|
|
- position: relative;
|
|
|
- background-color: $--background;
|
|
|
- padding-left: 15px;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- .el-icon-close {
|
|
|
- padding: 8px;
|
|
|
- font-size: 24px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .chart-title:before {
|
|
|
- content: "";
|
|
|
- position: absolute;
|
|
|
- height: 2px;
|
|
|
- left: 0px;
|
|
|
- right: 0;
|
|
|
- border-bottom: 2px solid;
|
|
|
- -o-border-image: linear-gradient(315deg, rgba(167, 208, 255, 0), rgba(110, 163, 255, .3)) 2 2;
|
|
|
- border-image: linear-gradient(315deg, rgba(167, 208, 255, 0), rgba(110, 163, 255, .3)) 2 2;
|
|
|
- bottom: .5px;
|
|
|
- }
|
|
|
-
|
|
|
- .video-toggle-box {
|
|
|
- flex: 1;
|
|
|
- height: 0;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding: 20px;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
-
|
|
|
- video {
|
|
|
- max-height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
.tips-4 {
|
|
|
cursor: pointer;
|
|
|
}
|
|
@@ -395,6 +433,10 @@
|
|
|
right: 30px;
|
|
|
top: 30px;
|
|
|
|
|
|
+ .distribution-drap-content {
|
|
|
+ padding-bottom: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
.distribution-drap-title {
|
|
|
height: 40px;
|
|
|
display: flex;
|
|
@@ -448,10 +490,9 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .image-box {
|
|
|
+ .user-item-image {
|
|
|
width: 100%;
|
|
|
height: 150px;
|
|
|
- padding: 10px;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
|
|
@@ -484,7 +525,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .image-box:hover {
|
|
|
+ .user-item-image:hover {
|
|
|
.video-mask {
|
|
|
opacity: 1;
|
|
|
}
|