mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
增加删除笔记的事件
This commit is contained in:
@@ -4,17 +4,14 @@
|
|||||||
<h3>我的笔记</h3>
|
<h3>我的笔记</h3>
|
||||||
<div>
|
<div>
|
||||||
<el-dropdown style="margin-left:15px" @command="exportCommand">
|
<el-dropdown style="margin-left:15px" @command="exportCommand">
|
||||||
<el-button>
|
<el-button>导出<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
导出<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="1">PDF</el-dropdown-item>
|
<el-dropdown-item command="1">PDF</el-dropdown-item>
|
||||||
<el-dropdown-item command="2">Excel</el-dropdown-item>
|
<el-dropdown-item command="2">Excel</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-dropdown style="margin-left:15px" @command="importCommand">
|
<el-dropdown style="margin-left:15px" @command="importCommand">
|
||||||
<el-button>
|
<el-button>导入<i class="el-icon-arrow-down el-icon--right"></i>
|
||||||
导入<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="3">图片</el-dropdown-item>
|
<el-dropdown-item command="3">图片</el-dropdown-item>
|
||||||
@@ -36,9 +33,7 @@
|
|||||||
end-placeholder="结束">
|
end-placeholder="结束">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
<el-dropdown @command="handleCommand">
|
<el-dropdown @command="handleCommand">
|
||||||
<el-button>
|
<el-button>全部课程<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
全部课程<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown" style="height: 150px;overflow-y: auto !important;">
|
<el-dropdown-menu slot="dropdown" style="height: 150px;overflow-y: auto !important;">
|
||||||
<el-dropdown-item command="">全部</el-dropdown-item>
|
<el-dropdown-item command="">全部</el-dropdown-item>
|
||||||
<el-dropdown-item v-for="cou in couresna" :command="cou.courseId">{{cou.courseName}}</el-dropdown-item>
|
<el-dropdown-item v-for="cou in couresna" :command="cou.courseId">{{cou.courseName}}</el-dropdown-item>
|
||||||
@@ -83,10 +78,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="textbut-box">
|
<div class="textbut-box">
|
||||||
<interactBar v-if="item.type == 1" nodeWidth="60px" :readonly="true" :type="6" :data="item" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
|
<interactBar v-if="item.type == 1" 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">
|
<el-button @click="deleteNote(item)" style=" margin-right: 10px;" class="textbut" type="text"><svg-icon icon-class="notedel" ></svg-icon>删除</el-button>
|
||||||
<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>
|
||||||
<el-button @click="edit(item)" class="textbut" type="text">
|
|
||||||
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -386,18 +379,36 @@ export default {
|
|||||||
}
|
}
|
||||||
this.noteData(this.num);
|
this.noteData(this.num);
|
||||||
},
|
},
|
||||||
open(item) {
|
deleteNote(item) {
|
||||||
|
let $this=this;
|
||||||
this.$confirm('移除后将不在笔记列表中展示', '确定要删除您的笔记吗?', {
|
this.$confirm('移除后将不在笔记列表中展示', '确定要删除您的笔记吗?', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
apiNote.del(item.id).then(res=>{
|
apiNote.del(item.id).then(res=>{
|
||||||
|
if(res.status==200){
|
||||||
this.noteData(this.num);
|
this.noteData(this.num);
|
||||||
this.$message({
|
this.$message({type:'success', message: '删除成功!'});
|
||||||
type: 'success',
|
//删除事件
|
||||||
message: '删除成功!'
|
let event = {
|
||||||
});
|
key: "DeleteNote",//
|
||||||
|
title: "删除笔记",//
|
||||||
|
parameters:"author",//
|
||||||
|
content: "删除了笔记",//事件的内容
|
||||||
|
source:'page',
|
||||||
|
objId: item.id,//关联的id
|
||||||
|
objType: "6",//关联的类型
|
||||||
|
objInfo: "",
|
||||||
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
|
status: 1 //状态,直接写1
|
||||||
|
}
|
||||||
|
this.$store.dispatch("userTrigger", event);
|
||||||
|
}else{
|
||||||
|
this.$message({type:'success', message: '删除失败!'+res.message});
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
Reference in New Issue
Block a user