From 39a523ffe37d2b3a464bcb3ec902d5a8e7470699 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期二, 23 七月 2024 18:40:51 +0800
Subject: [PATCH] 1

---
 src/pages/academicSchools/index.vue |  195 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 130 insertions(+), 65 deletions(-)

diff --git a/src/pages/academicSchools/index.vue b/src/pages/academicSchools/index.vue
index a369d13..cea42cc 100644
--- a/src/pages/academicSchools/index.vue
+++ b/src/pages/academicSchools/index.vue
@@ -217,6 +217,21 @@
       </div>
       <div class="btn" @click="spaceTimeArr(detailData.id)">鏌ョ湅鏇村>>></div>
     </div>
+    <div id="schoolDialog" class="customDialog">
+      <div class="title">
+        <span>{{ detailData.name }}</span>
+        <span @click="closeDom">鍏抽棴</span>
+      </div>
+      <div class="content">
+        <p>濮撳悕锛歿{ detailData.name }}</p>
+        <p>鍒悕锛歿{ detailData.alias }}</p>
+        <p>绫嶈疮锛歿{ detailData.nativePlace }}</p>
+        <p>鍖诲鍒嗙锛� {{ detailData.medicalBranch }}</p>
+        <p>灏忎紶锛歿{ detailData.biography }}</p>
+      </div>
+      <div class="btn" @click="spaceTimeArr(detailData.id)">鏌ョ湅鏇村>>></div>
+    </div>
+    
     <el-drawer
       title="鍦板潃鍒楄〃"
       :visible.sync="drawer"
@@ -253,7 +268,26 @@
       hotKeyList: [],
       searchKey: "",
       // 鍒嗙被
-      categories: [],
+      categories: [
+        {
+          name: "浜插睘鍏崇郴"
+        },
+        {
+          name: "甯堟壙鍏崇郴"
+        },
+        {
+          name: "鏂囩尞浣滃搧"
+        },
+        {
+          name: "绀句細鍏崇郴"
+        },
+        {
+          name: "娲诲姩鍦�"
+        },
+        {
+          name: "瀛︽湳娴佹淳"
+        }
+      ],
       // 褰撳墠浜虹墿淇℃伅
       ownInfo: null,
       detailData: {
@@ -611,7 +645,6 @@
         //     this.relationships.push(obj);
         //   });
         // }
-        
       });
     },
     // 閫掑綊澶勭悊鎵�鏈夊眰绾ф暟鎹�
@@ -645,11 +678,9 @@
                 );
                 if (p) {
                   this.nodeDatas.push({
+                    category: 0,
                     id: item.mainId,
-                    name: p.NAME[0].content1,
-                    itemStyle: {
-                      color: "#5470c6"
-                    }
+                    name: p.NAME[0].content1
                   });
                 }
               }
@@ -676,11 +707,9 @@
                 -1
               ) {
                 this.nodeDatas.push({
+                  category: 2,
                   id: item.mainId,
-                  name: item.literatureName,
-                  itemStyle: {
-                    color: "#fac858"
-                  }
+                  name: item.literatureName
                 });
               }
               this.links.push({
@@ -695,11 +724,9 @@
                 -1
               ) {
                 this.nodeDatas.push({
+                  category: 4,
                   id: item.mainId,
-                  name: item.ancientName,
-                  itemStyle: {
-                    color: "#ea7ccc"
-                  }
+                  name: item.ancientName
                 });
               }
               this.links.push({
@@ -716,16 +743,11 @@
                 const s = this.infoOfSchools.find(
                   (sItem) => sItem.schoolId == item.schoolId
                 );
-                console.log(this.infoOfSchools);
-                console.log(item.schoolId);
-                console.log(s);
                 if (s) {
                   this.nodeDatas.push({
+                    category: 5,
                     id: item.mainId,
-                    name: s.name[0],
-                    itemStyle: {
-                      color: "#9a60b4"
-                    }
+                    name: s.name[0]
                   });
                 }
               }
@@ -745,11 +767,9 @@
                 );
                 if (p) {
                   this.nodeDatas.push({
+                    category: 3,
                     id: item.mainId,
-                    name: p.NAME[0].content1,
-                    itemStyle: {
-                      color: "#ee6666"
-                    }
+                    name: p.NAME[0].content1
                   });
                 }
               }
@@ -780,11 +800,9 @@
                 );
                 if (p) {
                   this.nodeDatas.push({
+                    category: 1,
                     id: item.mainId,
-                    name: p.NAME[0].content1,
-                    itemStyle: {
-                      color: "#3dae7b"
-                    }
+                    name: p.NAME[0].content1
                   });
                 }
               }
@@ -897,9 +915,7 @@
             symbolSize: 15,
             data: this.nodeDatas,
             links: this.links,
-            categories: [{
-
-            }],
+            categories: this.categories,
             roam: true,
             label: {
               show: true,
@@ -925,6 +941,14 @@
               edgeLength: 300
             }
           }
+        ],
+        color: [
+          "#5470c6",
+          "#3dae7b",
+          "#fac858",
+          "#ee6666",
+          "#ea7ccc",
+          "#9a60b4"
         ]
       };
       // 璁剧疆鐐瑰嚮浜嬩欢鐩戝惉
@@ -937,39 +961,80 @@
       myChart.setOption(option);
     },
     creatDom(params) {
-      const e = params.event;
-      const div = document.getElementById("customDialog");
-      div.style.display = "block";
-      div.style.left = e.offsetX + 50 + "px";
-      div.style.top = e.offsetY - 50 + "px";
-      const data = this.infoOfPersons?.find(
-        (i) => i.id == params.data.personId
-      );
-      const obj = {
-        id: params.data.id,
-        name:
-          data?.NAME?.map((e, i) => {
-            i += 1;
-            return e["content" + i];
-          }).join("銆�") ?? "",
-        alias:
-          data?.ALIAS?.map((e, i) => {
-            i += 1;
-            return e["content" + i];
-          }).join("銆�") ?? "",
-        nativePlace:
-          data?.NATIVE_PLACE?.map((e, i) => {
-            i += 1;
-            return e["content" + i];
-          }).join("銆�") ?? "",
-        medicalBranch:
-          data?.MEDICAL_BRANCH?.map((e, i) => {
-            i += 1;
-            return e["content" + i];
-          }).join("銆�") ?? "",
-        biography: data?.BIOGRAPHY ?? ""
-      };
-      this.detailData = obj;
+      const id = params.data.id.split("_")[0];
+      const type = params.data.id.split("_")[1];
+      if (type == "p") {
+        // 浜�
+        const e = params.event;
+        const div = document.getElementById("customDialog");
+        div.style.display = "block";
+        div.style.left = e.offsetX + 50 + "px";
+        div.style.top = e.offsetY - 50 + "px";
+        const data = this.infoOfPersons?.find(
+          (i) => i.id == id
+        );
+        const obj = {
+          id: params.data.id,
+          name:
+            data?.NAME?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          alias:
+            data?.ALIAS?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          nativePlace:
+            data?.NATIVE_PLACE?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          medicalBranch:
+            data?.MEDICAL_BRANCH?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          biography: data?.BIOGRAPHY ?? ""
+        };
+        this.detailData = obj;
+      }
+      if (type == "s") {
+        // 瀛︽淳
+        const e = params.event;
+        const div = document.getElementById("schoolDialog");
+        div.style.display = "block";
+        div.style.left = e.offsetX + 50 + "px";
+        div.style.top = e.offsetY - 50 + "px";
+        const data = this.infoOfPersons?.find(
+          (i) => i.id == id
+        );
+        const obj = {
+          id: params.data.id,
+          name:
+            data?.NAME?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          alias:
+            data?.ALIAS?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          nativePlace:
+            data?.NATIVE_PLACE?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          medicalBranch:
+            data?.MEDICAL_BRANCH?.map((e, i) => {
+              i += 1;
+              return e["content" + i];
+            }).join("銆�") ?? "",
+          biography: data?.BIOGRAPHY ?? ""
+        };
+        this.detailData = obj;
+      }
     },
     closeDom() {
       const div = document.getElementById("customDialog");

--
Gitblit v1.9.1