From de279dec1d03ad1c5603871bd4beeebc236a64eb Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期六, 26 八月 2023 22:33:42 +0800 Subject: [PATCH] 增加了家谱图 --- ruoyi-ui/src/views/self/show.vue | 402 ++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 272 insertions(+), 130 deletions(-) diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue index 6c72a8e..e44fbb8 100644 --- a/ruoyi-ui/src/views/self/show.vue +++ b/ruoyi-ui/src/views/self/show.vue @@ -1,5 +1,7 @@ <template> <div class="app-container"> + <!-- 鍒锋柊椤甸潰 --> +<!-- <MyComponent :key="componentKey" />--> <!-- 鍥炲埌椤堕儴--> <el-backtop :bottom="150" :right="30"> <el-button type="primary" circle @@ -56,12 +58,12 @@ <!-- <el-input v-model="individualList.sex === 1 ? '鐢�':'濂�' " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">--> <!-- </el-input>--> <template v-if="!isEditing"> - <el-input v-model="individualList.sex === 1 ? '鐢�':'濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> + <el-input v-model="individualList.sex === 1 ? inds='鐢�':inds='濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> </template> <template v-else> - <el-select v-model="individualList.sex" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}"> - <el-option label="鐢�" value="1"></el-option> - <el-option label="濂�" value="0"></el-option> + <el-select v-model="inds" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-option label="鐢�" value='1'></el-option> + <el-option label="濂�" value='0'></el-option> </el-select> </template> </el-form-item> @@ -97,13 +99,14 @@ <template v-if="!isEditing" > <el-input v-if="individualList.maritalStatus===0" placeholder="鏈"></el-input> <el-input v-if="individualList.maritalStatus===1" placeholder="宸插"></el-input> - <el-input v-if="individualList.maritalStatus===2" placeholder="绂诲"></el-input> + <el-input v-if="individualList.maritalStatus===2" placeholder="鏈"></el-input> + </template> <template v-else> - <el-select v-model="individualList.maritalStatus" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}"> - <el-option label="鏈" value="0"></el-option> - <el-option label="宸插" value="1"></el-option> - <el-option label="绂诲" value="2"></el-option> + <el-select v-model="mrs" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}"> + <el-option label="鏈" value='0'></el-option> + <el-option label="宸插" value='1'></el-option> + <el-option label="绂诲" value='2'></el-option> </el-select> </template> </el-form-item> @@ -115,37 +118,50 @@ </div> <div style="padding-left:30px;padding-top:30px"> <el-col :span="6" :data="individualList"> - <div class="block" :model="individualList" > - <el-col v-model="individualList.img" prop="img"> - <el-avatar shape="square" style="width: 200px;height: 150px;" > + <div class="block" :model="individualList"> + <div v-if="!isEditing"> + <el-avatar shape="square" style="width: 200px; height: 150px;"> <el-image - :src="'http://47.93.189.255:8080/'+ individualList.img" + class="el-upload-list__item-thumbnail" + v-if="!individualList.img" + src="default-avatar-url" :fit="fit" - style="width: 100%;height: 100%;" + style="width: 100%; height: 100%;" + ></el-image> + <el-image + v-else + :src="'http://47.93.189.255:8080/' + individualList.img" + :fit="fit" + style="width: 100%; height: 100%;" ></el-image> </el-avatar> -<!-- <el-upload--> -<!-- action="#"--> -<!-- list-type="picture-card"--> -<!-- multiple--> -<!-- :http-request="requestUpload"--> -<!-- :file-list="fileList"--> -<!-- >--> -<!-- <i slot="default" class="el-icon-plus"></i>--> -<!-- <div slot="file" slot-scope="{file}">--> -<!-- <img--> -<!-- class="el-upload-list__item-thumbnail"--> -<!-- :src="file.url"--> -<!-- alt=""--> -<!-- style="width: 147px; height: 147px"--> -<!-- fit="cover"--> -<!-- :preview-src-list="[file.url]"--> -<!-- >--> -<!-- </div>--> -<!-- </el-upload>--> - </el-col> + </div> + <el-upload v-else + class="upload-demo" + action="#" + :auto-upload="false" + :http-request="requestUpload" + :limit="1" + :file-list="fileList" + > + <el-avatar shape="square" style="width: 200px; height: 150px;"> + <el-image + class="el-upload-list__item-thumbnail" + v-if="!individualList.img" + src="default-avatar-url" + :fit="fit" + style="width: 100%; height: 100%;" + ></el-image> + <el-image + v-else + :src="'http://47.93.189.255:8080/' + individualList.img" + :fit="fit" + style="width: 100%; height: 100%;" + ></el-image> + </el-avatar> + </el-upload> + <div class="edit-text" v-if="isEditing" @click="uploadImage">鐐瑰嚮鏇存崲鍥剧墖</div> </div> - </el-col> </div> @@ -234,12 +250,12 @@ </el-container> <!--鎶樺彔闈㈡澘--> - <el-collapse v-model="activeNames" @change="handleChange"> + <el-collapse v-model="activeNames" @change="handleChange"> <el-collapse-item title="绉诲眳鍥斤紙澧冿級鎯呭喌" name="3" > <div> <el-form v-loading="loading" :data="individualList" @selection-change="handleSelectionChange"> - <el-form-item label="鏄惁鎷ユ湁澶栫睄銆佸澶栧眳鐣欐潈銆侀暱鏈熷眳鐣欒鍙�"> - <el-radio-group v-model="individualList.outStatus" style="margin-bottom: 0"> + <el-form-item label="鏄惁鎷ユ湁澶栫睄銆佸澶栧眳鐣欐潈銆侀暱鏈熷眳鐣欒鍙�" > + <el-radio-group v-model="individualList.outStatus" style="margin-bottom: 0;color: #FEF7FC;" :disabled="dsb"> <el-radio :label="1">鏄�</el-radio> <el-radio :label="0">鍚�</el-radio> </el-radio-group> @@ -247,7 +263,7 @@ <el-row :span="7"> <el-form v-loading="loading" :data="individualList" @selection-change="handleSelectionChange"> <el-form-item label="璇佷欢鍙风爜" prop="idNo" label-width="70px"> - <el-input v-model="individualList.idNo" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="individualList.idNo" style="color: #FEF7FC;" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> </el-form> @@ -266,7 +282,7 @@ <div class="title-wrapper"> 涓昏瀛︿範鍙婂伐浣滅粡鍘� <div> - <el-button class="button" size="mini" type="text" @click="showDialog('open')"> + <el-button class="button" size="mini" type="text" @click="showDialog('open')" > <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn></el-button> </div> </div> @@ -275,13 +291,13 @@ <el-table-column label="寮�濮嬫棩鏈�" prop="startDate" sortable width="250" align="center" > <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.startDate }}</template> - <template v-else><el-input v-model="scope.row.startDate"></el-input></template> + <template v-else><el-input v-model="scope.row.startDate" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="缁撴潫鏃ユ湡" prop="endDate" sortable width="250" align="center" > <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.endDate }}</template> - <template v-else><el-input v-model="scope.row.endDate"></el-input></template> + <template v-else><el-input v-model="scope.row.endDate" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="涓昏瀛︿範缁忓巻銆佸伐浣滃崟浣嶅強浠昏亴鎯呭喌" prop="content" sortable width="350" align="center" > @@ -401,13 +417,13 @@ <el-table-column label="寮�濮嬫椂闂�" prop="startTime" sortable width="230" align="center"> <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.startTime }}</template> - <template v-else><el-input v-model="scope.row.startTime"></el-input></template> + <template v-else><el-input v-model="scope.row.startTime" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="缁撴潫鏃堕棿" prop="endTime" sortable width="230" align="center"> <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.endTime }}</template> - <template v-else><el-input v-model="scope.row.endTime"></el-input></template> + <template v-else><el-input v-model="scope.row.endTime" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> @@ -436,13 +452,13 @@ <el-table-column label="寮�濮嬫椂闂�" prop="startTime" sortable width="200" align="center"> <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.startTime }}</template> - <template v-else><el-input v-model="scope.row.startTime"></el-input></template> + <template v-else><el-input v-model="scope.row.startTime" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="缁撴潫鏃堕棿" prop="endTime" sortable width="200" align="center"> <template slot-scope="scope"> <template v-if="!scope.row.isEdit">{{ scope.row.endTime }}</template> - <template v-else><el-input v-model="scope.row.endTime"></el-input></template> + <template v-else><el-input v-model="scope.row.endTime" type="date" placeholder="閫夋嫨鏃ユ湡"></el-input></template> </template> </el-table-column> <el-table-column label="鎵�鍒板浗瀹舵垨鑰呭湴鍖�" prop="destination" sortable width="300" align="center" > @@ -490,11 +506,15 @@ <div v-if="item.term === '鐮旂┒鐢�'"> {{item.content}}</div> <div v-if="item.term === '宸ヤ綔'"> {{item.content}}</div> <div v-if="item.term === '缁撳鍚�'"> {{item.content}}</div> + <el-button size='mini' type="text" class="btn_edit" @click="editData(item)" style='position: absolute;right:10px;top:5px;'> + <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn> + </el-button> </el-tab-pane> </el-tabs> -<!-- <el-button size='mini' type="text" class="btn_autobiography" @click="showDialog('autobiography')" style='position: absolute;right:10px;top:5px;'>--> -<!-- <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn>--> -<!-- </el-button>--> + + <el-button size='mini' type="text" class="btn_autobiography" @click="showDialog('autobiography')" style='position: absolute;right:10px;top:5px;'> + <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn> + </el-button> </div> </div> @@ -627,21 +647,26 @@ </div> </el-dialog> <!--鏂板鑷紶--> - <el-dialog :title="title" :visible.sync="dialogVisible.autobiography" width="900px" > + <el-dialog :title="isEdit1 ? '缂栬緫璁板綍' : '鏂板璁板綍'" :visible.sync="dialogVisible.autobiography" width="900px" append-to-body> <el-col > - <el-form ref="elForm" :model="AutobiographyList" :rules="rules" size="medium" label-position="left" - v-loading="loading" :data="AutobiographyList" @selection-change="handleSelectionChange" > + <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-position="left" > <el-row :span="5"> +<!-- <el-form-item label="闇�瑕佷慨鏀圭殑璁板綍锛�" prop="id">--> +<!-- <el-select v-model="formDat.id" placeholder="璇烽�夋嫨闇�瑕佷慨鏀圭殑璁板綍" clearable :style="{width: '50%'}" >--> +<!-- <el-option v-for="(item, index) in AutobiographyList" :key='item.id' :label="item.ageBegin+'~'+item.ageEnd+'宀�'+'('+item.term+')'"--> +<!-- ></el-option>--> +<!-- </el-select>--> +<!-- </el-form-item>--> <el-form-item label="骞撮緞娈碉細" prop="ageBegin ageEnd" label-width="70px"> - <el-input v-model="AutobiographyList.ageBegin" placeholder="" clearable :style="{width: '20%'}" > + <el-input v-model="formDat.ageBegin" placeholder="" clearable :style="{width: '20%'}" > </el-input> <span> 宀� 鈥斺��</span> - <el-input v-model="AutobiographyList.ageEnd" placeholder="" clearable :style="{width: '20%'}" > + <el-input v-model="formDat.ageEnd" placeholder="" clearable :style="{width: '20%'}" > </el-input> <span> 宀� </span> </el-form-item> <el-form-item label="鏃舵湡锛�" prop="term"> - <el-select v-model="formDat.type" placeholder="璇烽�夋嫨鏃舵湡" clearable :style="{width: '50%'}" > + <el-select v-model="formDat.term" placeholder="璇烽�夋嫨鏃舵湡" clearable :style="{width: '50%'}" > <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" ></el-option> </el-select> @@ -661,7 +686,6 @@ </div> </el-dialog> - </div> </template> @@ -676,8 +700,8 @@ listExperience, addExperience, updateExperience, delExperience, getIndividualRelation, addRelation, updateRelation, delRelation, getCertificateList, addCertificate, updateCertificate, delCertificate, - getAbroadList, addAbroad,updateAbroad, delAbroad, - getAutobiographyList, getAutobiographyTermList, addAutobiography, + getAbroadList, addAbroad, updateAbroad, delAbroad, + getAutobiographyList, getAutobiographyTermList, addAutobiography,updateAutobiography, getCategory, } from "@/api/self/index"; import { delFamilyevent, uploadPic } from '../../api/bignote' @@ -688,6 +712,7 @@ export default { name: "show", dicts: ['sys_normal_disable'], + data() { return { // 閬僵灞� @@ -695,8 +720,13 @@ loading: true, formData:[], + componentKey: 0, // 閫変腑鏁扮粍 ids: [], + //鎬у埆 + inds:undefined, + //濠氬Щ绫诲埆 + mrs:undefined, // 闈炲崟涓鐢� single: true, // 闈炲涓鐢� @@ -713,7 +743,7 @@ //涓汉淇℃伅鏁版嵁 individualList:[], isEditing: false, - // fit:['fill'], + fit:['cover'], // 涓汉缁忓巻鏁版嵁 experienceList: [], // isEdit:true, @@ -767,15 +797,13 @@ dateRange: [], // 鏁版嵁鑼冨洿閫夐」 fot:[".jpg",".jif"], - fileList:[ - ], - fileListOther:[ - - ], + fileList:[], + fileListOther:[], dsb:true, btn:false, isShow:true, isShow_2:false, + isEdit1:false, formDat: { //涓汉鍩烘湰淇℃伅 nickName:undefined, @@ -830,7 +858,8 @@ //鑷紶 ageBegin:undefined, ageEnd:undefined, - term:undefined + term:undefined, + }, // 鑿滃崟鍒楄〃 menuOptions: [], @@ -921,8 +950,8 @@ trigger: 'blur' }], content: [{ - // required: true, - message: '璇疯緭鍏�', + required: true, + message: '璇疯緭鍏ユ枃鏈�', trigger: 'blur' }], witness: [{ @@ -930,8 +959,25 @@ message: '璇疯緭鍏ヨ瘉鏄庝汉', trigger: 'blur' }], + //鑷紶 + term: [{ + required: true, + message: '璇烽�夋嫨鏃舵湡', + trigger: 'blur' + }], + ageBegin: [{ + required: true, + message: '', + trigger: 'blur' + }], + ageEnd: [{ + required: true, + message: '', + trigger: 'blur' + }], }, + selectedOption:'', typeOptions:[], typeOption: [{ value:'鎶ょ収', @@ -957,9 +1003,19 @@ this.dialogVisible.relation1 = false; this.dialogVisible.certificate =false; this.dialogVisible.abroad=false; - this.dialogVisible.autobiography=false + this.dialogVisible.autobiography=false; + this.isEdit1 = false; this.reset(); + // 娓呯┖formDat瀵硅薄鐨勬暟鎹� + Object.keys(this.formDat).forEach(key => { + this.formDat[key] = ''; + }); }, + handleUploadSuccess(response, file) { + // 澶勭悊鏂囦欢涓婁紶鎴愬姛鍚庣殑鍥炶皟 + this.individualList.img = response.url; + }, + //涓嬫媺 handleChange(activeNames) { // console.log(val); @@ -973,7 +1029,19 @@ handleClick(tab, event) { // console.log(tab, event); this.getAutobiographyInfor(); + // this.getSrc1(typeOptions) + }, + //涓汉鑷紶缂栬緫 + editData(data) { + this.isEdit1 = true; // 璁剧疆涓虹紪杈戞搷浣� + // 灏嗚淇敼鐨勬暟鎹~鍏呭埌formDat瀵硅薄涓� + this.formDat.ageBegin = data.ageBegin; + this.formDat.ageEnd = data.ageEnd; + this.formDat.term = data.term; + this.formDat.content = data.content; + // 鎵撳紑寮圭獥 + this.dialogVisible.autobiography = true; }, //闅旇鍙樿壊 @@ -1054,16 +1122,16 @@ this.AutobiographyList = response.data; this.total = response.data.total; this.loading = false; + }); //鏍规嵁涓嶅悓鏃舵鐨勪釜浜鸿嚜浼� - getAutobiographyTermList(this.queryParams).then(response => { - // alert(123) - // console.log(response.data) - this.AutobiographyTermList = response.data; - this.total = response.data.total; - this.loading = false; - }); - + // getAutobiographyTermList(this.queryParams).then(response => { + // // alert(123) + // // console.log(response.data) + // this.AutobiographyTermList = response.data; + // this.total = response.data.total; + // this.loading = false; + // }); }, //鍥剧墖鐨勪笂浼犲強涓婁紶鎸夐挳闅愯棌 @@ -1176,32 +1244,45 @@ this.isShow=false this.isShow_2=true this.isEditing=true - // this.isEdit=false + if(this.individualList.maritalStatus == 0) + this.mrs = '鏈' + else if(this.individualList.maritalStatus == 1) + this.mrs = '宸插' + else + this.mrs = '绂诲'// this.isEdit=false }, /** 鏌ヨ鑷紶淇℃伅 */ getAutobiographyInfor() { let _this = this - getCategory().then(response=>{ + getCategory().then(response => { + // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ + // _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) + // }) + response.data.itemValues.replace("{", "").replace("}", "").split(",").map(elem => { + const label = elem.split(":")[0].trim(); + const value = parseInt(elem.split(":")[1].trim()); - response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ - _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) - }) - }) + // 鍒ゆ柇 typeOptions 鏁扮粍涓槸鍚﹀凡瀛樺湪鐩稿悓鐨� value + if (!_this.typeOptions.some(option => option.value === value)) { + _this.typeOptions.push({ "label": label, "value": value }); + } + // console.log(_this.typeOptions) + // _this.getSrc1(value) + }); + }); + + // if(AutobiographyList.ageEnd==null){ + // this.AgeEnd='?' + // }else{ + // this.AgeEnd=this.ageEnd + // } }, /** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */ //鏂板涓昏缁忓巻鐨勪繚瀛� submitDataScope: function() { - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { if (valid) { addExperience(this.formDat).then(response => { @@ -1218,14 +1299,6 @@ }, //鏂板鎴愬憳鍏崇郴鐨勪繚瀛� submitDataScope2: function() { - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { if (valid) { addRelation(this.formDat).then(response => { @@ -1242,15 +1315,6 @@ }, //鏂板鍑哄叆澧冭瘉浠剁殑淇濆瓨 submitDataScope4: function() { - - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { if (valid) { addCertificate(this.formDat).then(response => { @@ -1267,14 +1331,6 @@ }, //鏂板鍑哄浗澧冪殑淇濆瓨 submitDataScope5: function() { - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { if (valid) { addAbroad(this.formDat).then(response => { @@ -1289,29 +1345,49 @@ this.formDat[key] = ''; }); }, + //涓汉鑷紶鐨勪繚瀛� submitDataScope6: function() { - - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { if (valid) { - addAutobiography(this.formDat).then(response => { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.dialogVisible.autobiography = false; - this.getList(); - }); + // 鏍规嵁鍊兼壘鍒伴�変腑鐨勯�夐」瀵硅薄 + const selectedOption = this.typeOptions.find(option => option.value === this.formDat.term); + + if (this.isEdit1) { + // 鎵ц淇敼鎿嶄綔 + updateAutobiography(this.formDat).then(response => { + // 灏嗛�変腑閫夐」鐨勬枃鏈缃负"term"瀛楁鐨勫�� + this.formDat.term = selectedOption.label; + this.formDat.id = selectedOption.id; + console.log("1") + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.dialogVisible.autobiography = false; + this.isEdit1 = false; + this.getList(); + }).catch(error => { + console.log(error); + this.isEdit1 = false; + this.dialogVisible.autobiography = false; + }); + } else { + // 鎵ц鏂板鎿嶄綔 + addAutobiography(this.formDat).then(response => { + this.formDat.term = selectedOption.label; + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.dialogVisible.autobiography = false; + this.getList(); + }).catch(error => { + console.log(error); + this.dialogVisible.autobiography = false; + }); + } } }); // 娓呯┖formDat瀵硅薄鐨勬暟鎹� Object.keys(this.formDat).forEach(key => { this.formDat[key] = ''; }); + // 閲嶇疆isEdit涓篺alse锛屼互渚夸笅娆$偣鍑绘柊澧炴椂涓烘柊澧炴搷浣� + this.isEdit1 = false; }, editRow(row) { @@ -1321,6 +1397,16 @@ //淇敼鍚庣殑淇濆瓨 //涓汉鍩烘湰淇℃伅 submitForm() { + if(this.inds=='1') + this.individualList.sex = 1; + else + this.individualList.sex = 0; + if(this.mrs=='0') + this.individualList.maritalStatus = 0 + else if(this.mrs == '1') + this.individualList.maritalStatus = 1 + else + this.individualList.maritalStatus = 2 let ul = this.fileList.map(function (elem){ return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") }).join(",") @@ -1334,8 +1420,15 @@ if (this.individualList.userId !== undefined) { updateIndividual(this.individualList).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); + // 寮哄埗鏇存柊鐩稿叧缁勪欢 + this.individualList={...this.individualList} + // this.open = false; + this.dsb = true this.btn=false + this.isShow_2=false + this.isShow=true + this.isEditing = false }); } else { this.$modal.msgSuccess("淇敼澶辫触"); @@ -1344,7 +1437,52 @@ } }) // 鍒锋柊椤甸潰 - window.location.reload(); + // window.location.reload(); + }, + //澶村儚淇敼 + uploadImage() { + const inputElement = document.createElement("input"); + inputElement.type = "file"; + inputElement.accept = "image/*"; + inputElement.style.display = "none"; + document.body.appendChild(inputElement); + + inputElement.addEventListener("change", () => { + const file = inputElement.files[0]; + if (file) { + const formData = new FormData(); + formData.append("image", file); + + // 璋冪敤uploadPic鎺ュ彛涓婁紶鍥剧墖 + axios.post("/common/upload", formData, { + headers: { + "Content-Type": "multipart/form-data" + } + }).then(response => { + // 涓婁紶鎴愬姛锛岃幏鍙栨柊鍥剧墖鐨刄RL + const newImageUrl = response.data.img; + + // 鍋囪individualList鏄竴涓璞★紝鏇存柊individualList.img + this.individualList.img = newImageUrl; + + // 鍋囪fileList鏄竴涓暟缁勶紝鏇存柊fileList涓搴旂殑鍥剧墖URL + // const index = this.fileList.findIndex(item => item.id === fileId); + // this.fileList[index].url = newImageUrl; + + // 娓呴櫎input鍏冪礌骞剁Щ闄や簨浠剁洃鍚� + document.body.removeChild(inputElement); + inputElement.removeEventListener("change", null); + }).catch(error => { + console.error("涓婁紶澶辫触:", error); + // 娓呴櫎input鍏冪礌骞剁Щ闄や簨浠剁洃鍚� + document.body.removeChild(inputElement); + inputElement.removeEventListener("change", null); + }); + } + }); + + // 瑙﹀彂鐐瑰嚮浜嬩欢锛屾樉绀烘枃浠堕�夋嫨瀵硅瘽妗� + inputElement.click(); }, //涓昏缁忓巻 saveRowExperienceList(row) { @@ -1542,6 +1680,10 @@ .btn_autobiography{ background:center no-repeat url('../../assets/icons/add1.png') ; } +.btn_edit{ + background:center no-repeat url('../../assets/icons/edit.png') ; +} + .button { background:center no-repeat url('../../assets/icons/add1.png') ; margin-left: 69.5vw; -- Gitblit v1.9.1