From 84e172065fcc7fe6772d031c6c262a63e85f8efa Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 27 Dec 2021 09:31:42 +0800
Subject: [PATCH] +搜索为空return

---
 src/components/mobileLeftNav/index.vue |   90 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 71 insertions(+), 19 deletions(-)

diff --git a/src/components/mobileLeftNav/index.vue b/src/components/mobileLeftNav/index.vue
index a533ef5..824e0a4 100644
--- a/src/components/mobileLeftNav/index.vue
+++ b/src/components/mobileLeftNav/index.vue
@@ -20,12 +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: {
@@ -79,16 +82,16 @@
           imgSrc: "https://map.hit.edu.cn/images/tarrow_xq.png",
           // imgSrc: "img/mobile/pink.png",
         },
-        // {
-        //   flag: false,
-        //   label: "道路",
-        //   img: "/img/leftnav/way.png",
-        //   normal: "/img/leftnav/way.png",
-        //   checked: "/img/leftnav/way-checked.png",
-        //   layer: "wayLayer",
-        //   methods: getListdoor,
-        //   imgSrc: "img/mobile/green.png",
-        // },
+        {
+          flag: false,
+          label: "道路",
+          img: "/img/leftnav/way.png",
+          normal: "/img/leftnav/way.png",
+          checked: "/img/leftnav/way-checked.png",
+          layer: "wayLayer",
+          methods: getListroad,
+          imgSrc: "img/mobile/green.png",
+        },
         {
           flag: false,
           label: "实景",
@@ -97,6 +100,17 @@
           checked: "/img/leftnav/scene-checked.png",
           layer: "sceneLayer",
           methods: getListarchitecture,
+          imgSrc: "img/leftnav/map-panorama.png",
+          // imgSrc: "img/mobile/blue.png",
+        },
+        {
+          flag: false,
+          label: "监控",
+          img: "/img/leftnav/monitor.png",
+          normal: "/img/leftnav/monitor.png",
+          checked: "/img/leftnav/monitor-checked.png",
+          layer: "videoLayer",
+          methods: getListVideo,
           imgSrc: "img/leftnav/map-panorama.png",
           // imgSrc: "img/mobile/blue.png",
         },
@@ -117,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",
         },
@@ -128,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",
         },
@@ -139,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",
         },
@@ -149,6 +166,7 @@
       tagLayer: null,
       wayLayer: null,
       sceneLayer: null,
+      videoLayer: null,
       activityLayer: null,
       aedLayer: null,
       parkLayer: null,
@@ -229,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");
@@ -445,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);
@@ -459,6 +481,20 @@
                             </div>
                             <div class="tag-angle-content">
                                 <img src="${ourD.imgSrc}">
+                            </div>
+                        </div>
+                    `;
+            } else if (ourD.label == "道路") {
+              // <div  class="way-title" style="border: white 1px solid; padding-left: 2px;font-size: 12px; background: #0066ff;  width: 12px;line-height: 13px; padding:2px 1px 2px 1px; color:white;">
+              //    ${data[k].mechanismname}
+              // </div>
+              dom = `
+                        <div  class="way-entitys-box">
+                            <div  class="way-title" style="border: white 1px solid; padding-left: 2px;font-size: 12px; background: #0066ff;  width: 12px;line-height: 13px; padding:2px 1px 2px 1px; color:white;">
+                                ${data[k].roadname}
+                            </div>
+                            <div  class="way-sign-box">
+                                <img src="https://map.hit.edu.cn/images/roadsign3.png">
                             </div>
                         </div>
                     `;
@@ -510,14 +546,30 @@
                             </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,
+                name:
+                  data[k].mechanismname ||
+                  data[k].roadname ||
+                  (ourD.label == "监控" ? "监控" : "无显示名字"),
                 bgImg: data[k].tpurl,
+                video: data[k].videourl || "",
+                from: "labels",
                 introduce: data[k].introduce,
               };
               // 定制化窗体
@@ -575,7 +627,7 @@
   .m-left-coutrol {
     position: absolute;
     left: -24px;
-    top: 60px;
+    top: 96px;
     width: 25px;
     height: 60px;
     background-color: #fff;

--
Gitblit v1.9.3