From 66db80bd6679d011c67ae289e4ded4fa4a76e5d4 Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期二, 12 九月 2023 09:48:27 +0800
Subject: [PATCH] 修改个人中心
---
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