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 | 81 ++++++++++++++++++++++++++--------------
1 files changed, 52 insertions(+), 29 deletions(-)
diff --git a/ruoyi-ui/src/views/device/memo.vue b/ruoyi-ui/src/views/device/memo.vue
index 55e5714..d8081c5 100644
--- a/ruoyi-ui/src/views/device/memo.vue
+++ b/ruoyi-ui/src/views/device/memo.vue
@@ -86,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 {
@@ -94,7 +94,8 @@
dicts: ['sys_normal_disable'],
data() {
return {
- // 閬僵灞�
+ // 閬僵灞俰sEdit1:false,isEdit1:false,
+ isEdit1:false,
disabled: false,
loading: true,
formData:[],
@@ -309,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;
},
@@ -328,31 +329,53 @@
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.getList(_this.formDat.fid,_this.formDat.cid);
- //娓呯┖formDat瀵硅薄鐨勬暟鎹�
- Object.keys(this.formDat).forEach(key => {
- this.formDat[key] = '';
- });
- 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();
+ });
+ }
}
});
--
Gitblit v1.9.1