From 0188d5c81ee28ab2f42edc5d1db67c9cdb0db42d Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期五, 29 三月 2024 23:15:46 +0800
Subject: [PATCH] 提交上传的图像的代码

---
 ruoyi-ui/src/views/device/memo.vue |   93 ++++++++++++++++++++++++++++++----------------
 1 files changed, 60 insertions(+), 33 deletions(-)

diff --git a/ruoyi-ui/src/views/device/memo.vue b/ruoyi-ui/src/views/device/memo.vue
index 719c3ca..d8081c5 100644
--- a/ruoyi-ui/src/views/device/memo.vue
+++ b/ruoyi-ui/src/views/device/memo.vue
@@ -51,6 +51,7 @@
             v-model='formDat.happenTime'
             type='date'
             placeholder='閫夋嫨鏃ユ湡'
+			value-format="yyyy-MM-dd"
           ></el-date-picker>
         </el-form-item>
 
@@ -85,7 +86,7 @@
 
 
 //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁�  --鎺ュソ浜�
-import {addNote,listNote,enload,delNote, uploadPic} from "@/api/allmemo/index";
+import {addNote,updateNote, listNote,enload,delNote, uploadPic} from "@/api/allmemo/index";
 import { TimeSelect } from "element-ui";
 
 export default {
@@ -93,7 +94,8 @@
   dicts: ['sys_normal_disable'],
   data() {
     return {
-      // 閬僵灞�
+      // 閬僵灞俰sEdit1:false,isEdit1:false,
+	  isEdit1:false,
       disabled: false,
       loading: true,
       formData:[],
@@ -122,7 +124,10 @@
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       // 鏁版嵁鑼冨洿閫夐」
-      fot:[".jpg",".jif"],
+     // 鏁版嵁鑼冨洿閫夐」
+     fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
+       '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
+     
       fileList:[
       ],
       fileListOther:[
@@ -159,7 +164,7 @@
         happenTime: [{
           required: true,
           message: '璇烽�夋嫨鏃ユ湡閫夋嫨',
-          trigger: 'change'
+          trigger: 'blur'
         }],
         content: [{
           required: true,
@@ -305,14 +310,14 @@
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       const id = row.id;
-      let jd = true
+  
 
-      this.$router.push({
-        path:"/self/travel/travelInfo/" + id,
-        query:{
-          detail:jd
-        }
-      });
+     this.isEdit1 = true;
+     this.formDat.cid = row.cid;
+     this.formDat.id = row.id;
+     this.formDat.happenTime = row.happenTime;
+     this.formDat.content = row.content;
+     this.open = true;
     },
 
 
@@ -324,34 +329,56 @@
     submitDataScope: function() {
       const cid = this.$route.params && this.$route.params.id;
       const fid =2017;
-      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(",")
+      // 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.formDat.fid = 2017;
       this.formDat.cid = cid ;
-      this.formDat.url = ul+","+uls
-
+      // this.formDat.url = ul+","+uls
+		let _this = this
       this.$refs["elForm"].validate(valid => {
         if (valid) {
-
-          addNote(this.formDat).then(response => {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-            this.open = false;
-            // this.queryParams.cid = cid
-            // this.queryParams.fid = fid
-            this.getList(this.formDat.fid,this.formDat.cid);
-
-            resetQuery();
-          });
+          if (this.isEdit1) {
+			  // 鎵ц淇敼鎿嶄綔
+			  updateNote(this.formDat).then(response => {
+			    console.log("1")
+			    this.$modal.msgSuccess("淇敼鎴愬姛");
+			    this.open = false;
+			    //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+			    Object.keys(this.formDat).forEach(key => {
+			      this.formDat[key] = '';
+			    });
+			    this.isEdit1 = false;
+			    this.getList(2017,cid);
+			  }).catch(error => {
+			    console.log(error);
+			    this.isEdit1 = false;
+			    this.open = false;
+			  });
+			  
+			  
+  
+		  }
+		  else{
+			  addNote(this.formDat).then(response => {
+			           this.$modal.msgSuccess("鏂板鎴愬姛");
+			           this.open = false;
+			           // this.queryParams.cid = cid
+			    
+			           this.getList(_this.formDat.fid,_this.formDat.cid);
+			  //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+			     Object.keys(this.formDat).forEach(key => {
+			       this.formDat[key] = '';
+			     });
+			      //     resetQuery();
+			         });
+		  }
         }
       });
-      //娓呯┖formDat瀵硅薄鐨勬暟鎹�
-      Object.keys(this.formDat).forEach(key => {
-        this.formDat[key] = '';
-      });
+   
     },
     requestUpload(params)
     {

--
Gitblit v1.9.1