From b8f0a1e03704d02eb6b4bd0cdb14b71f4cb13d35 Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期五, 19 五月 2023 11:14:24 +0800
Subject: [PATCH] 修改了家跟网相关内容

---
 ruoyi-ui/src/views/genealogy/index.vue |  100 +++++++++----------
 ruoyi-ui/src/views/homeRoot/index.vue  |  151 +++++++++++++++++++++--------
 ruoyi-ui/src/api/root/index.js         |    8 +
 ruoyi-ui/src/router/index.js           |   32 ++++++
 4 files changed, 194 insertions(+), 97 deletions(-)

diff --git a/ruoyi-ui/src/api/root/index.js b/ruoyi-ui/src/api/root/index.js
index 4885e99..4262e56 100644
--- a/ruoyi-ui/src/api/root/index.js
+++ b/ruoyi-ui/src/api/root/index.js
@@ -2,10 +2,11 @@
 
 // 鑾峰彇瀹舵牴缃�
 export function listRoot(query) {
+ // alert(3)
   return request({
-    url: '/self/user/root',
+    url: '/self/user/root?depth='+query,
     method: 'get',
-    params: query
+ //   params: query
   })
 }
 
@@ -29,9 +30,10 @@
 
 // 鑾峰彇瀹舵牴缃�
 export function listUserAll(query) {
+
   return request({
     url: '/self/user/all',
     method: 'get',
-    params: query
+
   })
 }
diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index c847145..f831d4d 100644
--- a/ruoyi-ui/src/router/index.js
+++ b/ruoyi-ui/src/router/index.js
@@ -264,6 +264,38 @@
       }
     ]
   },
+ //涓汉淇℃伅灞曠ず
+  {
+    path: '/familymodel/jiagenwang',
+    component: Layout,
+    // permissions: [],
+    hidden: true,
+    permissions: ['familymodel:jiagenwang:info'],
+    children: [
+      {
+        path: 'personInfo/:id(\\d+)',
+        component: () => import('@/views/homeRoot/personInfo'),
+        name: 'personInfo',
+        meta: { title: '涓汉淇℃伅鏌ヨ璇︽儏',activeMenu: '/familymodel/jiagenwang'}
+      }
+    ]
+  },
+ //瀹惰氨涓汉淇℃伅灞曠ず
+  {
+    path: '/familymodel/jiagenwang',
+    component: Layout,
+    // permissions: [],
+    hidden: true,
+    permissions: ['familymodel:jiagenwang:getPInfo'],
+    children: [
+      {
+        path: 'getPInfo/:id(\\d+)',
+        component: () => import('@/views/genealogy/perInfo'),
+        name: 'perInfo',
+        meta: { title: '涓汉淇℃伅鏌ヨ璇︽儏',activeMenu: '/familymodel/jiagenwang'}
+      }
+    ]
+  },
 
   //缂栬緫涓汉淇℃伅
   {
diff --git a/ruoyi-ui/src/views/genealogy/index.vue b/ruoyi-ui/src/views/genealogy/index.vue
index 46d08b4..4fd0266 100644
--- a/ruoyi-ui/src/views/genealogy/index.vue
+++ b/ruoyi-ui/src/views/genealogy/index.vue
@@ -142,7 +142,7 @@
       </el-row>
     </div>
 
-    <el-table v-loading="loading" :data="listRoot"  @selection-change="handleSelectionChange"  @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
+    <el-table v-loading="loading" :data="listRoot"  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
       <el-table-column type="selection" width="25"  align="center" />
       <el-table-column  label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
 
@@ -174,40 +174,25 @@
       <el-table-column label="鎵�鍦ㄥ崟浣�" prop="unit" sortable width="150" align="center" >
         <template slot-scope="scope">{{scope.row.unit? scope.row.unit: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="閰嶅伓" prop="userId" sortable width="110" align="center" >
-        <template slot-scope="scope">{{scope.row.phoneNumber? scope.row.phoneNumber: '鈥斺�斺�斺��'}}</template>
+      <el-table-column label="閰嶅伓" prop="spouseId" sortable width="110" align="center" >
+        <template slot-scope="scope"><span>{{getPerson(scope.row.spouseId)}}</span></template>
       </el-table-column>
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+  <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope" v-if="scope.row.roleId !== 1">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:role:edit']"
-          >淇敼</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:role:remove']"
-          >鍒犻櫎</el-button>
-
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-d-arrow-right"
-            @click="handleCheck(scope.row)">
-            鏌ョ湅璇︽儏</el-button>
 
 
+<el-button
+             size="mini"
+              type="text"
+             icon="el-icon-d-arrow-right"
+              @click="handleCheck(scope.row)">
+鏌ョ湅璇︽儏</el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total>0"
+      v-show="total"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -340,7 +325,7 @@
 
 //瀵煎叆鎺ュ彛鍑芥暟
 import {enload, uploadPic} from "@/api/contacts/index";
-import {getRoot} from "@/api/root/index";
+import {getRoot,listUserAll} from "@/api/root/index";
 export default {
   name: "index",
   dicts: ['sys_normal_disable'],
@@ -484,7 +469,31 @@
       this.open = false;
       this.reset();
     },
+     //鎷垮埌閰嶅伓鐨勫鍚�
+     getPerson(id)
+     {
+     //  alert(id)
+   //    alert(typeof(id))
+       // this.listRoot.forEach(function(item, index) {
+       //             //item 灏辨槸褰撴棩鎸夊惊鐜埌鐨勫璞�
+       //             //index鏄惊鐜殑绱㈠紩锛屼粠0寮�濮�
+       //              //alert(typeof(item.userId))
+       //             if(item.userId==id){
+       //            //   alert(89)
+       //            alert(item.nickName)
+       //               return item.nickName
+       //             }
 
+       // })
+       let username = ""
+       for(let i = 0; i < this.listRoot.length;i++)
+       {
+         if(this.listRoot[i].userId==id)
+          username = this.listRoot[i].nickName
+       }
+       return username;
+      // return "12ddd"
+     },
     //闅旇鍙樿壊
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 == 0) {
@@ -497,13 +506,18 @@
     /** 鏌ヨ閫氳褰曞垪琛� */
     getList() {
       this.loading = true;
-      // console.log(this.queryParams)
+     //  console.log(this.queryParams)
+      //alert(23)
+
       //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-      getRoot(this.queryParams).then(response => {
+      listUserAll(this.queryParams).then(response => {
           //  alert(123)
           //   console.log(response.data)
-          this.listRoot = response.data.data;
-          this.total = response.data.total;
+       //   alert(76)
+          this.listRoot = response.data;
+        //  alert(this.listRoot)
+          this.total = response.data.length;
+       //   alert(this.total)
           this.loading = false;
         }
       );
@@ -583,28 +597,12 @@
     // },
 
 
-    /** 鏂板鎸夐挳鎿嶄綔 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "娣诲姞閫氳褰曡缁嗕俊鎭�";
-    },
+
     /** 鏌ョ湅璇︾粏淇℃伅 */
     handleCheck(row){
-      const id = row.id;
-      this.$router.push("/familymodel/Contact/contactsInfo/" + id);
-    },
-    /** 淇敼鎸夐挳鎿嶄綔 */
-    handleUpdate(row) {
-      const id = row.id;
-      let jd = true
-
-      this.$router.push({
-        path:"/familymodel/Contact/contactsInfo/" + id,
-        query:{
-          detail:jd
-        }
-      });
+      const id = row.userId;
+      alert(id)
+     this.$router.push("/familymodel/jiagenwang/getPInfo/" + id);
     },
 
 
diff --git a/ruoyi-ui/src/views/homeRoot/index.vue b/ruoyi-ui/src/views/homeRoot/index.vue
index 5ad025b..d071d3f 100644
--- a/ruoyi-ui/src/views/homeRoot/index.vue
+++ b/ruoyi-ui/src/views/homeRoot/index.vue
@@ -20,46 +20,47 @@
         <!-- 鑳屾櫙澶у浘-->
         <img v-if="imageSrc" :src="imageSrc" alt="" class="background"/>
         <!-- 鐢ㄦ埛澶村儚-->
+
         <div  v-model="rootList.url">
-          <el-avatar shape="circle" class="avater_1_1">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+          <el-avatar shape="circle" class="avater_1_1" v-if="isShow_1">
+            <img :src="'http://47.93.189.255:8080/'+ rootList[0].url"
+            @click="getPersonInfo(rootList[0].userId)"></img>
           </el-avatar>
-          <el-avatar shape="circle" class="avater_1_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+          <el-avatar shape="circle" class="avater_1_2" v-if="isShow_1">
+            <img :src="'http://47.93.189.255:8080/'+ rootList[1].url"
+            @click="getPersonInfo(rootList[1].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_1" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[0][0].url"
+            @click="getPersonInfo(rootSecList[0][0].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_2" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[0][1].url"
+            @click="getPersonInfo(rootSecList[0][1].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_3" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[1][0].url"
+             @click="getPersonInfo(rootSecList[1][0].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_4" v-if="isShow_2">
-          <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-          ></el-img>
+          <img :src="'http://47.93.189.255:8080/'+ rootSecList[2][1].url"
+            @click="getPersonInfo(rootSecList[1][1].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_5" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[2][0].url"
+                @click="getPersonInfo(rootSecList[2][0].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_6" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[2][1].url"
+                 @click="getPersonInfo(rootSecList[2][1].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_7" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[3][0].url"
+                 @click="getPersonInfo(rootSecList[3][0].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_2_8" v-if="isShow_2">
-            <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
-            ></el-img>
+            <img :src="'http://47.93.189.255:8080/'+ rootSecList[3][1].url"
+                 @click="getPersonInfo(rootSecList[3][1].userId)"></img>
           </el-avatar>
           <el-avatar shape="circle" class="avater_3_1" v-if="isShow_3">
             <el-img :src="'http://47.93.189.255:8080'+ rootList.url"
@@ -179,7 +180,7 @@
 
 <script>
 
-import {listRoot} from "@/api/root";
+import {listRoot} from "@/api/root/index";
 
 export default {
   name: "index",
@@ -187,17 +188,19 @@
     return{
       imageSrc: require('../../assets/images/Group 407.png') ,
       dropdownList: [
-        { name: '鍙樉绀虹涓�浠�', src: 'Group 443.png' },
-        { name: '鏄剧ず鑷崇浜屼唬', src: 'Group 444.png' },
+        { name: '鍙樉绀虹涓�浠�', src: 'Group 407.png' },
+        { name: '鏄剧ず鑷崇浜屼唬', src: 'Group 407.png' },
         { name: '鏄剧ず鑷崇涓変唬', src: 'Group 445.png' },
         { name: '鏄剧ず鍏ㄩ儴', src: 'Group 407.png' }
       ],
       rootList:[],
+      rootSecList:[],
       loading: true,
       formData:[],
-      isShow_2:true,
-      isShow_3:true,
-      isShow_4:true,
+      isShow_1:false,
+      isShow_2:false,
+      isShow_3:false,
+      isShow_4:false,
       formDat:{
         userId: undefined,
         nickName: undefined,
@@ -288,11 +291,14 @@
 
   },
   created() {
-    this.getList();
+
     // this.getCateInfor()
     // for (let i = 0; i < this.contactList.length; i++) {
     //   this.formDat[i] = this.contactList[i];
     // }
+  },
+  mounted() {
+     this.getList(1);
   },
   methods:{
     getInfo(src)
@@ -316,35 +322,94 @@
       }
     },
     generation_1(){
-      this.isShow_2=false
-      this.isShow_3=false
-      this.isShow_4=false
+
+
+    //  alert(127)
+      // this.getList(1)
+            listRoot(1).then(response => {
+                this.rootList = response.data
+                this.isShow_1=true
+                this.isShow_2=false
+                this.isShow_3=false
+                this.isShow_4=false
+            })
+    },
+    getPersonInfo(id)
+    {
+            this.$router.push("/familymodel/jiagenwang/personInfo/" + id);
+      //alert(id)
     },
     generation_2(){
-      this.isShow_2=true
-      this.isShow_3=false
-      this.isShow_4=false
+
+     // alert(2356)
+      //this.getList(2);
+      let st = new Map()
+      this.rootSecList = []
+       listRoot(2).then(response => {
+         this.rootList = response.data
+     // console.log(this.rootList[0].childList)
+     // alert(this.rootList[0].childList.length)
+      for(let i = 0; i < this.rootList[0].childList.length; i++)
+      {
+       // alert(343)
+        if(st.has(this.rootList[0].childList[i].userId)!=true)
+        {
+         // alert(35)
+          st.set(this.rootList[0].childList[i].userId, 1);
+          st.set(this.rootList[0].childList[i].spouseId,1)
+          let spid = this.rootList[0].childList[i].spouseId
+          let gen = []
+
+          gen.push(this.rootList[0].childList[i])
+          for(let j = 0; j < this.rootList[0].childList.length; j++)
+           {
+             if(this.rootList[0].childList[j].userId==spid)
+             {
+               gen.push(this.rootList[0].childList[j])
+               break
+             }
+           }
+           this.rootSecList.push(gen)
+        }
+
+        this.isShow_2=true
+        this.isShow_1=true
+        this.isShow_3=false
+        this.isShow_4=false
+        }
+      //  console.log(this.rootSecList)
+      })
+
+
     },
     generation_3(){
+      this.getList(3);
       this.isShow_2=true
       this.isShow_3=true
       this.isShow_4=false
     },
     generation_4(){
+      this.getList(4);
       this.isShow_2=true
       this.isShow_3=true
       this.isShow_4=true
     },
-    getList() {
+    getList(depth) {
       this.loading = true;
+     // alert(23)
+   //   alert(45)
       // console.log(this.queryParams)
-      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-      listRoot(this.queryParams).then(response => {
-          //  alert(123)
-          //   console.log(response.data)
-          this.rootList = response.data.data;
 
-          this.total = response.data.total;
+      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      listRoot(depth).then(response => {
+          //  alert(123)
+        //  alert(123)
+          //   console.log(response.data)
+        //  alert(90)
+          this.rootList = response.data;
+          this.isShow_1=true
+        //  alert(this.rootList[0].url)
+       //   this.total = response.data.total;
           this.loading = false;
         }
       );
@@ -375,7 +440,7 @@
 .avater_1_1 {
   position: absolute;
   top: 94%;
-  left: 51%;
+  left: 49%;
   transform: translate(-50%, -50%);
   width: 54px;
   height: 54px;

--
Gitblit v1.9.1