Commit e07fed51 authored by 以墨为白's avatar 以墨为白 🎧

优化 聊天大群

parent 8501ff17
...@@ -152,7 +152,28 @@ export default { ...@@ -152,7 +152,28 @@ export default {
//取消导演部审批 //取消导演部审批
//订阅大群主题,订阅功能中设置ID: //订阅大群主题,订阅功能中设置ID:
this.stompClient.subscribe(item.address, res => { this.stompClient.subscribe(item.address, res => {
this.getRecordsByPagingFn(item); // this.getRecordsByPagingFn(item);
let body = JSON.parse(res.body);
this.publicNoticeList.push({
attachment: body.attachment,
content: body.content,
destId: res.headers.chatRoomId,
fromUserId: res.headers.fromUserId,
messageForm: body.messageForm,
remark: body.remark,
teamId: body.teamInfo.id,
teamInfo: body.teamInfo,
title: body.title,
createTime: body.createTime
});
this.publicNoticeList = this.publicNoticeList.sort(this.compare);
this.dataOrderByParams(5, null);
this.optionsFrom = [];
this.publicNoticeList.forEach(item => {
if (this.optionsFrom.indexOf(item.fromUserId) == -1) {
this.optionsFrom.push(item.fromUserId);
}
});
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.myNotice.handleClose(); this.$refs.myNotice.handleClose();
}) })
...@@ -330,6 +351,17 @@ export default { ...@@ -330,6 +351,17 @@ export default {
}, },
handleChangeTimeFrame(val) { handleChangeTimeFrame(val) {
this.dataOrderByParams(val, this.formInfo.fromUser); this.dataOrderByParams(val, this.formInfo.fromUser);
},
compare(obj1, obj2) {
var val1 = obj1.createTime;
var val2 = obj2.createTime;
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
} }
}, },
computed: { computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment