shuishen
2021-12-24 a3761173a91a1fd7270b848f9f8d255c0bfa9b6c
src/components/mobileLeftNav/index.vue
@@ -20,13 +20,15 @@
<script>
import { mapGetters } from "vuex";
import {
  getListdoor, //出入
  getListaed, //AED
  getListparking, //停车场
  // getListdoor, //出入
  // getListaed, //AED
  // getListparking, //停车场
  getListarchitecture, //全景
  getListarchitecture1, //标签
  getListroad, //道路
  getListcat, //出入-AED-停车场
} from "@/api/mobile/piont/index";
import { getListVideo } from "@/api/mobile/monitor/index";
export default {
  name: "mobileLeftNav",
  watch: {
@@ -101,6 +103,17 @@
          imgSrc: "img/leftnav/map-panorama.png",
          // imgSrc: "img/mobile/blue.png",
        },
        {
          flag: false,
          label: "监控",
          img: "/img/leftnav/scene.png",
          normal: "/img/leftnav/scene.png",
          checked: "/img/leftnav/scene-checked.png",
          layer: "videoLayer",
          methods: getListVideo,
          imgSrc: "img/leftnav/map-panorama.png",
          // imgSrc: "img/mobile/blue.png",
        },
        // {
        //   flag: false,
        //   label: "活动",
@@ -118,7 +131,8 @@
          normal: "/img/leftnav/aed.png",
          checked: "/img/leftnav/aed-checked.png",
          layer: "aedLayer",
          methods: getListaed,
          methods: getListcat,
          type: 9,
          imgSrc: "img/leftnav/map-aed.png",
          // imgSrc: "img/mobile/pink.png",
        },
@@ -129,7 +143,8 @@
          normal: "/img/leftnav/park.png",
          checked: "/img/leftnav/park-checked.png",
          layer: "parkLayer",
          methods: getListparking,
          methods: getListcat,
          type: 11,
          imgSrc: "https://map.hit.edu.cn/images/p-biao.png",
          // imgSrc: "img/mobile/popcorn.png",
        },
@@ -140,7 +155,8 @@
          normal: "/img/leftnav/come.png",
          checked: "/img/leftnav/come-checked.png",
          layer: "comeLayer",
          methods: getListdoor,
          methods: getListcat,
          type: 12,
          imgSrc: "img/leftnav/map-activity.png",
          // imgSrc: "img/mobile/purple.png",
        },
@@ -150,6 +166,7 @@
      tagLayer: null,
      wayLayer: null,
      sceneLayer: null,
      videoLayer: null,
      activityLayer: null,
      aedLayer: null,
      parkLayer: null,
@@ -230,6 +247,9 @@
      // this.sceneLayer = new this.DC.VectorLayer("sceneLayer");
      this.sceneLayer = new this.DC.HtmlLayer("sceneLayer");
      viewer.addLayer(this.sceneLayer);
      this.videoLayer = new this.DC.HtmlLayer("videoLayer");
      viewer.addLayer(this.videoLayer);
      // this.activityLayer = new this.DC.VectorLayer("activityLayer");
      this.activityLayer = new this.DC.HtmlLayer("activityLayer");
@@ -446,7 +466,8 @@
      let ourNum = that.leftNavData.length;
      for (let n = 0; n < ourNum; n++) {
        let ourD = this.leftNavData[n];
        ourD.methods().then((res) => {
        let d = ourD.type ? { lifetype: ourD.type } : {};
        ourD.methods(d).then((res) => {
          let dom;
          let data = res.data.data;
          let position = that.changePoiton(data);
@@ -525,14 +546,32 @@
                            </div>
                        </div>
                    `;
            } else if (ourD.label == "监控") {
              dom = `
                        <div class="mobiletag-entitys-box-pink">
                            <div class="tag-content">
                              监控
                            </div>
                            <div class="tag-angle-content">
                                <img src="${ourD.imgSrc}">
                            </div>
                        </div>
                    `;
            }
            const divIcon = new that.DC.DivIcon(position[k], dom);
            //订阅事件
            divIcon.on(DC.MouseEventType.CLICK, (e) => {
              // console.log(data[k]);
              let d = {
                name: data[k].mechanismname || data[k].roadname,
                name:
                  data[k].mechanismname ||
                  data[k].roadname ||
                  ourD.label == "监控"
                    ? "监控"
                    : "无显示名字",
                bgImg: data[k].tpurl,
                video: data[k].videourl || "",
                from: "labels",
                introduce: data[k].introduce,
              };
              // 定制化窗体