|
@@ -42,7 +42,7 @@
|
|
|
import organization from '@/components/work/bim/modelDetail/organization'
|
|
|
import house from '@/components/work/bim/modelDetail/house'
|
|
|
export default {
|
|
|
- props: ['item'],
|
|
|
+ props: ['target'],
|
|
|
data() {
|
|
|
return {
|
|
|
bimViewer: null,
|
|
@@ -52,9 +52,13 @@
|
|
|
detail: {},
|
|
|
roomList: [],
|
|
|
organizationObj: {},
|
|
|
- type: ''
|
|
|
+ type: '',
|
|
|
+ item: {}
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.item = this.target;
|
|
|
+ },
|
|
|
mounted() {
|
|
|
let width = document.getElementById('distribution').clientWidth;
|
|
|
document.getElementById('distribution-drap').style.left = (width - 330) + 'px';
|
|
@@ -90,8 +94,8 @@
|
|
|
house
|
|
|
},
|
|
|
methods: {
|
|
|
- init() {
|
|
|
- this.$loading();
|
|
|
+ init(type) {
|
|
|
+ if (type != '1') this.$loading();
|
|
|
let postData = {
|
|
|
currPage: 1,
|
|
|
pageSize: 100,
|
|
@@ -106,12 +110,22 @@
|
|
|
nodes['data'] = node;
|
|
|
return nodes;
|
|
|
});
|
|
|
- getIntegrateViewToken(this.item.bimIntegrateId).then(this.successFunc);
|
|
|
+ if (type == '1') {
|
|
|
+ this.initFloor();
|
|
|
+ this.setFloor();
|
|
|
+ } else {
|
|
|
+ getIntegrateViewToken(this.item.bimIntegrateId).then(this.successFunc);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$loading.close();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ changeTarget(data) {
|
|
|
+ this.clearFloor();
|
|
|
+ this.item = data;
|
|
|
+ this.init('1');
|
|
|
+ },
|
|
|
successFunc(res) {
|
|
|
if (res.state) {
|
|
|
this.bimViewer = new bimView({
|
|
@@ -155,6 +169,13 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ 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);
|
|
|
+ this.bimViewer.clearDrawable(arr1.concat(arr2));
|
|
|
+ this.bimViewer.clearAllRooms();
|
|
|
+ },
|
|
|
dragStart(evt) {
|
|
|
let oEvent = evt || event; //获取事件对象,这个是兼容写法
|
|
|
if (oEvent.target.id !== 'title') return;
|