mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 20:36:43 +08:00
提交问答详情的处理,增加设置为最好答案的事件
This commit is contained in:
@@ -723,25 +723,26 @@ export default {
|
|||||||
const { id } = data;
|
const { id } = data;
|
||||||
apiQa.isBest(id).then(res => {
|
apiQa.isBest(id).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.$message({ type: "success", message: "设置为最佳答案成功" });
|
|
||||||
this.messageSave("set");
|
this.messageSave("set");
|
||||||
//消息
|
//消息
|
||||||
|
console.log(data,'data');
|
||||||
let event = {
|
let event = {
|
||||||
key: "AnswerBest",//设置为最佳答案
|
key: "AnswerBest",//设置为最佳答案
|
||||||
title: "回答被选为最佳答案",//
|
title: "回答被选为最佳答案",//
|
||||||
parameters:"author:"+this.data.sysCreateAid,//内容的作者
|
parameters:"author:"+data.sysCreateAid,//内容的作者
|
||||||
content: '回答被选为最佳答案',//事件的内容
|
content: '回答被选为最佳答案',//事件的内容
|
||||||
objId: this.data.id,//关联的id
|
objId: data.id,//关联的id
|
||||||
objType: this.type,//关联的类型
|
objType: '5',//关联的类型
|
||||||
objInfo: this.data.title,
|
objInfo: '设置最佳答案',
|
||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 //状态,直接写1
|
status: 1 //状态,直接写1
|
||||||
}
|
}
|
||||||
|
console.log(event,'event');
|
||||||
this.$store.dispatch("userTrigger", event);
|
this.$store.dispatch("userTrigger", event);
|
||||||
this.loadAnswer();
|
this.loadAnswer();
|
||||||
this.getQuestionDetail();
|
this.getQuestionDetail();
|
||||||
|
this.$message({ type: "success", message: "设置为最佳答案成功" });
|
||||||
}else{
|
}else{
|
||||||
this.$message({ type: "warning",message: "设置为最佳答案失败:"+res.message});
|
this.$message({ type: "warning",message: "设置为最佳答案失败:"+res.message});
|
||||||
}
|
}
|
||||||
@@ -815,7 +816,7 @@ export default {
|
|||||||
this.replyContent = '';
|
this.replyContent = '';
|
||||||
//添加到页面中
|
//添加到页面中
|
||||||
if (data.clevel < 3) {
|
if (data.clevel < 3) {
|
||||||
if (data.answers) {
|
if(data.answers) {
|
||||||
data.answers.push(res.result);
|
data.answers.push(res.result);
|
||||||
} else {
|
} else {
|
||||||
data.answers = [];
|
data.answers = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user