diff --git a/src/components/Course/myNote.vue b/src/components/Course/myNote.vue index 11e05027..b4af83e9 100644 --- a/src/components/Course/myNote.vue +++ b/src/components/Course/myNote.vue @@ -26,7 +26,7 @@
{{note.sysCreateTime}} - {{note.openType == 1?'公开':'私密'}} + {{note.openType == 9?'公开':'私密'}} @@ -248,7 +248,7 @@ export default { // courseId: '',// 课程id // contentId: '',//课程内容id // courseName: '',// 课程名称 - openType: 1,// 1表不公开 9表完全公开 + openType: 9,// 1表不公开 9表完全公开 }; }, 2000) } @@ -274,7 +274,7 @@ export default { // courseId: '',// 课程id // contentId: '',//课程内容id // courseName: '',// 课程名称 - openType: 1,// 1表不公开 9表完全公开 + openType: 9,// 1表不公开 9表完全公开 }; }, 2000) diff --git a/src/views/user/Mynotes.vue b/src/views/user/Mynotes.vue index c505bfba..91bb2ce9 100644 --- a/src/views/user/Mynotes.vue +++ b/src/views/user/Mynotes.vue @@ -71,15 +71,19 @@
{{ item.sysUpdateTime }}
- {{ item.content }} - + {{ item.content }} +
+ +
@@ -192,9 +196,13 @@ export default { fileName:'', openType:1, }, - fileType:[], - filType:null, - limit:1, + upNoteFile:{ + content:[], + fileType:[],//文件上传格式 + contentType:null, + limit:1, + }, + uploadFileUrl: process.env.VUE_APP_BASE_API + '/xboe/sys/xuploader/file/upload', text:'', importDialogVisible:false, @@ -240,7 +248,6 @@ export default { return item.id; } }) - console.log(ids,'contentType'); let data = { // name:this.userInfo.name, // sign:'abcd', @@ -263,14 +270,20 @@ export default { document.body.removeChild(link); }) } - console.log(e,'e'); }, noteSave() { if(this.noteFile.courseName == '') { this.$message.warning('请填写标题!'); return } - this.noteFile.contentType =this.filType; + 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(); + } apiNote.save(this.noteFile).then(res=>{ if(res.status == 200) { this.$message.success('导入笔记成功'); @@ -284,28 +297,35 @@ export default { }, importCommand(e){ this.importDialogVisible = true; - this.filType = e; + this.upNoteFile.contentType = e; if(e == '3') { - this.limit = 9; - this.fileType = ["png","jpg"]; + this.upNoteFile.limit = 9; + this.upNoteFile.fileType = ["png","jpg"]; } else if(e == '1'){ - this.fileType = ["txt"]; + this.upNoteFile.fileType = ["txt"]; } else { - this.fileType = ["doc","docx"]; + this.upNoteFile.fileType = ["doc","docx"]; } }, handleRemoveSuccess(file) { - if(this.filType == 1) { + if(this.upNoteFile.contentType == 1) { + // this.upNoteFile.content.push() // this.noteFile.filePath.replace(file.response.result.filePath+',',''); + this.upNoteFile.content.forEach((item,index) => { + if(item == file.response.result.filePath) { + this.upNoteFile.content.splice(index,1); + } + }); } else { this.noteFile.filePath =''; this.noteFile.fileName = ''; } }, handleUploadSuccess(file) { - if(this.filType == 3) { + if(this.upNoteFile.contentType == 3) { this.noteFile.fileName = '图片'; - this.noteFile.filePath += file.result.filePath; + this.upNoteFile.content.push(file.result.filePath); + // this.noteFile.filePath += file.result.filePath; } else { this.noteFile.filePath = file.result.filePath; this.noteFile.fileName = file.result.displayName; @@ -383,8 +403,16 @@ export default { endTime:this.endTime, } apiNote.query(data).then(res=>{ - this.datalist = res.result.list; - this.count = res.result.count; + if(res.status == 200) { + res.result.list.forEach((item,index)=>{ + if(item.contentType == 3) { + item.content = item.content.split(','); + } + }); + this.datalist = res.result.list; + this.count = res.result.count; + } + }) },