2019-12-05 16:04:36 +08:00
|
|
|
<template>
|
2019-12-13 09:14:28 +08:00
|
|
|
<div class="jl3ddevice">
|
2019-12-05 16:04:36 +08:00
|
|
|
<div id="jl3d" class="jl3ddraw">
|
|
|
|
|
|
|
|
</div>
|
2019-12-13 09:14:28 +08:00
|
|
|
<Jl3ddevicetrain-Menu :devicelist="devicelist" @sdevice="sdevice" >
|
|
|
|
</Jl3ddevicetrain-Menu>
|
|
|
|
<div class="menutop">
|
|
|
|
<el-button-group>
|
|
|
|
<el-button type="primary" @click="selectdevice">选择设备</el-button>
|
|
|
|
<el-button type="primary" @click="dispersed">{{devicestats}}</el-button>
|
|
|
|
</el-button-group>
|
|
|
|
</div>
|
|
|
|
<div class="menudown">
|
|
|
|
<el-button-group>
|
|
|
|
<el-button type="primary" @click="back">退出</el-button>
|
|
|
|
</el-button-group>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="testjlmap3d" class="jlmap3ddraw">
|
|
|
|
<canvas id="canvastexture" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-12-05 16:04:36 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import Vue from 'vue';
|
2019-12-11 10:47:24 +08:00
|
|
|
import { Jl3ddevice } from '@/jlmap3d/jl3ddevicetrain/jl3ddevicetrain.js';
|
2019-12-13 09:14:28 +08:00
|
|
|
import Jl3ddevicetrainMenu from '@/views/jlmap3d/devicetrain/component/devicetrainmenu';
|
2019-12-05 16:04:36 +08:00
|
|
|
export default {
|
2019-12-11 10:47:24 +08:00
|
|
|
name: 'devicetrain',
|
2019-12-05 16:04:36 +08:00
|
|
|
components: {
|
2019-12-13 09:14:28 +08:00
|
|
|
Jl3ddevicetrainMenu
|
2019-12-05 16:04:36 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
jl3d: null,
|
2019-12-13 09:14:28 +08:00
|
|
|
devicelist:[],
|
|
|
|
devicestats:"设备分解",
|
|
|
|
|
2019-12-05 16:04:36 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
// '$store.state.socket.device.code': {
|
|
|
|
// handler: function (newVal, oldVal) {
|
|
|
|
// if (newVal != oldVal) {
|
|
|
|
// this.jl3d.selectmodel(this.$store.state.socket.device);
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// '$store.state.socket.device': {
|
|
|
|
// deep: true,
|
|
|
|
// handler: function (newVal, oldVal) {
|
|
|
|
// if (newVal.code == oldVal.code) {
|
|
|
|
// this.jl3d.updateaction(newVal);
|
|
|
|
// } else {
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// },
|
2019-12-13 09:14:28 +08:00
|
|
|
'jl3d.animastats': {
|
|
|
|
handler: function (newVal, oldVal) {
|
|
|
|
if (newVal != oldVal) {
|
|
|
|
if(newVal == false){
|
|
|
|
this.devicestats = "设备分解";
|
|
|
|
}
|
|
|
|
if(newVal == true){
|
|
|
|
this.devicestats = "设备归位";
|
|
|
|
}
|
|
|
|
console.log(newVal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-12-05 16:04:36 +08:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
code() {
|
|
|
|
return this.$route.query.code;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
2019-12-13 09:14:28 +08:00
|
|
|
window.updatemenulist = this.updatemenulist;
|
|
|
|
this.init();
|
2019-12-05 16:04:36 +08:00
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
},
|
|
|
|
methods: {
|
2019-12-13 09:14:28 +08:00
|
|
|
init: function () {
|
2019-12-05 16:04:36 +08:00
|
|
|
// let mapdata = this.$store.state.socket.device;
|
|
|
|
let dom = document.getElementById('jl3d');
|
2019-12-13 09:14:28 +08:00
|
|
|
this.jl3d = new Jl3ddevice(dom);
|
|
|
|
},
|
|
|
|
sdevice(changedata) {
|
|
|
|
|
|
|
|
this.jl3d.updateselect(changedata);
|
|
|
|
|
|
|
|
},
|
|
|
|
selectdevice(device) {
|
|
|
|
this.jl3d.backselect();
|
|
|
|
},
|
|
|
|
dispersed(device) {
|
|
|
|
this.jl3d.disperdevice();
|
|
|
|
},
|
|
|
|
updatemenulist(devicelist) {
|
|
|
|
console.log(devicelist);
|
|
|
|
this.devicelist = devicelist;
|
|
|
|
},
|
|
|
|
back(changedata) {
|
|
|
|
window.close();
|
2019-12-05 16:04:36 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
/* #jl3d {
|
|
|
|
width: 937px;
|
|
|
|
height: 937px;
|
|
|
|
} */
|
|
|
|
|
|
|
|
.jl3ddraw {
|
|
|
|
position: absolute;
|
2019-12-13 09:14:28 +08:00
|
|
|
float: left;
|
2019-12-11 10:47:24 +08:00
|
|
|
top:0;
|
2019-12-05 16:04:36 +08:00
|
|
|
/* left: 0; */
|
2019-12-13 09:14:28 +08:00
|
|
|
width: 80%;
|
2019-12-11 10:47:24 +08:00
|
|
|
height: 100%;
|
2019-12-13 09:14:28 +08:00
|
|
|
/* z-index: 1500; */
|
2019-12-05 16:04:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#canvastexture {
|
|
|
|
position: absolute;
|
|
|
|
float: left;
|
|
|
|
left: 0;
|
|
|
|
z-index: -12;
|
|
|
|
}
|
2019-12-13 09:14:28 +08:00
|
|
|
|
|
|
|
#testjlmap3d {
|
|
|
|
}
|
|
|
|
|
|
|
|
.jlmap3ddraw {
|
|
|
|
float: left;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
position:absolute;
|
|
|
|
z-index: -1;
|
|
|
|
}
|
|
|
|
.menutop{
|
|
|
|
top:0;
|
|
|
|
right:20%;
|
|
|
|
position:absolute;
|
|
|
|
}
|
|
|
|
.menudown{
|
|
|
|
bottom:0;
|
|
|
|
right:20%;
|
|
|
|
position:absolute;
|
|
|
|
}
|
|
|
|
#canvastexture {
|
|
|
|
position: absolute;
|
|
|
|
float: left;
|
|
|
|
left: 0;
|
|
|
|
z-index: -12;
|
|
|
|
}
|
2019-12-05 16:04:36 +08:00
|
|
|
</style>
|