|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div style="width: 100%;height: 100%">
|
|
|
<CusTabs :tabs="areaTabs" :dropDown="true" @room-click="roomClick" :active.sync="areaType"
|
|
|
- @tab-click="areaTabClick" />
|
|
|
+ @tab-click="areaTabClick"/>
|
|
|
<div class="center" id="model">
|
|
|
|
|
|
</div>
|
|
@@ -24,7 +24,7 @@ const areaEnums = {
|
|
|
};
|
|
|
export default {
|
|
|
name: 'Center',
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
areaType: 'all',
|
|
|
areaTabs: [
|
|
@@ -42,20 +42,20 @@ export default {
|
|
|
components: {
|
|
|
CusTabs
|
|
|
},
|
|
|
- mounted () {
|
|
|
+ mounted() {
|
|
|
this.initThree();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations('userState', ['setAreaType']),
|
|
|
- roomClick (value) {
|
|
|
+ roomClick(value) {
|
|
|
this.roomActive = value
|
|
|
if (this.roomActive && (this.areaType == '1' || this.areaType == '2')) {
|
|
|
- this.modelApi.modelChange(`model${this.roomActive}`,areaEnums[this.areaType])
|
|
|
+ this.modelApi.modelChange(`model${this.roomActive}`, areaEnums[this.areaType])
|
|
|
} else {
|
|
|
this.modelApi.modelChange('model')
|
|
|
}
|
|
|
},
|
|
|
- areaTabClick () {
|
|
|
+ areaTabClick() {
|
|
|
this.roomActive = ''
|
|
|
this.modelApi.controlRotate(false)
|
|
|
this.setAreaType(areaEnums[this.areaType].value)
|
|
@@ -82,15 +82,12 @@ export default {
|
|
|
targetContent: {x: -17.701772776272723, y: -307.6331500346563, z: 148.44436360369687}, // 控制器目标焦点
|
|
|
time: 1000 // 动画时间
|
|
|
};
|
|
|
- this.modelApi.flyTo(target,0.8)
|
|
|
+ this.modelApi.flyTo(target, 0.8)
|
|
|
}
|
|
|
},
|
|
|
- initThree () {
|
|
|
- setTimeout(() => {
|
|
|
- this.modelApi = new renderModel('#model')
|
|
|
- this.modelApi.init()
|
|
|
- }, 100);
|
|
|
- setTimeout(() => {
|
|
|
+ initThree() {
|
|
|
+ this.modelApi = new renderModel('#model')
|
|
|
+ this.modelApi.init(() => {
|
|
|
this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
component: pvReal,
|
|
|
props: {
|
|
@@ -152,7 +149,7 @@ export default {
|
|
|
y: -140,
|
|
|
z: 20
|
|
|
})
|
|
|
- }, 2000);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|