mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
修改笔记编辑逻辑 - 公开笔记转私密笔记时按钮控制。
This commit is contained in:
@@ -84,9 +84,9 @@
|
||||
<div class="newcote-bottom" v-if="notetab == 1 || isEdit">
|
||||
<span v-if="btnPlayTime" style="cursor: pointer;" @click="videoLocation"> <img src="../../../public/images/playtime.png"
|
||||
alt=""> 视频位置</span>
|
||||
<el-radio v-model="mynoteData.openType" :label="9">公开</el-radio>
|
||||
<el-radio v-model="mynoteData.openType" :label="1">私密</el-radio>
|
||||
<el-button size="small" v-show="isEdit" @click="isEdit = false">取消</el-button>
|
||||
<el-radio v-if="mynoteData.openType == 9" v-model="editRadio" :label="9">公开</el-radio>
|
||||
<el-radio v-model="editRadio" :label="1">私密</el-radio>
|
||||
<el-button size="small" v-show="isEdit" @click="editCancel()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="saveNote()">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -133,6 +133,7 @@ export default {
|
||||
courseName: '',// 课程名称
|
||||
openType: 9,// 1表不公开 9表完全公开
|
||||
},
|
||||
editRadio: 9 , // 单选按钮(笔记公开状态)状态值 : 1- 私密 9-公开
|
||||
noteList: [],
|
||||
type: 1, // 1自动保存 2点击保存
|
||||
};
|
||||
@@ -165,6 +166,12 @@ export default {
|
||||
//这里应该加上内容的id
|
||||
this.$emit('onPlayVideo',conId,time);
|
||||
},
|
||||
|
||||
// 取消编辑
|
||||
editCancel(){
|
||||
this.isEdit = false; // 关闭编辑框
|
||||
this.getMyNote(); // 重新渲染对应课程的笔记列表
|
||||
},
|
||||
formatSeconds(value) {
|
||||
let result = parseInt(value)
|
||||
let h = Math.floor(result / 3600);
|
||||
@@ -199,6 +206,7 @@ export default {
|
||||
console.log(note,'note');
|
||||
this.isEdit = true;
|
||||
this.mynoteData = note;
|
||||
this.editRadio = this.mynoteData.openType; // 设置默认的单选按钮选中状态
|
||||
// this.notetabType(1);
|
||||
},
|
||||
noteDel(note) {
|
||||
@@ -258,6 +266,7 @@ export default {
|
||||
}
|
||||
this.mynoteData.courseId = this.courseId;
|
||||
this.mynoteData.courseName = this.data.name;
|
||||
this.mynoteData.openType = this.editRadio;
|
||||
if(this.isEdit) {
|
||||
apiNote.update(this.mynoteData).then(res=>{
|
||||
if(res.status == 200) {
|
||||
|
||||
Reference in New Issue
Block a user