From b912d487fcb309a3e8c727ad8a6778afb1436a75 Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期五, 26 十二月 2025 15:32:22 +0800
Subject: [PATCH] feat: 修改大屏页面

---
 src/components/page/leaderShow/leaderIndex.vue |  125 +++++++++++++++++++++++++++++++----------
 1 files changed, 95 insertions(+), 30 deletions(-)

diff --git a/src/components/page/leaderShow/leaderIndex.vue b/src/components/page/leaderShow/leaderIndex.vue
index 2d71b43..fc251be 100644
--- a/src/components/page/leaderShow/leaderIndex.vue
+++ b/src/components/page/leaderShow/leaderIndex.vue
@@ -2,12 +2,6 @@
     <div class="leaderIndex-wrap">
         <div class="leaderIndex-title">
             <h1>宄板嘲鐭垮尯缁煎悎琛屾斂鎵ф硶灞�鏅烘収娉婅溅骞冲彴</h1>
-            <div class="leader-title-left">
-                <h2>娆㈣繋鐧诲綍锛寋{userName}}</h2>
-            </div>
-            <div class="logout" @click="logout">
-                閫�鍑虹櫥褰�
-            </div>
 <!--            <div class="leader-title-right" @click="houtaiBtn">-->
 <!--                <h2>鍚庡彴绠$悊</h2>-->
 <!--            </div>-->
@@ -233,6 +227,7 @@
                     getLogoUrl: this.$systemconfig.basePath + '/statistic/getLogo',
                     findAllUrl: this.$systemconfig.basePath + '/ffzf/user/findAll',
                     illegalCarUrl: this.$systemconfig.basePath + '/ffzf/notice/illegalCar2',
+                    getCarNumUrl: this.$systemconfig.basePath + '/ffzf/park/getCarNum'
                 },
                 weizhangTimer:null,  //杩濈珷list瀹氭椂鍣�
                 getDataTimer:null, //缁熻鏁版嵁瀹氭椂鍣�
@@ -290,16 +285,19 @@
                 map:'',
                 centerLng:'114.225914',
                 centerLat:'36.438982',
+                pointNum1: '',
+                pointNum2: '',
             }
         },
         mounted() {
             BaiduMap.init()
                 .then((BMap) => {
                   console.log('鍦板浘鍒濆鍖�')
-                  this.inits()
+                //   this.inits()
+                    this.createMap(BMap)
                 })
             this.newTimes()
-            this.userName = this.getStore('userinfo').name
+            this.userName = this.getStore('userinfo')
             this.getData()
             this.$nextTick(() => {
                 this.createMap()
@@ -442,30 +440,97 @@
                    this.$refs.zhipaiForm.initData()
                })
             },
-            createMap(){  // // 鏂规硶 - 鍒涘缓鍦板浘
+            createMap(BMap){  // // 鏂规硶 - 鍒涘缓鍦板浘
                 // 鍦ㄧ櫨搴﹀湴鍥惧鍣ㄤ腑鍒涘缓鍦板浘瀹炰緥
-                let map = new BMap.Map("container");
-                // 灏唌ap鍙橀噺瀛樺偍鍦ㄥ叏灞�
-                this.map = map;
-                // let goodsData = require('../../../assets/custom_map_config.json')
-                // 璁惧畾鍦板浘鐨勪腑蹇冪偣鍜屽潗鏍�
-                let point = new BMap.Point(this.centerLng, this.centerLat);
-                // let marker = new BMap.Marker(point) // 鍒涘缓鏍囨敞
-                // 璁剧疆涓績鐐瑰潗鏍囧拰鍦板浘绾у埆
-                this.map.centerAndZoom(point, 1);
-                // 娣诲姞鑷畾涔夎鐩栫墿
-                // this.map.addOverlay(marker) // 灏嗘爣娉ㄦ坊鍔犲埌鍦板浘涓�
-                // 鍏佽婊氳疆缂╂斁
-                this.map.enableScrollWheelZoom(point, 15);
-                // 璁剧疆鍦板浘榛樿缂╂斁姣斾緥
-                this.map.setZoom(15);
-                this.map.setMapStyle({
-                       style:'midnight'
-                            // styleJson:goodsData
-                 });
-                this.addHeatMap(this.map)
-                this.addMarker(this.map,point)
+                let map = new BMap.Map('container');
+                this.$nextTick(() => {
+                    // 灏唌ap鍙橀噺瀛樺偍鍦ㄥ叏灞�
+                    this.map = map;
+                    //  let goodsData = require('../../../assets/custom_map_config.json')
+                    // 璁惧畾鍦板浘鐨勪腑蹇冪偣鍜屽潗鏍�
+                    // let point = new BMap.Point(this.centerLng, this.centerLat);
+                    // let marker = new BMap.Marker(point) // 鍒涘缓鏍囨敞
+                    // // 璁剧疆涓績鐐瑰潗鏍囧拰鍦板浘绾у埆
+                    // this.map.centerAndZoom(point, 1);
+                    // // 娣诲姞鑷畾涔夎鐩栫墿
+                    // this.map.addOverlay(marker) // 灏嗘爣娉ㄦ坊鍔犲埌鍦板浘涓�
 
+
+                    const centerPoint = new BMap.Point(114.23123, 36.43123);
+                    // 瀹氫箟澶氱偣鍧愭爣
+                    const points = [
+                        {lng: 114.23123, lat: 36.43123, name: '鏂颁笘绾仠杞﹀満', id: 4 },
+                        {lng: 114.18, lat: 36.44, name: '鍏噷鏂瑰仠杞﹀満', id: 36 },
+                        {lng: 114.21, lat: 36.43, name: '婊忔簮鍫ゅ仠杞﹀満', id: 34 },
+                        {lng: 114.24, lat: 36.42, name: '婊忛槼婀垮湴鍏洯鍋滆溅鍦�', id: 33 },
+                        {lng: 114.18, lat: 36.43, name: '闄剁摲鍗氱墿棣嗗仠杞﹀満', id: 30 },
+                        {lng: 114.21, lat: 36.42, name: '椋庢湀鍏冲仠杞﹀満', id: 25 },
+                        {lng: 114.23, lat: 36.44, name: '娓呮硥鍏洯鍋滆溅鍦�', id: 22 },
+                        {lng: 114.21222, lat: 36.43111, name: '宄板嘲瀹鹃鍋滆溅鍦�', id: 7 },
+                        {lng: 114.23, lat: 36.42, name: '鍗楀ご鏉戝仠杞﹀満', id: 20 },
+                        {lng: 114.24125, lat: 36.43127, name: '鍥藉湡灞�鍋滆溅鍦�', id: 21 },
+                        {lng: 114.22127, lat: 36.43129, name: '浜烘皯骞垮満鍦颁笅鍋滆溅鍦�', id: 8 },
+                    ];
+                    // 娣诲姞涓績鐐规爣璁�
+                    const centerMarker = new BMap.Marker(centerPoint);
+                    this.map.addOverlay(centerMarker);
+                    // 寰幆娣诲姞鍏朵粬鐐�
+                    points.forEach(coord => {
+                        const point = new BMap.Point(coord.lng, coord.lat);
+                        const marker = new BMap.Marker(point);
+                        this.map.addOverlay(marker);
+
+                        // 娣诲姞榧犳爣鎮仠浜嬩欢
+                        marker.addEventListener("mouseover", (e) => {
+                            this.$byutil.postData4(this, this.pageConfig.getCarNumUrl, { parkId: coord.id }, res => {
+                                this.pointNum1 = res.data.num // 杞︿綅鎬绘暟
+                                this.pointNum2 = Math.floor(Number(res.data.num) - Number(res.data.carNum));
+
+                                // 鍒涘缓淇℃伅绐楀彛鍐呭
+                                const content = `
+                                    <div style="padding:10px">
+                                        <h4>${coord.name}</h4>
+                                        <p>杞︿綅鎬绘暟: ${this.pointNum1}</p>
+                                        <p>鍓╀綑:${this.pointNum2} </p>
+                                    </div>
+                                `;
+                                // 鍒涘缓淇℃伅绐楀彛
+                                const infoWindow = new BMap.InfoWindow(content, {
+                                    width: 200,
+                                    title: "璇︾粏淇℃伅"
+                                });
+
+                                // 鍦ㄦ爣璁扮偣浣嶇疆鎵撳紑淇℃伅绐楀彛
+                                marker.openInfoWindow(infoWindow, point);
+                            })
+                        });
+                    });
+                    // 鍦板浘璁剧疆...
+                    this.map.centerAndZoom(centerPoint, 1);
+                    this.map.enableScrollWheelZoom(true);
+                    this.map.setZoom(15);
+                    // 鑷姩璋冩暣瑙嗛噹
+                    const bounds = new BMap.Bounds();
+                    [centerPoint, ...points].forEach(p => bounds.extend(p));
+                    this.map.setViewport(bounds.getSouthWest(), bounds.getNorthEast());
+
+
+                    // 鍏佽婊氳疆缂╂斁
+                    this.map.enableScrollWheelZoom(point, 15);
+                    // 璁剧疆鍦板浘榛樿缂╂斁姣斾緥
+                    this.map.setZoom(15);
+                    this.map.setMapStyle({
+                        // style:'midnight',
+                        styleJson:goodsData
+                    });
+
+                    this.map.addEventListener("tilesloaded", () => {
+                        this.addHeatMap(this.map); // 纭繚鍦� tilesloaded 浜嬩欢鍚庤皟鐢�
+                    });
+
+                    // this.addHeatMap(this.map)
+                    this.addMarker(this.map,point)
+                })
             },
             addHeatMap(map) {  //鐑姏鍥�
                 this.$byutil.postData(this,this.pageConfig.getLogoUrl,null,res => {

--
Gitblit v1.9.1