From 2b1a20911531565bf42e6c6d5b4b176743e2c0ec Mon Sep 17 00:00:00 2001
From: zhaofang <752743406@qq.com>
Date: Wed, 28 Sep 2022 11:42:02 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/user/Mynotes.vue | 8 +++---
src/views/user/Noteedit.vue | 52 ++++++++++++++++++++++++++++++++++---
2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/src/views/user/Mynotes.vue b/src/views/user/Mynotes.vue
index 91bb2ce9..ed68aa81 100644
--- a/src/views/user/Mynotes.vue
+++ b/src/views/user/Mynotes.vue
@@ -276,14 +276,14 @@ export default {
this.$message.warning('请填写标题!');
return
}
- if(this.noteFile.filePath == '') {
- this.$message.warning('您还没有上传文件!');
- return
- }
this.noteFile.contentType = this.upNoteFile.contentType;
if(this.upNoteFile.content.length > 0) {
this.noteFile.filePath = this.upNoteFile.content.join();
}
+ if(this.noteFile.filePath == '') {
+ this.$message.warning('您还没有上传文件!');
+ return
+ }
apiNote.save(this.noteFile).then(res=>{
if(res.status == 200) {
this.$message.success('导入笔记成功');
diff --git a/src/views/user/Noteedit.vue b/src/views/user/Noteedit.vue
index 67c61bf3..8d91f281 100644
--- a/src/views/user/Noteedit.vue
+++ b/src/views/user/Noteedit.vue
@@ -11,11 +11,17 @@
{{ editdata.courseName }}

8:40
-
+
+
+
+
![]()
+
+
+
还原
-
+
{{ item.beforeContent }}
+
+
+
+
+
@@ -54,6 +65,8 @@ import apiNote from '@/api/phase2/note.js'
export default {
data () {
return {
+ imgContent:[],
+ fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
isShowList:false,
isShowTip:'',
radio: '1',
@@ -75,14 +88,21 @@ export default {
},30000 *10);
},
methods:{
+ imgDel(index) {
+ this.imgContent.splice(index,1);
+ },
comeback(){
this.$router.go(-1);
},
notedetail(){
apiNote.detail(this.id).then(res=>{
+ if(res.result.contentType == 3 && res.result.content != '') {
+ this.imgContent = res.result.content.split(',');
+ }
this.editdata = res.result;
this.editdata.openTypeBackups = res.result.openType;
this.histId = res.result.id;
+
this.hist();
})
},
@@ -92,7 +112,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.editdata.content = item.beforeContent;
+ this.imgContent = item.beforeContent;
}).catch(() => {
this.$message({
type: 'info',
@@ -111,6 +131,12 @@ export default {
},
hist(){
apiNote.history(this.histId).then(res=>{
+ if(this.editdata.contentType == 3) {
+ res.result.forEach(item=>{
+ item.beforeContent = item.beforeContent.split(',');
+ })
+
+ }
this.histdata = res.result
})
},
@@ -124,6 +150,9 @@ export default {
}
if(num == 1) {
this.editdata.isAuto = true;
+ }
+ if(this.imgContent.length > 0) {
+ this.editdata.content = this.imgContent.join();
}
apiNote.update(this.editdata).then(res=>{
if(res.status == 200) {
@@ -256,6 +285,23 @@ export default {
font-size: 14px;
font-weight: 400;
color: #333333;
+ display: flex;
+ flex-wrap: wrap;
+ .img-box{
+ position: relative;
+ // display: flex;
+ .del-icon{
+ display: inline-block;
+ position: absolute;
+ top:0;
+ right:20px;
+ }
+ }
+ img{
+ width: 140px;
+ height: 175px;
+ margin-right: 23px;
+ }
input{
border: none;
font-size: 14px;