From c028e3f8ea083ed7ef78bf8aaf9f05866661f0dd Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期四, 18 七月 2024 11:19:23 +0800
Subject: [PATCH] 1

---
 src/pages/academicSchools/index.vue |  216 +++++++++++++++++++++++++++--------------------------
 1 files changed, 110 insertions(+), 106 deletions(-)

diff --git a/src/pages/academicSchools/index.vue b/src/pages/academicSchools/index.vue
index 7b41958..a37812d 100644
--- a/src/pages/academicSchools/index.vue
+++ b/src/pages/academicSchools/index.vue
@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view style="width: 100%; height: 100%; display: flex; flex-direction: column;">
     <headNav :idIndex="'6'" text="瀛︽湳娴佹淳" />
     <!-- 楂樼骇鎼滅储 -->
     <view style="margin-top: 0.1rem">
@@ -26,7 +26,6 @@
         </li>
       </ul>
     </view>
-    <view style="margin-left: 0.2rem">涔︿腑鏈�甯告彁鍒扮殑100浣嶄汉鐗�</view>
     <!-- 鍏崇郴琛ㄥ湴鍥� -->
     <div
       id="relation"
@@ -54,7 +53,7 @@
 import {
   getPersonData,
   getHotSearch,
-  getPDataStatistics,
+  getPDataStatistics
 } from "@/api/index.js";
 import * as echarts from "echarts";
 export default {
@@ -74,19 +73,19 @@
             type: "input",
             label: "濮撳悕",
             name: "name",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "鍒悕",
             name: "alias",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "绫嶈疮",
             name: "location",
-            value: "",
+            value: ""
           },
           {
             type: "select",
@@ -96,15 +95,15 @@
             options: [
               {
                 label: "鏈寚鏄�",
-                value: "UNKNOWN",
-              },
-            ],
+                value: "UNKNOWN"
+              }
+            ]
           },
           {
             type: "input",
             label: "瀹樿亴",
             name: "office",
-            value: "",
+            value: ""
           },
           {
             type: "select",
@@ -114,43 +113,43 @@
             options: [
               {
                 label: "鏈寚鏄�",
-                value: "UNKNOWN",
+                value: "UNKNOWN"
               },
               {
                 label: "鐢�",
-                value: "MALE",
+                value: "MALE"
               },
               {
                 label: "濂�",
-                value: "WOMAN",
-              },
-            ],
+                value: "WOMAN"
+              }
+            ]
           },
           {
             type: "input",
             label: "鏃舵湡",
             name: "period",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "鏈烘瀯",
             name: "inst",
-            value: "",
+            value: ""
           },
           {
             type: "number",
             label: "椤电爜",
             name: "page",
-            value: "",
+            value: ""
           },
           {
             type: "number",
             label: "椤靛ぇ灏�",
             name: "pageSize",
-            value: "",
-          },
-        ],
+            value: ""
+          }
+        ]
       },
       // 涓嬮潰鐨勬湞浠�1
       dynastyColor: 1,
@@ -159,79 +158,79 @@
         {
           name: "澶忔湞",
           coord: "2070BC",
-          id: 1,
+          id: 1
         },
         {
           name: "鍟嗘湞",
           id: 2,
-          coord: "1600BC",
+          coord: "1600BC"
         },
         {
           name: "瑗垮懆",
           id: 3,
-          coord: "1600BC",
+          coord: "1600BC"
         },
         {
           name: "鏄ョ鎴樺浗",
           id: 4,
-          coord: "770BC",
+          coord: "770BC"
         },
         {
           name: "绉︽湞",
           id: 5,
-          coord: "221BC",
+          coord: "221BC"
         },
         {
           name: "姹夋湞",
           id: 6,
-          coord: "202BC",
+          coord: "202BC"
         },
         {
           name: "涓夊浗涓ゆ檵鍗楀寳鏈�",
           id: 7,
-          coord: "184",
+          coord: "184"
         },
         {
           name: "闅嬫湞",
           id: 8,
-          coord: "581",
+          coord: "581"
         },
         {
           name: "鍞愭湞",
           id: 9,
-          coord: "618",
+          coord: "618"
         },
         {
           name: "浜斾唬鍗佸浗",
           id: 10,
-          coord: "907",
+          coord: "907"
         },
         {
           name: "杈藉閲�",
           id: 11,
-          coord: "907",
+          coord: "907"
         },
         {
           name: "瀹嬫湞",
           id: 12,
-          coord: "960",
+          coord: "960"
         },
         {
           name: "鍏冩湞",
           id: 13,
-          coord: "1271",
+          coord: "1271"
         },
 
         {
           name: "鏄庢湞",
           id: 14,
-          coord: "1368",
+          coord: "1368"
         },
         {
           name: "娓呮湞",
           id: 15,
-          coord: "1636",
-        },
+          coord: "1636"
+        }
       ],
       // 鐑棬鎼滅储
       hotKeyList: [],
@@ -242,7 +241,7 @@
       // 浜虹墿淇℃伅
       infoOfPersons: [],
       // 褰撳墠浜虹墿淇℃伅
-      ownInfo: null,
+      ownInfo: null
     };
   },
   mounted() {
@@ -271,7 +270,7 @@
           relationTypeName: ele.relationTypeName,
           name1: this.ownInfo?.NAME[0]?.content1,
           name2: personInfo?.NAME[0]?.content1,
-          category: type,
+          category: type
         };
         newArr.push(obj);
         if (ele[str] && ele[str]?.length) {
@@ -332,20 +331,20 @@
                   this.nodes.push({
                     name: item.name1,
                     id: item.id1,
-                    ...item,
+                    ...item
                   });
                 }
                 if (item.name2 && exists2 !== true) {
                   this.nodes.push({
                     name: item.name2,
                     id: item.id2,
-                    ...item,
+                    ...item
                   });
                 }
                 let obj = {
                   source: item.name1,
                   target: item.name2,
-                  relation: item.relationTypeName || "", // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
+                  relation: item.relationTypeName || "" // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
                 };
                 this.relationships.push(obj);
               });
@@ -430,8 +429,8 @@
                 borderRadius: 30,
                 position: "middle", // 璁剧疆鏍囩鏂囨湰鍦ㄧ嚎鐨勪腑闂翠綅缃笂灞呬腑鏄剧ず
                 // z: -1, // 璁剧疆鏍囩鐨剒杞撮珮搴︼紝浣垮叾姣旇繛鎺ョ嚎鏇撮珮
-                distance: -10, // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
-              },
+                distance: -10 // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
+              }
             });
           }
         }
@@ -441,11 +440,11 @@
         return {
           name: node.name,
           id: node.id,
-          itemStyle: {
-            color: "#eae0eb", // 鍙互鏍规嵁绱㈠紩璁剧疆涓嶅悓鐨勯鑹�
-            borderWidth: BorderWidth,
-            borderColor: "#996f9f",
-          },
+          // itemStyle: {
+          //   color: "#eae0eb", // 鍙互鏍规嵁绱㈠紩璁剧疆涓嶅悓鐨勯鑹�
+          //   borderWidth: BorderWidth,
+          //   borderColor: "#996f9f"
+          // }
         };
       });
 
@@ -461,15 +460,15 @@
           // },
           subtextStyle: {
             fontSize: FontSize, // 璁剧疆鍓爣棰樻枃瀛楀ぇ灏忎负 14px
-            color: "#2C2C2C",
-          },
+            color: "#2C2C2C"
+          }
         },
         backgroundColor: {
           type: "image",
           image: "/static/image/characterRelationBg.png",
           // repeat: 'repeat-x', // 鏄惁骞抽摵锛屽彲浠ユ槸 'repeat-x', 'repeat-y', 'no-repeat'
           size: "100% 100%", // 鑳屾櫙鍥剧墖鐨勫昂瀵革紝鍙互鏄櫨鍒嗘瘮鎴栬�呭儚绱�
-          position: "center center", // 鑳屾櫙鍥剧墖鐨勪綅缃紝鍙互鏄� top, bottom, middle 鎴栬�呯櫨鍒嗘瘮
+          position: "center center" // 鑳屾櫙鍥剧墖鐨勪綅缃紝鍙互鏄� top, bottom, middle 鎴栬�呯櫨鍒嗘瘮
         },
         tooltip: {},
         legend: [
@@ -477,60 +476,30 @@
             // selectedMode: 'single',
             data: this.categories.map(function (a) {
               return a.name;
-            }),
-          },
+            })
+          }
         ],
         animationDurationUpdate: 1500,
         animationEasingUpdate: "quinticInOut",
         series: [
-          {
-            type: "graph",
-            layout: "force",
-            roam: true,
-            symbolSize: SymbolSize, // 璋冩暣鑺傜偣澶у皬
-            label: {
-              show: true,
-              color: "black", // 璁剧疆鑺傜偣鏂囧瓧棰滆壊涓洪粦鑹�
-              fontSize: FontSize, // 璁剧疆鏂囧瓧澶у皬
-            },
-            edgeSymbol: ["circle", "arrow"],
-            edgeSymbolSize: [4, 10],
-            data: nodeData,
-            links: links,
-            categories: this.categories,
-            lineStyle: {
-              opacity: 0.9,
-              width: 2,
-              curveness: 0.3,
-            },
-            emphasis: {
-              focus: "adjacency",
-              lineStyle: {
-                width: 10,
-              },
-            },
-            force: {
-              // layoutAnimation: false,
-              // friction: 1,
-              repulsion: 800,
-              edgeLength: 400,
-            },
-          },
           // {
-          //   name: "Les Miserables",
           //   type: "graph",
-          //   legendHoverLink: false,
-          //   layout: "none",
-          //   data: nodeData,
-          //   links: links,
-          //   categories: this.categories,
+          //   layout: "force",
           //   roam: true,
+          //   symbolSize: SymbolSize, // 璋冩暣鑺傜偣澶у皬
           //   label: {
-          //     position: "right",
-          //     formatter: "{b}",
+          //     show: true,
+          //     color: "black", // 璁剧疆鑺傜偣鏂囧瓧棰滆壊涓洪粦鑹�
+          //     fontSize: FontSize, // 璁剧疆鏂囧瓧澶у皬
           //   },
+          //   edgeSymbol: ["circle", "arrow"],
+          //   edgeSymbolSize: [4, 10],
+          //   data: nodeData,
+          //   links,
+          //   categories: this.categories,
           //   lineStyle: {
-          //     color: "source",
+          //     opacity: 0.9,
+          //     width: 2,
           //     curveness: 0.3,
           //   },
           //   emphasis: {
@@ -539,11 +508,41 @@
           //       width: 10,
           //     },
           //   },
+          //   force: {
+          //     // layoutAnimation: false,
+          //     // friction: 1,
+          //     repulsion: 800,
+          //     edgeLength: 400,
+          //   },
           // },
-        ],
+          {
+            name: "Les Miserables",
+            type: "graph",
+            legendHoverLink: false,
+            layout: 'force',
+            data: nodeData,
+            links: links,
+            categories: this.categories,
+            roam: true,
+            label: {
+              position: "right",
+              formatter: "{b}"
+            },
+            lineStyle: {
+              color: "source",
+              curveness: 0.3
+            },
+            emphasis: {
+              focus: "adjacency",
+              lineStyle: {
+                width: 10
+              }
+            }
+          }
+        ]
       };
       // 灏嗙敓鎴愮殑杩炴帴绾挎坊鍔犲埌echarts鍥捐〃鐨刼ption涓�
-      option.series[0].links = links;
+      // option.series[0].links = links;
       // 璁剧疆鐐瑰嚮浜嬩欢鐩戝惉
       myChart.off("click");
       myChart.on("click", (params) => {
@@ -551,7 +550,8 @@
           this.spaceTimeArr(params.data.id);
         }
       });
-      option && myChart.setOption(option);
+      console.log(option, "option");
+      myChart.setOption(option);
     },
     // 鍩虹鎼滅储
     onSearch(val, index) {
@@ -569,28 +569,28 @@
       getAdvanceSearch({
         ...val,
         page: 1,
-        pageSize: 100,
+        pageSize: 100
       }).then((res) => {
         console.log(res, "res");
       });
     },
     advancedSearchBack() {
       uni.navigateTo({
-        url: "/pages/knowledgeBase/knowledgeBase",
+        url: "/pages/knowledgeBase/knowledgeBase"
       });
     },
     // 鐐瑰嚮涓嬮潰鐨勬湞浠f寜閽�
     dynastyBottomClick(item) {
       this.dynastyColor = item.id;
       this.onSearch({
-        text: item.name,
+        text: item.name
       });
     },
     // 鍏崇郴鍥� 鐐瑰嚮閲岄潰鐨勫厓绱�
     spaceTimeArr(id) {
       // 鍏崇郴鍥剧殑鏁版嵁
       uni.navigateTo({
-        url: "/pages/character/detail?id=" + id,
+        url: "/pages/character/detail?id=" + id
       });
     },
     // 鑾峰彇鏈濅唬echarts鐨勬暟鎹�
@@ -629,19 +629,23 @@
           const options = res.object.occupationStatistic.details.map(
             (item) => ({
               label: item.tagName,
-              value: item.tagId.toString(), // 灏� id 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 value 绫诲瀷涓�鑷�
+              value: item.tagId.toString() // 灏� id 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 value 绫诲瀷涓�鑷�
             })
           );
           // 鏇存柊鑱屼笟瀛楁鐨� options 灞炴��
           this.$set(this.From.from[professionIndex], "options", options);
         }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 
 <style>
+#relatio {
+  width: 100%;
+  height: 100%;
+}
 @media screen and (min-width: 2560px) and (max-width: 3840px) {
 }
 

--
Gitblit v1.9.1