|
@@ -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,12 +42,12 @@ 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])
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
this.modelApi.modelChange('model')
|
|
|
}
|
|
|
},
|
|
|
- areaTabClick() {
|
|
|
+ areaTabClick () {
|
|
|
this.roomActive = ''
|
|
|
this.modelApi.controlRotate(false)
|
|
|
this.setAreaType(areaEnums[this.areaType].value)
|
|
@@ -85,71 +85,73 @@ export default {
|
|
|
this.modelApi.flyTo(target, 0.8)
|
|
|
}
|
|
|
},
|
|
|
- initThree() {
|
|
|
- this.modelApi = new renderModel('#model')
|
|
|
- this.modelApi.init(() => {
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: pvReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3001"
|
|
|
- }
|
|
|
- }), "北区光伏", {
|
|
|
- x: 0,
|
|
|
- y: 20,
|
|
|
- z: 20
|
|
|
- })
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: storageReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3001"
|
|
|
- }
|
|
|
- }), "北区储能", {
|
|
|
- x: 120,
|
|
|
- y: 120,
|
|
|
- z: 20
|
|
|
- })
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: usageReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3001"
|
|
|
- }
|
|
|
- }), "北区负荷", {
|
|
|
- x: 0,
|
|
|
- y: 120,
|
|
|
- z: 20
|
|
|
- })
|
|
|
+ initThree () {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.modelApi = new renderModel('#model')
|
|
|
+ this.modelApi.init(() => {
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: pvReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3001"
|
|
|
+ }
|
|
|
+ }), "北区光伏", {
|
|
|
+ x: 0,
|
|
|
+ y: 20,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: storageReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3001"
|
|
|
+ }
|
|
|
+ }), "北区储能", {
|
|
|
+ x: 120,
|
|
|
+ y: 120,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: usageReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3001"
|
|
|
+ }
|
|
|
+ }), "北区负荷", {
|
|
|
+ x: 0,
|
|
|
+ y: 120,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: pvReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3002"
|
|
|
- }
|
|
|
- }), "南区光伏", {
|
|
|
- x: -40,
|
|
|
- y: -80,
|
|
|
- z: 20
|
|
|
- })
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: storageReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3002"
|
|
|
- }
|
|
|
- }), "南区储能", {
|
|
|
- x: -120,
|
|
|
- y: -120,
|
|
|
- z: 20
|
|
|
- })
|
|
|
- this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
- component: usageReal,
|
|
|
- props: {
|
|
|
- areaCode: "321283124S3002"
|
|
|
- }
|
|
|
- }), "南区负荷", {
|
|
|
- x: 0,
|
|
|
- y: -140,
|
|
|
- z: 20
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: pvReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3002"
|
|
|
+ }
|
|
|
+ }), "南区光伏", {
|
|
|
+ x: -40,
|
|
|
+ y: -80,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: storageReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3002"
|
|
|
+ }
|
|
|
+ }), "南区储能", {
|
|
|
+ x: -120,
|
|
|
+ y: -120,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
+ this.modelApi.addDialog(ComponentHandle.createComponent({
|
|
|
+ component: usageReal,
|
|
|
+ props: {
|
|
|
+ areaCode: "321283124S3002"
|
|
|
+ }
|
|
|
+ }), "南区负荷", {
|
|
|
+ x: 0,
|
|
|
+ y: -140,
|
|
|
+ z: 20
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }, 100);
|
|
|
}
|
|
|
}
|
|
|
}
|