From cb62f9fe04c98c30434bb4a3a20bafb57c231ebb Mon Sep 17 00:00:00 2001
From: Tcsm <1377977403@qq.com>
Date: 星期二, 05 九月 2023 15:13:56 +0800
Subject: [PATCH] 1.成长经历阅历证件情况可以输入或选择,已改为“持有证件情况” 2.家谱样式调整和两个名字互换位置 3.更新了首页背景图片

---
 ruoyi-ui/src/views/mindMap/index.vue           |   80 +++++++++++++-------------
 ruoyi-ui/src/views/self/show.vue               |   58 ++++++++++++++-----
 ruoyi-ui/src/views/components/superMindmap.vue |   14 ++--
 ruoyi-ui/src/api/self/index.js                 |    9 ++
 ruoyi-ui/src/assets/images/shouye.png          |    0 
 5 files changed, 99 insertions(+), 62 deletions(-)

diff --git a/ruoyi-ui/src/api/self/index.js b/ruoyi-ui/src/api/self/index.js
index fab5092..acb9597 100644
--- a/ruoyi-ui/src/api/self/index.js
+++ b/ruoyi-ui/src/api/self/index.js
@@ -140,7 +140,14 @@
     method: 'delete',
   })
 }
-
+//璇佷欢绫诲瀷鏁版嵁
+export function listType(query) {
+  return request({
+    url: '/zCertificate/type',
+    method: 'get',
+    params: query
+  })
+}
 // 鏌ヨ鍑哄浗鎯呭喌
 export function getAbroadList() {
   return request({
diff --git a/ruoyi-ui/src/assets/images/shouye.png b/ruoyi-ui/src/assets/images/shouye.png
index af94d17..a3dca1c 100644
--- a/ruoyi-ui/src/assets/images/shouye.png
+++ b/ruoyi-ui/src/assets/images/shouye.png
Binary files differ
diff --git a/ruoyi-ui/src/views/components/superMindmap.vue b/ruoyi-ui/src/views/components/superMindmap.vue
index 8c30a33..6ce4c1b 100644
--- a/ruoyi-ui/src/views/components/superMindmap.vue
+++ b/ruoyi-ui/src/views/components/superMindmap.vue
@@ -3,7 +3,7 @@
 </template>
 <script>
     import * as d3 from 'd3';
- 
+
     export default {
         props: {
             data: Object,
@@ -281,7 +281,7 @@
             },
         },
     }
- 
+
     // 鑾峰彇鏍戠殑娣卞害
     function getDepth(json) {
         var arr = [];
@@ -306,7 +306,7 @@
         }
         return depth;
     }
- 
+
     // 鎻愬彇鏍戠殑瀛愯妭鐐癸紝鏈�缁堟墍鏈夋爲鐨勫瓙鑺傜偣閮戒細瀛樺叆浼犲叆鐨刲eafList鏁扮粍涓�
     function getTreeLeaf(treeData, leafList) {
         // 鍒ゆ柇鏄惁涓烘暟缁�
@@ -326,13 +326,13 @@
             }
         }
     }
- 
+
     // 鑾峰彇鍖呭惈姹夊瓧鐨勫瓧绗︿覆鐨勯暱搴�
     function getStringSizeLength(string) {
         //鍏堟妸涓枃鏇挎崲鎴愪袱涓瓧鑺傜殑鑻辨枃锛屽啀璁$畻闀垮害
         return string.replace(/[\u0391-\uFFE5]/g, "aa").length;
     }
- 
+
     // 鐢熸垚闅忔満鐨勫瓧绗︿覆
     function randomString(strLength) {
         strLength = strLength || 32;
@@ -343,7 +343,7 @@
         }
         return n
     }
- 
+
     // 鑾峰彇瀛楃涓茬殑鍍忕礌瀹藉害
     function getPXwidth(str, fontSize = "12px", fontFamily = "Microsoft YaHei") {
         var span = document.createElement("span");
@@ -365,4 +365,4 @@
         // result.height = parseFloat(window.getComputedStyle(span).height) - result.height;
         return result.width;
     }
-</script>
\ No newline at end of file
+</script>
diff --git a/ruoyi-ui/src/views/mindMap/index.vue b/ruoyi-ui/src/views/mindMap/index.vue
index 5579db5..5f1fd1a 100644
--- a/ruoyi-ui/src/views/mindMap/index.vue
+++ b/ruoyi-ui/src/views/mindMap/index.vue
@@ -1,10 +1,11 @@
 <template>
   <div class="app-container">
-    <h1 style="font-size: 21px;">{{ greeting +'锛�' + user.userName }}</h1>
+    <div class="text" >
+      <h1 style="font-size: 21px;margin-left: 0">{{ greeting +'锛�' + user.userName }}</h1></div>
     <div class="image-container">
       <img class="top-image" src="../../assets/images/zhang.png" alt="Top Image">
     </div>
-  <superMindmap  v-if="showMindMap" :active='active' :data="mapData" @activeChange="activeChange" class="mind-map-container"/>
+    <superMindmap  v-if="showMindMap" :active='active' :data="mapData" @activeChange="activeChange" class="mind-map-container "/>
 
   </div>
 </template>
@@ -39,9 +40,6 @@
    // console.log(this.mapData)
    // console.log('sssssssssssssssssss')
   },
-
-
-
 
   methods: {
      // 鐐瑰嚮鎬濈淮瀵煎浘鑺傜偣鍚庯紝瑙﹀彂鍙橀噺鏇存柊
@@ -83,45 +81,39 @@
 
         const mindMapData = this.rootList[0];
 
-
        // console.log(this.drawData(mindMapData))
         this.mapData = this.drawData(mindMapData)
         this.showMindMap = true
       })
 
     },
-    drawData(mpdata)
-    {
-      if(mpdata==null)
-        return null
+    drawData(mpdata) {
+      if (mpdata == null)
+        return null;
       var data = {
-        "label": mpdata['nickName'],
+        "label": mpdata['spouse'] != null ? eval(mpdata['spouse']).nickName : '',
         "prop": mpdata['nickName'],
         "url": '',
-        "link": '',
-        "children":[]
-      }
-      if(eval(mpdata['spouse'])!=null)
-        data['link'] = eval(mpdata['spouse']).nickName
-      if(mpdata['childList']!=null){
-      for(var i = 0; i < mpdata['childList'].length; i++)
-      {
-        var dt = {
-          "label": mpdata['childList'][i]['nickName'],
-          "prop": mpdata['childList'][i]['nickName'],
-          "url": '',
-          "link": "",
-          "children":[]
+        "link": mpdata['nickName'],
+        "children": []
+      };
+
+      if (mpdata['childList'] != null) {
+        for (var i = 0; i < mpdata['childList'].length; i++) {
+          var dt = {
+            "label": mpdata['childList'][i]['spouse'] != null ? eval(mpdata['childList'][i]['spouse']).nickName : '',
+            "prop": mpdata['childList'][i]['nickName'],
+            "url": '',
+            "link": mpdata['childList'][i]['nickName'],
+            "children": []
+          };
+          if (mpdata['childList'][i]['childList'] != null) {
+            for (var j = 0; j < mpdata['childList'][i]['childList'].length; j++) {
+              dt['children'].push(this.drawData(mpdata['childList'][i]['childList'][j]));
+            }
+          }
+          data['children'].push(dt);
         }
-        if(eval(mpdata['childList'][i]['spouse'])!=null)
-          dt['link'] = eval(mpdata['childList'][i]['spouse']).nickName
-        if(mpdata['childList'][i]['childList']!=null)
-        {
-          for(var j = 0; j < mpdata['childList'][i]['childList'].length;j++)
-          dt['children'].push(this.drawData(mpdata['childList'][i]['childList'][j]))
-        }
-        data['children'].push(dt)
-      }
       }
       return data;
     },
@@ -132,23 +124,33 @@
 
 <style scoped>
 .app-container{
-  background-color: #FEF7FC;
   position: relative;
+  /*background-color: transparent;*/
+  /*padding-left: -20px;*/
 }
+.text{
+  background-color: #FEF7FC;
+  opacity: 0.75;
+  margin-top: -20px;
+  padding: 20px;
 
+}
 .image-container {
   /*position: absolute;*/
   position: fixed;
-  margin-left: -10px;
-  width: 90%;
-  height: 90%;
+  top: 50px;
+  left: 50px;
+  width: 100%;
+  height: 100%;
   z-index: -1;
 }
 
 .mind-map-container{
+  position: fixed;
   z-index: 2;
   opacity: 0.8;
-  /*margin-top: 200px;*/
+  margin-top: 50px;
+  margin-left: 50px;
   background-color: transparent;
 }
 .top-image {
diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue
index 69b3d57..2889f83 100644
--- a/ruoyi-ui/src/views/self/show.vue
+++ b/ruoyi-ui/src/views/self/show.vue
@@ -626,10 +626,12 @@
           </el-input>
         </el-form-item>
         <el-form-item label="璇佷欢绫诲瀷" prop="type">
-          <el-select v-model="formDat.type" placeholder="璇烽�夋嫨绫诲瀷" clearable :style="{width: '100%'}"  >
+          <el-select v-model="formDat.type" placeholder="璇烽�夋嫨璇佷欢绫诲瀷" clearable :style="{width: '100%'}"  >
             <el-option v-for="(item, index) in typeOption" :key="index" :label="item.label" :value="item.value"
             ></el-option>
           </el-select>
+          <el-input v-model="newOption" v-if="showInput" placeholder="鑻ユ湭鍦ㄤ笂杩伴�夐」涓壘鍒板搴旂被鍨嬶紝璇峰湪姝よ緭鍏ユ柊鐨勮瘉浠剁被鍨�" @change="addNewOption"></el-input>
+
         </el-form-item>
         <el-form-item label="鎸佹湁鎯呭喌" prop="ownStatus">
           <el-input v-model="formDat.ownStatus" placeholder="璇疯緭鍏ユ寔鏈夋儏鍐�" clearable :style="{width: '100%'}" >
@@ -734,12 +736,11 @@
 import axios from 'axios';
 
 //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁�  --鎺ュソ浜�
-import {
-  getIndividualList, addIndividual, updateIndividual, delIndividual,
+import {getIndividualList, addIndividual, updateIndividual, delIndividual,
   listExperience, addExperience, updateExperience, delExperience,
   getIndividualRelation, addRelation, updateRelation, delRelation,
   getCertificateList, addCertificate, updateCertificate, delCertificate,
-  getAbroadList, addAbroad, updateAbroad, delAbroad,
+  getAbroadList, addAbroad, updateAbroad, delAbroad,listType,
   getAutobiographyList, getAutobiographyTermList, addAutobiography,updateAutobiography,
   getCategory,
 } from "@/api/self/index";
@@ -791,6 +792,7 @@
       relationList:[],
       //鍑哄叆澧冭瘉浠舵儏鍐�
       certificateList:[],
+      typeList:[],
       //鍑哄浗鎯呭喌
       AbroadList:[],
 
@@ -1016,16 +1018,9 @@
       },
       selectedOption:'',
       typeOptions:[],
-      typeOption: [{
-        value:'鎶ょ収',
-        label:'鎶ょ収'
-      },{
-        value:'閫氳璇�',
-        label:'閫氳璇�'
-      },{
-        value:'韬唤璇�',
-        label:'韬唤璇�'
-      }],
+      typeOption:[],
+      newOption: undefined,
+      showInput: true
     };
   },
   created() {
@@ -1101,7 +1096,14 @@
         return '鈥斺�斺�斺�斺�斺��'
       }
     },
-
+//绫诲埆
+    addNewOption() {
+      const newOption = this.newOption.trim();
+      if (newOption && !this.typeOption.includes(newOption)) {
+        this.typeOption.push(newOption);
+        this.$set(this.formDat, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
+      }
+    },
     /** 鏌ヨ瑙掕壊鍒楄〃 */
     getList() {
       this.loading = true;
@@ -1169,6 +1171,32 @@
       //   this.total = response.data.total;
       //   this.loading = false;
       // });
+      listType(this.queryParams).then(response => {
+          this.typeList = response.data;
+          this.total = response.data.total;
+          // console.log( this.typeList )
+          // 鍦ㄥ洖璋冨嚱鏁颁腑璋冪敤 getTypeOptions()
+          this.getTypeOptions();
+          this.loading = false;
+        }
+      );
+    },
+    getTypeOptions() {
+      const filteredOptions = this.typeList.filter(item => typeof item === 'string' && item !== '');
+      // 鍒涘缓涓�涓┖瀵硅薄鐢ㄤ簬瀛樺偍鍞竴鐨勫瓧绗︿覆閫夐」
+      const uniqueOptions = {};
+      // 鏋勫缓涓嬫媺閫夐」鍒楄〃
+      this.typeOption = filteredOptions.reduce((options, option) => {
+        if (!uniqueOptions[option]) {
+          uniqueOptions[option] = true;
+          options.push({
+            label: option,
+            value: option
+          });
+        }
+        return options;
+      }, []);
+
     },
 
     //鍥剧墖鐨勪笂浼犲強涓婁紶鎸夐挳闅愯棌

--
Gitblit v1.9.1