From f3e5b489e30a921c03ef8b97e1cd845b65ea5d9d Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期三, 05 六月 2024 18:17:16 +0800
Subject: [PATCH] 1

---
 src/pages/character/detail.vue            |   12 ++++
 src/pages/character/index.vue             |   20 +++++-
 src/api/index.js                          |    8 ++
 src/pages/inherit/index.vue               |    3 
 src/pages/knowledgeBase/knowledgeBase.vue |  120 ++++++++++++++++++++++------------------
 5 files changed, 104 insertions(+), 59 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index 9c15377..42aaa5d 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -333,3 +333,11 @@
 export const getImg = (path) => {
   return baseUrl + "/picture/getImageByFilePath?filePath=" + path;
 };
+
+export const getRelationTypeTreeList = () => {
+  return req1({
+    url: "/personRelationType/getRelationTypeTreeList",
+    method: "post"
+  });
+};
+
diff --git a/src/pages/character/detail.vue b/src/pages/character/detail.vue
index 10fcf40..2333598 100644
--- a/src/pages/character/detail.vue
+++ b/src/pages/character/detail.vue
@@ -401,6 +401,7 @@
 import {
   getFuzzySearch,
   getPersonInfo,
+  getRelationTypeTreeList,
   getWebBasic,
   getIntroduction,
   getSource,
@@ -718,6 +719,10 @@
       });
     },
     getRelationship() {
+      getRelationTypeTreeList().then(res=>{
+        console.log(res,"getRelationTypeTreeList");
+        console.log(res);
+      })
       // getPersonRelationAtSchool({
       //   personId: this.detailId,
       // }).then((res) => {
@@ -731,6 +736,13 @@
       //     });
       //   }
       // });
+      getPersonInfo({
+        id: this.detailId,
+        type: "PERSON_RELATIONS"
+      }).then((res) => {
+        this.tableData4
+        console.log(res,"PERSON_RELATIONS");
+      });
       // 绀句細鍏崇郴
       getPersonRelationAtSchool({
         personId: this.detailId,
diff --git a/src/pages/character/index.vue b/src/pages/character/index.vue
index fe8ecf5..0055b31 100644
--- a/src/pages/character/index.vue
+++ b/src/pages/character/index.vue
@@ -19,9 +19,10 @@
       鐑棬鎼滅储锛�
       <ul class="flex" style="margin-right: 10rpx">
         <li
-          @click="onSearch({ text: item })"
-          class="cursor"
-          v-for="item in hotKeyList"
+          @click="onSearch({ text: item }, index)"
+          :class="{ cursor: true, active: hotAciveIndex === index }"
+          hotAciveIndex
+          v-for="(item, index) in hotKeyList"
           :key="item"
         >
           {{ item }}
@@ -106,6 +107,7 @@
   data() {
     return {
       loading: true,
+      hotAciveIndex: "",
       // echarts鏁版嵁
       nodes: [],
       // echarts涓よ�呯殑鍏崇郴
@@ -483,7 +485,13 @@
       option && myChart.setOption(option);
     },
     // 鍩虹鎼滅储
-    onSearch(val) {
+    onSearch(val, index) {
+      if (index !== undefined) {
+        this.searchKey = "";
+        this.hotAciveIndex = index;
+      } else {
+        this.hotAciveIndex = "";
+      }
       // this.searchKey = val.text;
       this.getData(val.text);
     },
@@ -593,6 +601,10 @@
     color: #244a7b;
     margin: 0 0.1rem;
     color: #244a7b;
+    &.active{
+      color: #027EDC;
+      font-weight: bold;
+    }
   }
 }
 </style>
diff --git a/src/pages/inherit/index.vue b/src/pages/inherit/index.vue
index 203d015..64c5077 100644
--- a/src/pages/inherit/index.vue
+++ b/src/pages/inherit/index.vue
@@ -252,8 +252,9 @@
               curveness: 0
             },
             force: {
+              layoutAnimation: false,
               // initLayout: 'circular',
-              // gravity: 0
+              // gravity: 0,
               friction: 0.1,
               repulsion: 500,
               edgeLength: 6
diff --git a/src/pages/knowledgeBase/knowledgeBase.vue b/src/pages/knowledgeBase/knowledgeBase.vue
index 74eb53c..638d85e 100644
--- a/src/pages/knowledgeBase/knowledgeBase.vue
+++ b/src/pages/knowledgeBase/knowledgeBase.vue
@@ -15,7 +15,7 @@
         class="advancedSea"
         @click="isAvancedClick"
         style="color: #244a7b; cursor: pointer"
-        >楂樼骇鎼滅储 {{isAdvancedSearch ? "鈭�" : "鈭�"}}</view
+        >楂樼骇鎼滅储 {{ isAdvancedSearch ? "鈭�" : "鈭�" }}</view
       >
     </view>
     <!-- 鐑棬鎼滅储 -->
@@ -77,15 +77,15 @@
               :style="{
                 background: profession.index === item.tagId ? '#d6e3f4' : '',
                 borderRadius: profession.index === item.tagId ? '60rpx' : '',
-                display: index + 1 > professionIndex ? 'none' : 'flex',
+                display: index + 1 > professionIndex ? 'none' : 'flex'
               }"
               v-for="(item, index) in profession.list"
               :key="index"
               style="padding: 0 20rpx; line-height: 0.3rem; height: 0.3rem"
               @click="handInstitCLick(item, 'a')"
             >
-              <view >{{ item.tagName }}</view>
-              <view >{{ item.count }}</view>
+              <view>{{ item.tagName }}</view>
+              <view>{{ item.count }}</view>
             </li>
           </ul>
           <view v-if="profession.list.length - 1 > 3" class="flex flex-center">
@@ -115,15 +115,15 @@
               :style="{
                 background: dynasty.index === item.dynastyId ? '#d6e3f4' : '',
                 borderRadius: dynasty.index === item.dynastyId ? '60rpx' : '',
-                display: index + 1 > dynastyIndex ? 'none' : 'flex',
+                display: index + 1 > dynastyIndex ? 'none' : 'flex'
               }"
               v-for="(item, index) in dynasty.list"
               :key="index"
               style="padding: 0 20rpx"
               @click="handInstitCLick(item, 'b')"
             >
-              <view >{{ item.dynastyName }}</view>
-              <view >{{ item.count }}</view>
+              <view>{{ item.dynastyName }}</view>
+              <view>{{ item.count }}</view>
             </li>
           </ul>
           <view v-if="dynasty.list.length - 1 > 3" class="flex flex-center">
@@ -160,7 +160,7 @@
               style="padding: 0 20rpx; color: #244a7b"
               @click="handInstitCLick(item, 'c')"
             >
-              <view >{{ index + 1 + ". " + item.source }}</view>
+              <view>{{ index + 1 + ". " + item.source }}</view>
             </li>
           </ul>
           <!-- 	<view class="flex flex-center">
@@ -182,12 +182,21 @@
         "
       >
         <view class="flex lightTop" style="width: 100%; margin: 0.1rem 0">
-          <view  style="color: #2c2c2c">鍏眥{ total }}鏉�</view>
+          <view style="color: #2c2c2c">鍏眥{ total }}鏉�</view>
           <el-button size="small" @click="exportClick">涓嬭浇</el-button>
         </view>
-        <el-table :data="tableData" class="lightBo" style="width: 100%" empty-text="鏆傛棤鎼滅储淇℃伅">
+        <el-table
+          :data="tableData"
+          class="lightBo"
+          style="width: 100%"
+          empty-text="鏆傛棤鎼滅储淇℃伅"
+        >
           <el-table-column prop="id" label="搴忓彿" width="110"></el-table-column>
-          <el-table-column prop="personName" label="濮撳悕"></el-table-column>
+          <el-table-column prop="personName" label="濮撳悕">
+            <template slot-scope="scope">
+              <a style="cursor: pointer;color: #027EDC;" @click="gotoDetail(scope.row.id)">{{ scope.row.personName }}</a>
+            </template>
+          </el-table-column>
           <el-table-column prop="personAlias" label="鍒悕"></el-table-column>
           <el-table-column
             prop="gender"
@@ -246,12 +255,12 @@
   getPDownload,
   getPList,
   getHotSearch,
-  getPersonList,
+  getPersonList
 } from "@/api/index.js";
 export default {
   components: {
     Footer1,
-    MyForm,
+    MyForm
   },
   data() {
     return {
@@ -264,19 +273,19 @@
             type: "input",
             label: "濮撳悕",
             name: "name",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "鍒悕",
             name: "alias",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "绫嶈疮",
             name: "nativePlace",
-            value: "",
+            value: ""
           },
           {
             type: "select",
@@ -286,19 +295,19 @@
             options: [
               {
                 label: "鍖诲",
-                value: "1",
+                value: "1"
               },
               {
                 label: "涓栧",
-                value: "2",
-              },
-            ],
+                value: "2"
+              }
+            ]
           },
           {
             type: "input",
             label: "鑱屽畼",
             name: "official",
-            value: "",
+            value: ""
           },
           {
             type: "select",
@@ -308,31 +317,31 @@
             options: [
               {
                 label: "鏈寚鏄�",
-                value: "UNKNOWN",
+                value: "UNKNOWN"
               },
               {
                 label: "鐢�",
-                value: "MALE",
+                value: "MALE"
               },
               {
                 label: "濂�",
-                value: "WOMAN",
-              },
-            ],
+                value: "WOMAN"
+              }
+            ]
           },
           {
             type: "input",
             label: "鏃堕棿",
             name: "dynasty",
-            value: "",
+            value: ""
           },
           {
             type: "input",
             label: "鏈烘瀯",
             name: "institution",
-            value: "",
-          },
-        ],
+            value: ""
+          }
+        ]
       },
 
       // 鐑棬鎼滅储
@@ -342,7 +351,7 @@
         title: "鑱屼笟",
         index: 0,
         id: 0,
-        list: [],
+        list: []
       },
       // 鐜板湪澶氬皯鏉¤亴涓氭暟鎹�
       professionIndex: 4,
@@ -353,7 +362,7 @@
         title: "鏃朵唬",
         id: "",
         index: "",
-        list: [],
+        list: []
       },
       // 鐜板湪澶氬皯鏉℃椂鏈熸暟鎹�
       dynastyIndex: 4,
@@ -362,7 +371,7 @@
         title: "鏉ユ簮",
         index: 0,
         id: 0,
-        list: [],
+        list: []
       },
       // 琛ㄦ牸鐨勬暟缁�
       tableData: [],
@@ -381,8 +390,8 @@
         nativePlace: "",
         tagId: "",
         official: "",
-        genderType: "",
-      },
+        genderType: ""
+      }
     };
   },
   onLoad(options) {
@@ -420,7 +429,7 @@
         institution: "", //鏈烘瀯
         bookId: null, //鏉ユ簮id
         page: 1,
-        pageSize: 1,
+        pageSize: 1
       };
       // // 鎼滅储
       await getPDownload(Obj).then((res) => {
@@ -443,7 +452,7 @@
             鍗掑勾: dataList[i].deathYear,
             绫嶈疮: dataList[i].nativePlace,
             绀句細韬唤: dataList[i].socialDistinction,
-            瀹樿亴: dataList[i].official,
+            瀹樿亴: dataList[i].official
           };
 
           dataTable.push(obj); //   璁剧疆excel姣忓垪鑾峰彇鐨勬暟鎹簮
@@ -469,7 +478,7 @@
             "鍗掑勾",
             "绫嶈疮",
             "绀句細韬唤",
-            "瀹樿亴",
+            "瀹樿亴"
           ],
           //   excel鏂囦欢鍒楀悕
           sheetFilter: [
@@ -483,26 +492,26 @@
             "鍗掑勾",
             "绫嶈疮",
             "绀句細韬唤",
-            "瀹樿亴",
-          ],
+            "瀹樿亴"
+          ]
           // columnWidths: ['10', '10', '20'] //excel鍒楀搴﹁缃�
-        },
+        }
       ];
       this.Ture();
     },
     // 鎺ュ彛
-    async getStatistics() {
+    getStatistics() {
       // 鐑棬鎼滅储
-      await getHotSearch().then((res) => {
+      getHotSearch().then((res) => {
         this.hot = Object.keys(res.object).map((key) => {
           return {
             id: parseInt(key),
-            name: res.object[key],
+            name: res.object[key]
           };
         });
       });
       // 鍙充晶鑱屼笟銆佹椂鏈熴�佹潵婧愮殑鏁版嵁
-      await getPDataStatistics().then((res) => {
+      getPDataStatistics().then((res) => {
         let totalCount1 = res.object.occupationStatistic.details.reduce(
           (total, item) => total + item.count,
           0
@@ -514,7 +523,7 @@
         // 鑱屼笟
         this.profession.list = [
           { count: totalCount1, tagName: "鍏ㄩ儴", tagId: 0 },
-          ...res.object.occupationStatistic.details,
+          ...res.object.occupationStatistic.details
         ];
         // 楂樼骇鎼滅储閲岄潰鐨勮亴涓�--------------------------------------------------
         // 鎵惧埌鑱屼笟瀛楁鍦� from 瀵硅薄涓殑绱㈠紩
@@ -526,7 +535,7 @@
           // 灏� profession.list 杞崲涓� options 鏍煎紡
           const options = this.profession.list.map((item) => ({
             label: item.tagName,
-            value: item.tagId.toString(), // 灏� id 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 value 绫诲瀷涓�鑷�
+            value: item.tagId.toString() // 灏� id 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 value 绫诲瀷涓�鑷�
           }));
 
           // 鏇存柊鑱屼笟瀛楁鐨� options 灞炴��
@@ -537,11 +546,16 @@
         // 鏃舵湡
         this.dynasty.list = [
           { count: totalCount2, dynastyName: "鍏ㄩ儴", dynastyId: "" },
-          ...res.object.dynastyStatistic.details,
+          ...res.object.dynastyStatistic.details
         ];
         // 鏉ユ簮
         this.source.list = res.object.sourceStatistic.details;
         this.source.index = this.source.list[0].bookId;
+      });
+    },
+    gotoDetail(id) {
+      uni.navigateTo({
+        url: "/pages/character/detail?id=" + id
       });
     },
     // 鐑棬鎼滅储
@@ -568,7 +582,6 @@
         this.CurrentPage = 1;
       }
       this.onSearch("");
-
     },
     isAvancedClick() {
       this.isAdvancedSearch = !this.isAdvancedSearch;
@@ -607,7 +620,7 @@
         institution: val.institution, //鏈烘瀯
         bookId: null, //鏉ユ簮id
         page: this.CurrentPage,
-        pageSize: this.pageSize,
+        pageSize: this.pageSize
       };
       // // 鎼滅储
       await getPersonList(Obj).then((res) => {
@@ -634,7 +647,7 @@
         institution: "", //鏈烘瀯
         bookId: this.source.id, //鏉ユ簮id
         page: this.CurrentPage,
-        pageSize: this.pageSize,
+        pageSize: this.pageSize
       };
       // // 鎼滅储
       await getPersonList(Obj).then((res) => {
@@ -657,7 +670,6 @@
     },
     // 灞曞紑鏀剁缉
     shrinkClick(box, name) {
-
       // this.activeBox = this.activeBox === 'a' ? null : 'a';
       if (name == "鑱屼笟") {
         this.professionIndex =
@@ -695,8 +707,8 @@
         this.CurrentPage = val;
         this.onSearch("");
       }
-    },
-  },
+    }
+  }
 };
 </script>
 

--
Gitblit v1.9.1