mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
个人中心笔记
This commit is contained in:
@@ -93,6 +93,7 @@ export default {
|
||||
name: 'MyNote',
|
||||
data() {
|
||||
return {
|
||||
courseId:'',
|
||||
inAnimation: false,
|
||||
radio: '1',
|
||||
notetab: 1,
|
||||
@@ -114,23 +115,19 @@ export default {
|
||||
...mapGetters(['intTimeNote', 'userInfo']),
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.data,'data111');
|
||||
// this.mynoteData.courseId = this.data.courseId;
|
||||
// this.mynoteData.contentId = this.data.id;
|
||||
// if(localStorage.getItem("NOTE_TEXT") !=''){
|
||||
// this.mynoteData.content = localStorage.getItem("NOTE_TEXT");
|
||||
// this.notetab = 1;
|
||||
// }
|
||||
// console.log(this.$route,'route');
|
||||
// console.log(this.data,'data111');
|
||||
this.courseId = this.$route.query.id;
|
||||
this.getMyNote();
|
||||
// this.autoSaveNote();
|
||||
|
||||
},
|
||||
watch: {
|
||||
data(val){
|
||||
if(val.id) {
|
||||
console.log(val,'val');
|
||||
this.mynoteData.courseId = this.data.courseId;
|
||||
this.mynoteData.contentId = this.data.id;
|
||||
this.mynoteData.courseId = this.courseId;
|
||||
this.mynoteData.courseName = this.data.name;
|
||||
// this.mynoteData.contentId = this.data.id;
|
||||
}
|
||||
},
|
||||
intTimeNote(val) {
|
||||
@@ -187,7 +184,7 @@ export default {
|
||||
|
||||
},
|
||||
getMyNote() {
|
||||
apiNote.myCourse(this.mynoteData.courseId).then(res => {
|
||||
apiNote.myCourse(this.courseId).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.noteList = res.result;
|
||||
}
|
||||
@@ -207,6 +204,7 @@ export default {
|
||||
this.$message({ type: 'info', message: '您还没有书写笔记!', offset: 50 });
|
||||
return;
|
||||
}
|
||||
this.mynoteData.courseId = this.courseId;
|
||||
console.log(this.mynoteData,'this.mynoteData');
|
||||
apiNote.save(this.mynoteData).then(res => {
|
||||
if (res.status == 200) {
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
</div>
|
||||
<!-- 我的笔记 -->
|
||||
<div class="mynote" v-show="tab == 2">
|
||||
<my-note :data="contentData" @videoLocation="videoLocation" @onPlayVideo="onPlayVideo" :score="courseInfo.score"></my-note>
|
||||
<my-note :data="courseInfo" @videoLocation="videoLocation" @onPlayVideo="onPlayVideo" :score="courseInfo.score"></my-note>
|
||||
</div>
|
||||
</div>
|
||||
<div class="coures-tearch">
|
||||
|
||||
@@ -56,12 +56,12 @@
|
||||
<span @click="noteData(2)" :class=" num == 2 ? 'tab-textactive':''" >导入笔记</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note-all" v-if="num == null" >
|
||||
<div class="note-all">
|
||||
<div class="note-all-info" v-for="(item,idx) in datalist" :key="idx">
|
||||
<div class="all-title">
|
||||
<h3> {{ item.courseName }} </h3>
|
||||
<div><img src="../../../public/images/coteplay.png" alt=""> {{ getHMS(item.playTime) }} </div>
|
||||
<span>私密</span>
|
||||
<div v-if="item.playTime != ''"><img src="../../../public/images/coteplay.png" alt=""> {{ getHMS(item.playTime) }} </div>
|
||||
<span>{{item.openType == 9?'公开':'私密'}}</span>
|
||||
<h6>{{ item.sysUpdateTime }}</h6>
|
||||
</div>
|
||||
<div class="all-content">
|
||||
@@ -71,54 +71,7 @@
|
||||
<div class="all-footer">
|
||||
<div>
|
||||
<div class="textbut-box">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="datalist" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
|
||||
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
|
||||
<el-button @click="edit(item)" class="textbut" type="text">
|
||||
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note-all-info">
|
||||
<div class="all-title">
|
||||
<h3> 《高效能人士的7个习惯》</h3>
|
||||
<!-- <div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
|
||||
<span>私密</span> -->
|
||||
<div class="daoru">导入</div>
|
||||
<h6>2022/05/21 16:28</h6>
|
||||
</div>
|
||||
<div class="all-content">
|
||||
我见过的策划们,不管是甲方企业的,还是广告代理都经常犯三大错误:找一个营销理论,做策略时直接向上套。不管是什么行业、企业处在什么发展阶段,都要照着这个理论的要求,做策略时直接向上套。不管是什么行业、企业处在什么来实。不管是么行业、企业处在什什么行业、企业处在发展发发发施营销传播,写PPT时 也要照着这个理论的框架来写。施营销传播,写PPT时 也要照着这个理论的框架来写施营销传播,写PPT时 也要照论。
|
||||
</div>
|
||||
<div class="all-footer">
|
||||
<div>
|
||||
<div class="textbut-box">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="datalist" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
|
||||
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
|
||||
<el-button @click="edit(item)" class="textbut" type="text">
|
||||
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note-all-info">
|
||||
<div class="all-title">
|
||||
<h3> 《高效能人士的7个习惯》</h3>
|
||||
<!-- <div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
|
||||
<span>私密</span> -->
|
||||
<div class="daoru">导入</div>
|
||||
<h6>2022/05/21 16:28</h6>
|
||||
</div>
|
||||
<div class="all-content">
|
||||
<img src="../../../public/images/course.png" alt="">
|
||||
<!-- <img v-if="item.filePath" :src="fileBaseUrl + item.filePath" alt=""> -->
|
||||
</div>
|
||||
<div class="all-footer">
|
||||
<div>
|
||||
<div class="textbut-box">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="datalist" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="item" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
|
||||
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
|
||||
<el-button @click="edit(item)" class="textbut" type="text">
|
||||
@@ -128,63 +81,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="note-all" v-if="num == 1" >
|
||||
<div class="note-all-info" v-for="(item,idx) in datalist" :key="idx">
|
||||
<div class="all-title">
|
||||
<h3> {{ item.courseName }} </h3>
|
||||
<div><img src="../../../public/images/coteplay.png" alt="">{{ getHMS(item.playTime) }}</div>
|
||||
<span>私密</span>
|
||||
<h6>{{ item.sysUpdateTime }}</h6>
|
||||
</div>
|
||||
<div class="all-content">
|
||||
{{ item.content }}
|
||||
<img v-if="item.filePath" :src="fileBaseUrl + item.filePath" alt="">
|
||||
</div>
|
||||
<div class="all-footer">
|
||||
<div>
|
||||
<div class="textbut-box">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="datalist" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
|
||||
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
|
||||
<el-button @click="edit(item)" class="textbut" type="text">
|
||||
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="note-all" v-if="num == 2" >
|
||||
<div class="note-all-info" v-for="(item,idx) in datalist" :key="idx">
|
||||
<div class="all-title">
|
||||
<h3> {{ item.courseName }} </h3>
|
||||
<div><img src="../../../public/images/coteplay.png" alt="">{{ getHMS(item.playTime) }}</div>
|
||||
<span v-if="item.openType == 1">私密</span>
|
||||
<h6>{{ item.sysUpdateTime }}</h6>
|
||||
</div>
|
||||
<div class="all-content">
|
||||
{{ item.content }}
|
||||
<img v-if="item.filePath" :src="fileBaseUrl + item.filePath" alt="">
|
||||
</div>
|
||||
<div class="all-footer">
|
||||
<div>
|
||||
<div class="textbut-box">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="6" :data="datalist" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
||||
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
|
||||
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
|
||||
<el-button @click="edit(item)" class="textbut" type="text">
|
||||
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog
|
||||
width="860px"
|
||||
title="王明"
|
||||
@@ -278,7 +174,6 @@ export default {
|
||||
Time(){
|
||||
this.startTime = this.Filtertime[0];
|
||||
this.endTime = this.Filtertime[1];
|
||||
console.log(this.Filtertime[0]);
|
||||
this.noteData(this.num);
|
||||
},
|
||||
open(item) {
|
||||
@@ -300,14 +195,8 @@ export default {
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
console.log(item.id)
|
||||
|
||||
|
||||
},
|
||||
couresitem(item){
|
||||
console.log(item.courseId)
|
||||
this.courseId = item.courseId;
|
||||
this.noteData(this.num)
|
||||
},
|
||||
@@ -335,11 +224,8 @@ export default {
|
||||
},
|
||||
edit(item){
|
||||
this.$router.push({ path: `/user/Noteedit?id=${item.id}` });
|
||||
|
||||
|
||||
},
|
||||
noteData(tab){
|
||||
// console.log(tab)
|
||||
this.num = tab
|
||||
let data = {
|
||||
pageIndex:this.pageIndex,
|
||||
@@ -352,10 +238,7 @@ export default {
|
||||
endTime:this.endTime,
|
||||
}
|
||||
apiNote.query(data).then(res=>{
|
||||
// console.log(res);
|
||||
|
||||
this.datalist = res.result.list
|
||||
// console.log(this.datalist,'111lmj')
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<div class="edit-box">
|
||||
<div class="edit-hear">
|
||||
<h3>笔记编辑</h3>
|
||||
<span>笔记自动保存成功</span>
|
||||
<span>{{isShowTip}}</span>
|
||||
</div>
|
||||
<div class="edit-content">
|
||||
<div class="note-tit">
|
||||
<h3> {{ editdata.courseName }} </h3>
|
||||
<div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
|
||||
<div v-if="editdata.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">8:40</div>
|
||||
</div>
|
||||
<div class="note-text">
|
||||
<!-- <input style="vertical-align:top;outline:none;" type="textarea" :rows="4" v-model="editdata.content"> -->
|
||||
@@ -16,8 +16,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="edit-footer">
|
||||
<el-radio v-model="editdata.openType" :label="9">公开</el-radio>
|
||||
<el-radio v-model="editdata.openType" :label="1">私密</el-radio>
|
||||
<el-radio-group v-model="editdata.openType">
|
||||
<el-radio :label="9">公开</el-radio>
|
||||
<el-radio :label="1">私密</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button @click="comeback">取消</el-button>
|
||||
<el-button type="primary" @click="savedata" >确定</el-button>
|
||||
</div>
|
||||
@@ -55,6 +57,7 @@ import apiNote from '@/api/phase2/note.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
isShowTip:'',
|
||||
radio: '1',
|
||||
editdata:{
|
||||
|
||||
@@ -62,12 +65,15 @@ export default {
|
||||
histId:'',
|
||||
histdata:[],
|
||||
id:'',
|
||||
timer:null,
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
this.id = this.$route.query.id;
|
||||
this.notedetail()
|
||||
|
||||
this.id = this.$route.query.id;
|
||||
this.notedetail();
|
||||
this.timer = setInterval(()=>{
|
||||
this.savedata(1);
|
||||
},300000);
|
||||
},
|
||||
methods:{
|
||||
comeback(){
|
||||
@@ -75,16 +81,15 @@ export default {
|
||||
},
|
||||
notedetail(){
|
||||
apiNote.detail(this.id).then(res=>{
|
||||
let that = this;
|
||||
that.editdata = res.result
|
||||
console.log(res.result)
|
||||
that.histId = res.result.id
|
||||
that.hist();
|
||||
// let that = this;
|
||||
this.editdata = res.result;
|
||||
this.editdata.openTypeBackups = res.result.openType;
|
||||
this.histId = res.result.id;
|
||||
this.hist();
|
||||
})
|
||||
},
|
||||
restore(item){
|
||||
apiNote.restore(item.id).then(res=>{
|
||||
console.loh(res)
|
||||
this.$message({
|
||||
message: '还原成功',
|
||||
type: 'success'
|
||||
@@ -94,21 +99,44 @@ export default {
|
||||
},
|
||||
hist(){
|
||||
apiNote.history(this.histId).then(res=>{
|
||||
console.log(res,'qqq')
|
||||
this.histdata = res.result
|
||||
})
|
||||
},
|
||||
|
||||
savedata(){
|
||||
savedata(num){
|
||||
if(this.editdata.openTypeBackups == 1 && this.editdata.openType == 9) {
|
||||
this.$message({
|
||||
message: '仅支持公开笔记转私密笔记!',
|
||||
type: 'warning'
|
||||
});
|
||||
this.editdata.openType == 1;
|
||||
}
|
||||
apiNote.update(this.editdata).then(res=>{
|
||||
this.notedetail()
|
||||
this.$message({
|
||||
message: '编辑成功',
|
||||
if(res.status == 200) {
|
||||
sessionStorage.setItem('isShowTip','');
|
||||
if(num ==1) {//自动保存
|
||||
this.isShowTip = '笔记自动保存成功';
|
||||
setTimeout(()=>{
|
||||
this.isShowTip = '';
|
||||
},10000)
|
||||
} else {
|
||||
this.notedetail()
|
||||
this.$message({
|
||||
message: '笔记保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.isShowTip = '当前网络异常,内容已离线保存,请尝试连接网络后重新自动上传!';
|
||||
sessionStorage.setItem('isShowTip',this.editdata.content);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearImmediate(this.timer);
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -128,7 +156,7 @@ export default {
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
.histinfo{
|
||||
background: #F2F5F7;
|
||||
// background: #F2F5F7;
|
||||
.hist-cont{
|
||||
padding: 38px 32px;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user