|
@@ -15,32 +15,34 @@
|
|
|
</span>
|
|
|
<div class="read-btn">
|
|
|
<el-badge :hidden="tasknot==0?true:false" :value="tasknot" class="item">
|
|
|
- <el-button size="mini" plain >未读</el-button>
|
|
|
+ <el-button type="primary" @click="taskclick('未读')" size="mini" :plain="tasknobtn" >未读</el-button>
|
|
|
</el-badge>
|
|
|
- <el-button size="mini" plain >
|
|
|
+ <el-button type="primary" @click="taskclick('已读')" size="mini" :plain="taskbtn" >
|
|
|
已读
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <div class="news-box" v-for="(item,index) in newstasklist" :key="index">
|
|
|
- <div class="news-box-list">
|
|
|
- <div class="news-list-hade">
|
|
|
- <div>{{item.title}}</div>
|
|
|
- <div>所属部门: {{item.issuerDep}}</div>
|
|
|
- </div>
|
|
|
- <div class="news-list-content" v-html="item.content">
|
|
|
- </div>
|
|
|
- <div class="news-list-posts">
|
|
|
- <div>发布人: {{item.issuerUser}}</div>
|
|
|
- <div>发布时间: {{item.releaseTime}}</div>
|
|
|
- </div>
|
|
|
- <div class="news-list-btn">
|
|
|
- <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
|
|
|
- <el-button v-if="item.isRead==1" type="info">已读</el-button>
|
|
|
+ <div class="scroll-box">
|
|
|
+ <div class="news-box" v-for="(item,index) in newstasklist" :key="index">
|
|
|
+ <div class="news-box-list">
|
|
|
+ <div class="news-list-hade">
|
|
|
+ <div>{{item.title}}</div>
|
|
|
+ <div>所属部门: {{item.issuerDep}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="news-list-content" v-html="item.content">
|
|
|
+ </div>
|
|
|
+ <div class="news-list-posts">
|
|
|
+ <div>发布人: {{item.issuerUser}}</div>
|
|
|
+ <div>发布时间: {{item.releaseTime}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="news-list-btn" >
|
|
|
+ <el-button @click="DeleMsg(index,item)" v-if="item.isRead==0" type="primary">确认已读</el-button>
|
|
|
+ <el-button v-if="item.isRead==1" type="info">已读</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="notyet" v-if="newstasklist.length==0">
|
|
|
- 暂无通知
|
|
|
+ <div class="notyet" v-if="newstasklist.length==0">
|
|
|
+ 暂无通知
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="second">
|
|
@@ -50,32 +52,34 @@
|
|
|
</span>
|
|
|
<div class="read-btn">
|
|
|
<el-badge :hidden="groupnot==0?true:false" :value="groupnot" class="item">
|
|
|
- <el-button size="mini" plain >未读</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="groupclick('未读')" :plain="groupnobtn" >未读</el-button>
|
|
|
</el-badge>
|
|
|
- <el-button size="mini" plain >
|
|
|
+ <el-button type="primary" size="mini" @click="groupclick('已读')" :plain="groupbtn" >
|
|
|
已读
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <div class="news-box" v-for="(item,index) in newsgrouplist" :key="index">
|
|
|
- <div class="news-box-list">
|
|
|
- <div class="news-list-hade">
|
|
|
- <div>{{item.title}}</div>
|
|
|
- <div>所属部门: {{item.issuerDep}}</div>
|
|
|
- </div>
|
|
|
- <div class="news-list-content" v-html="item.content">
|
|
|
- </div>
|
|
|
- <div class="news-list-posts">
|
|
|
- <div>发布人: {{item.issuerUser}}</div>
|
|
|
- <div>发布时间: {{item.releaseTime}}</div>
|
|
|
- </div>
|
|
|
- <div class="news-list-btn">
|
|
|
- <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
|
|
|
- <el-button v-if="item.isRead==1" type="info">已读</el-button>
|
|
|
+ <div class="scroll-box">
|
|
|
+ <div class="news-box" v-for="(item,index) in newsgrouplist" :key="index">
|
|
|
+ <div class="news-box-list">
|
|
|
+ <div class="news-list-hade">
|
|
|
+ <div>{{item.title}}</div>
|
|
|
+ <div>所属部门: {{item.issuerDep}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="news-list-content" v-html="item.content">
|
|
|
+ </div>
|
|
|
+ <div class="news-list-posts">
|
|
|
+ <div>发布人: {{item.issuerUser}}</div>
|
|
|
+ <div>发布时间: {{item.releaseTime}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="news-list-btn">
|
|
|
+ <el-button v-if="item.isRead==0" type="primary">确认已读</el-button>
|
|
|
+ <el-button v-if="item.isRead==1" type="info">已读</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="notyet" v-if="newsgrouplist.length==0">
|
|
|
- 暂无通知
|
|
|
+ <div class="notyet" v-if="newsgrouplist.length==0">
|
|
|
+ 暂无通知
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -302,6 +306,10 @@ export default {
|
|
|
taskReadlist:[],//任务以读
|
|
|
groupnotlist:[],//团组未读
|
|
|
groupReadlist:[],//团组以读
|
|
|
+ taskbtn:true,//plain任务已读
|
|
|
+ tasknobtn:true,//plain任务未读
|
|
|
+ groupbtn:true,//plain团组已读
|
|
|
+ groupnobtn:true,//plain团组未读
|
|
|
};
|
|
|
},
|
|
|
// components: {
|
|
@@ -437,11 +445,41 @@ export default {
|
|
|
}).then(function (res) {
|
|
|
console.log(res)
|
|
|
if(res.data.code==200){
|
|
|
- that.newstasklist=res.data.data.taskNotificatio.taskNotificatioData;
|
|
|
- that.tasknot=res.data.data.taskNotificatio.unReadCount;
|
|
|
- that.newsgrouplist=res.data.data.operationNotificatio.operationNotificatioData;
|
|
|
- that.groupnot=res.data.data.operationNotificatio.unReadCount;
|
|
|
- console.log(that.newsgrouplist)
|
|
|
+ //初始化
|
|
|
+ that.tasknotlist=[];
|
|
|
+ that.taskReadlist=[];
|
|
|
+ that.groupnotlist=[];
|
|
|
+ that.groupReadlist=[];
|
|
|
+ that.taskbtn=true;//plain任务已读
|
|
|
+ that.tasknobtn=true;//plain任务未读
|
|
|
+ that.groupbtn=true;//plain团组已读
|
|
|
+ that.groupnobtn=true;//plain团组未读
|
|
|
+ var listdata=res.data.data;
|
|
|
+ // that.newstasklist=res.data.data.taskNotification.taskNotificationData;
|
|
|
+ that.tasknot=res.data.data.taskNotification.unReadCount;
|
|
|
+ // that.newsgrouplist=res.data.data.operationNotification.operationNotificatioData;
|
|
|
+ that.groupnot=res.data.data.operationNotification.unReadCount;
|
|
|
+ console.log(listdata.taskNotification.taskNotificationData)
|
|
|
+ //任务
|
|
|
+ for(let i=0;i<listdata.taskNotification.taskNotificationData.length;i++){
|
|
|
+ if(listdata.taskNotification.taskNotificationData[i].isRead==0){
|
|
|
+ that.tasknotlist.push(listdata.taskNotification.taskNotificationData[i]);
|
|
|
+ }else{
|
|
|
+ that.taskReadlist.push(listdata.taskNotification.taskNotificationData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.newstasklist=that.tasknotlist;
|
|
|
+ that.tasknobtn=false;
|
|
|
+ //团组
|
|
|
+ for(let j=0;j<listdata.operationNotification.operationNotificatioData.length;j++){
|
|
|
+ if(listdata.operationNotification.operationNotificatioData[j].isRead==0){
|
|
|
+ that.groupnotlist.push(listdata.operationNotification.operationNotificatioData[j]);
|
|
|
+ }else{
|
|
|
+ that.groupReadlist.push(listdata.operationNotification.operationNotificatioData[j]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.newsgrouplist=that.groupnotlist;
|
|
|
+ that.groupnobtn=false;
|
|
|
}else{
|
|
|
that.$message.error(res.data.msg);
|
|
|
}
|
|
@@ -449,6 +487,60 @@ export default {
|
|
|
that.$message.error("获取消息列表失败!");
|
|
|
});
|
|
|
},
|
|
|
+ //消息确认已读
|
|
|
+ DeleMsg(index,row){
|
|
|
+ console.log(index,row)
|
|
|
+ var url = "/api/System/DeleMsg"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data:{
|
|
|
+ portType:1,
|
|
|
+ pageIndex:0,
|
|
|
+ pageSize:0,
|
|
|
+ msgId:row.id,
|
|
|
+ userId:that.userId
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if(res.data.code==200){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ that.$message.error(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.$message.error("确认已读失败!");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //任务切换
|
|
|
+ taskclick(text){
|
|
|
+ if(text=='未读'){
|
|
|
+ this.newstasklist=this.tasknotlist
|
|
|
+ this.tasknobtn=false;
|
|
|
+ this.taskbtn=true;
|
|
|
+ }else{
|
|
|
+ this.newstasklist=this.taskReadlist
|
|
|
+ this.tasknobtn=true;
|
|
|
+ this.taskbtn=false;
|
|
|
+ }
|
|
|
+ console.log(this.newstasklist)
|
|
|
+ },
|
|
|
+ //团组切换
|
|
|
+ groupclick(text){
|
|
|
+ if(text=='未读'){
|
|
|
+ this.newsgrouplist=this.groupnotlist
|
|
|
+ this.groupnobtn=false;
|
|
|
+ this.groupbtn=true;
|
|
|
+ }else{
|
|
|
+ this.newsgrouplist=this.groupReadlist
|
|
|
+ this.groupnobtn=true;
|
|
|
+ this.groupbtn=false;
|
|
|
+ }
|
|
|
+ },
|
|
|
//消息通知
|
|
|
chatHub(){
|
|
|
var url = "/api/chatHub"
|
|
@@ -517,6 +609,8 @@ export default {
|
|
|
this.ifIndexValue();
|
|
|
this.getmenu();
|
|
|
this.PsotMsgPageList();
|
|
|
+ setInterval(this.PsotMsgPageList, 300000);
|
|
|
+ // setInterval(this.PsotMsgPageList, 3000);
|
|
|
// this.chatHub();
|
|
|
},
|
|
|
created() {
|
|
@@ -554,6 +648,12 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style>
|
|
|
+*{
|
|
|
+ font-family: arial,"\5B8B\4F53";
|
|
|
+}
|
|
|
+.all-box{
|
|
|
+ font-family: arial,"\5B8B\4F53";
|
|
|
+}
|
|
|
.el-menu .el-menu-item.is-active {
|
|
|
color: #fff;
|
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
@@ -998,5 +1098,26 @@ i.icon-tongzhi {
|
|
|
padding: 0;
|
|
|
}
|
|
|
.delwh::-webkit-scrollbar {display:none}
|
|
|
+.scroll-box{
|
|
|
+ height: 750px;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+.scroll-box::-webkit-scrollbar {
|
|
|
+ width: 6px;
|
|
|
+}
|
|
|
+.scroll-box::-webkit-scrollbar-track {
|
|
|
+ background: rgb(239, 239, 239);
|
|
|
+ border-radius: 2px;
|
|
|
+}
|
|
|
+.scroll-box::-webkit-scrollbar-thumb {
|
|
|
+ background: #40a0ff49;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+.scroll-box::-webkit-scrollbar-thumb:hover {
|
|
|
+ background: #40a0ff;
|
|
|
+}
|
|
|
+.all-box .communal-box .el-autocomplete,.el-select{
|
|
|
+ margin-right: 0;
|
|
|
+}
|
|
|
</style>
|
|
|
|