From a4fe90ef374a9a3144fb8de5d7229dd11bfa7ff4 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期二, 11 六月 2024 10:24:02 +0800
Subject: [PATCH] 1

---
 src/pages/character/detail.vue |   78 ++++++++++++++++++++++++++++++++------
 1 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/src/pages/character/detail.vue b/src/pages/character/detail.vue
index d84ce9c..c6c4778 100644
--- a/src/pages/character/detail.vue
+++ b/src/pages/character/detail.vue
@@ -414,9 +414,10 @@
   getPersonBiog,
   getPersonWritings,
   getPersonRelationAtSchool,
-  getSpaceTime
+  getSpaceTime,
+  getDynastyData,
 } from "@/api/index.js";
-import { getImg, getFile } from "@/static/tool.js";
+import { getImg } from "@/static/tool.js";
 import L from "leaflet";
 import "leaflet.chinatmsproviders";
 
@@ -560,7 +561,7 @@
         window.open(item.url);
       }
       if (item.filePath) {
-        window.open(getFile(item.filePath));
+        window.open(getImg(item.filePath));
       }
     },
     getData() {
@@ -646,7 +647,9 @@
               value: obj.dynastyDesc || "-",
               valueClick: () => {
                 uni.navigateTo({
-                  url: "/pages/knowledgeBase/knowledgeBase?dynasty=" + obj.dynastyId
+                  url:
+                    "/pages/knowledgeBase/knowledgeBase?dynasty=" +
+                    obj.dynastyId
                 });
               }
             },
@@ -671,7 +674,9 @@
               value: obj.official || "-",
               valueClick: () => {
                 uni.navigateTo({
-                  url: "/pages/knowledgeBase/knowledgeBase?isAdvancedSearch=1&official=" + obj.official
+                  url:
+                    "/pages/knowledgeBase/knowledgeBase?isAdvancedSearch=1&official=" +
+                    obj.official
                 });
               }
             },
@@ -762,6 +767,30 @@
       }).then((res) => {
         this.tableData4;
         console.log(res, "PERSON_RELATIONS");
+        if (res.object.personRelationMap.kin.length) {
+          this.tableData2 = res.object.personRelationMap.kin.map((f) => {
+            return {
+              a: f.nodeName,
+              b: f.relationTypeName,
+            };
+          });
+        }
+        if (res.object.personRelationMap.teacherStudent.length) {
+          this.tableData3 = res.object.personRelationMap.teacherStudent.map((f) => {
+            return {
+              a: f.nodeName,
+              b: f.relationTypeName,
+            };
+          });
+        }
+        if (res.object.personRelationMap.social.length) {
+          this.tableData4 = res.object.personRelationMap.social.map((f) => {
+            return {
+              a: f.nodeName,
+              b: f.relationTypeName,
+            };
+          });
+        }
       });
       // 绀句細鍏崇郴
       getPersonRelationAtSchool({
@@ -782,6 +811,7 @@
         personId: this.detailId,
         relationSearchTypeEO: "KINSHIP"
       }).then((res) => {
+        console.log(res, "123123");
         if (res.list && res.list.length) {
           this.tableData2 = res.list.map((f) => {
             return {
@@ -849,16 +879,23 @@
         personId: this.detailId
       }).then((res) => {
         if (res.list && res.list.length) {
-          const data = res.list.map((item) => {
-            return {
-              name: item.activityName,
-              value: [item.xcoord, item.ycoord]
-            };
-          });
+          const data = [];
+          for (let i = 0; i < res.list.length; i++) {
+            const item = res.list[i];
+            if (item.xcoord && item.ycoord) {
+              const obj = {
+                name: item.activityName,
+                value: [item.xcoord, item.ycoord]
+              };
+              data.push(obj);
+            }
+          }
           this.markerList = data;
           // 鏃剁┖鍦板浘
           // 杩欓噷鍙彇浜嗙涓�鏉★紝闇�瑕佸叏閮ㄦ暟鎹�
-          this.initMap(data[0]);
+          if (data && data.length) {
+            this.initMap(data);
+          }
         }
 
         // loadBMap("1NJdwrI1CfT6lrykVhDkmWgsO6O2bjQK").then(() => {
@@ -870,9 +907,16 @@
       var map = L.map("spaceTime", {
         preferCanvas: true,
         attributionControl: false
-      }).setView([markerList.value[1], markerList.value[0]], 13);
+      }).setView([markerList[0].value[1], markerList[0].value[0]], 13);
       L.tileLayer
         .chinaProvider("TianDiTu.Normal.Map", {
+          key: "76bc34ead7e30e663a4eded8aeaf5860",
+          maxZoom: 18,
+          minZoom: 3
+        })
+        .addTo(map);
+      L.tileLayer
+        .chinaProvider("TianDiTu.Normal.Annotion", {
           key: "76bc34ead7e30e663a4eded8aeaf5860",
           maxZoom: 18,
           minZoom: 3
@@ -887,6 +931,14 @@
       const temp_mark = L.marker([markerList.value[1], markerList.value[0]], {
         icon: icon
       }).addTo(map);
+      if (markerList.length) {
+        for (let i = 0; i < markerList.length; i++) {
+          const item = markerList[i];
+          const temp_mark = L.marker([item.value[1], item.value[0]], {
+            icon: icon
+          }).addTo(map);
+        }
+      }
     },
     // 鏀惧ぇ鍦板浘璺宠浆
     fangdaClick(index) {

--
Gitblit v1.9.1