From cda2f5263a6d2e6c8475f396bca4bd38dc29bb3b Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期五, 19 七月 2024 18:39:28 +0800
Subject: [PATCH] 1

---
 src/pages/academicSchools/index.vue |  317 +++++++++++-----------------------------------------
 1 files changed, 68 insertions(+), 249 deletions(-)

diff --git a/src/pages/academicSchools/index.vue b/src/pages/academicSchools/index.vue
index 303a67c..edb01c5 100644
--- a/src/pages/academicSchools/index.vue
+++ b/src/pages/academicSchools/index.vue
@@ -4,30 +4,40 @@
   >
     <headNav :idIndex="'6'" text="瀛︽湳娴佹淳" />
     <!-- 楂樼骇鎼滅储 -->
-    <view style="margin-top: 0.1rem">
+    <view style="margin-left: 0.6rem; margin-top: 0.1rem; display: flex">
       <advancedSearch
         @onSearch="onSearch"
-        @onSubmit="onSubmit"
-        :from="From"
         placehold="璇疯緭鍏ュ叧閿瓧"
+        :isAvancedTrue="false"
         :keyword="searchKey"
-        :advancedSearchBack="advancedSearchBack"
       />
+      <view
+        @click="isAvancedClick"
+        style="
+          color: #244a7b;
+          cursor: pointer;
+          font-size: 0.12rem;
+          margin-left: 0.35rem;
+          line-height: 0.58rem;
+        "
+        >楂樼骇鎼滅储 {{ isAdvancedSearch ? "鈭�" : "鈭�" }}</view
+      >
+      <!-- 鐑棬鎼滅储 -->
+      <view class="flex flex-center hotSearch" style="margin-left: 2rem">
+        鐑棬鎼滅储锛�
+        <ul class="flex" style="margin-right: 10rpx">
+          <li
+            @click="onSearch({ text: item }, index)"
+            :class="{ cursor: true, active: hotAciveIndex === index }"
+            v-for="(item, index) in hotKeyList"
+            :key="item"
+          >
+            {{ item }}
+          </li>
+        </ul>
+      </view>
     </view>
-    <!-- 鐑棬鎼滅储 -->
-    <view class="flex flex-center hotSearch">
-      鐑棬鎼滅储锛�
-      <ul class="flex" style="margin-right: 10rpx">
-        <li
-          @click="onSearch({ text: item }, index)"
-          :class="{ cursor: true, active: hotAciveIndex === index }"
-          v-for="(item, index) in hotKeyList"
-          :key="item"
-        >
-          {{ item }}
-        </li>
-      </ul>
-    </view>
+
     <!-- 鍏崇郴琛ㄥ湴鍥� -->
     <div
       id="relation"
@@ -69,7 +79,7 @@
 import {
   getPersonData,
   getHotSearch,
-  getPDataStatistics,
+  getPDataStatistics
 } from "@/api/index.js";
 import * as echarts from "echarts";
 export default {
@@ -82,172 +92,6 @@
       nodes: [],
       // echarts涓よ�呯殑鍏崇郴
       relationships: [],
-      // 楂樼骇鎼滅储
-      From: {
-        from: [
-          {
-            type: "input",
-            label: "濮撳悕",
-            name: "name",
-            value: "",
-          },
-          {
-            type: "input",
-            label: "鍒悕",
-            name: "alias",
-            value: "",
-          },
-          {
-            type: "input",
-            label: "绫嶈疮",
-            name: "location",
-            value: "",
-          },
-          {
-            type: "select",
-            label: "鑱屼笟",
-            name: "sdId",
-            value: "",
-            options: [
-              {
-                label: "鏈寚鏄�",
-                value: "UNKNOWN",
-              },
-            ],
-          },
-          {
-            type: "input",
-            label: "瀹樿亴",
-            name: "office",
-            value: "",
-          },
-          {
-            type: "select",
-            label: "鎬у埆",
-            value: "",
-            name: "genderTypeEO",
-            options: [
-              {
-                label: "鏈寚鏄�",
-                value: "UNKNOWN",
-              },
-              {
-                label: "鐢�",
-                value: "MALE",
-              },
-              {
-                label: "濂�",
-                value: "WOMAN",
-              },
-            ],
-          },
-          {
-            type: "input",
-            label: "鏃舵湡",
-            name: "period",
-            value: "",
-          },
-          {
-            type: "input",
-            label: "鏈烘瀯",
-            name: "inst",
-            value: "",
-          },
-          {
-            type: "number",
-            label: "椤电爜",
-            name: "page",
-            value: "",
-          },
-          {
-            type: "number",
-            label: "椤靛ぇ灏�",
-            name: "pageSize",
-            value: "",
-          },
-        ],
-      },
-      // 涓嬮潰鐨勬湞浠�1
-      dynastyColor: 1,
-      // 鏈濅唬
-      dynasty: [
-        {
-          name: "澶忔湞",
-          coord: "2070BC",
-          id: 1,
-        },
-        {
-          name: "鍟嗘湞",
-          id: 2,
-          coord: "1600BC",
-        },
-        {
-          name: "瑗垮懆",
-          id: 3,
-          coord: "1600BC",
-        },
-        {
-          name: "鏄ョ鎴樺浗",
-          id: 4,
-          coord: "770BC",
-        },
-        {
-          name: "绉︽湞",
-          id: 5,
-          coord: "221BC",
-        },
-        {
-          name: "姹夋湞",
-          id: 6,
-          coord: "202BC",
-        },
-        {
-          name: "涓夊浗涓ゆ檵鍗楀寳鏈�",
-          id: 7,
-          coord: "184",
-        },
-        {
-          name: "闅嬫湞",
-          id: 8,
-          coord: "581",
-        },
-        {
-          name: "鍞愭湞",
-          id: 9,
-          coord: "618",
-        },
-        {
-          name: "浜斾唬鍗佸浗",
-          id: 10,
-          coord: "907",
-        },
-        {
-          name: "杈藉閲�",
-          id: 11,
-          coord: "907",
-        },
-        {
-          name: "瀹嬫湞",
-          id: 12,
-          coord: "960",
-        },
-        {
-          name: "鍏冩湞",
-          id: 13,
-          coord: "1271",
-        },
-
-        {
-          name: "鏄庢湞",
-          id: 14,
-          coord: "1368",
-        },
-        {
-          name: "娓呮湞",
-          id: 15,
-          coord: "1636",
-        },
-      ],
       // 鐑棬鎼滅储
       hotKeyList: [],
       searchKey: "",
@@ -261,8 +105,9 @@
       // 褰撳墠浜虹墿淇℃伅
       ownInfo: null,
       detailData: {
-        name: "",
+        name: ""
       },
+      isAdvancedSearch: false
     };
   },
   mounted() {
@@ -271,7 +116,6 @@
     this.hotSearch();
     // 鐩戝惉绐楀彛澶у皬鍙樺寲
     window.addEventListener("resize", this.relation);
-    this.innt();
   },
   onLoad(options) {
     this.searchKey = options.keyword;
@@ -292,7 +136,7 @@
             relationTypeName: ele.relationTypeName,
             parentName: parent?.NAME[0]?.content1 ?? parent.parentName,
             name2: personInfo?.NAME[0]?.content1,
-            category: type,
+            category: type
           };
           if (str == "literatureList") {
             obj.relationTypeName = ele.literatureName;
@@ -391,7 +235,7 @@
               const data = item[str]?.map((e) => {
                 return {
                   ...e,
-                  personId: item.personId,
+                  personId: item.personId
                 };
               });
               if (data?.length) {
@@ -531,7 +375,7 @@
             ...literature,
             ...social,
             ...place,
-            ...school,
+            ...school
           ];
           // const k = personData.filter((item) => item.category == 0);
           // const t = personData.filter((item) => item.category == 1);
@@ -554,20 +398,20 @@
               this.nodes.push({
                 name: item.parentName,
                 id: item.parentId,
-                ...item,
+                ...item
               });
             }
             if (item.name2 && exists2 !== true) {
               this.nodes.push({
                 name: item.name2,
                 id: item.id2,
-                ...item,
+                ...item
               });
             }
             let obj = {
               source: item.parentName,
               target: item.name2,
-              relation: item.relationTypeName || "", // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
+              relation: item.relationTypeName || "" // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
             };
             this.relationships.push(obj);
           });
@@ -635,8 +479,8 @@
                 borderRadius: 30,
                 position: "middle", // 璁剧疆鏍囩鏂囨湰鍦ㄧ嚎鐨勪腑闂翠綅缃笂灞呬腑鏄剧ず
                 // z: -1, // 璁剧疆鏍囩鐨剒杞撮珮搴︼紝浣垮叾姣旇繛鎺ョ嚎鏇撮珮
-                distance: -10, // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
-              },
+                distance: -10 // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
+              }
             });
           }
         }
@@ -649,7 +493,7 @@
           type: "image",
           image: "/static/image/characterRelationBg.png",
           size: "100% 100%", // 鑳屾櫙鍥剧墖鐨勫昂瀵革紝鍙互鏄櫨鍒嗘瘮鎴栬�呭儚绱�
-          position: "center center", // 鑳屾櫙鍥剧墖鐨勪綅缃紝鍙互鏄� top, bottom, middle 鎴栬�呯櫨鍒嗘瘮
+          position: "center center" // 鑳屾櫙鍥剧墖鐨勪綅缃紝鍙互鏄� top, bottom, middle 鎴栬�呯櫨鍒嗘瘮
         },
         tooltip: {},
         legend: [
@@ -659,8 +503,8 @@
             orient: "vertical",
             data: this.categories.map(function (a) {
               return a.name;
-            }),
-          },
+            })
+          }
         ],
         series: [
           {
@@ -675,31 +519,31 @@
             label: {
               show: true,
               position: "right",
-              formatter: "{b}",
+              formatter: "{b}"
             },
             labelLayout: {
-              hideOverlap: true,
+              hideOverlap: true
             },
             scaleLimit: {
               min: 0.4,
-              max: 2,
+              max: 2
             },
             lineStyle: {
               color: "source",
-              curveness: 0.2,
+              curveness: 0.2
             },
             emphasis: {
               focus: "adjacency",
               lineStyle: {
-                width: 5,
-              },
+                width: 5
+              }
             },
             force: {
               repulsion: 600,
-              edgeLength: 300,
-            },
-          },
-        ],
+              edgeLength: 300
+            }
+          }
+        ]
       };
       // 璁剧疆鐐瑰嚮浜嬩欢鐩戝惉
       myChart.off("click");
@@ -741,7 +585,7 @@
             i += 1;
             return e["content" + i];
           }).join("銆�") ?? "",
-        biography: data?.BIOGRAPHY ?? "",
+        biography: data?.BIOGRAPHY ?? ""
       };
       this.detailData = obj;
     },
@@ -759,33 +603,18 @@
       }
       this.getData(val.text);
     },
-    // 楂樼骇鎼滅储
-    onSubmit(val) {
-      getAdvanceSearch({
-        ...val,
-        page: 1,
-        pageSize: 100,
-      }).then((res) => {
-        console.log(res, "res");
-      });
-    },
-    advancedSearchBack() {
-      uni.navigateTo({
-        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鐨勬暟鎹�
@@ -811,28 +640,18 @@
         });
       });
     },
-
-    // 楂樼骇鎼滅储閲岄潰鑱屼笟鐨勪笅鎷夎彍鍗�
-    innt() {
-      getPDataStatistics().then((res) => {
-        const professionIndex = this.From.from.findIndex(
-          (field) => field.label === "鑱屼笟"
-        );
-        // 濡傛灉鎵惧埌浜嗚亴涓氬瓧娈�
-        if (professionIndex !== -1) {
-          // 灏� profession.list 杞崲涓� options 鏍煎紡
-          const options = res.object.occupationStatistic.details.map(
-            (item) => ({
-              label: item.tagName,
-              value: item.tagId.toString(), // 灏� id 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 value 绫诲瀷涓�鑷�
-            })
-          );
-          // 鏇存柊鑱屼笟瀛楁鐨� options 灞炴��
-          this.$set(this.From.from[professionIndex], "options", options);
-        }
-      });
+    isAvancedClick() {
+      this.isAdvancedSearch = !this.isAdvancedSearch;
+      // this.$nextTick(() => {
+      //   var box1Height = document.querySelector(".fbox").offsetHeight;
+      //   // let box2Height= document.querySelector('.fbox1').style.height = box1Height + 'px';
+      //   let box2Height = document.querySelector(".fbox1").offsetHeight;
+      //   if (box1Height <= box2Height) {
+      //     document.querySelector(".fbox1").style.height = box1Height + "px";
+      //   }
+      // });
     },
-  },
+  }
 };
 </script>
 
@@ -926,8 +745,8 @@
     color: #244a7b;
     margin: 0 0.1rem;
     color: #244a7b;
-    &.active{
-      color: #027EDC;
+    &.active {
+      color: #027edc;
       font-weight: bold;
     }
   }

--
Gitblit v1.9.1