<template>
|
<div class="mapViewer">
|
<div class="cacheImage">
|
<img style="display: none;" src="@assets/img/new/rightCircle-y.png" alt="" />
|
<img style="display: none;" src="@assets/img/new/leftCircle-y.png" alt="" />
|
<img style="display: none;" src="@assets/img/new/treeClose-y.png" alt="" />
|
<img style="display: none;" src="@assets/img/new/h1.png" alt="" />
|
</div>
|
|
|
<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>
|
|
</div>
|
<viewer1 class="mapViewer" id="mapOl" :key="switchKey" v-show="viewer1Show" :style="viewer1Style" />
|
<viewer class="mapViewer" id="mapView" ref="mapViewer" :style="viewerStyle" />
|
<measure-coord v-show="$store.state.isShowMeasureCoord"></measure-coord>
|
<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 ref="bottommenu" /> -->
|
<signalling v-if="signallingShow"></signalling>
|
<setting v-if="showSetting" />
|
<qycharts v-if="$store.state.qyEchartsShow" />
|
</div>
|
|
<div id="imageModel" class="imageModel">
|
<img id="myImage" class="image" src="">
|
</div>
|
<message-info v-if="$store.state.showMessageInfo"></message-info>
|
<zhai-hai-info v-if="$store.state.isshowZhaiHai"></zhai-hai-info>
|
</div>
|
</template>
|
|
<script>
|
import viewer from "@/components/map/viewer";
|
import viewer1 from "@/components/map/history";
|
// 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 signalling from "@/components/menu/signalling";
|
import bottommenu from "@/components/menu/bottom-menu";
|
import { mapState, mapMutations } from "vuex";
|
import messageInfo from "@/components/left/layerTree/messageInfo.vue";
|
import measureCoord from "@/components/left/layerTree/measureCoord.vue";
|
import zhaiHaiInfo from "./left/layerTree/zhaiHaiInfo.vue";
|
export default {
|
name: "index",
|
components: {
|
viewer,
|
viewer1,
|
leftpanel,
|
right,
|
// bottom,
|
yqfk,
|
menupanel,
|
bottommenu,
|
setting,
|
qycharts,
|
History,
|
signalling,
|
messageInfo,
|
measureCoord,
|
zhaiHaiInfo
|
},
|
data() {
|
return {
|
date: "",
|
undergroundAlpha: 50,
|
// openUnderGround: false,
|
viewerStyle: "",
|
viewer1Style: "",
|
size: "100%",
|
scale: "1",
|
offset: "0%",
|
tooltipInfo: "请稍后。。。",
|
tooltipShow: false,
|
signallingShow: false,
|
switchKey: 0,
|
// 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", "isLand", "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);
|
},
|
changeMode(mode) {
|
this.$refs.mapViewer.changeMode(mode);
|
},
|
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(),
|
|
// };
|
// 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(),
|
|
// });
|
},
|
sgworld1EvenListener() {
|
// sgworld.Viewer.camera.setView({
|
// destination: sgworld1.Viewer.camera.position.clone(),
|
|
// });
|
},
|
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);
|
},
|
},
|
beforeDestroy() {
|
this.$refs.bottommenu.switchMenu(0);
|
},
|
};
|
</script>
|
<style scoped>
|
.cacheImage {
|
display: none !important;
|
}
|
|
.mapViewer {
|
height: 100%;
|
}
|
|
.userinfo {
|
position: absolute;
|
z-index: 20;
|
top: 10px;
|
}
|
|
#headlog {
|
width: 1920px;
|
height: 100px;
|
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;
|
}
|
|
.imageModel {
|
z-index: 40;
|
position: absolute;
|
display: none;
|
|
|
}
|
|
.imageModel .image {
|
width: 30px;
|
height: 30px;
|
}
|
</style>
|