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:
@@ -723,25 +723,26 @@ export default {
|
||||
const { id } = data;
|
||||
apiQa.isBest(id).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.$message({ type: "success", message: "设置为最佳答案成功" });
|
||||
this.messageSave("set");
|
||||
//消息
|
||||
console.log(data,'data');
|
||||
let event = {
|
||||
key: "AnswerBest",//设置为最佳答案
|
||||
title: "回答被选为最佳答案",//
|
||||
parameters:"author:"+this.data.sysCreateAid,//内容的作者
|
||||
parameters:"author:"+data.sysCreateAid,//内容的作者
|
||||
content: '回答被选为最佳答案',//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
objId: data.id,//关联的id
|
||||
objType: '5',//关联的类型
|
||||
objInfo: '设置最佳答案',
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
console.log(event,'event');
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
this.loadAnswer();
|
||||
this.getQuestionDetail();
|
||||
|
||||
this.$message({ type: "success", message: "设置为最佳答案成功" });
|
||||
}else{
|
||||
this.$message({ type: "warning",message: "设置为最佳答案失败:"+res.message});
|
||||
}
|
||||
@@ -815,7 +816,7 @@ export default {
|
||||
this.replyContent = '';
|
||||
//添加到页面中
|
||||
if (data.clevel < 3) {
|
||||
if (data.answers) {
|
||||
if(data.answers) {
|
||||
data.answers.push(res.result);
|
||||
} else {
|
||||
data.answers = [];
|
||||
|
||||
Reference in New Issue
Block a user