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/self/show.vue |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 43 insertions(+), 15 deletions(-)

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