动态收集事件添加

This commit is contained in:
zhaofang
2022-09-19 20:12:23 +08:00
parent 9d8839b401
commit 596410abef
4 changed files with 306 additions and 238 deletions

View File

@@ -13,13 +13,8 @@
<img src="../../../public/images/cotedetel.png" @click="timeDel()" />
</div>
<div class="newcote-text">
<el-input
type="textarea"
:autofocus="true"
placeholder="好记性不如烂笔头,记录些什么吧~"
v-model="mynoteData.content"
maxlength="200"
:autosize="{ minRows: 18, maxRows: 20}"
<el-input type="textarea" :autofocus="true" placeholder="好记性不如烂笔头,记录些什么吧~"
v-model="mynoteData.content" maxlength="200" :autosize="{ minRows: 18, maxRows: 20}"
show-word-limit>
</el-input>
</div>
@@ -27,7 +22,8 @@
<!-- 我的笔记 -->
<div class="mycote-content" v-if="notetab == 2">
<div v-if="noteList.length > 0">
<div style="border-bottom:1px solid #4444;padding-bottom:25px;" v-for="note in noteList" :key="note.id">
<div style="border-bottom:1px solid #4444;padding-bottom:25px;" v-for="note in noteList"
:key="note.id">
<span class="mycote-time">{{note.sysCreateTime}}
<span class="sm">{{note.openType == 1?'公开':'私密'}}</span>
<span class="more">
@@ -35,15 +31,20 @@
<span class="el-dropdown-link">
<svg-icon style="margin-right: 0;font-size:26px;" icon-class="spot"></svg-icon>
</span>
<el-dropdown-menu slot="dropdown" class="dropdown-box" style="background:#333333;border: none;">
<el-dropdown-item command="a" style="color:#fff" @click.native="noteDel(note)"><img style="width:13px;height:18px;vertical-align: middle;" src="@/assets/images/icon/note-del.png" /> 删除</el-dropdown-item>
<el-dropdown-item command="b" style="color:#fff" @click.native="noteEdit(note)"><img style="width:13px;height:14px;margin-right:4px;vertical-align: middle;" src="@/assets/images/icon/note-edit.png" />编辑</el-dropdown-item>
<el-dropdown-menu slot="dropdown" class="dropdown-box"
style="background:#333333;border: none;">
<el-dropdown-item command="a" style="color:#fff" @click.native="noteDel(note)">
<img style="width:13px;height:18px;vertical-align: middle;"
src="@/assets/images/icon/note-del.png" /> 删除</el-dropdown-item>
<el-dropdown-item command="b" style="color:#fff" @click.native="noteEdit(note)">
<img style="width:13px;height:14px;margin-right:4px;vertical-align: middle;"
src="@/assets/images/icon/note-edit.png" />编辑</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</span>
<div style="margin-top:10px" class="newcote-time" v-if="note.playTime" @click="onPlayVideo(note.playTime)">
<div style="margin-top:10px" class="newcote-time" v-if="note.playTime"
@click="onPlayVideo(note.playTime)">
<img src="../../../public/images/coteplay.png" alt="">
{{formatSeconds(note.playTime)}}
</div>
@@ -59,7 +60,8 @@
</div>
</div>
<div class="newcote-bottom" v-if="notetab == 1">
<span style="cursor: pointer;" @click="videoLocation"> <img src="../../../public/images/playtime.png" alt=""> 视频位置</span>
<span style="cursor: pointer;" @click="videoLocation"> <img src="../../../public/images/playtime.png"
alt=""> 视频位置</span>
<el-radio v-model="mynoteData.openType" :label="1">公开</el-radio>
<el-radio v-model="mynoteData.openType" :label="2">私密</el-radio>
<el-button type="primary" size="small" @click="saveNote()">保存</el-button>
@@ -197,6 +199,9 @@
if (res.status == 200) {
if (!this.mynoteData.id) {
this.inAnimation = true;
if(this.mynoteData.openType != 9){
return
}
// 是编辑新增
let event = {
key: "PublishNote",//后台的事件key
@@ -242,21 +247,25 @@
::v-deep .el-dropdown-menu__item:hover {
background: #333333;
}
.mynote {
// width: 100%;
margin: 35px 30px;
position: relative;
.animation {
display: block !important;
animation-name: ubAddBlock;
animation-duration: 2s;
animation-fill-mode: forwards;
}
.animation-box {
display: none;
position: absolute;
bottom: 0;
right: 200px;
.box-text {
padding: 12px 16px;
width: 252px;
@@ -266,6 +275,7 @@
border-radius: 2px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
img {
width: 16px;
height: 16px;
@@ -274,27 +284,32 @@
}
}
}
.newcote-time {
width: 80px;
height: 30px;
border-radius: 4px;
border: 1px solid #3379FB;
font-size: 14px;
color: #387DF7;;
color: #387DF7;
;
text-align: center;
line-height: 28px;
margin-bottom: 12px;
img {
vertical-align: middle;
margin: 0 5px;
}
}
.newcote-bottom {
span {
font-size: 14px;
color: #333333;
margin-right: 30px;
img {
width: 20px;
height: 24px;
@@ -302,17 +317,20 @@
}
}
}
.newcote-text {
// margin-top: 24px;
font-size: 14px;
color: #333333;
height: 100%;
::v-deep .el-textarea__inner {
background: #f5f5f5;
border: none;
padding: 0;
}
}
.newcote-content {
margin: 30px 0px;
box-sizing: border-box;
@@ -320,6 +338,7 @@
height: 474px;
background-color: #F5F5F5;
}
.mycote-content {
margin: 30px 0px;
box-sizing: border-box;
@@ -327,18 +346,22 @@
height: 550px;
overflow-y: auto;
background-color: #fff;
.my-nonote {
text-align: center;
margin-top: 100px;
img {
width: 198px;
height: 163px;
}
}
.mycote-time {
color: #666;
font-size: 14px;
padding-bottom: 20px;
.sm {
width: 50px;
height: 22px;
@@ -350,11 +373,13 @@
margin-left: 20px;
padding: 3px 10px;
}
.more {
margin-top: 12px;
float: right;
}
}
.mycote-dibu {
margin: 50px 38%;
@@ -362,16 +387,19 @@
font-size: 14px;
}
}
.mynote-tab {
width: 180px;
margin-top: 17px;
display: flex;
div {
font-size: 16px;
color: #666666;
flex: 1;
}
.noteactive a {
font-weight: 600;
color: #333333;

View File

@@ -59,7 +59,7 @@
</div>
<div style="width: 90px;display: flex;justify-content: flex-end;">
<el-button @click="submit()" style="height: 35px;margin-top:20px" type="primary">发布</el-button>
<el-button @click="submit()" style="height: 52px;" type="primary">发布</el-button>
</div>
</div>
</div>
@@ -193,7 +193,7 @@
<el-input show-word-limit class="hideControl" type="textarea" v-model="replyInfo.content" maxlength="100" placeholder="回复内容..."></el-input>
</div>
<div style="width: 120px;display: flex;justify-content: flex-end;">
<el-button @click="submitDlgReply(com)" type="primary">发布回复</el-button>
<el-button @click="submitDlgReply(com)" type="primary">发布1回复</el-button>
</div>
</div>
</div>
@@ -499,7 +499,20 @@
this.list.unshift(res.result);
this.loadAuthorInfo([res.result],[res.result.sysCreateAid]);
this.$message.success('发布成功');
//
let event = {
key: "PublishComment",//后台的事件key 发布文章且审核通过
title: "发表评论",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "每发表一个评论",//事件的内容
objId: this.resolveId,//关联的id
objType: this.objType,//关联的类型
objInfo: "评论",
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
this.total++;
this.$emit('success',res.result);
@@ -569,6 +582,19 @@
this.replyInfo.parentId='';
this.replyInfo.content='';
this.$message.success("发布成功");
let event = {
key: "ReplyComment",//后台的事件key 发布文章且审核通过
title: "回复评论",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "每回一个评论",//事件的内容
objId: this.replyInfo.commentId,//关联的id
objType: this.objType,//关联的类型
objInfo: "评论",
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
}else{
this.$message.error(res.message);
}

View File

@@ -489,6 +489,20 @@ export default {
this.$message.success('打分成功,谢谢您的打分');
that.scoreInfo.has = true;
that.courseInfo.score = rs.result;
let event = {
key: "ScoreCourse",//后台的事件key 发布文章且审核通过
title: "完成课程评分",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "给课程评分",//事件的内容
objId: this.resolveId,//关联的id
objType: 1,//关联的类型
objInfo: this.courseInfo.name,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
} else {
this.$message.error('打分处理失败,请稍后再试');
}