From 331a8018f4ffb03e7af3b111492d299a0c7a24c5 Mon Sep 17 00:00:00 2001 From: yz3456 <2753272399@qq.com> Date: 星期三, 17 七月 2024 08:56:58 +0800 Subject: [PATCH] a --- ruoyi-ui/src/views/honor/honorInfo.vue | 127 ++++++++++++++++++++++++++++++++---------- 1 files changed, 96 insertions(+), 31 deletions(-) diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue index fd1bc88..062deff 100644 --- a/ruoyi-ui/src/views/honor/honorInfo.vue +++ b/ruoyi-ui/src/views/honor/honorInfo.vue @@ -92,9 +92,9 @@ accept="image/jpeg, image/png,image/jpg, image/WMF,image/gif" list-type="picture-card" multiple - + :show-file-list="true" - :http-request="requestUpload" + :http-request="requestUpload" :file-list="fileList" :on-change="handleChange" :auto-upload="false" @@ -154,8 +154,8 @@ :on-remove="handleRemoveFile" :http-request="requestUpload1" :show-file-list="true" - - + + ref="upload1" :on-change="handleChange1" :auto-upload="false" @@ -175,7 +175,7 @@ ></video> <img v-else class="el-upload-list__item-thumbnail" - src="../../assets/401_images/401.gif" + src="../../assets/images/deviceLis.png" alt="" style="width: 147px; height: 147px" fit="cover"> @@ -216,7 +216,7 @@ @click="fileUpload" >涓婁紶鍒版湇鍔″櫒</el-button> <h4 class="form-header"> </h4> - + <el-form-item size="large"> <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼</el-button> </el-form-item> @@ -249,14 +249,13 @@ '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], fileList:[], - - + + fileList1:[], uploadFileList:[], uploadFileList1:[], - fileListOther:[ - - ], + fileListOther:[], + fileListOther1:[], dsb:true, btn:false, isShow:true, @@ -381,16 +380,30 @@ for(let i = 0; i < paths.length; i++) { if(paths[i]!="") { - + let pth = paths[i].substr(paths[i].length - 4, paths[i].length) // alert(pth) if (_this.fot.includes(pth) === true) - { - if(paths[i][0]=="/") - _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false}) - else - _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false}) - } + // { + // if(paths[i][0]=="/") + // _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false}) + // else + // _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false}) + // } + { + if(paths[i].includes(process.env.VUE_APP_BASE_TRUE_API)){ + if(paths[i][0]=="/") + _this.fileList.push({name:paths[i],url: paths[i].substr(1),res:false}) + else + _this.fileList.push({name:paths[i],url: paths[i],res:false}) + }else{ + if(paths[i][0]=="/") + _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false}) + else + _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false}) + } + + } else { // alert(paths[i]) // alert() @@ -400,7 +413,7 @@ _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false}) else _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false}) - + } } } @@ -419,10 +432,60 @@ // this.getCateInfor() } + console.log(this.fileListOther,'this.fileListOtherthis.fileListOtherthis.fileListOther') }, mounted() {}, methods: { + getData(){ + const id = this.$route.params && this.$route.params.id; + let _this = this + if (id) { + this.loading = true; + getHonor({id}).then((response) => { + this.formData = response.data; + // alert(this.formData.type) + let paths = response.data.url.split(","); + for(let i = 0; i < paths.length; i++) + { + if(paths[i]!="") { + + let pth = paths[i].substr(paths[i].length - 4, paths[i].length) + // alert(pth) + if (_this.fot.includes(pth) === true) + { + console.log() + } + else { + // alert(paths[i]) + // alert() + let nms = paths[i].split("\/") + let nm = nms[nms.length - 1] + if(paths[i][0]=="/") + _this.fileListOther1.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false}) + else + _this.fileListOther1.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false}) + + } + } + } + _this.fileListOther = _this.fileListOther1 + 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; + } + ); + this.fetchData() + // this.getCateInfor() + + } + }, // 鑾峰彇鏁版嵁鏂规硶 fetchData(id) { const url = 'https://47.93.189.255:8080/zHonor/id=${id}'; // 鎺ュ彛 URL'/zHonor/id='+query @@ -549,10 +612,10 @@ this.$delete(this.uploadFileList1, Math.abs(i - this.uploadFileList1.length-1)) } this.$delete(this.fileListOther,i); - + } } - + let ul = "" this.fileList.map(function (elem){ if(elem.res==false) @@ -569,7 +632,7 @@ updateHonor(this.formData).then(response => { this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); // this.open = false; - + }); } }, @@ -593,7 +656,7 @@ // alert(this.uploadFileList.length) } this.$delete(this.fileList,i); - + } } let ul = "" @@ -612,7 +675,7 @@ this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }); } - + }, handleFileCardPreview(file){ this.dialogFileUrl = file.url; @@ -659,7 +722,7 @@ //鑷畾涔変笂浼犳柟娉� handleChange1(file, fileListOther1) { //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍 - + // this.uploadFileList.push(file.raw); this.uploadFileList1.push(file.raw); this.fileListOther.push({name:file.name,url:file.url,res:true}) @@ -678,10 +741,10 @@ if(this.uploadFileList1.length==0){ this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�"); return} - + this.uploadFileList1.forEach((elem)=>{ formData.append("files", elem) - + }) console.log(this.uploadFileList1) let _this = this @@ -693,6 +756,8 @@ updateHonor(_this.formData).then(response => { this.$modal.msgSuccess("鏂囨。涓婁紶鎴愬姛"); // this.open = false; + this.getData() + this.fileListOther1=[] }); }) @@ -709,11 +774,11 @@ this.uploadFileList.forEach((elem)=>{ formData.append("files", elem) - + }) let _this = this - + uploadPic(formData).then(response => { // console.log(response.originalFilenames) // console.log(response.urls) @@ -755,8 +820,8 @@ // this.uploadFileList.push(params.file); //alert(34) - - + + }, requestUpload1(params) { -- Gitblit v1.9.1