From c1cff08cdbcee3278c1ac8d8a3a067e3bf015202 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期三, 21 二月 2024 22:45:01 +0800
Subject: [PATCH] 提交新内容

---
 ruoyi-ui/src/views/bignote/familyeventInfo.vue |   45 +++++++++++++++++++--------------------------
 1 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/ruoyi-ui/src/views/bignote/familyeventInfo.vue b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
index 8ce2343..ca99b19 100644
--- a/ruoyi-ui/src/views/bignote/familyeventInfo.vue
+++ b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -101,6 +101,7 @@
 		          style="margin-left: 10px"
 		          size="small"
 		          type="success"
+				  v-if="btn"
 		          @click="picUpload"
 		        >涓婁紶鍒版湇鍔″櫒</el-button>
       <h4 class="form-header">鍏朵粬闄勪欢 </h4>
@@ -186,6 +187,7 @@
 		          style="margin-left: 10px"
 		          size="small"
 		          type="success"
+		          v-if="btn"
 		          @click="fileUpload"
 		        >涓婁紶鍒版湇鍔″櫒</el-button>
 				      <h4 class="form-header"> </h4>
@@ -314,8 +316,12 @@
               // alert(paths[i])
               let nms = paths[i].split("\/")
               let nm = nms[nms.length - 1]
-              _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
-            }
+			  if(paths[i][0]=="/")
+              _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1)})
+				else
+				_this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+				
+			}
           }
 		  _this.fileList1 = _this.fileList
         }
@@ -471,10 +477,13 @@
 	},
 	fileUpload(){
 	//	var file = params.file;
+
 		var formData = new FormData();
 		this.$refs.upload1.submit();
 		// formData.append('uploadFile', file);
-		
+		if(this.uploadFileList1.length==0){
+			  this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�");
+			  return}
 		
 		this.uploadFileList1.forEach((elem)=>{
 			formData.append("files", elem)
@@ -485,39 +494,23 @@
 
 		this.uploading = true;
 		uploadPic(formData).then(response => {
-		//   let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
-		//   _this.uploading = false;
-		//   // this.$modal.msgSuccess("涓婁紶鎴愬姛");
-		//   if(_this.fot.includes(pth) === true)
-		//   {
-		//     _this.fileList.push({name:response.data.fileName, "url":response.data.url})
-		
-		//   }
-		
-		//   else{
-		//     _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
-		//     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
-		//     console.log(_this.formData.url)
+		_this.uploadFileList1 = []
 		  _this.formData.url = _this.formData.url+","+response.fileNames
 		    updateFamilyevent(_this.formData).then(response => {
 		      this.$modal.msgSuccess("鏂囨。涓婁紶鎴愬姛");
 		      // this.open = false;
-		
 		    });
 		  })
 
 	},
 	picUpload()
 	{
+
 		var formData = new FormData();
 		this.$refs.upload.submit();
-	
+	if(this.uploadFileList.length==0){
+		  this.$modal.msgSuccess("鍥惧儚涓婁紶鍒楄〃涓嶈兘涓虹┖锛�");
+		  return}
 
 		this.uploadFileList.forEach((elem)=>{
 			formData.append("files", elem)
@@ -545,9 +538,9 @@
         //     return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
         //   }).join(",")
 		//console.log(_this.fileList)
-		alert(response.fileNames)
+	//	alert(response.fileNames)
           _this.formData.url = _this.formData.url+","+response.fileNames
-
+		_this.uploadFileList = []
          // alert(87)
           updateFamilyevent(_this.formData).then(response => {
             _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");

--
Gitblit v1.9.1