From 25bcf1541e231adc9992fff9ae9c361e66e3d711 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期一, 11 九月 2023 23:14:52 +0800 Subject: [PATCH] 模块添加打印功能,查看详情的页面去掉上传功能 --- ruoyi-ui/src/views/self/show.vue | 61 ++++++++++++++++++++++-------- 1 files changed, 45 insertions(+), 16 deletions(-) diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue index 69b3d57..0e2cf44 100644 --- a/ruoyi-ui/src/views/self/show.vue +++ b/ruoyi-ui/src/views/self/show.vue @@ -1,5 +1,5 @@ <template> - <div class="app-container"> + <div class="app-container" id="printable-content"> <!-- 鍒锋柊椤甸潰 --> <!-- <MyComponent :key="componentKey" />--> <!-- 鍥炲埌椤堕儴--> @@ -35,6 +35,7 @@ size="mini" style=" width: 67px;height: 27px;background: #FFDDE3; border-radius: 7px 7px 7px 7px;opacity: 1; margin-left: 20px;" + v-print="'#printable-content'" v-hasPermi="['family:note:export']" >鎵撳嵃</el-button> </div> @@ -626,10 +627,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 +737,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 +793,7 @@ relationList:[], //鍑哄叆澧冭瘉浠舵儏鍐� certificateList:[], + typeList:[], //鍑哄浗鎯呭喌 AbroadList:[], @@ -1016,16 +1019,9 @@ }, selectedOption:'', typeOptions:[], - typeOption: [{ - value:'鎶ょ収', - label:'鎶ょ収' - },{ - value:'閫氳璇�', - label:'閫氳璇�' - },{ - value:'韬唤璇�', - label:'韬唤璇�' - }], + typeOption:[], + newOption: undefined, + showInput: true }; }, created() { @@ -1101,7 +1097,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 +1172,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