From d5f572496c5fb12fec2fe346b847bf58331299c9 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 17 七月 2024 15:56:51 +0800
Subject: [PATCH] 1

---
 src/pages/characterMap/characterMap.vue |  159 +++++++++++++++++++++++++++++------------------------
 1 files changed, 87 insertions(+), 72 deletions(-)

diff --git a/src/pages/characterMap/characterMap.vue b/src/pages/characterMap/characterMap.vue
index df06f02..a4f33a5 100644
--- a/src/pages/characterMap/characterMap.vue
+++ b/src/pages/characterMap/characterMap.vue
@@ -1,8 +1,10 @@
 <template>
-  <view style="width: 100%;height: 100%;display: flex;flex-direction: column;">
-    <headNav :idIndex="1 + ''" text="涓尰浜虹墿鏁版嵁搴�" />
+  <view
+    style="width: 100%; height: 100%; display: flex; flex-direction: column"
+  >
+    <headNav :idIndex="1 + ''" text="鍘嗕唬浜虹墿" />
     <el-button class="getBack" @click="goBack">杩斿洖</el-button>
-    <view style="flex: 1;overflow: hidden;">
+    <view style="flex: 1; overflow: hidden">
       <!-- 鍦板浘 -->
       <!-- <view id="spaceTime" style="height: 90vh;width: 100%;position: relative;"></view> -->
       <div id="map"></div>
@@ -12,7 +14,7 @@
         <view
           class="font-family"
           style="font-size: 0.26rem; padding-top: 0.16rem; font-weight: bold"
-          >{{ activityInfo.participants }}</view
+          >{{ basicInfo.name }}</view
         >
         <ul
           style="
@@ -23,15 +25,15 @@
             line-height: 0.28rem;
           "
         >
-          <li>鍑虹敓浜巤{ basicInfo.nativePlace }}</li>
+          <li>鍑虹敓浜巤{ basicInfo.nativePlace || "-" }}</li>
           <li>
-            {{
-              basicInfo.birthYear +
-              basicInfo.nativePlace +
-              "(浠�" +
-              basicInfo.nowPlace +
-              ")"
-            }}
+            <span v-if="basicInfo.birthYear">{{ basicInfo.birthYear }}</span>
+            <span v-if="basicInfo.nativePlace">{{
+              basicInfo.nativePlace
+            }}</span>
+            <span v-if="basicInfo.nowPlace"
+              >锛堜粖{{ basicInfo.nowPlace }}锛�</span
+            >
           </li>
         </ul>
         <ul
@@ -42,18 +44,18 @@
             line-height: 0.28rem;
           "
         >
-          <li>娲诲姩鍚嶇О锛歿{ activityInfo.activityName }}</li>
-          <li>娲诲姩鍦扮偣锛歿{ activityInfo.activityAddr }}</li>
-          <li>娲诲姩鍖洪棿锛歿{ activityInfo.time }}</li>
-          <li>娲诲姩鎻忚堪锛歿{ activityInfo.desc }}</li>
-          <li>鍙備笌浜哄憳锛歿{ activityInfo.participants }}</li>
+          <li>娲诲姩鍚嶇О锛歿{ activityInfo.activityName || "-" }}</li>
+          <li>娲诲姩鍦扮偣锛歿{ activityInfo.activityAddr || "-" }}</li>
+          <li>娲诲姩鍖洪棿锛歿{ activityInfo.time || "-" }}</li>
+          <li>娲诲姩鎻忚堪锛歿{ activityInfo.desc || "-" }}</li>
+          <li>鍙備笌浜哄憳锛歿{ activityInfo.participants || "-" }}</li>
         </ul>
         <!-- <img
           style="width: 100%; height: 2rem"
           src="https://img0.baidu.com/it/u=1845740325,2917001370&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1711731600&t=0b208ab46e1d33aa81ac31dd6bf627be"
           alt=""
         /> -->
-        <div class="box" style="width: 80%">
+        <!-- <div class="box" style="width: 80%">
           <span class="span" :style="{ marginLeft: spanML + 'rem' }"
             >{{ span }}骞�</span
           >
@@ -67,7 +69,7 @@
           </div>
           <div class="MX"></div>
           <div class="cursor" :style="{ marginLeft: cursorML + 'rem' }"></div>
-        </div>
+        </div> -->
       </el-dialog>
     </view>
   </view>
@@ -95,7 +97,13 @@
       spanML: 0,
       cursorML: -0.05,
       activityInfo: {},
-      basicInfo: {}
+      basicInfo: {
+        name: "",
+        birthYear: "",
+        deathYear: "",
+        nativePlace: "",
+        nowPlace: "",
+      },
     };
   },
 
@@ -116,7 +124,7 @@
     initMap(info) {
       var map = L.map("map", {
         attributionControl: false,
-        preferCanvas: true
+        preferCanvas: true,
       }).setView([35.91667, 110.41667], 5);
 
       // L.tileLayer(
@@ -127,26 +135,33 @@
         .chinaProvider("TianDiTu.Normal.Map", {
           key: "76bc34ead7e30e663a4eded8aeaf5860",
           maxZoom: 18,
-          minZoom: 5
+          minZoom: 5,
+        })
+        .addTo(map);
+      L.tileLayer
+        .chinaProvider("TianDiTu.Normal.Annotion", {
+          key: "76bc34ead7e30e663a4eded8aeaf5860",
+          maxZoom: 18,
+          minZoom: 3,
         })
         .addTo(map);
       let DefaultIcon1 = L.icon({
         iconUrl: this.icoName,
         iconSize: [24, 41], //  鍥炬爣鐨勫ぇ灏�    銆愬��1锛屽��2銆� 涓哄叿浣撲綘鑷畾涔夊浘鏍囩殑灏哄锛屾瘮濡傛垜鍥炬爣灏哄鏄�32脳52锛岃〃绀鸿鍥炬爣锛氬搴�32鍍忕礌锛岄珮搴︼細52鍍忕礌锛岄偅涔堝��1:灏辨槸32锛屽��2锛氬氨鏄�52
         iconAnchor: [24, 41], //  鍥炬爣灏嗗搴旀爣璁扮偣鐨勪綅缃� 杩欎釜鏄噸鐐癸紝 銆愬��1锛屽��2銆戯紝鍊�1锛氫负鍥炬爣鍧愭爣绗竴涓��(鍗�32)鐨勪竴鍗婏紝鍊�2锛氫负鍥炬爣鍧愭爣绗簩涓��(鍗�52)
-        popupAnchor: [1, -24] // 璇ョ偣鏄浉瀵逛簬iconAnchor寮瑰嚭淇℃伅鐨勪綅缃�  杩欎釜鏄垜鎵嬪姩璋冨嚭鏉ョ殑锛屾枃妗i粯璁ゅ師濮嬪�兼槸[-1锛�-76]锛屾垜鏄幓涓�鍗婂�硷紝鍙栦竴鍗婂�艰皟鍑烘潵鐨�
+        popupAnchor: [1, -24], // 璇ョ偣鏄浉瀵逛簬iconAnchor寮瑰嚭淇℃伅鐨勪綅缃�  杩欎釜鏄垜鎵嬪姩璋冨嚭鏉ョ殑锛屾枃妗i粯璁ゅ師濮嬪�兼槸[-1锛�-76]锛屾垜鏄幓涓�鍗婂�硷紝鍙栦竴鍗婂�艰皟鍑烘潵鐨�
       });
       let icon = L.divIcon({
         html: "<div class='map-circle-name ripple'></div>",
         iconSize: [80, 80],
-        className: "map-circle"
+        className: "map-circle",
       });
       this.map = map;
       if (info && info.length) {
         for (let i = 0; i < info.length; i++) {
           const item = info[i];
           const marker1 = L.marker([item.ycoord, item.xcoord], {
-            icon: icon
+            icon: icon,
           }).addTo(map);
           marker1.on("click", (e) => {
             this.menuNav = true;
@@ -178,7 +193,7 @@
     getPersonInfoFun() {
       getPersonInfo({
         id: this.$route.query.id,
-        type: "PERSON_SPACE_TIME"
+        type: "PERSON_SPACE_TIME",
       }).then((res) => {
         this.initMap(res.object.personSpaceTimeList);
       });
@@ -187,7 +202,7 @@
     getBasicInfo() {
       getPersonInfo({
         id: this.$route.query.id,
-        type: "PERSON_BASIC"
+        type: "PERSON_BASIC",
       }).then((res) => {
         this.basicInfo.name = res.object.personFieldList.find(
           (f) => f.fieldName == "WEAK_NAME"
@@ -204,7 +219,7 @@
         this.basicInfo.nowPlace = res.object.personFieldList.find(
           (f) => f.fieldName == "NATIVE_PLACE"
         ).content2;
-        // this.initMap(res.object.personSpaceTimeList);
+        console.log(this.basicInfo);
       });
     },
 
@@ -248,40 +263,40 @@
       const data = [
         {
           name: "娴烽棬",
-          value: 9
+          value: 9,
         },
         {
           name: "閲戞槍",
-          value: 19
+          value: 19,
         },
         {
           name: "娉夊窞",
-          value: 21
+          value: 21,
         },
         {
           name: "琛㈠窞",
-          value: 177
+          value: 177,
         },
         {
           name: "寤婂潑",
-          value: 193
+          value: 193,
         },
         {
           name: "鑿忔辰",
-          value: 194
+          value: 194,
         },
         {
           name: "鍚堣偉",
-          value: 229
+          value: 229,
         },
         {
           name: "姝︽眽",
-          value: 273
+          value: 273,
         },
         {
           name: "鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨",
-          value: 279
-        }
+          value: 279,
+        },
       ];
       const geoCoordMap = {
         娴烽棬: [121.15, 31.89],
@@ -311,7 +326,7 @@
         鑿忔辰: [115.480656, 35.23375],
         鍚堣偉: [117.27, 31.86],
         姝︽眽: ["浣犲ソ", 30.52],
-        鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨: [125.03, 46.58]
+        鍟婁笁澶х熆鍙婅鍒板簳鏄皝寤哄+澶уか澶у笀鍌呭氨: [125.03, 46.58],
       };
       const convertData = function (data) {
         var res = [];
@@ -320,7 +335,7 @@
           if (geoCoord) {
             res.push({
               name: data[i].name,
-              value: geoCoord.concat(data[i].value)
+              value: geoCoord.concat(data[i].value),
             });
           }
         }
@@ -328,7 +343,7 @@
       };
       option = {
         tooltip: {
-          trigger: "item"
+          trigger: "item",
         },
         bmap: {
           center: [104.114129, 37.550339], // 璋冩暣鍦板浘涓績鐐逛綅缃�
@@ -340,60 +355,60 @@
                 featureType: "water",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1"
-                }
+                  color: "#d1d1d1",
+                },
               },
               {
                 featureType: "land",
                 elementType: "all",
                 stylers: {
-                  color: "#f3f3f3"
-                }
+                  color: "#f3f3f3",
+                },
               },
               {
                 featureType: "manmade",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1"
-                }
+                  color: "#d1d1d1",
+                },
               },
               {
                 featureType: "local",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1"
-                }
+                  color: "#d1d1d1",
+                },
               },
               {
                 featureType: "arterial",
                 elementType: "labels",
                 stylers: {
-                  visibility: "off"
-                }
+                  visibility: "off",
+                },
               },
               {
                 featureType: "boundary",
                 elementType: "all",
                 stylers: {
-                  color: "#fefefe"
-                }
+                  color: "#fefefe",
+                },
               },
               {
                 featureType: "building",
                 elementType: "all",
                 stylers: {
-                  color: "#d1d1d1"
-                }
+                  color: "#d1d1d1",
+                },
               },
               {
                 featureType: "label",
                 elementType: "labels.text.fill",
                 stylers: {
-                  color: "#999999"
-                }
-              }
-            ]
-          }
+                  color: "#999999",
+                },
+              },
+            ],
+          },
         },
         series: [
           {
@@ -410,11 +425,11 @@
               return val[2] / 10;
             },
             encode: {
-              value: 2
+              value: 2,
             },
             showEffectOn: "render",
             rippleEffect: {
-              brushType: "stroke"
+              brushType: "stroke",
             },
             label: {
               formatter: "{b}",
@@ -432,18 +447,18 @@
               },
               show: true,
               fontSize: 12,
-              borderRadius: 30
+              borderRadius: 30,
             },
             itemStyle: {
               shadowBlur: 10,
-              shadowColor: "#333"
+              shadowColor: "#333",
             },
             emphasis: {
-              scale: true
+              scale: true,
             },
-            zlevel: 1
-          }
-        ]
+            zlevel: 1,
+          },
+        ],
       };
       let menuNav1 = this.menuNav;
       let menuNav2 = this.menuNav;
@@ -466,8 +481,8 @@
       // 淇敼 Vue 缁勪欢鐨勬暟鎹紝渚嬪鏄剧ず鑿滃崟瀵艰埅
       this.menuNav = !this.menuNav;
       // 鏃剁┖鍦板浘鐨勬暟鎹�
-    }
-  }
+    },
+  },
 };
 </script>
 
@@ -555,9 +570,9 @@
   margin: 0 !important;
   position: absolute;
   right: 0;
-  top: 0;
+  top: 86px;
+  bottom: 0;
   width: 4rem;
-  height: 100%;
 }
 
 .particulars ::v-deep .el-dialog__header {

--
Gitblit v1.9.1