From 81475c257b068c74f335024f7a15359a03cad8e8 Mon Sep 17 00:00:00 2001
From: yz3456 <2753272399@qq.com>
Date: 星期三, 01 五月 2024 14:07:05 +0800
Subject: [PATCH] 修改备忘录其他附件背景图

---
 ruoyi-ui/src/views/honor/honorInfo.vue |  100 +++++++++++++++++++++++++++++++++++++------------
 1 files changed, 75 insertions(+), 25 deletions(-)

diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue
index de4a44d..fd04a1c 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"
@@ -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,7 +380,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)
@@ -400,7 +399,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})
-          		
+
           	}
             }
         }
@@ -423,6 +422,55 @@
   },
   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
@@ -440,7 +488,7 @@
       const newOption = this.newOption.trim();
       if (newOption && !this.typeOptions.includes(newOption)) {
         this.typeOptions.push(newOption);
-        this.$set(this.formData, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
+        this.$set(this.formData, 'name', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
       }
     },
     getTypeOptions() {
@@ -549,10 +597,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 +617,7 @@
       	  updateHonor(this.formData).then(response => {
       		this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       		// this.open = false;
-      	  
+
       	  });
         }
     },
@@ -593,7 +641,7 @@
       		 	//	  alert(this.uploadFileList.length)
       		 }
             this.$delete(this.fileList,i);
-         
+
         }
         }
         let ul = ""
@@ -612,7 +660,7 @@
       		this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       	  });
         }
-      
+
     },
     handleFileCardPreview(file){
       this.dialogFileUrl = file.url;
@@ -659,7 +707,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 +726,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 +741,8 @@
 		    updateHonor(_this.formData).then(response => {
 		      this.$modal.msgSuccess("鏂囨。涓婁紶鎴愬姛");
 		      // this.open = false;
+          this.getData()
+          this.fileListOther1=[]
 		    });
 		  })
 
@@ -709,11 +759,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 +805,8 @@
 //	 this.uploadFileList.push(params.file);
 
      //alert(34)
- 
-	
+
+
     },
     requestUpload1(params)
     {

--
Gitblit v1.9.1