mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
笔记代码还原
This commit is contained in:
@@ -11,11 +11,17 @@
|
||||
<h3> {{ editdata.courseName }} </h3>
|
||||
<div v-if="editdata.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">8:40</div>
|
||||
</div>
|
||||
<div class="note-text">
|
||||
<div class="note-text" v-if="editdata.contentType != 3">
|
||||
<!-- <input style="vertical-align:top;outline:none;" type="textarea" :rows="4" v-model="editdata.content"> -->
|
||||
<textarea v-model="editdata.content" name="" id="" cols="" rows="16" style="vertical-align:top;outline:none;width:100%;border:none; font-size: 14px;font-weight: 400;color: #333333;" maxlength="200"
|
||||
show-word-limit></textarea>
|
||||
</div>
|
||||
<div class="note-text" v-else>
|
||||
<div class="img-box" v-for="(img,index) in imgContent">
|
||||
<img :src="fileBaseUrl + img" alt=""/>
|
||||
<span class="del-icon"><i class="el-icon-delete" @click="imgDel(index)"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edit-footer">
|
||||
<el-radio-group v-model="editdata.openType">
|
||||
@@ -40,9 +46,14 @@
|
||||
</div>
|
||||
<span class="pointer" @click="restore(item)"> <i class="el-icon-refresh-left"></i> 还原</span>
|
||||
</div>
|
||||
<div class="hist-text">
|
||||
<div class="hist-text" v-if="editdata.contentType != 3">
|
||||
{{ item.beforeContent }}
|
||||
</div>
|
||||
<div class="hist-text" v-else>
|
||||
<template class="img-box" v-for="(before,index) in item.beforeContent">
|
||||
<img style="width:40px;height:65px;margin-right:10px" :src="fileBaseUrl + before" alt=""/>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user