From a4d8869bff7df9a2b888530df9efef46b8d6eaf4 Mon Sep 17 00:00:00 2001 From: feige <791364011@qq.com> Date: 星期四, 22 二月 2024 12:47:00 +0800 Subject: [PATCH] 提交多图片,视频上传 --- ruoyi-ui/src/views/bignote/familyeventInfo.vue | 51 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 34 insertions(+), 17 deletions(-) diff --git a/ruoyi-ui/src/views/bignote/familyeventInfo.vue b/ruoyi-ui/src/views/bignote/familyeventInfo.vue index 0c0a81a..94444e7 100644 --- a/ruoyi-ui/src/views/bignote/familyeventInfo.vue +++ b/ruoyi-ui/src/views/bignote/familyeventInfo.vue @@ -378,22 +378,37 @@ for(let i = 0; i < this.fileListOther.length; i++) { if(this.fileListOther[i].url==file.url) - + { + if(this.fileListOther[i].res==false) + res = true + else + { + this.$delete(this.uploadFileList1, Math.abs(i - this.uploadFileList1.length-1)) + } this.$delete(this.fileListOther,i); - 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; - + + } } - updateFamilyevent(this.formData).then(response => { - this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - // this.open = false; - }); + let ul = "" + this.fileList.map(function (elem){ + if(elem.res==false) + ul = ul + ","+elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }) + let uls = "" + this.fileListOther.map(function (elem){ + if(elem.res==false) + uls = uls +","+elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }) + this.formData.url = ul+","+uls; + alert(this.formData.url) + if(res==true){ + updateFamilyevent(this.formData).then(response => { + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + // this.open = false; + + }); + } }, handleRemove(file) { //鍒ゆ柇鏄惁鏄箣鍓嶇殑鍥剧墖 @@ -483,10 +498,12 @@ this.fileList.push({name:file.name,url:file.url,res:true}) }, //鑷畾涔変笂浼犳柟娉� - handleChange1(file, fileListOther) { + 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}) console.log("=========5555=========") //console.log(file) // console.log(this.uploadFileList) @@ -496,8 +513,8 @@ // var file = params.file; var formData = new FormData(); - this.$refs.upload1.submit(); - + //this.$refs.upload1.submit(); + // alert(this.uploadFileList1.length) // formData.append('uploadFile', file); if(this.uploadFileList1.length==0){ this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�"); @@ -585,7 +602,7 @@ requestUpload1(params) { // alert(123) - this.uploadFileList1.push(params.file); + // this.uploadFileList1.push(params.file); // console.log("-----------") //console.log(this.uploadFileList1) }, -- Gitblit v1.9.1