From 86e76b965eca189b0d000cbadce383f5d4ecadba Mon Sep 17 00:00:00 2001
From: yz3456 <2753272399@qq.com>
Date: 星期一, 25 三月 2024 23:54:21 +0800
Subject: [PATCH] 修改了bug

---
 ruoyi-ui/src/views/pet/noteInfo.vue |  102 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 62 insertions(+), 40 deletions(-)

diff --git a/ruoyi-ui/src/views/pet/noteInfo.vue b/ruoyi-ui/src/views/pet/noteInfo.vue
index c0bb6be..36114ef 100644
--- a/ruoyi-ui/src/views/pet/noteInfo.vue
+++ b/ruoyi-ui/src/views/pet/noteInfo.vue
@@ -182,14 +182,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,21 +270,32 @@
         this.formData = response.data;
         let paths = response.data.url.split(",");
         for(let i = 0; i < paths.length; i++)
-        {
-          if(paths[i]!="") {
+    {
+      if(paths[i]!="") {
 
-            let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
+        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})
+    	  }
+        else {
+          // alert(paths[i])
+    	 // alert()
+          let nms = paths[i].split("\/")
+          let nm = nms[nms.length - 1]
+    	  if(paths[i][0]=="/")
+          _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})
 
-            if (_this.fot.includes(pth) === true)
-              _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
-            else {
-              // 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]})
-            }
-          }
-        }
+    	}
+      }
+    //  _this.fileList1 = _this.fileList
+    }
         this.loading = false;
       });
 
@@ -322,10 +333,18 @@
       this.$refs['elForm'].resetFields()
     },
     handleFileCardPreview(file){
-      this.dialogFileUrl = file.url;
-      const Base64 = require('js-base64').Base64
-      this.desurl = process.env.VUE_APP_BASE_OTHER_API+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
-      myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
+
+	      this.dialogFileUrl = file.url;
+	  if(this.dialogFileUrl.includes("47.93.189.255")==true)
+	    this.dialogFileUrl = this.dialogFileUrl.replace("47.93.189.255","www.bendudu.com")
+	  //alert(this.dialogFileUrl)
+	  const Base64 = require('js-base64').Base64
+
+	  this.desurl = process.env.VUE_APP_BASE_OTHER_API+"preview/"+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl));
+	  let myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300');
+
+
+
     },
     handlePreview(file)
     {
@@ -354,10 +373,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)
@@ -374,7 +393,7 @@
       	  updatenotePet(this.formData).then(response => {
       		this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       		// this.open = false;
-      	  
+
       	  });
         }
     },
@@ -398,7 +417,7 @@
      		 	//	  alert(this.uploadFileList.length)
      		 }
            this.$delete(this.fileList,i);
-        
+
        }
        }
        let ul = ""
@@ -451,7 +470,7 @@
    //鑷畾涔変笂浼犳柟娉�
        handleChange(file, fileList1) {
           //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍
-   
+
         // this.uploadFileList.push(file.raw);
          console.log("=========5555=========")
    	  this.uploadFileList.push(file.raw);
@@ -460,7 +479,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})
@@ -471,7 +490,7 @@
    	},
    	fileUpload(){
    	//	var file = params.file;
-   
+
    		var formData = new FormData();
    		//this.$refs.upload1.submit();
    	//	alert(this.uploadFileList1.length)
@@ -479,42 +498,45 @@
    		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;
+		// alert(234)
    		uploadPic(formData).then(response => {
    		_this.uploadFileList1 = []
    		  _this.formData.url = _this.formData.url+","+response.fileNames
+		  // alert(2346)
    		    updatenotePet(_this.formData).then(response => {
    		      this.$modal.msgSuccess("鏂囨。涓婁紶鎴愬姛");
    		      // this.open = false;
+            this.uploading = 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)
@@ -541,12 +563,12 @@
              updatenotePet(_this.formData).then(response => {
                _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");
                // this.open = false;
-   
+
              });
            // }
            // else{
            //   _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
-   
+
            // }
          });
    	},
@@ -554,10 +576,10 @@
        {
       //  alert(124)
    //	 this.uploadFileList.push(params.file);
-   
+
         //alert(34)
-    
-   	
+
+
        },
        requestUpload1(params)
        {

--
Gitblit v1.9.1