@aochuang/client-sdk 1.0.378 → 1.0.379-wework
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +4 -40
- package/components/chat-editor/chat-editor.vue +5 -75
- package/components/index.js +6 -1
- package/components/session-select/session-select-item.vue +8 -9
- package/components/wechat-chat-control/.DS_Store +0 -0
- package/components/wechat-chat-control/location/location.vue +3 -3
- package/components/wechat-chat-control/transfer/.DS_Store +0 -0
- package/components/wechat-chat-control/url/.DS_Store +0 -0
- package/components/wechat-chat-control/voice/.DS_Store +0 -0
- package/components/wework-chat-control/channel-card/channel-card.vue +144 -0
- package/components/wework-chat-control/channel-live/channel-live.vue +7 -2
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/custom-expression/custom-expression.vue +2 -1
- package/components/wework-chat-control/file-url/file-url.vue +34 -16
- package/components/wework-chat-control/image/image.vue +137 -2
- package/components/wework-chat-control/index.js +15 -7
- package/components/wework-chat-control/link/.DS_Store +0 -0
- package/components/wework-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/merge-message/merge-message-panel.vue +63 -0
- package/components/wework-chat-control/merge-message/merge-message.vue +84 -0
- package/components/wework-chat-control/merge-message/util.js +59 -0
- package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
- package/components/wework-chat-control/metting/meeting-video.svg +4 -0
- package/components/wework-chat-control/metting/metting.vue +181 -0
- package/components/wework-chat-control/red-envelopes/red-envelopes.vue +3 -2
- package/components/wework-chat-control/text/text-default.vue +99 -0
- package/components/wework-chat-control/text/text-quote.vue +138 -0
- package/components/wework-chat-control/text/text.vue +27 -143
- package/components/wework-chat-control/url/url-channel-live.vue +53 -0
- package/components/wework-chat-control/url/url-miniprogram.vue +6 -7
- package/components/wework-chat-control/url/url.vue +26 -2
- package/components/wework-chat-control/util.js +26 -17
- package/components/wework-chat-control/video/.DS_Store +0 -0
- package/components/wework-chat-control/video/video.vue +10 -2
- package/components/wework-chat-control/voice/voice.vue +9 -2
- package/components/wework-chat-control/wework-chat-control-config-item.vue +24 -0
- package/components/wework-chat-control/wework-chat-control-config-msg.vue +25 -0
- package/{uni-components/chat-control/chat-control-config.vue → components/wework-chat-control/wework-chat-control-config.vue} +16 -13
- package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +73 -0
- package/components/wework-chat-panel/chat-panel-item.vue +56 -25
- package/components/wework-chat-panel/chat-panel.vue +96 -13
- package/package.json +10 -3
- package/services/.DS_Store +0 -0
- package/services/client-chat/client-chat-wework/client-chat-account.js +84 -1
- package/services/client-chat/client-chat-wework/client-chat-concats.js +81 -17
- package/services/client-chat/client-chat-wework/client-chat-message.js +121 -11
- package/services/client-chat/client-chat-wework/client-chat-session.js +271 -191
- package/services/client-chat/client-chat-wework/client-chat-socket.js +13 -1
- package/services/client-chat/client-chat-wework/client-chat.js +404 -84
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/services/socket/socket.js +14 -4
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +0 -36
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +0 -36
- package/components/wework-chat-panel/chat-panel-controls/index.js +0 -35
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +0 -28
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +0 -43
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +0 -39
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +0 -37
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +0 -35
- package/uni-common/account-portray/account-portray.vue +0 -51
- package/uni-common/account-select/account-select-item.vue +0 -172
- package/uni-common/account-select/account-select.vue +0 -252
- package/uni-common/all-friend-avatar/all-friend-avatar.vue +0 -49
- package/uni-common/friend-avatar/default.svg +0 -1
- package/uni-common/friend-avatar/friend-avatar.vue +0 -27
- package/uni-common/friend-avatar/index.js +0 -3
- package/uni-common/friend-loader/friend-loader.vue +0 -53
- package/uni-common/friend-portray/friend-portray.vue +0 -56
- package/uni-common/group-avatar/default.svg +0 -1
- package/uni-common/group-avatar/group-avatar.vue +0 -18
- package/uni-common/group-avatar/index.js +0 -3
- package/uni-common/room-avatar/default.svg +0 -6
- package/uni-common/room-avatar/index.js +0 -3
- package/uni-common/room-avatar/room-avatar.vue +0 -27
- package/uni-common/room-loader/room-loader.vue +0 -53
- package/uni-common/room-portray/room-portray.vue +0 -56
- package/uni-components/chat-control/calling/calling.vue +0 -91
- package/uni-components/chat-control/calling/phone-fill.svg +0 -1
- package/uni-components/chat-control/calling/vidicon-fill.svg +0 -1
- package/uni-components/chat-control/channel-video/channel-video.vue +0 -89
- package/uni-components/chat-control/channel-video-card/channel-video-card.vue +0 -105
- package/uni-components/chat-control/channel-video-live/channel-video-live.vue +0 -92
- package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +0 -20
- package/uni-components/chat-control/chat-control-config-item/index.js +0 -3
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +0 -25
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +0 -21
- package/uni-components/chat-control/chat-control.vue +0 -218
- package/uni-components/chat-control/company-card/company-card.vue +0 -123
- package/uni-components/chat-control/const.js +0 -28
- package/uni-components/chat-control/expression/expression.vue +0 -41
- package/uni-components/chat-control/image/image.vue +0 -68
- package/uni-components/chat-control/index.js +0 -89
- package/uni-components/chat-control/location/location.vue +0 -110
- package/uni-components/chat-control/member-change/member-change.vue +0 -32
- package/uni-components/chat-control/quote-message/quote-message.vue +0 -216
- package/uni-components/chat-control/real-time-position/real-time-position.vue +0 -62
- package/uni-components/chat-control/redpacket/red-envelope.svg +0 -1
- package/uni-components/chat-control/redpacket/redpacket.vue +0 -75
- package/uni-components/chat-control/share-card/share-card.vue +0 -101
- package/uni-components/chat-control/system/system.vue +0 -69
- package/uni-components/chat-control/system-batch-message/system-batch-message.vue +0 -30
- package/uni-components/chat-control/system-text/system-text.vue +0 -32
- package/uni-components/chat-control/text/text.vue +0 -67
- package/uni-components/chat-control/text-with-at/text-with-at.vue +0 -51
- package/uni-components/chat-control/transfer/red-transfer.svg +0 -1
- package/uni-components/chat-control/transfer/transfer.vue +0 -80
- package/uni-components/chat-control/unkonw/unkonw.vue +0 -37
- package/uni-components/chat-control/url/icons/file-excel-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-info-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-music-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-pdf-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-ppt-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-settings-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-text-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-unknow-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-word-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-zip-line.svg +0 -1
- package/uni-components/chat-control/url/icons/index.js +0 -24
- package/uni-components/chat-control/url/miniprogram.svg +0 -1
- package/uni-components/chat-control/url/url-miniprogram.vue +0 -116
- package/uni-components/chat-control/url/url.vue +0 -306
- package/uni-components/chat-control/url-new/icons/file-excel-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-info-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-music-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-settings-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-text-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-word-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-zip-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/index.js +0 -24
- package/uni-components/chat-control/url-new/url-new.vue +0 -110
- package/uni-components/chat-control/utils.js +0 -12
- package/uni-components/chat-control/video/video.vue +0 -156
- package/uni-components/chat-control/voice/voice.vue +0 -166
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +0 -84
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +0 -28
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +0 -85
- package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +0 -157
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +0 -158
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +0 -61
- package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +0 -58
- package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +0 -54
- package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +0 -42
- package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +0 -42
- package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +0 -25
- package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +0 -158
- package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +0 -75
- package/uni-components/chat-editor/chat-editor.vue +0 -257
- package/uni-components/chat-editor/index.js +0 -10
- package/uni-components/chat-editor/util.js +0 -65
- package/uni-components/chat-panel/chat-panel-chats-box.vue +0 -238
- package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +0 -273
- package/uni-components/chat-panel/chat-panel-chats-item.vue +0 -578
- package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +0 -71
- package/uni-components/chat-panel/chat-panel-chats.vue +0 -368
- package/uni-components/chat-panel/chat-panel.vue +0 -227
- package/uni-components/contacts-group-select/contacts-group-select-item.vue +0 -85
- package/uni-components/contacts-group-select/contacts-group-select-panel.vue +0 -119
- package/uni-components/contacts-group-select/contacts-group-select.vue +0 -150
|
@@ -2,6 +2,7 @@ import Vue from 'vue'
|
|
|
2
2
|
import Event from '../../../utils/event.js'
|
|
3
3
|
import { unique } from '../../../utils/string.js'
|
|
4
4
|
import { formatDate } from '../../../utils/date.js'
|
|
5
|
+
import { createPromise } from '../../../utils/util'
|
|
5
6
|
|
|
6
7
|
export default class ClientChatMessage {
|
|
7
8
|
|
|
@@ -20,8 +21,11 @@ export default class ClientChatMessage {
|
|
|
20
21
|
*/
|
|
21
22
|
messageData: {}
|
|
22
23
|
})
|
|
23
|
-
|
|
24
|
+
|
|
24
25
|
messageMap = {}
|
|
26
|
+
lastMessageTimeMap = {}
|
|
27
|
+
tempMessageMap = {}
|
|
28
|
+
checkMessageSendResultTaskList = []
|
|
25
29
|
|
|
26
30
|
get messageData () {
|
|
27
31
|
return this.data.messageData
|
|
@@ -33,15 +37,18 @@ export default class ClientChatMessage {
|
|
|
33
37
|
queryMethod: null,
|
|
34
38
|
sortField: null, // 排序的字段,必须是唯一的,例如时间
|
|
35
39
|
groupField: null, // 分组的字段
|
|
40
|
+
checkMessageSendResultMethod: null,
|
|
36
41
|
onAddMessageSuccess: null // 新增消息成功回调事件
|
|
37
42
|
}, options)
|
|
38
43
|
if (!options.clientChat) {
|
|
39
44
|
throw new Error('必须将clientChat传递过来')
|
|
40
45
|
}
|
|
46
|
+
if (!options.checkMessageSendResultMethod) throw new Error('缺少checkMessageSendResultMethod配置')
|
|
41
47
|
this.queryMethod = options.queryMethod
|
|
42
48
|
this.clientChat = options.clientChat
|
|
43
49
|
this.groupField = options.groupField
|
|
44
50
|
this.sortField = options.sortField
|
|
51
|
+
this.checkMessageSendResultMethod = options.checkMessageSendResultMethod
|
|
45
52
|
this.onAddMessageSuccess = options.onAddMessageSuccess
|
|
46
53
|
this.event = new Event()
|
|
47
54
|
}
|
|
@@ -74,7 +81,7 @@ export default class ClientChatMessage {
|
|
|
74
81
|
* "msgSvrId": "4319123759514541049",
|
|
75
82
|
* "msgType": 1,
|
|
76
83
|
* "origin": "0",
|
|
77
|
-
* "
|
|
84
|
+
* "status": 0,
|
|
78
85
|
* "tenantId": "1761952223049924608",
|
|
79
86
|
* "wechatAccountId": "ad9d9ae2a8be4f27311312cdd4af3549dc8427ef",
|
|
80
87
|
* "wechatFriendId": "2089efcc7f8f40b00b7f05fa4c6dfd3bb642774d",
|
|
@@ -89,7 +96,13 @@ export default class ClientChatMessage {
|
|
|
89
96
|
if (this.messageMap[data.id]) {
|
|
90
97
|
return
|
|
91
98
|
}
|
|
99
|
+
if (this.tempMessageMap[data.id]) {
|
|
100
|
+
Object.assign(data, this.tempMessageMap[data.id])
|
|
101
|
+
delete this.tempMessageMap[data.id]
|
|
102
|
+
}
|
|
92
103
|
const groupField = data[this.groupField]
|
|
104
|
+
const lastMessageTime = this.getLastMessageTime(groupField)
|
|
105
|
+
const isBeforeLastMessage = !data.isSend && lastMessageTime && data[this.sortField] < lastMessageTime
|
|
93
106
|
if (!this.data.messageData[groupField]) {
|
|
94
107
|
Vue.set(this.data.messageData, groupField, {})
|
|
95
108
|
}
|
|
@@ -105,13 +118,27 @@ export default class ClientChatMessage {
|
|
|
105
118
|
}
|
|
106
119
|
this.data.messageData[groupField][sortFields.day][sortFields.milliseconds].push(data)
|
|
107
120
|
this.messageMap[data.id] = data
|
|
121
|
+
this.setLastMessageTime(groupField, data[this.sortField], data)
|
|
122
|
+
if (data.isSend && data.status === 1 && !data._temp) this.addCheckMessageSendResultTask(data)
|
|
108
123
|
if (fireEvent !== false) {
|
|
124
|
+
try {
|
|
125
|
+
this.onAddMessageSuccess && this.onAddMessageSuccess({
|
|
126
|
+
data,
|
|
127
|
+
lastMessageTime,
|
|
128
|
+
isBeforeLastMessage
|
|
129
|
+
})
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error('[client-chat-message] onAddMessageSuccess error', {
|
|
132
|
+
messageId: data.id,
|
|
133
|
+
error
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
if (isBeforeLastMessage) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
109
139
|
this.event && this.event.emit('add-message', {
|
|
110
140
|
data
|
|
111
141
|
})
|
|
112
|
-
this.onAddMessageSuccess && this.onAddMessageSuccess({
|
|
113
|
-
data
|
|
114
|
-
})
|
|
115
142
|
}
|
|
116
143
|
}
|
|
117
144
|
|
|
@@ -119,6 +146,7 @@ export default class ClientChatMessage {
|
|
|
119
146
|
if (!id) {
|
|
120
147
|
return
|
|
121
148
|
}
|
|
149
|
+
this.removeCheckMessageSendResultTask(id)
|
|
122
150
|
const message = this.messageMap[id]
|
|
123
151
|
if (!message) {
|
|
124
152
|
return
|
|
@@ -147,21 +175,57 @@ export default class ClientChatMessage {
|
|
|
147
175
|
delete this.data.messageData[groupField]
|
|
148
176
|
}
|
|
149
177
|
this.event && this.event.emit('remove-message', {
|
|
150
|
-
data
|
|
178
|
+
data: message
|
|
151
179
|
})
|
|
152
180
|
}
|
|
153
181
|
|
|
154
182
|
updateMessage (id, props) {
|
|
155
183
|
const message = this.getMessage(id)
|
|
156
184
|
if (!message) {
|
|
185
|
+
this.tempMessageMap[id] = props
|
|
157
186
|
return
|
|
158
187
|
}
|
|
159
188
|
if (!props) {
|
|
160
189
|
return
|
|
161
190
|
}
|
|
191
|
+
const groupField = message[this.groupField]
|
|
192
|
+
const oldSortFieldValue = message[this.sortField]
|
|
193
|
+
const oldSortFields = this.getSortField(oldSortFieldValue)
|
|
162
194
|
Object.keys(props).forEach(key => {
|
|
163
|
-
message
|
|
195
|
+
Vue.set(message, key, props[key])
|
|
164
196
|
})
|
|
197
|
+
if (typeof props[this.sortField] !== 'undefined' && props[this.sortField] !== oldSortFieldValue) {
|
|
198
|
+
const oldBucket = this.data.messageData[groupField] &&
|
|
199
|
+
this.data.messageData[groupField][oldSortFields.day] &&
|
|
200
|
+
this.data.messageData[groupField][oldSortFields.day][oldSortFields.milliseconds]
|
|
201
|
+
if (oldBucket) {
|
|
202
|
+
const index = oldBucket.findIndex(item => item.id === message.id)
|
|
203
|
+
if (index >= 0) {
|
|
204
|
+
oldBucket.splice(index, 1)
|
|
205
|
+
}
|
|
206
|
+
if (!oldBucket.length) {
|
|
207
|
+
Vue.delete(this.data.messageData[groupField][oldSortFields.day], oldSortFields.milliseconds)
|
|
208
|
+
}
|
|
209
|
+
if (!Object.keys(this.data.messageData[groupField][oldSortFields.day]).length) {
|
|
210
|
+
Vue.delete(this.data.messageData[groupField], oldSortFields.day)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const newSortFields = this.getSortField(message[this.sortField])
|
|
214
|
+
if (!this.data.messageData[groupField]) {
|
|
215
|
+
Vue.set(this.data.messageData, groupField, {})
|
|
216
|
+
}
|
|
217
|
+
if (!this.data.messageData[groupField][newSortFields.day]) {
|
|
218
|
+
Vue.set(this.data.messageData[groupField], newSortFields.day, {})
|
|
219
|
+
}
|
|
220
|
+
if (!this.data.messageData[groupField][newSortFields.day][newSortFields.milliseconds]) {
|
|
221
|
+
Vue.set(this.data.messageData[groupField][newSortFields.day], newSortFields.milliseconds, [])
|
|
222
|
+
}
|
|
223
|
+
const newBucket = this.data.messageData[groupField][newSortFields.day][newSortFields.milliseconds]
|
|
224
|
+
if (!newBucket.some(item => item.id === message.id)) {
|
|
225
|
+
newBucket.push(message)
|
|
226
|
+
}
|
|
227
|
+
this.setLastMessageTime(groupField, message[this.sortField], message)
|
|
228
|
+
}
|
|
165
229
|
}
|
|
166
230
|
|
|
167
231
|
getMessage (id) {
|
|
@@ -215,11 +279,11 @@ export default class ClientChatMessage {
|
|
|
215
279
|
}, data, {
|
|
216
280
|
cmdType: 'CmdQwSendMessage'
|
|
217
281
|
})).then(({ data }) => {
|
|
218
|
-
if (data.
|
|
282
|
+
if (data.status === 0) {
|
|
219
283
|
// 发送成功
|
|
220
|
-
} else if (data.
|
|
284
|
+
} else if (data.status === 2) {
|
|
221
285
|
// 发送失败
|
|
222
|
-
} else if (data.
|
|
286
|
+
} else if (data.status === 1) {
|
|
223
287
|
// 发送中
|
|
224
288
|
}
|
|
225
289
|
// 如果返回的是对象,证明发送成功了
|
|
@@ -273,8 +337,54 @@ export default class ClientChatMessage {
|
|
|
273
337
|
this.clearMessage()
|
|
274
338
|
return this.loadMessageData(params)
|
|
275
339
|
}
|
|
340
|
+
|
|
341
|
+
addCheckMessageSendResultTask (message) {
|
|
342
|
+
if (this.checkMessageSendResultTaskList.some(v => v.id === message.id)) return
|
|
343
|
+
let timer
|
|
344
|
+
const task = { id: message.id, promise: createPromise(), check: () => {
|
|
345
|
+
if (message.status !== 1) return task.promise.resolve()
|
|
346
|
+
if (Date.now() - (message.createTime || message.sendTime) > 5 * 60 * 1000) return task.promise.resolve({status: 3, resultMsg: '消息发送超时'})
|
|
347
|
+
timer = setTimeout(() => {
|
|
348
|
+
Promise.resolve(this.checkMessageSendResultMethod({message})).then(rs => {
|
|
349
|
+
const data = rs && rs.data
|
|
350
|
+
if (data && data.status === 1) task.check()
|
|
351
|
+
else task.promise.resolve(data || {})
|
|
352
|
+
}, () => task.check())
|
|
353
|
+
}, 3000)
|
|
354
|
+
}, cancel: () => { clearTimeout(timer); task.promise.reject('reject') } }
|
|
355
|
+
this.checkMessageSendResultTaskList.push(task)
|
|
356
|
+
task.check()
|
|
357
|
+
task.promise.then(rs => this.updateMessage(message.id, rs || {})).finally(() => this.removeCheckMessageSendResultTask(message.id))
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
removeCheckMessageSendResultTask (id) {
|
|
361
|
+
const index = this.checkMessageSendResultTaskList.findIndex(v => v.id === id)
|
|
362
|
+
if (index >= 0) { this.checkMessageSendResultTaskList[index].cancel(); this.checkMessageSendResultTaskList.splice(index, 1) }
|
|
363
|
+
}
|
|
276
364
|
|
|
277
365
|
reset () {
|
|
366
|
+
this.checkMessageSendResultTaskList.forEach(task => task.cancel())
|
|
367
|
+
this.checkMessageSendResultTaskList = []
|
|
368
|
+
this.tempMessageMap = {}
|
|
369
|
+
this.messageMap = {}
|
|
370
|
+
this.lastMessageTimeMap = {}
|
|
278
371
|
this.data.messageData = {}
|
|
279
372
|
}
|
|
280
|
-
|
|
373
|
+
|
|
374
|
+
getLastMessageTime (groupField) {
|
|
375
|
+
return this.lastMessageTimeMap[groupField]
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
setLastMessageTime (groupField, messageTime, message) {
|
|
379
|
+
if (!groupField || !messageTime || (message && message.msgType === '_EMPTY_')) {
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
if (message && message._temp) {
|
|
383
|
+
return
|
|
384
|
+
}
|
|
385
|
+
const lastMessageTime = this.getLastMessageTime(groupField)
|
|
386
|
+
if (!lastMessageTime || messageTime > lastMessageTime) {
|
|
387
|
+
this.lastMessageTimeMap[groupField] = messageTime
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|