This commit is contained in:
zhaofang
2022-09-22 20:05:53 +08:00
parent 1cb22d4090
commit 1e62c2392a
2 changed files with 38 additions and 1 deletions

View File

@@ -122,8 +122,12 @@
<script> <script>
import apiArticle from '@/api/modules/article.js' import apiArticle from '@/api/modules/article.js'
import { mapGetters } from 'vuex';
export default { export default {
name: 'articleItems', name: 'articleItems',
computed: {
...mapGetters(['userInfo'])
},
data() { data() {
return { return {
pageData: { pageData: {
@@ -227,6 +231,19 @@ export default {
if (res.status == 200) { if (res.status == 200) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getArticleList() this.getArticleList()
let event = {
key: "DeleteArticle",//后台的事件key 发布文章且审核通过
title: '删除文章(被删除)',//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: '删除文章(被删除)',//事件的内容
objId: item.id,//关联的id
objType: "2",//关联的类型
objInfo:item.title,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
} else { } else {
this.$message.error('删除失败') this.$message.error('删除失败')
} }

View File

@@ -131,8 +131,12 @@
<script> <script>
import apiQa from '@/api/modules/qa.js'; import apiQa from '@/api/modules/qa.js';
import { mapGetters } from 'vuex';
export default { export default {
name: 'articleItems', name: 'articleItems',
computed: {
...mapGetters(['userInfo'])
},
data() { data() {
return { return {
getRowKeys(row) { getRowKeys(row) {
@@ -208,14 +212,30 @@ export default {
.del(id) .del(id)
.then(res => { .then(res => {
if (res.status == 200) { if (res.status == 200) {
this.getQaList(); this.getQaList();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功' message: '删除成功'
}); });
let event = {
key: "DeleteQuestion",//后台的事件key 发布文章且审核通过
title: '删除问题',//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: '删除问题',//事件的内容
objId: data.id,//关联的id
objType: "3",//关联的类型
objInfo:data.title,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
} }
}) })
.catch(err => { .catch(err => {
console.log(err,'err');
this.$message({ this.$message({
type: 'error', type: 'error',
message: '删除失败' message: '删除失败'