北京经济技术开发区经开区虚拟城市项目-【前端】-Web
lixuliang
2024-05-08 10ecfd0b60442d209d1ab4b749580ffb638d1992
src/components/index.vue
@@ -1,12 +1,19 @@
<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>
      <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>
@@ -19,20 +26,57 @@
          <img class="searchBtn" src="@/assets/img/right/closeinput1.png" />
        </el-button>
      </div>
    </div>
    <viewer1 class="mapViewer" :key="switchKey" v-if="viewer1Show" :style="viewer1Style"
      @mousemove.native="viewer1MouseMove" />
    <viewer class="mapViewer" ref="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})`,
    }">
    <left-menu></left-menu>
    <viewer1
      class="mapViewer"
      :key="switchKey"
      v-if="viewer1Show"
      :style="viewer1Style"
      @mousemove.native="viewer1MouseMove"
    />
    <viewer
      class="mapViewer"
      ref="mapViewer"
      :style="viewerStyle"
      @mousemove.native="viewerMouseMove"
    />
    <div v-if="isShowDigitalPerson" class="digital_Box">
      <div
        class="textBtn"
        @click="showTextArea"
        :class="{ active: isShowTextArea }"
      >
        <img class="legendImg" src="@/assets/img/new/文本输入.png" />
      </div>
      <iframe
        id="digital_page"
        allow="microphone;"
        :src="digitalHuman"
        :height="digitalSize.height"
        :width="digitalSize.width"
        frameborder="no"
        border="0"
        marginwidth="0"
        marginheight="0"
        scrolling="no"
        allowtransparency="yes"
      ></iframe>
    </div>
    <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
@@ -67,6 +111,9 @@
import signalling from "@/components/menu/signalling";
import bottommenu from "@/components/menu/bottom-menu";
import { mapState, mapMutations } from "vuex";
import vueEvents from "@/utils/vueEvent.js";
import leftMenu from "@/components/menu/leftMenu.vue";
import mapMsg from "@/assets/js/mapMsg";
export default {
  name: "index",
@@ -82,7 +129,8 @@
    setting,
    qycharts,
    History,
    signalling
    signalling,
    leftMenu,
  },
  data() {
    return {
@@ -96,16 +144,24 @@
      offset: "0%",
      tooltipInfo: "请稍后。。。",
      tooltipShow: false,
      signallingShow:false,
      signallingShow: false,
      switchKey: 0,
      isShowTA: false,
      digitalHuman: null,
      digitalSize: {},
      // viewer1Show: false,
    };
  },
  mounted() {
    this.digitalHuman = window.digitalHumanURL;
    this.digitalSize = window.digitalSize;
    let size = this.detectZoom();
    this.scale = (100 / size).toFixed(2);
    this.offset = "-" + ((size - 100) / 2).toFixed(2) + "%";
    this.size = size + "%";
    vueEvents.$on("queryLayer", (res) => {
      this.queryShow = res;
    });
  },
  computed: {
    ...mapState(["viewer1Show", "isLand", "yqfk"]),
@@ -114,6 +170,16 @@
    },
    isShowHistory() {
      return this.$store.state.isShowHistory;
      F;
    },
    isShowDigitalPerson() {
      return this.$store.state.isShowDigitalPerson;
    },
    isShowTextArea() {
      if (this.$store.state.isShowTextArea) {
        this.input = "";
      }
      return this.$store.state.isShowTextArea;
    },
  },
  watch: {
@@ -131,14 +197,19 @@
  },
  methods: {
    ...mapMutations(["setLayerTreeTwoScreen"]),
    showTextArea() {
      this.$store.commit("showTextArea", !this.$store.state.isShowTextArea);
    },
    setMessgae(show, msg) {
      this.tooltipShow = show;
      this.tooltipInfo = msg ? msg : "";
    },
    changePwd() {
      console.log(111);
    },
    changeMode(mode){
    changeMode(mode) {
      this.$refs.mapViewer.changeMode(mode);
    },
    detectZoom() {
@@ -239,13 +310,13 @@
      this.$store.commit("showHistory", false);
    },
  },
  beforeDestroy(){
  beforeDestroy() {
    this.$refs.bottommenu.switchMenu(0);
  },
};
</script>
<style scoped>
.cacheImage{
.cacheImage {
  display: none !important;
}
.mapViewer {
@@ -275,6 +346,43 @@
  bottom: 0;
  transform: translate(-50%, 0);
}
.digital_Box {
  position: absolute;
  left: 0;
  bottom: 120px;
  z-index: 10;
}
.textBtn {
  background-image: url("~@/assets/img/new/leftCircle.png");
  background-size: 100%;
  background-color: transparent;
  width: 35px;
  height: 35px;
  position: absolute;
  left: 20px;
  cursor: pointer;
}
.textBtn:hover {
  background-image: url("~@/assets/img/new/leftCircle-y.png");
}
.active {
  background-image: url("~@/assets/img/new/leftCircle-y.png");
}
.textBtn img {
  /* margin-top: 14px;
  margin-left: 14px; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
}
#digital_page {
  /* position: absolute;
  left: 0;
  bottom: 120px;
  z-index: 10; */
}
.trigger {
  pointer-events: all;