From d647d78c29afaeff8e6ba01d01cf9c2dc6e53479 Mon Sep 17 00:00:00 2001 From: yz3456 <2753272399@qq.com> Date: 星期六, 20 四月 2024 18:43:11 +0800 Subject: [PATCH] 修改所有备忘录上传图片 --- ruoyi-ui/src/views/healthy/ExaminationInfo.vue | 78 +++++++++++++++++++------------------- 1 files changed, 39 insertions(+), 39 deletions(-) diff --git a/ruoyi-ui/src/views/healthy/ExaminationInfo.vue b/ruoyi-ui/src/views/healthy/ExaminationInfo.vue index 90e757b..e99179a 100644 --- a/ruoyi-ui/src/views/healthy/ExaminationInfo.vue +++ b/ruoyi-ui/src/views/healthy/ExaminationInfo.vue @@ -31,8 +31,8 @@ multiple :http-request="requestUpload" :file-list="fileList" - - + + ref="upload" show-file-list="true" :on-change="handleChange" @@ -40,7 +40,7 @@ :disabled="!btn" :class="{ hide: !btn }" > - + <i v-if="!uploading" slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> <img @@ -94,8 +94,8 @@ list-type="picture-card" :on-preview="handleFileCardPreview" :show-file-list="true" - - + + :on-remove="handleRemoveFile" :http-request="requestUpload1" :on-change="handleChange1" @@ -184,14 +184,14 @@ // 鏁版嵁鑼冨洿閫夐」 fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], - + fileList:[ ], fileList1:[], uploadFileList:[], uploadFileList1:[], fileListOther:[ - + ], dsb:true, btn:false, @@ -270,7 +270,7 @@ 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) @@ -289,7 +289,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}) - + } } } @@ -319,13 +319,13 @@ submitForm() { - 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.formData.url = ul+","+uls + // 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.formData.url = ul+","+uls this.$refs['elForm'].validate(valid => { @@ -374,10 +374,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) @@ -394,7 +394,7 @@ updateExamination(this.formData).then(response => { this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); // this.open = false; - + }); } }, @@ -418,7 +418,7 @@ // alert(this.uploadFileList.length) } this.$delete(this.fileList,i); - + } } let ul = "" @@ -437,7 +437,7 @@ this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }); } - + }, handleFileCardPreview(file){ this.dialogFileUrl = file.url; @@ -475,11 +475,11 @@ this.btn = true this.isShow=false }, - + //鑷畾涔変笂浼犳柟娉� handleChange(file, fileList1) { //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍 - + // this.uploadFileList.push(file.raw); console.log("=========5555=========") this.uploadFileList.push(file.raw); @@ -488,7 +488,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}) @@ -499,7 +499,7 @@ }, fileUpload(){ // var file = params.file; - + var formData = new FormData(); //this.$refs.upload1.submit(); // alert(this.uploadFileList1.length) @@ -507,14 +507,14 @@ if(this.uploadFileList1.length==0){ this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�"); return} - + this.uploadFileList1.forEach((elem)=>{ formData.append("files", elem) - + }) console.log(this.uploadFileList1) let _this = this - + this.uploading = true; uploadPic(formData).then(response => { _this.uploadFileList1 = [] @@ -524,25 +524,25 @@ // this.open = false; }); }) - + }, picUpload() { - + var formData = new FormData(); //this.$refs.upload.submit(); //alert(this.uploadFileList.length) if(this.uploadFileList.length==0){ this.$modal.msgSuccess("鍥惧儚涓婁紶鍒楄〃涓嶈兘涓虹┖锛�"); return} - + this.uploadFileList.forEach((elem)=>{ formData.append("files", elem) - + }) let _this = this - - + + uploadPic(formData).then(response => { // console.log(response.originalFilenames) // console.log(response.urls) @@ -569,12 +569,12 @@ updateExamination(_this.formData).then(response => { _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛"); // this.open = false; - + }); // } // else{ // _this.fileListOther.push({name:response.data.fileName, url:response.data.url}) - + // } }); }, @@ -582,10 +582,10 @@ { // alert(124) // this.uploadFileList.push(params.file); - + //alert(34) - - + + }, requestUpload1(params) { -- Gitblit v1.9.1