mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
提交
This commit is contained in:
@@ -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('删除失败')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: '删除失败'
|
||||||
@@ -230,7 +250,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.delQaList(item);
|
this.delQaList(item);
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//设置单挑数据
|
//设置单挑数据
|
||||||
|
|||||||
Reference in New Issue
Block a user