diff --git a/src/api/system/user.js b/src/api/system/user.js index ddcc76f7..ff3723f1 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -76,6 +76,13 @@ const updateDynamic=function (dynamic){ return ajax.get('/xboe/sys/user/update-dynamic?dynamic='+dynamic); } +/** + * 二次查询 签名和动态 + * */ +const findSignDynamic=function (id){ + return ajax.get('/xboe/sys/user/findSign-dynamic='+id); +} + export default{ list, searchLoginName, @@ -84,5 +91,6 @@ export default{ findByName, detail, updateSign, - updateDynamic + updateDynamic, + findSignDynamic } diff --git a/src/components/Course/myNote.vue b/src/components/Course/myNote.vue index 11e05027..b7cb362d 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?'公开':'私密'}} @@ -227,6 +227,7 @@ export default { // } }, saveNote() { + let that = this; if (this.mynoteData.content == '') { this.$message({ type: 'info', message: '您还没有书写笔记!', offset: 50 }); return; @@ -240,15 +241,15 @@ export default { this.inAnimation = true; this.isEdit = false; setTimeout(() => { - this.getMyNote(); - this.mynoteData = { + that.getMyNote(); + that.mynoteData = { type: 1, //我发布的是1 我导入的是2 content: '', playTime: '', // courseId: '',// 课程id // contentId: '',//课程内容id // courseName: '',// 课程名称 - openType: 1,// 1表不公开 9表完全公开 + openType: 9,// 1表不公开 9表完全公开 }; }, 2000) } @@ -262,19 +263,19 @@ export default { if(this.mynoteData.openType != 9){ return } - setTimeout(() => { + setTimeout(() => { localStorage.setItem("NOTE_TEXT", ''); // clearInterval(this.autoSave); - this.getMyNote(); - this.notetabType(2); - this.mynoteData = { + that.getMyNote(); + that.notetabType(2); + that.mynoteData = { type: 1, //我发布的是1 我导入的是2 content: '', playTime: '', // 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..ed68aa81 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; + 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('导入笔记成功'); @@ -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; + } + }) }, 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;