From 12d99c9a0dc366df61e10101b3e0821e1add6adb Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期二, 23 七月 2024 17:40:13 +0800
Subject: [PATCH] 1

---
 src/pages/academicSchools/index.vue |  270 +++++++++++++++++++++++++++++------------------------
 1 files changed, 146 insertions(+), 124 deletions(-)

diff --git a/src/pages/academicSchools/index.vue b/src/pages/academicSchools/index.vue
index 620dd0d..8ecc0ed 100644
--- a/src/pages/academicSchools/index.vue
+++ b/src/pages/academicSchools/index.vue
@@ -6,7 +6,7 @@
     <!-- 楂樼骇鎼滅储 -->
     <view
       style="
-        margin-left: 0.6rem;
+        padding-left: 0.6rem;
         margin-top: 0.1rem;
         display: flex;
         position: relative;
@@ -43,12 +43,86 @@
           </li>
         </ul>
       </view>
-      <view v-if="isAdvancedSearch">
-        <h3>楂樼骇鎼滅储</h3>
-        <MyForm @submit="onSubmit" :from="searchFrom" />
+      <view v-if="isAdvancedSearch" class="searchDialog">
+        <h3 style="margin-bottom: 0.2rem">楂樼骇鎼滅储</h3>
+        <el-form  label-width="100px" :model="formData" size="mini">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="濮撳悕/鍒悕锛�">
+                <el-input v-model="formData.name"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="娲诲姩鍦帮細">
+                <el-select
+                  style="width: 100%"
+                  v-model="formData.actively"
+                  placeholder="璇烽�夋嫨娲诲姩鍦�"
+                >
+                  <!-- <el-option label="鍖哄煙涓�" value="shanghai"></el-option> -->
+                  <!-- <el-option label="鍖哄煙浜�" value="beijing"></el-option> -->
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="浣滃搧锛�">
+                <el-input v-model="formData.works"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="浜虹墿鏍囩锛�">
+                <el-select
+                  style="width: 100%"
+                  v-model="formData.personTags"
+                  placeholder="璇烽�夋嫨浜虹墿鏍囩"
+                >
+                  <!-- <el-option label="鍖哄煙涓�" value="shanghai"></el-option> -->
+                  <!-- <el-option label="鍖哄煙浜�" value="beijing"></el-option> -->
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="绀句細韬唤锛�">
+                <el-select
+                  style="width: 100%"
+                  v-model="formData.socialIdentity"
+                  placeholder="璇烽�夋嫨绀句細韬唤"
+                >
+                  <!-- <el-option label="鍖哄煙涓�" value="shanghai"></el-option> -->
+                  <!-- <el-option label="鍖哄煙浜�" value="beijing"></el-option> -->
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="鏃舵湡锛�">
+                <el-select
+                  style="width: 100%"
+                  v-model="formData.period"
+                  placeholder="璇烽�夋嫨鏃舵湡"
+                >
+                  <!-- <el-option label="鍖哄煙涓�" value="shanghai"></el-option> -->
+                  <!-- <el-option label="鍖哄煙浜�" value="beijing"></el-option> -->
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div style="text-align: right">
+          <el-button type="primary" size="mini">鎼滅储</el-button>
+          <el-button size="mini">閲嶇疆</el-button>
+        </div>
       </view>
       <div v-if="showPerson" class="personDialog">
-        <i class="el-icon-circle-close closeBtn" @click="()=>{showPerson = false}"></i>
+        <i
+          class="el-icon-circle-close closeBtn"
+          @click="
+            () => {
+              showPerson = false;
+            }
+          "
+        ></i>
         <el-table :data="personList" style="width: 100%">
           <el-table-column prop="name" label="濮撳悕">
             <template slot-scope="scope">
@@ -127,10 +201,9 @@
   getPersonData,
   getHotSearch,
   getPDataStatistics,
-  academicSearch
+  academicSearch,
 } from "@/api/index.js";
 import * as echarts from "echarts";
-import MyForm from "@/components/form/form.vue";
 export default {
   data() {
     return {
@@ -154,54 +227,24 @@
       // 褰撳墠浜虹墿淇℃伅
       ownInfo: null,
       detailData: {
-        name: ""
+        name: "",
       },
       isAdvancedSearch: false,
-      searchFrom: [
-        {
-          type: "input",
-          label: "濮撳悕/鍒悕",
-          name: "name",
-          value: ""
-        },
-        {
-          type: "input",
-          label: "娲诲姩鍦�",
-          name: "address",
-          value: ""
-        },
-        {
-          type: "input",
-          label: "浣滃搧",
-          name: "address",
-          value: ""
-        },
-        {
-          type: "input",
-          label: "浜虹墿鏍囩",
-          name: "address",
-          value: ""
-        },
-        {
-          type: "input",
-          label: "绀句細韬唤",
-          name: "address",
-          value: ""
-        },
-        {
-          type: "input",
-          label: "鏃舵湡",
-          name: "address",
-          value: ""
-        }
-      ],
+      formData: {
+        name: "",
+        actively: "",
+        works: "",
+        personTags: "",
+        socialIdentity: "",
+        period: ""
+      },
       showPerson: false,
       personList: [],
       personPageInfo: {
         totalCount: 0,
         page: 1,
-        limit: 10
-      }
+        limit: 10,
+      },
     };
   },
   mounted() {
@@ -226,12 +269,11 @@
           const obj = {
             personId: ele.personId,
             parentId: parent.id,
-            id2: personInfo.id,
             relationTypeName: ele.relationTypeName,
             parentName: parent?.NAME[0]?.content1 ?? parent.parentName,
-            name2: personInfo?.NAME[0]?.content1,
+            name: personInfo?.NAME[0]?.content1,
             category: type,
-            symbolSize: 15
+            symbolSize: 15,
           };
           if (order > 80) {
             order = 80;
@@ -327,16 +369,16 @@
         if (!ele.personId && ele.personList?.length) {
           ele.literatureList = [];
           ele.personId = this.ownInfo.id;
-          if (ele[str] && ele[str]?.length) {
-            for (let j = 0; j < ele.personList.length; j++) {
-              const item = ele.personList[j];
+          if (ele["personList"] && ele["personList"]?.length) {
+            for (let j = 0; j < ele["personList"].length; j++) {
+              const item = ele["personList"][j];
               const data = item[str]?.map((e) => {
                 return {
                   ...e,
-                  personId: item.personId
+                  personId: item.personId,
                 };
               });
-              if (data?.length) {
+              if (ele[str] && data?.length) {
                 ele[str].push(...data);
               }
             }
@@ -345,6 +387,8 @@
       }
       return arr;
     },
+
+    // 鏂囩尞
 
     //鏁扮粍鍘婚噸
     deduplicateArray(arr, idKey) {
@@ -370,6 +414,7 @@
     getData() {
       this.loading = true;
       getPersonData(this.currentId).then((res) => {
+        console.log(res,'res')
         this.nodes = [];
         this.relationships = [];
         let kinData = [];
@@ -381,6 +426,7 @@
         if (res && res.success && res.object) {
           this.infoOfPersons = res.object?.infoOfPersons;
           this.infoOfSchools = res.object?.infoOfSchools;
+          console.log(res.object);
           if (res.object?.personChain) {
             this.ownInfo = this.infoOfPersons.find(
               (item) => item.id == res.object?.personChain.personId
@@ -428,7 +474,6 @@
                 this.ownInfo
               );
               literature = [...newArr];
-              // console.log(literature, "literature");
             }
             if (obj.socialList?.length) {
               let newArr = [];
@@ -472,44 +517,19 @@
             ...literature,
             ...social,
             ...place,
-            ...school
+            ...school,
           ];
-          console.log(personData);
-          // const k = personData.filter((item) => item.category == 0);
-          // const t = personData.filter((item) => item.category == 1);
-          // const l = personData.filter((item) => item.category == 2);
-          // const o = personData.filter((item) => item.category == 3);
-          // const p = personData.filter((item) => item.category == 4);
-          // const s = personData.filter((item) => item.category == 5);
-          // const nodesList = [...k, ...t, ...l, ...o, ...p, ...s];
-          
+
           personData.forEach((item) => {
-            let exists1 = this.nodes.some(
-              (node) =>
-                node.id === item.parentId && node.name === item.parentName
-            );
-            let exists2 = this.nodes.some(
-              (node) => node.id === item.parentId && node.name === item.name2
-            );
-            // 璇佹槑涓嶅瓨鍦�
-            if (item.name1 && exists1 !== true) {
-              this.nodes.push({
-                name: item.parentName,
-                id: item.parentId,
-                ...item
-              });
-            }
-            if (item.name2 && exists2 !== true) {
-              this.nodes.push({
-                name: item.name2,
-                id: item.id2,
-                ...item
-              });
-            }
+            this.nodes.push({
+              name: item.name,
+              id: item.personId,
+              ...item,
+            });
             let obj = {
               source: item.parentName,
-              target: item.name2,
-              relation: item.relationTypeName || "" // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
+              target: item.name,
+              relation: item.relationTypeName || "", // 濡傛灉瀛樺湪 relationName 瀛楁鍒欎娇鐢紝鍚﹀垯涓虹┖瀛楃涓�
             };
             this.relationships.push(obj);
           });
@@ -539,7 +559,7 @@
         }
         return {
           ...item,
-          symbolSize: size > 80 ? 80 : size
+          symbolSize: size > 80 ? 80 : size,
         };
       });
 
@@ -568,7 +588,7 @@
       var links = [];
       relationships.forEach((relationship, i) => {
         var sourceIndex = nodes.findIndex(
-          (node) => node.name === relationship.source
+          (node) => node.parentName === relationship.source
         );
         var targetIndex = nodes.findIndex(
           (node) => node.name === relationship.target
@@ -594,25 +614,16 @@
                 borderRadius: 30,
                 position: "middle", // 璁剧疆鏍囩鏂囨湰鍦ㄧ嚎鐨勪腑闂翠綅缃笂灞呬腑鏄剧ず
                 // z: -1, // 璁剧疆鏍囩鐨剒杞撮珮搴︼紝浣垮叾姣旇繛鎺ョ嚎鏇撮珮
-                distance: -10 // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
-              }
+                distance: -10, // 灏嗘爣绛炬斁缃湪杩炴帴绾夸笂
+              },
             });
           }
         }
       });
       // 鏍规嵁nodes鍔ㄦ�佺敓鎴愯妭鐐规暟鎹�
       var nodeData = nodes;
-      console.log(nodeData);
-      console.log(links);
       var option;
       option = {
-        // backgroundColor: {
-        //   type: "image",
-        //   image: "/static/image/characterRelationBg.png",
-        //   size: "100% 100%", // 鑳屾櫙鍥剧墖鐨勫昂瀵革紝鍙互鏄櫨鍒嗘瘮鎴栬�呭儚绱�
-        //   position: "center center", // 鑳屾櫙鍥剧墖鐨勪綅缃紝鍙互鏄� top, bottom, middle 鎴栬�呯櫨鍒嗘瘮
-        // },
-        // tooltip: {},
         legend: [
           {
             left: 20,
@@ -620,8 +631,8 @@
             orient: "vertical",
             data: this.categories.map(function (a) {
               return a.name;
-            })
-          }
+            }),
+          },
         ],
         series: [
           {
@@ -636,28 +647,28 @@
             label: {
               show: true,
               position: "right",
-              formatter: "{b}"
+              formatter: "{b}",
             },
             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");
@@ -699,7 +710,7 @@
             i += 1;
             return e["content" + i];
           }).join("銆�") ?? "",
-        biography: data?.BIOGRAPHY ?? ""
+        biography: data?.BIOGRAPHY ?? "",
       };
       this.detailData = obj;
     },
@@ -728,7 +739,7 @@
       academicSearch({
         keyword: key,
         page: this.personPageInfo.page,
-        pageSize: this.personPageInfo.limit
+        pageSize: this.personPageInfo.limit,
       }).then((res) => {
         this.personList = res.list.map((item) => {
           return {
@@ -749,7 +760,7 @@
             division:
               item.medicalBranchList && item.medicalBranchList.length
                 ? item.medicalBranchList[0].content1
-                : "-"
+                : "-",
           };
         });
         this.showPerson = true;
@@ -759,7 +770,7 @@
     spaceTimeArr(id) {
       // 鍏崇郴鍥剧殑鏁版嵁
       uni.navigateTo({
-        url: "/pages/character/detail?id=" + id
+        url: "/pages/character/detail?id=" + id,
       });
     },
     // 鑾峰彇鏈濅唬echarts鐨勬暟鎹�
@@ -783,7 +794,7 @@
         this.hotKeyList = indexList.map((item) => {
           return {
             id: item,
-            name: res.object[item]
+            name: res.object[item],
           };
         });
       });
@@ -798,8 +809,8 @@
       //     document.querySelector(".fbox1").style.height = box1Height + "px";
       //   }
       // });
-    }
-  }
+    },
+  },
 };
 </script>
 
@@ -904,6 +915,17 @@
   }
 }
 
+.searchDialog {
+  position: absolute;
+  top: 0.68rem;
+  left: 0;
+  right: 0;
+  z-index: 999;
+  padding: 0.1rem 0.4rem;
+  background: #fff;
+  min-height: 2rem;
+}
+
 .personDialog {
   position: absolute;
   top: 0.68rem;
@@ -912,7 +934,7 @@
   background: #fff;
   border-radius: 6px;
   box-shadow: 0 0 10px -3px #000;
-  .closeBtn{
+  .closeBtn {
     position: absolute;
     right: -10px;
     top: -10px;
@@ -921,7 +943,7 @@
     font-size: 24px;
     background-color: #fff;
     border-radius: 50%;
-    color: #F56C6C;
+    color: #f56c6c;
     cursor: pointer;
   }
 }

--
Gitblit v1.9.1