<template>
|
<div class="mapViewer">
|
<div class="tooltip" :class="{ tooltiphide: !tooltipShow }">
|
<span>
|
{{ tooltipInfo }}
|
</span>
|
</div>
|
<div class="hisbox" v-if="isShowHistory">
|
<div class="btnbox">
|
<el-button @click="closeHis">
|
<img class="searchBtn" src="@/assets/img/right/closeinput1.png" />
|
</el-button>
|
</div>
|
<History />
|
</div>
|
<viewer1
|
class="mapViewer"
|
v-if="viewer1Show"
|
:style="viewer1Style"
|
@mousemove.native="viewer1MouseMove"
|
/>
|
<viewer
|
class="mapViewer"
|
:style="viewerStyle"
|
@mousemove.native="viewerMouseMove"
|
/>
|
<div
|
class="controlPanel"
|
:style="{
|
width: `${size}`,
|
height: `${size}`,
|
transform: `scale(${scale}) translate(${offset},${offset})`,
|
'-webkit-transform': `scale(${scale}) translate(${offset},${offset})`,
|
'-moz-transform': `scale(${scale}) translate(${offset},${offset})`,
|
'-o-transform': `scale(${scale}) translate(${offset},${offset})`,
|
'-ms-transform': `scale(${scale}) translate(${offset},${offset})`,
|
}"
|
>
|
<img @click="changePwd" id="headlog" src="@/assets/img/new/topBar.png" />
|
<img id="bottomBar" src="@/assets/img/new/bottomBar.png" />
|
<!-- <el-slider
|
class="undergroundAlpha"
|
v-if="openUnderGround"
|
v-model="undergroundAlpha"
|
:show-tooltip="false"
|
@input="changeAlpha"
|
></el-slider> -->
|
<right ref="Right" />
|
<leftpanel ref="Left" />
|
<menupanel />
|
<bottommenu />
|
<setting v-if="showSetting" />
|
<qycharts v-if="$store.state.qyEchartsShow" />
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import viewer from "@/components/map/viewer";
|
import viewer1 from "@/components/map/viewer1";
|
// import left from "@/components/left/left";
|
import leftpanel from "@/components/left/index";
|
import right from "@/components/right/right";
|
// import bottom from "@/components/bottom/bottom";
|
import yqfk from "@/components/bottom/yqfk";
|
import qycharts from "@/components/bottom/qycharts";
|
import menupanel from "@/components/menu/index";
|
import setting from "@/components/menu/tools/setting";
|
|
import bottommenu from "@/components/menu/bottom-menu";
|
import { mapState, mapMutations } from "vuex";
|
import History from "@/components/map/history.vue";
|
|
export default {
|
name: "index",
|
components: {
|
viewer,
|
viewer1,
|
leftpanel,
|
right,
|
// bottom,
|
yqfk,
|
menupanel,
|
bottommenu,
|
setting,
|
qycharts,
|
History,
|
},
|
data() {
|
return {
|
date: "",
|
undergroundAlpha: 50,
|
// openUnderGround: false,
|
viewerStyle: "",
|
viewer1Style: "",
|
size: "100%",
|
scale: "1",
|
offset: "0%",
|
tooltipInfo: "请稍后。。。",
|
tooltipShow: false,
|
// viewer1Show: false,
|
};
|
},
|
mounted() {
|
let size = this.detectZoom();
|
this.scale = (100 / size).toFixed(2);
|
this.offset = "-" + ((size - 100) / 2).toFixed(2) + "%";
|
this.size = size + "%";
|
},
|
computed: {
|
...mapState(["viewer1Show", "yqfk"]),
|
showSetting() {
|
return this.$store.state.showSetting;
|
},
|
isShowHistory() {
|
return this.$store.state.isShowHistory;
|
},
|
},
|
watch: {
|
viewer1Show(newvalue, oldvalue) {
|
if (newvalue) {
|
this.viewerStyle =
|
"width:49.9% !important;float:right;position:absolute;height:100%;right:0px";
|
this.viewer1Style =
|
"width:49.9% !important;float:left;position:absolute;height:100%;left:0px";
|
} else {
|
this.viewerStyle = "";
|
this.viewer1Style = "";
|
}
|
},
|
},
|
methods: {
|
...mapMutations(["setLayerTreeTwoScreen"]),
|
setMessgae(show, msg) {
|
this.tooltipShow = show;
|
this.tooltipInfo = msg ? msg : "";
|
},
|
changePwd() {
|
console.log(111);
|
},
|
detectZoom() {
|
var ratio = 0,
|
screen = window.screen,
|
ua = navigator.userAgent.toLowerCase();
|
if (window.devicePixelRatio !== undefined) {
|
ratio = window.devicePixelRatio;
|
} else if (~ua.indexOf("msie")) {
|
if (screen.deviceXDPI && screen.logicalXDPI) {
|
ratio = screen.deviceXDPI / screen.logicalXDPI;
|
}
|
} else if (
|
window.outerWidth !== undefined &&
|
window.innerWidth !== undefined
|
) {
|
ratio = window.outerWidth / window.innerWidth;
|
}
|
|
if (ratio) {
|
ratio = Math.round(ratio * 100);
|
}
|
// ratio 就是获取到的百分比
|
//console.log(ratio);
|
return ratio;
|
//this.onresize_height = ratio;
|
// return ratio;
|
},
|
cameraMoveEnd() {
|
var p = {
|
destination: sgworld.Navigate.getPosition(),
|
orientation: {
|
heading: sgworld.Viewer.camera.heading,
|
pitch: sgworld.Viewer.camera.pitch,
|
roll: sgworld.Viewer.camera.roll,
|
},
|
};
|
sgworld1.Viewer.camera.setView(p);
|
},
|
viewer1MouseMove() {
|
if (this.viewer1Show) {
|
sgworld1.Viewer.scene.preRender.addEventListener(
|
this.sgworld1EvenListener
|
);
|
sgworld.Viewer.scene.preRender.removeEventListener(
|
this.sgworldEvenListener
|
);
|
}
|
},
|
viewerMouseMove() {
|
if (this.viewer1Show) {
|
sgworld.Viewer.scene.preRender.addEventListener(
|
this.sgworldEvenListener
|
);
|
sgworld1.Viewer.scene.preRender.removeEventListener(
|
this.sgworld1EvenListener
|
);
|
}
|
},
|
sgworldEvenListener() {
|
sgworld1.Viewer.camera.setView({
|
destination: sgworld.Viewer.camera.position.clone(),
|
orientation: {
|
heading: sgworld.Viewer.camera.heading,
|
pitch: sgworld.Viewer.camera.pitch,
|
roll: sgworld.Viewer.camera.roll,
|
},
|
});
|
},
|
sgworld1EvenListener() {
|
sgworld.Viewer.camera.setView({
|
destination: sgworld1.Viewer.camera.position.clone(),
|
orientation: {
|
heading: sgworld1.Viewer.camera.heading,
|
pitch: sgworld1.Viewer.camera.pitch,
|
roll: sgworld1.Viewer.camera.roll,
|
},
|
});
|
},
|
closeHighLight() {
|
this.$refs.Left.closeHighLight();
|
},
|
closeRight() {
|
this.$refs.Right.closeAll();
|
},
|
closeLeft() {
|
//this.$refs.Left.closeAll();
|
},
|
clearTX() {
|
this.$refs.Left.clearTX();
|
},
|
changeAlpha(value) {
|
Viewer.scene.globe.translucency.frontFaceAlpha =
|
this.undergroundAlpha / 100;
|
sgworld.Creator.set3DTilesetsAlpha(this.undergroundAlpha / 100);
|
},
|
closeHis() {
|
this.$store.commit("showHistory", false);
|
},
|
},
|
};
|
</script>
|
<style scoped>
|
.mapViewer {
|
height: 100%;
|
}
|
.userinfo {
|
position: absolute;
|
z-index: 20;
|
top: 10px;
|
}
|
#headlog {
|
width: 965px;
|
height: 70px;
|
position: absolute;
|
left: 50%;
|
top: 0;
|
transform: translate(-50%, 0);
|
}
|
#bottomBar {
|
width: 1357px;
|
height: 52px;
|
position: absolute;
|
left: 50%;
|
bottom: 0;
|
transform: translate(-50%, 0);
|
}
|
.trigger {
|
pointer-events: all;
|
}
|
|
.controlPanel {
|
position: absolute;
|
left: 0px;
|
top: 0px;
|
pointer-events: none;
|
}
|
|
.undergroundAlpha {
|
width: 20%;
|
margin: 1% 40%;
|
position: absolute;
|
}
|
|
.tooltip {
|
position: absolute;
|
z-index: 999999;
|
color: white;
|
width: 100%;
|
top: 30px;
|
margin: 0 auto;
|
font-size: 24px;
|
pointer-events: none;
|
text-align: center;
|
height: 60px;
|
transition: all 0.2s linear;
|
}
|
|
.tooltiphide {
|
opacity: 0;
|
height: 0px !important;
|
}
|
|
.tooltip span {
|
background-color: rgba(0, 0, 0, 0.6);
|
border-radius: 10px;
|
padding: 10px 30px;
|
}
|
.hisbox {
|
position: absolute;
|
z-index: 10000002;
|
width: 100%;
|
height: 100%;
|
background-color: #fff;
|
}
|
.btnbox {
|
position: absolute;
|
z-index: 100000003;
|
right: 30px;
|
}
|
.btnbox .el-button {
|
padding: 0 !important;
|
font-size: 24px;
|
border: unset;
|
float: unset;
|
display: block;
|
background: transparent;
|
width: 48px;
|
height: 48px;
|
border-radius: 50%;
|
margin: 1px;
|
margin: 20px 0;
|
}
|
|
.searchBtn {
|
width: 40px;
|
}
|
</style>
|