mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-21 08:46:44 +08:00
Merge remote-tracking branch 'origin/stat' into stat
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<Remark :fixed="false">
|
||||
<ul>
|
||||
<li>class名为problem的dom(即时间)无法直接垂直居中</li>
|
||||
<li>状态有草稿、待审核、未通过、已通过、已发布</li>
|
||||
<li>状态为已发布时才显示点赞收藏图标</li>
|
||||
<li>点击编辑时没有跳转到新页面</li>
|
||||
</ul>
|
||||
</Remark>
|
||||
<div class="article-list" v-for="(item, idx) in items" :key="idx" @click="jumpDetail(item)">
|
||||
<div class="article-info">
|
||||
<div class="article-info-title one-line-ellipsis"
|
||||
<div class="article-info-title one-line-ellipsis"
|
||||
>
|
||||
<!-- <span v-if="item.enabled" :class="classFilter(item.status).className">{{classFilter(item.status).text}}</span> -->
|
||||
<!-- <span v-else class="article-status8">【已下架】</span> -->
|
||||
@@ -53,6 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import interactBar from '@/components/Portal/interactBar.vue';
|
||||
import apiArticle from '@/api/modules/article.js';
|
||||
import editItems from '@/components/Article/editItems.vue';
|
||||
@@ -60,6 +53,9 @@ export default {
|
||||
components: {
|
||||
interactBar,editItems
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["userInfo"]),
|
||||
},
|
||||
name: 'articleItems',
|
||||
props: {
|
||||
items: {
|
||||
@@ -78,7 +74,7 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
filters:{
|
||||
sysCreateTimeFilter(item){
|
||||
return item.split(' ')[0]
|
||||
@@ -146,26 +142,35 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
.then(() => {
|
||||
apiArticle
|
||||
.del(item.id)
|
||||
.then(res => {
|
||||
}).then(() => {
|
||||
apiArticle.del(item.id).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.$emit('update',true)
|
||||
this.$message.success('删除成功');
|
||||
console.log('shanchushanchu')
|
||||
//发送删除事件
|
||||
let event = {
|
||||
key: "DeleteArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "删除文章",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "删除文章",//事件的内容
|
||||
source:'page',
|
||||
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{
|
||||
this.$message.error('删除失败');
|
||||
this.$message.error('删除失败:'+res.message);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
}).catch(err => {
|
||||
this.$message.error('删除失败');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -275,7 +280,7 @@ export default {
|
||||
width: 100%;
|
||||
font-size: 18px;
|
||||
// font-weight: 400;
|
||||
|
||||
|
||||
// height: 40px;
|
||||
margin-top: 7px;
|
||||
// line-height: 40px;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
show-word-limit
|
||||
v-model="inputValue"
|
||||
maxlength="800"
|
||||
placeholder="写下您的评论(800字以内),可以@案主哦~"
|
||||
placeholder="写下您的评论~"
|
||||
></el-input>
|
||||
|
||||
|
||||
@@ -793,6 +793,7 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.publish-button{
|
||||
// line-height: 30px;
|
||||
padding-top: 7px;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</el-tooltip>
|
||||
<span class="interact-bar-value"> {{data.comments}}</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="praises" @click="addPraise()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
||||
<el-tooltip effect="light" content="点赞" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon style="margin-right: 0;font-size: 14px;" :icon-class="isPraise?'praised':'like'"></svg-icon>
|
||||
@@ -336,6 +336,21 @@ export default {
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomPraises",false)
|
||||
}
|
||||
|
||||
let event = {
|
||||
key: "cancelPraise",//
|
||||
title: "取消点赞",//事件的标题
|
||||
parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: "取消点赞"+this.data.title,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
|
||||
this.$message({message:'取消点赞',type:'success'})
|
||||
}else{
|
||||
console.log('取消失败:'+res.message);
|
||||
@@ -362,7 +377,7 @@ export default {
|
||||
let event = {
|
||||
key: "Praise",//后台的事件key 发布文章且审核通过
|
||||
title: "点赞",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: "点赞"+this.data.title,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
@@ -552,7 +567,7 @@ export default {
|
||||
}
|
||||
}
|
||||
let event = {
|
||||
key: "Share",//后台的事件key
|
||||
key: "Share",//后台的事件key
|
||||
title: "被分享",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: '被分享',//事件的内容
|
||||
|
||||
@@ -164,13 +164,13 @@ export default {
|
||||
this.feedbackDlgShow=false;
|
||||
|
||||
let event = {
|
||||
key: "Feedback",//后台的事件key
|
||||
key: "Feedback",//后台的事件key
|
||||
title: "意见反馈",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: '意见反馈',//事件的内容
|
||||
// objId: this.data.id,//关联的id
|
||||
// objType: this.type,//关联的类型
|
||||
// objInfo: this.data.title,
|
||||
objId: res.result.id,//关联的id
|
||||
objType:'99',//关联的类型
|
||||
objInfo: "意见反馈",
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<el-badge class="person-action-index message-count" :value="userMsg" :hidden="userMsg == 0">
|
||||
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<el-link type="primary" :href="`${webBaseUrl}/message/center/index`" :underline="false">
|
||||
<svg-icon v-if="current == 'qa'" style="margin-right: 0;font-size:26px;" icon-class="message"></svg-icon>
|
||||
<svg-icon v-if="current == 'qa' || 'index'" style="margin-right: 0;font-size:26px;" icon-class="message"></svg-icon>
|
||||
<svg-icon v-else style="margin-right: 0;font-size:26px;" icon-class="messfff"></svg-icon>
|
||||
</el-link>
|
||||
</el-tooltip>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<span v-if="item.status==0||item.status==2" style="color: red">{{statusText(item.status)}}</span>
|
||||
<!-- <div class="article-info-tools-btns"> -->
|
||||
<!-- <interactBar :data="item" :type="0" class="test" :answers="true" :comments="false" :shares="false" :views="false"></interactBar> -->
|
||||
|
||||
|
||||
<div class="button-cla"><interactBar nodeWidth="60px" :readonly="true" :type="4" :data="item" :shares="true" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar></div>
|
||||
</div>
|
||||
<!-- <el-link icon="el-icon-chat-line-round" class="article-info-tools-btn" >回答57</el-link>
|
||||
@@ -78,12 +78,16 @@
|
||||
|
||||
<script>
|
||||
// import interactBar from '@/components/Portal/interactBar';
|
||||
import { mapGetters } from "vuex";
|
||||
import imageUpload from '@/components/ImageUpload/index.vue';
|
||||
import apiQa from '@/api/modules/qa.js'
|
||||
import interactBar from '@/components/Portal/interactBar.vue';
|
||||
export default {
|
||||
name: 'articleItems',
|
||||
components: { imageUpload,interactBar },
|
||||
computed: {
|
||||
...mapGetters(["userInfo"]),
|
||||
},
|
||||
props: {
|
||||
items: {
|
||||
//name,
|
||||
@@ -200,7 +204,22 @@ export default {
|
||||
apiQa.del(item.id).then(res=>{
|
||||
if(res.status==200){
|
||||
this.$message({ type: 'success', message: '删除成功!' });
|
||||
this.$emit('sure',true)
|
||||
this.$emit('sure',true);
|
||||
//发送删除问题事件
|
||||
let event = {
|
||||
key: "DeleteQuestion",//
|
||||
title: "删除提问",//事件的标题
|
||||
parameters:"author:"+item.sysCreateAid,//作者参数
|
||||
content: "删除提问【"+item.title+"】",//事件的内容
|
||||
source:'page',
|
||||
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);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user