@aochuang/client-sdk 1.0.278

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.
Files changed (366) hide show
  1. package/README.md +93 -0
  2. package/common/avatar/avatar.vue +86 -0
  3. package/common/avatar/index.js +3 -0
  4. package/common/badge/badge.vue +105 -0
  5. package/common/badge/index.js +3 -0
  6. package/common/context-menu/context-menu-box.vue +61 -0
  7. package/common/context-menu/context-menu-group.vue +162 -0
  8. package/common/context-menu/context-menu-item.vue +179 -0
  9. package/common/context-menu/context-menu.vue +201 -0
  10. package/common/context-menu/index.js +3 -0
  11. package/common/context-menu/utils.js +138 -0
  12. package/common/friend-avatar/default.svg +1 -0
  13. package/common/friend-avatar/friend-avatar.vue +29 -0
  14. package/common/friend-avatar/index.js +3 -0
  15. package/common/image/index.js +3 -0
  16. package/common/index.js +17 -0
  17. package/common/room-avatar/default.svg +6 -0
  18. package/common/room-avatar/index.js +3 -0
  19. package/common/room-avatar/room-avatar.vue +29 -0
  20. package/common/scroll-load-more/index.js +3 -0
  21. package/common/scroll-load-more/scroll-load-more.vue +195 -0
  22. package/common/user-avatar/default.svg +1 -0
  23. package/common/user-avatar/index.js +3 -0
  24. package/common/user-avatar/user-avatar.vue +29 -0
  25. package/components/account-select/account-select-skeleton.vue +56 -0
  26. package/components/account-select/account-select.vue +205 -0
  27. package/components/account-select/all.svg +1 -0
  28. package/components/account-select/index.js +3 -0
  29. package/components/chat-editor/MENTION_TOKEN_SUMMARY.md +74 -0
  30. package/components/chat-editor/chat-editor-button/chat-editor-button.vue +78 -0
  31. package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +329 -0
  32. package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar-item.vue +28 -0
  33. package/components/chat-editor/chat-editor-toolbar/chat-editor-toolbar.vue +17 -0
  34. package/components/chat-editor/chat-editor.vue +933 -0
  35. package/components/chat-editor/index.js +12 -0
  36. package/components/chat-editor/utils.js +189 -0
  37. package/components/chat-friend-profile/chat-friend-profile.vue +118 -0
  38. package/components/chat-friend-profile/index.js +3 -0
  39. package/components/chat-layout/chat-layout.vue +71 -0
  40. package/components/chat-layout/index.js +3 -0
  41. package/components/chat-panel/chat-panel-box.vue +350 -0
  42. package/components/chat-panel/chat-panel-chat.vue +121 -0
  43. package/components/chat-panel/chat-panel-chats.vue +674 -0
  44. package/components/chat-panel/chat-panel-empty.vue +32 -0
  45. package/components/chat-panel/chat-panel-increment.vue +80 -0
  46. package/components/chat-panel/chat-panel-inner-msg.vue +25 -0
  47. package/components/chat-panel/chat-panel-loading.vue +29 -0
  48. package/components/chat-panel/chat-panel-nearest.vue +136 -0
  49. package/components/chat-panel/chat-panel.vue +292 -0
  50. package/components/chat-panel/index.js +3 -0
  51. package/components/chat-panel/util.js +83 -0
  52. package/components/chat-room-profile/chat-room-profile.vue +103 -0
  53. package/components/chat-room-profile/index.js +3 -0
  54. package/components/contacts-friend-select/contacts-friend-select-skeleton.vue +41 -0
  55. package/components/contacts-friend-select/contacts-friend-select.vue +204 -0
  56. package/components/contacts-friend-select/index.js +3 -0
  57. package/components/contacts-group-select/contacts-group-select-item.vue +98 -0
  58. package/components/contacts-group-select/contacts-group-select-skeleton.vue +81 -0
  59. package/components/contacts-group-select/contacts-group-select.vue +396 -0
  60. package/components/contacts-group-select/index.js +3 -0
  61. package/components/contacts-room-select/contacts-room-select-skeleton.vue +41 -0
  62. package/components/contacts-room-select/contacts-room-select.vue +208 -0
  63. package/components/contacts-room-select/index.js +3 -0
  64. package/components/index.js +43 -0
  65. package/components/layout/index.js +3 -0
  66. package/components/layout/layout.vue +70 -0
  67. package/components/session-select/index.js +11 -0
  68. package/components/session-select/session-select-item-skeleton.vue +59 -0
  69. package/components/session-select/session-select-item.vue +190 -0
  70. package/components/session-select/session-select.vue +386 -0
  71. package/components/wechat-chat-control/calling/calling.vue +227 -0
  72. package/components/wechat-chat-control/calling/phone-fill.svg +1 -0
  73. package/components/wechat-chat-control/calling/vidicon-fill.svg +1 -0
  74. package/components/wechat-chat-control/channel-live/channel-live.vue +198 -0
  75. package/components/wechat-chat-control/channel-live/quote-icon.svg +1 -0
  76. package/components/wechat-chat-control/channel-video/channel-video.vue +180 -0
  77. package/components/wechat-chat-control/channel-video/quote-icon.svg +1 -0
  78. package/components/wechat-chat-control/channel-video-card/channel-video-card.vue +139 -0
  79. package/components/wechat-chat-control/channel-video-card/quote-icon.svg +1 -0
  80. package/components/wechat-chat-control/company-card/company-card.vue +136 -0
  81. package/components/wechat-chat-control/company-card/quote-icon.svg +1 -0
  82. package/components/wechat-chat-control/custom-expression/custom-expression.vue +45 -0
  83. package/components/wechat-chat-control/empty/empty.vue +27 -0
  84. package/components/wechat-chat-control/file-url/file-url.vue +307 -0
  85. package/components/wechat-chat-control/file-url/icons/file-excel-line.svg +1 -0
  86. package/components/wechat-chat-control/file-url/icons/file-info-line.svg +1 -0
  87. package/components/wechat-chat-control/file-url/icons/file-music-line.svg +1 -0
  88. package/components/wechat-chat-control/file-url/icons/file-pdf-line.svg +1 -0
  89. package/components/wechat-chat-control/file-url/icons/file-ppt-line.svg +1 -0
  90. package/components/wechat-chat-control/file-url/icons/file-settings-line.svg +1 -0
  91. package/components/wechat-chat-control/file-url/icons/file-text-line.svg +1 -0
  92. package/components/wechat-chat-control/file-url/icons/file-unknow-line.svg +1 -0
  93. package/components/wechat-chat-control/file-url/icons/file-word-line.svg +1 -0
  94. package/components/wechat-chat-control/file-url/icons/file-zip-line.svg +1 -0
  95. package/components/wechat-chat-control/file-url/icons/index.js +24 -0
  96. package/components/wechat-chat-control/image/image.vue +344 -0
  97. package/components/wechat-chat-control/image/index.js +1 -0
  98. package/components/wechat-chat-control/image/util.js +29 -0
  99. package/components/wechat-chat-control/index.js +104 -0
  100. package/components/wechat-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
  101. package/components/wechat-chat-control/location/location.vue +179 -0
  102. package/components/wechat-chat-control/location/offline-bg.png +0 -0
  103. package/components/wechat-chat-control/member-change/member-change.vue +37 -0
  104. package/components/wechat-chat-control/music/icons/163.png +0 -0
  105. package/components/wechat-chat-control/music/icons/163.svg +12 -0
  106. package/components/wechat-chat-control/music/icons/default.png +0 -0
  107. package/components/wechat-chat-control/music/icons/default.svg +1 -0
  108. package/components/wechat-chat-control/music/icons/kuwo.png +0 -0
  109. package/components/wechat-chat-control/music/icons/qq.png +0 -0
  110. package/components/wechat-chat-control/music/icons/qq.svg +1 -0
  111. package/components/wechat-chat-control/music/music.vue +156 -0
  112. package/components/wechat-chat-control/music/utils.js +30 -0
  113. package/components/wechat-chat-control/quote-message/quote-message.vue +257 -0
  114. package/components/wechat-chat-control/real-time-position/icon.svg +1 -0
  115. package/components/wechat-chat-control/real-time-position/real-time-position.vue +57 -0
  116. package/components/wechat-chat-control/red-envelopes/quote-icon.svg +1 -0
  117. package/components/wechat-chat-control/red-envelopes/red-envelope.svg +1 -0
  118. package/components/wechat-chat-control/red-envelopes/red-envelopes.vue +168 -0
  119. package/components/wechat-chat-control/revoke-me-message/revoke-me-message.vue +41 -0
  120. package/components/wechat-chat-control/revoke-other-message/revoke-other-message.vue +41 -0
  121. package/components/wechat-chat-control/revoke-you-message/revoke-you-message.vue +41 -0
  122. package/components/wechat-chat-control/room-calling/phone-fill.svg +1 -0
  123. package/components/wechat-chat-control/room-calling/room-calling.vue +52 -0
  124. package/components/wechat-chat-control/room-calling/vidicon-fill.svg +1 -0
  125. package/components/wechat-chat-control/share-card/quote-icon.svg +1 -0
  126. package/components/wechat-chat-control/share-card/share-card.vue +140 -0
  127. package/components/wechat-chat-control/system/system.vue +122 -0
  128. package/components/wechat-chat-control/system-batch-message/system-batch-message.vue +28 -0
  129. package/components/wechat-chat-control/system-money/system-money.vue +39 -0
  130. package/components/wechat-chat-control/text/icons/icon.svg +6 -0
  131. package/components/wechat-chat-control/text/text.vue +164 -0
  132. package/components/wechat-chat-control/text-with-at/text-with-at.vue +88 -0
  133. package/components/wechat-chat-control/transfer/collection.svg +1 -0
  134. package/components/wechat-chat-control/transfer/quote-icon.svg +1 -0
  135. package/components/wechat-chat-control/transfer/red-transfer.svg +1 -0
  136. package/components/wechat-chat-control/transfer/refund.svg +1 -0
  137. package/components/wechat-chat-control/transfer/transfer.svg +1 -0
  138. package/components/wechat-chat-control/transfer/transfer.vue +263 -0
  139. package/components/wechat-chat-control/unknow/unknow.vue +21 -0
  140. package/components/wechat-chat-control/url/icons/link.svg +1 -0
  141. package/components/wechat-chat-control/url/icons/video.svg +6 -0
  142. package/components/wechat-chat-control/url/miniprogram.svg +1 -0
  143. package/components/wechat-chat-control/url/url-file.vue +47 -0
  144. package/components/wechat-chat-control/url/url-link.vue +169 -0
  145. package/components/wechat-chat-control/url/url-merge.vue +164 -0
  146. package/components/wechat-chat-control/url/url-miniprogram.vue +259 -0
  147. package/components/wechat-chat-control/url/url.vue +116 -0
  148. package/components/wechat-chat-control/util.js +234 -0
  149. package/components/wechat-chat-control/video/icons/video.svg +1 -0
  150. package/components/wechat-chat-control/video/video.vue +304 -0
  151. package/components/wechat-chat-control/voice/icons/voice.svg +1 -0
  152. package/components/wechat-chat-control/voice/voice.vue +464 -0
  153. package/components/wechat-chat-control/wechat-chat-control-config-item.vue +24 -0
  154. package/components/wechat-chat-control/wechat-chat-control-config-msg.vue +21 -0
  155. package/components/wechat-chat-control/wechat-chat-control-config.vue +57 -0
  156. package/components/wechat-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +69 -0
  157. package/components/wechat-chat-panel/chat-panel-item.vue +695 -0
  158. package/components/wechat-chat-panel/chat-panel.vue +257 -0
  159. package/components/wechat-chat-panel/index.js +3 -0
  160. package/components/wework-chat-control/calling/calling.vue +223 -0
  161. package/components/wework-chat-control/calling/phone-fill.svg +1 -0
  162. package/components/wework-chat-control/calling/vidicon-fill.svg +1 -0
  163. package/components/wework-chat-control/channel-live/channel-live.vue +198 -0
  164. package/components/wework-chat-control/channel-live/quote-icon.svg +1 -0
  165. package/components/wework-chat-control/channel-video/channel-video.vue +180 -0
  166. package/components/wework-chat-control/channel-video/quote-icon.svg +1 -0
  167. package/components/wework-chat-control/company-card/company-card.vue +136 -0
  168. package/components/wework-chat-control/company-card/quote-icon.svg +1 -0
  169. package/components/wework-chat-control/custom-expression/custom-expression.vue +34 -0
  170. package/components/wework-chat-control/empty/empty.vue +27 -0
  171. package/components/wework-chat-control/expression/expression.vue +53 -0
  172. package/components/wework-chat-control/file-url/file-url.vue +247 -0
  173. package/components/wework-chat-control/file-url/icons/file-excel-line.svg +1 -0
  174. package/components/wework-chat-control/file-url/icons/file-info-line.svg +1 -0
  175. package/components/wework-chat-control/file-url/icons/file-music-line.svg +1 -0
  176. package/components/wework-chat-control/file-url/icons/file-pdf-line.svg +1 -0
  177. package/components/wework-chat-control/file-url/icons/file-ppt-line.svg +1 -0
  178. package/components/wework-chat-control/file-url/icons/file-settings-line.svg +1 -0
  179. package/components/wework-chat-control/file-url/icons/file-text-line.svg +1 -0
  180. package/components/wework-chat-control/file-url/icons/file-unknow-line.svg +1 -0
  181. package/components/wework-chat-control/file-url/icons/file-word-line.svg +1 -0
  182. package/components/wework-chat-control/file-url/icons/file-zip-line.svg +1 -0
  183. package/components/wework-chat-control/file-url/icons/index.js +24 -0
  184. package/components/wework-chat-control/image/image.vue +296 -0
  185. package/components/wework-chat-control/image/index.js +1 -0
  186. package/components/wework-chat-control/image/util.js +21 -0
  187. package/components/wework-chat-control/index.js +105 -0
  188. package/components/wework-chat-control/jx-sys-text/jx-sys-text.vue +28 -0
  189. package/components/wework-chat-control/link/link.vue +100 -0
  190. package/components/wework-chat-control/location/location.vue +181 -0
  191. package/components/wework-chat-control/location/offline-bg.png +0 -0
  192. package/components/wework-chat-control/red-envelopes/quote-icon.svg +1 -0
  193. package/components/wework-chat-control/red-envelopes/red-envelope.svg +1 -0
  194. package/components/wework-chat-control/red-envelopes/red-envelopes.vue +168 -0
  195. package/components/wework-chat-control/share-card/quote-icon.svg +1 -0
  196. package/components/wework-chat-control/share-card/share-card.vue +140 -0
  197. package/components/wework-chat-control/text/icons/icon.svg +6 -0
  198. package/components/wework-chat-control/text/text.vue +157 -0
  199. package/components/wework-chat-control/unknow/unknow.vue +21 -0
  200. package/components/wework-chat-control/url/icons/link.svg +1 -0
  201. package/components/wework-chat-control/url/icons/video.svg +6 -0
  202. package/components/wework-chat-control/url/miniprogram.svg +1 -0
  203. package/components/wework-chat-control/url/url-file.vue +37 -0
  204. package/components/wework-chat-control/url/url-link.vue +169 -0
  205. package/components/wework-chat-control/url/url-merge.vue +164 -0
  206. package/components/wework-chat-control/url/url-miniprogram.vue +248 -0
  207. package/components/wework-chat-control/url/url.vue +103 -0
  208. package/components/wework-chat-control/util.js +223 -0
  209. package/components/wework-chat-control/video/icons/video.svg +1 -0
  210. package/components/wework-chat-control/video/video.vue +304 -0
  211. package/components/wework-chat-control/voice/icons/voice.svg +1 -0
  212. package/components/wework-chat-control/voice/voice.vue +464 -0
  213. package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
  214. package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
  215. package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
  216. package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
  217. package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
  218. package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
  219. package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
  220. package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
  221. package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
  222. package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
  223. package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
  224. package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
  225. package/components/wework-chat-panel/chat-panel-item.vue +650 -0
  226. package/components/wework-chat-panel/chat-panel.vue +163 -0
  227. package/components/wework-chat-panel/index.js +3 -0
  228. package/package.json +23 -0
  229. package/services/client-chat/client-chat-wechat/client-chat-account.js +426 -0
  230. package/services/client-chat/client-chat-wechat/client-chat-concats.js +1029 -0
  231. package/services/client-chat/client-chat-wechat/client-chat-draft.js +92 -0
  232. package/services/client-chat/client-chat-wechat/client-chat-message.js +588 -0
  233. package/services/client-chat/client-chat-wechat/client-chat-session-manage.js +67 -0
  234. package/services/client-chat/client-chat-wechat/client-chat-session.js +1048 -0
  235. package/services/client-chat/client-chat-wechat/client-chat-socket.js +215 -0
  236. package/services/client-chat/client-chat-wechat/client-chat.js +1065 -0
  237. package/services/client-chat/client-chat-wechat/index.js +3 -0
  238. package/services/client-chat/client-chat-wechat/utils.js +82 -0
  239. package/services/client-chat/client-chat-wework/client-chat-account.js +310 -0
  240. package/services/client-chat/client-chat-wework/client-chat-concats.js +772 -0
  241. package/services/client-chat/client-chat-wework/client-chat-message.js +278 -0
  242. package/services/client-chat/client-chat-wework/client-chat-session.js +929 -0
  243. package/services/client-chat/client-chat-wework/client-chat-socket.js +64 -0
  244. package/services/client-chat/client-chat-wework/client-chat.js +330 -0
  245. package/services/client-chat/client-chat-wework/index.js +3 -0
  246. package/services/client-chat/client-chat-wework/utils.js +82 -0
  247. package/services/index.js +10 -0
  248. package/services/socket/index.js +5 -0
  249. package/services/socket/socket.js +797 -0
  250. package/services/socket/utils.js +7 -0
  251. package/uni-common/account-portray/account-portray.vue +51 -0
  252. package/uni-common/account-select/account-select-item.vue +172 -0
  253. package/uni-common/account-select/account-select.vue +252 -0
  254. package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
  255. package/uni-common/friend-avatar/default.svg +1 -0
  256. package/uni-common/friend-avatar/friend-avatar.vue +27 -0
  257. package/uni-common/friend-avatar/index.js +3 -0
  258. package/uni-common/friend-loader/friend-loader.vue +53 -0
  259. package/uni-common/friend-portray/friend-portray.vue +56 -0
  260. package/uni-common/group-avatar/default.svg +1 -0
  261. package/uni-common/group-avatar/group-avatar.vue +18 -0
  262. package/uni-common/group-avatar/index.js +3 -0
  263. package/uni-common/room-avatar/default.svg +6 -0
  264. package/uni-common/room-avatar/index.js +3 -0
  265. package/uni-common/room-avatar/room-avatar.vue +27 -0
  266. package/uni-common/room-loader/room-loader.vue +53 -0
  267. package/uni-common/room-portray/room-portray.vue +56 -0
  268. package/uni-components/chat-control/calling/calling.vue +91 -0
  269. package/uni-components/chat-control/calling/phone-fill.svg +1 -0
  270. package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
  271. package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
  272. package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
  273. package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
  274. package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
  275. package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
  276. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
  277. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
  278. package/uni-components/chat-control/chat-control-config.vue +59 -0
  279. package/uni-components/chat-control/chat-control.vue +218 -0
  280. package/uni-components/chat-control/company-card/company-card.vue +123 -0
  281. package/uni-components/chat-control/const.js +28 -0
  282. package/uni-components/chat-control/expression/expression.vue +41 -0
  283. package/uni-components/chat-control/image/image.vue +68 -0
  284. package/uni-components/chat-control/index.js +89 -0
  285. package/uni-components/chat-control/location/location.vue +110 -0
  286. package/uni-components/chat-control/member-change/member-change.vue +32 -0
  287. package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
  288. package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
  289. package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
  290. package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
  291. package/uni-components/chat-control/share-card/share-card.vue +101 -0
  292. package/uni-components/chat-control/system/system.vue +69 -0
  293. package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
  294. package/uni-components/chat-control/system-text/system-text.vue +32 -0
  295. package/uni-components/chat-control/text/text.vue +67 -0
  296. package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
  297. package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
  298. package/uni-components/chat-control/transfer/transfer.vue +80 -0
  299. package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
  300. package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
  301. package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
  302. package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
  303. package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
  304. package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
  305. package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
  306. package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
  307. package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
  308. package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
  309. package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
  310. package/uni-components/chat-control/url/icons/index.js +24 -0
  311. package/uni-components/chat-control/url/miniprogram.svg +1 -0
  312. package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
  313. package/uni-components/chat-control/url/url.vue +306 -0
  314. package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
  315. package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
  316. package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
  317. package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
  318. package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
  319. package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
  320. package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
  321. package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
  322. package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
  323. package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
  324. package/uni-components/chat-control/url-new/icons/index.js +24 -0
  325. package/uni-components/chat-control/url-new/url-new.vue +110 -0
  326. package/uni-components/chat-control/utils.js +12 -0
  327. package/uni-components/chat-control/video/video.vue +156 -0
  328. package/uni-components/chat-control/voice/voice.vue +166 -0
  329. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
  330. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
  331. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
  332. package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
  333. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
  334. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
  335. package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
  336. package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
  337. package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
  338. package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
  339. package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
  340. package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
  341. package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
  342. package/uni-components/chat-editor/chat-editor.vue +257 -0
  343. package/uni-components/chat-editor/index.js +10 -0
  344. package/uni-components/chat-editor/util.js +65 -0
  345. package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
  346. package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
  347. package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
  348. package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
  349. package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
  350. package/uni-components/chat-panel/chat-panel.vue +227 -0
  351. package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
  352. package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
  353. package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
  354. package/utils/color.js +178 -0
  355. package/utils/data.js +11 -0
  356. package/utils/date.js +107 -0
  357. package/utils/event.js +3 -0
  358. package/utils/file.js +26 -0
  359. package/utils/index.js +5 -0
  360. package/utils/json.js +40 -0
  361. package/utils/log.js +243 -0
  362. package/utils/queue.js +97 -0
  363. package/utils/regexp.js +9 -0
  364. package/utils/string.js +66 -0
  365. package/utils/url.js +48 -0
  366. package/utils/util.js +130 -0
@@ -0,0 +1,772 @@
1
+ import Vue from 'vue'
2
+ import Event from '../../../utils/event.js'
3
+ import { createPromise } from '../../../utils/util.js'
4
+
5
+ export default class ClientChatContacts {
6
+ data = Vue.observable({
7
+ friendGroupData: [],
8
+ /**
9
+ * {
10
+ * "departmentId": "1801429132909334528",
11
+ * "departmentName": "测试一部",
12
+ * "groupMemo": "木三",
13
+ * "groupName": "群聊分组1",
14
+ * "groupType": 2,
15
+ * "id": "f953ef9a40774230be25c259fba2af7b",
16
+ * "ownerType": 0,
17
+ * "sortIndex": 1710206716604,
18
+ * "tenantId": "1761952223049924608"
19
+ * }
20
+ */
21
+ roomGroupData: [],
22
+ /**
23
+ * {
24
+ * "accountId": "1775049357349355520",
25
+ * "addFrom": 15,
26
+ * "additionalPicture": "",
27
+ * "alias": "ling93hui",
28
+ * "avatar": "https://wx.qlogo.cn/mmhead/ver_1/HtM8dZ3P4y5Xut8qV9bPGnCrrrXLhcfqoowicK9yDUrJDRVEJo4tXfHEYo4ebiaARBWIVcYM94jd9LGOTedDhHWUicHrib6YKRkopwGAp2CMg3A/0",
29
+ * "changeType": 2,
30
+ * "city": "大陆",
31
+ * "conRemark": "",
32
+ * "country": "中国",
33
+ * "desc": "",
34
+ * "deviceType": 0,
35
+ * "gender": 1,
36
+ * "groupId": "6efe8da4f39949b8824e808213f57225",
37
+ * "id": "0086a2b675ffd5d6c5cfaaaeef17aea196670040",
38
+ * "isPassed": true,
39
+ * "labels": [],
40
+ * "lastUpdateTime": 1722909288369,
41
+ * "nickname": "凌辉",
42
+ * "phone": "",
43
+ * "phones": [],
44
+ * "province": "上海",
45
+ * "pyInitial": "LH",
46
+ * "quanPin": "linghui",
47
+ * "region": "中国大陆上海",
48
+ * "qwAccountId": "7ccabf58328d3524f1f4089e405be4f0ed8d30db",
49
+ * "wechatId": "wxid_88k3o4vexl8l22"
50
+ * }
51
+ */
52
+ friendData: [],
53
+ /**
54
+ * {
55
+ * "accountId": "1775049357349355520",
56
+ * "accountRealname": "杨雨",
57
+ * "accountUsername": "18627032190",
58
+ * "changeType": 2,
59
+ * "chatroomAvatar": "https://kefures.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/c82512dc9fc44ca49a66f3ceea09f438/02c3338c30c11de7a7284adcae6488c7/9998/f50496f945c61eb741fe86be90f5f36d.png",
60
+ * "chatroomId": "45456576437@chatroom",
61
+ * "chatroomMemberCount": 0,
62
+ * "conRemark": "",
63
+ * "deviceType": 0,
64
+ * "id": "01869a0ad096b9f707f005fc9df77e362a56a44b",
65
+ * "nickname": "X布雷斯特丨政企%note11丨41",
66
+ * "notice": "",
67
+ * "owner": {
68
+ * "nickname": "翟康胜🇨🇳私域scrm",
69
+ * "id": "wxid_iz2rc1jtj0jr22",
70
+ * "avatar": "https://wx.qlogo.cn/mmhead/ver_1/XUGXKbN9bwr0rNrPT8ZPHTGTc2khF91x9FlguIUyfQWKQ8JISuLJL4cumg41rkDzpebMUwTgmb2myT8uN8TM4iaUfwErwSAyR8n5ibiapPelDw/0"
71
+ * },
72
+ * "ownerWechatId": "wxid_iz2rc1jtj0jr22",
73
+ * "pyInitial": "XBLSTSZQNOTE11S41",
74
+ * "quanPin": "Xbuleisiteshuzhengqinote11shu41",
75
+ * "selfDisplayName": "",
76
+ * "qwAccountId": "6ab35665f1809d5c9aa7c6285e1e733981ade2f5"
77
+ * }
78
+ */
79
+ roomData: [],
80
+
81
+
82
+ /**
83
+ * {
84
+ * groupId: [{
85
+ * ... 好友/群数据
86
+ * }]
87
+ * }
88
+ */
89
+ groupBindFriendMap: {},
90
+
91
+ /**
92
+ * {
93
+ * groupId: [{
94
+ * ... 好友/群数据
95
+ * }]
96
+ * }
97
+ */
98
+ groupBindRoomMap: {},
99
+
100
+ /**
101
+ * {
102
+ * accountId: {
103
+ * groupId: [{
104
+ * ...好友/群数据
105
+ * }]
106
+ * }
107
+ * }
108
+ */
109
+ accountBindFriendMap: {},
110
+
111
+ /**
112
+ * {
113
+ * accountId: {
114
+ * groupId: [{
115
+ * ...好友/群数据
116
+ * }]
117
+ * }
118
+ * }
119
+ */
120
+ accountBindRoomMap: {},
121
+ /**
122
+ * 群成员数据
123
+ * {
124
+ * roomId: []
125
+ * }
126
+ */
127
+ roomBindMemberMap: {},
128
+
129
+ /**
130
+ * 标记通讯录是否修改了
131
+ * 如果修改了,比如接收到了分配好友的会话时,一定通讯录变了,变了的时候界面需要根据这个状态刷新通讯录
132
+ */
133
+ isModify: false
134
+ })
135
+
136
+ friendMap = {}
137
+
138
+ roomMap = {}
139
+
140
+ loadContactsRoomGroupDataMethod = null
141
+
142
+ loadContactsFriendGroupDataMethod = null
143
+
144
+ loadContactsFriendDataMethod = null
145
+
146
+ loadContactsRoomDataMethod = null
147
+
148
+ loadContactsRoomMemberDataMethod = null
149
+
150
+ constructor (options) {
151
+ options = Object.assign({
152
+ loadContactsRoomGroupDataMethod: null,
153
+ loadContactsFriendGroupDataMethod: null,
154
+ loadContactsFriendDataMethod: null,
155
+ loadContactsRoomDataMethod: null,
156
+ loadContactsRoomMemberDataMethod: null,
157
+ getContactsFriendMethod: null,
158
+ getContactsRoomMethod: null,
159
+ getContactsFriendGroupCountMethod: null,
160
+ getContactsRoomGroupCountMethod: null,
161
+ onRoomRemoved: null
162
+ }, options)
163
+ if (!options.loadContactsRoomGroupDataMethod) {
164
+ throw new Error('缺少loadContactsRoomGroupDataMethod配置')
165
+ }
166
+ if (!options.loadContactsFriendGroupDataMethod) {
167
+ throw new Error('缺少loadContactsFriendGroupDataMethod配置')
168
+ }
169
+ if (!options.loadContactsFriendDataMethod) {
170
+ throw new Error('缺少loadContactsFriendDataMethod配置')
171
+ }
172
+ if (!options.loadContactsRoomDataMethod) {
173
+ throw new Error('缺少loadContactsRoomDataMethod配置')
174
+ }
175
+ if (!options.loadContactsRoomMemberDataMethod) {
176
+ throw new Error('缺少loadContactsRoomMemberDataMethod配置')
177
+ }
178
+ if (!options.getContactsFriendMethod) {
179
+ throw new Error('缺少getContactsFriendMethod配置')
180
+ }
181
+ if (!options.getContactsRoomMethod) {
182
+ throw new Error('缺少getContactsRoomMethod配置')
183
+ }
184
+ if (!options.getContactsFriendGroupCountMethod) {
185
+ throw new Error('缺少getContactsFriendGroupCountMethod配置')
186
+ }
187
+ if (!options.getContactsRoomGroupCountMethod) {
188
+ throw new Error('缺少getContactsRoomGroupCountMethod配置')
189
+ }
190
+ this.loadContactsRoomGroupDataMethod = options.loadContactsRoomGroupDataMethod
191
+ this.loadContactsFriendGroupDataMethod = options.loadContactsFriendGroupDataMethod
192
+ this.loadContactsFriendDataMethod = options.loadContactsFriendDataMethod
193
+ this.loadContactsRoomDataMethod = options.loadContactsRoomDataMethod
194
+ this.loadContactsRoomMemberDataMethod = options.loadContactsRoomMemberDataMethod
195
+ this.getContactsFriendMethod = options.getContactsFriendMethod
196
+ this.getContactsRoomMethod = options.getContactsRoomMethod
197
+ this.getContactsRoomGroupCountMethod = options.getContactsRoomGroupCountMethod
198
+ this.getContactsFriendGroupCountMethod = options.getContactsFriendGroupCountMethod
199
+ this.onRoomRemoved = options.onRoomRemoved
200
+ this.event = new Event()
201
+ this.reloadPromise = createPromise()
202
+ }
203
+
204
+ get groupBindFriendData () {
205
+ return this.data.groupBindFriendMap
206
+ }
207
+
208
+ get groupBindRoomData () {
209
+ return this.data.groupBindRoomMap
210
+ }
211
+
212
+ get accountBindFriendData () {
213
+ return this.data.accountBindFriendMap
214
+ }
215
+
216
+ get accountBindRoomData () {
217
+ return this.data.accountBindRoomMap
218
+ }
219
+
220
+ get roomBindMemberData () {
221
+ return this.data.roomBindMemberMap
222
+ }
223
+
224
+ get roomData () {
225
+ return this.data.roomData
226
+ }
227
+
228
+ get friendData () {
229
+ return this.data.friendData
230
+ }
231
+
232
+ get friendGroupData () {
233
+ return this.data.friendGroupData
234
+ }
235
+
236
+ get roomGroupData () {
237
+ return this.data.roomGroupData
238
+ }
239
+
240
+ get isModify () {
241
+ return this.data.isModify
242
+ }
243
+
244
+ setRoomGroup (data) {
245
+ this.data.roomGroupData = []
246
+ if (data && data.length) {
247
+ data.forEach(item => {
248
+ this.addRoomGroup(item)
249
+ })
250
+ }
251
+ }
252
+
253
+ addRoomGroup (data) {
254
+ if (!data || !data.id) {
255
+ throw new Error('缺少必须参数')
256
+ }
257
+ if (this.data.roomGroupData.some(v => v.id === data.id)) {
258
+ return
259
+ }
260
+ this.data.roomGroupData.push(data)
261
+ }
262
+
263
+ updateRoomGroup (id, props) {
264
+ const group = this.data.roomGroupData.find(v => v.id === id)
265
+ if (!group) {
266
+ return
267
+ }
268
+ if (!props) {
269
+ return
270
+ }
271
+ Object.keys(props).forEach(key => {
272
+ group[key] = props[key]
273
+ })
274
+ }
275
+
276
+ removeRoomGroup (id) {
277
+ let index = -1
278
+ this.data.roomGroupData.some((v, i) => {
279
+ if (v.id === data.id) {
280
+ index = i
281
+ return true
282
+ }
283
+ })
284
+ if (index < 0) {
285
+ return
286
+ }
287
+ this.data.roomGroupData.splice(index, 1)
288
+ }
289
+
290
+ setFriendGroup (data) {
291
+ this.data.friendGroupData = []
292
+ if (data && data.length) {
293
+ data.forEach(item => {
294
+ this.addFriendGroup(item)
295
+ })
296
+ }
297
+ }
298
+
299
+ addFriendGroup (data) {
300
+ if (!data || !data.id) {
301
+ throw new Error('缺少必须参数')
302
+ }
303
+ if (this.data.friendGroupData.some(v => v.id === data.id)) {
304
+ return
305
+ }
306
+ this.data.friendGroupData.push(data)
307
+ }
308
+
309
+ getFriendGroup () {
310
+ return this.reloadPromise.then(() => {
311
+ const group = this.data.friendGroupData.find(v => v.id === id)
312
+ if (!group) {
313
+ return Promise.reject('未找到好友分组数据')
314
+ } else {
315
+ return group
316
+ }
317
+ })
318
+ }
319
+
320
+ removeFriendGroup (id) {
321
+ let index = -1
322
+ this.data.friendGroupData.some((v, i) => {
323
+ if (v.id === data.id) {
324
+ index = i
325
+ return true
326
+ }
327
+ })
328
+ if (index < 0) {
329
+ return
330
+ }
331
+ this.data.friendGroupData.splice(index, 1)
332
+ }
333
+
334
+ updateFriendGroup (id, props) {
335
+ const group = this.data.friendGroupData.find(v => v.id === id)
336
+ if (!group) {
337
+ return
338
+ }
339
+ if (!props) {
340
+ return
341
+ }
342
+ Object.keys(props).forEach(key => {
343
+ group[key] = props[key]
344
+ })
345
+ }
346
+
347
+ setFriendData (data, reset = true) {
348
+ if (reset) {
349
+ this.friendMap = {}
350
+ this.data.groupBindFriendMap = {}
351
+ this.data.accountBindFriendMap = {}
352
+ this.data.friendData = []
353
+ }
354
+ if (data && data.length) {
355
+ data.forEach(v => {
356
+ this.addFriend(v)
357
+ })
358
+ }
359
+ }
360
+
361
+ addFriend (data) {
362
+ if (!data || !data.id) {
363
+ throw new Error('缺少必须参数')
364
+ }
365
+ if (this.friendMap[data.id]) {
366
+ return
367
+ }
368
+ this.friendMap[data.id] = data
369
+ this.data.friendData.push(data)
370
+ const groupIds = (data.groupId || 'defaultFriendGroup').split(',')
371
+ groupIds.forEach(groupId => {
372
+ if (!this.data.groupBindFriendMap[groupId]) {
373
+ Vue.set(this.data.groupBindFriendMap, groupId, [])
374
+ }
375
+ if (data.qwAccountId) {
376
+ if (!this.data.accountBindFriendMap[data.qwAccountId]) {
377
+ Vue.set(this.data.accountBindFriendMap, data.qwAccountId, {})
378
+ }
379
+ if (!this.data.accountBindFriendMap[data.qwAccountId][groupId]) {
380
+ Vue.set(this.data.accountBindFriendMap[data.qwAccountId], groupId , [])
381
+ }
382
+ this.data.accountBindFriendMap[data.qwAccountId][groupId].push(data)
383
+ }
384
+ this.data.groupBindFriendMap[groupId].push(data)
385
+ })
386
+ }
387
+
388
+ removeFriend (id) {
389
+ if (!id) {
390
+ throw new Error('缺少必须参数')
391
+ }
392
+ if (!this.friendMap[id]) {
393
+ return
394
+ }
395
+ const index = this.data.friendData.indexOf(this.friendMap[id])
396
+ if (index >= 0) {
397
+ this.data.friendData.splice(index, 1)
398
+ }
399
+ const groupIds = (this.friendMap[id].groupId || 'defaultFriendGroup').split(',')
400
+ groupIds.forEach(groupId => {
401
+ if (this.data.groupBindFriendMap[groupId]) {
402
+ const bindIndex = this.data.groupBindFriendMap[groupId].indexOf(this.friendMap[id])
403
+ if (bindIndex >= 0) {
404
+ this.data.groupBindFriendMap[groupId].splice(bindIndex, 1)
405
+ }
406
+ }
407
+ const qwAccountId = this.friendMap[id].qwAccountId
408
+ if (qwAccountId && this.data.accountBindFriendMap[qwAccountId] && this.data.accountBindFriendMap[qwAccountId][groupId]) {
409
+ const bindIndex = this.data.accountBindFriendMap[qwAccountId][groupId].indexOf(this.friendMap[id])
410
+ if (bindIndex >= 0) {
411
+ this.data.accountBindFriendMap[qwAccountId][groupId].splice(bindIndex, 1)
412
+ }
413
+ }
414
+ })
415
+ delete this.friendMap[id]
416
+ }
417
+
418
+ updateFriend (id, props) {
419
+ if (!id) {
420
+ throw new Error('缺少必须参数')
421
+ }
422
+ if (!this.friendMap[id]) {
423
+ return
424
+ }
425
+ if (!props || typeof props !== 'object') {
426
+ return
427
+ }
428
+ Object.keys(props).forEach((key) => {
429
+ Vue.set(this.friendMap[id], key, props[key])
430
+ })
431
+ }
432
+
433
+ setRoomData (data, reset = true) {
434
+ if (reset) {
435
+ this.roomMap = {}
436
+ this.data.groupBindRoomMap = {}
437
+ this.data.accountBindRoomMap = {}
438
+ this.data.roomData = []
439
+ }
440
+ if (data && data.length) {
441
+ data.forEach(v => {
442
+ this.addRoom(v)
443
+ })
444
+ }
445
+ }
446
+
447
+ addRoom (data) {
448
+ if (!data || !data.id) {
449
+ throw new Error('缺少必须参数')
450
+ }
451
+ if (this.roomMap[data.id]) {
452
+ return
453
+ }
454
+ this.roomMap[data.id] = data
455
+ this.data.roomData.push(data)
456
+ const groupIds = (data.groupId || 'defaultRoomGroup').split(',')
457
+ groupIds.forEach(groupId => {
458
+ if (!this.data.groupBindRoomMap[groupId]) {
459
+ Vue.set(this.data.groupBindRoomMap, groupId, [])
460
+ }
461
+ this.data.groupBindRoomMap[groupId].push(data)
462
+ if (data.qwAccountId) {
463
+ if (!this.data.accountBindRoomMap[data.qwAccountId]) {
464
+ Vue.set(this.data.accountBindRoomMap, data.qwAccountId, {})
465
+ }
466
+ if (!this.data.accountBindRoomMap[data.qwAccountId][groupId]) {
467
+ Vue.set(this.data.accountBindRoomMap[data.qwAccountId], groupId, [])
468
+ }
469
+ this.data.accountBindRoomMap[data.qwAccountId][groupId].push(data)
470
+ }
471
+ })
472
+ }
473
+
474
+ removeRoom (id) {
475
+ if (!id) {
476
+ throw new Error('缺少必须参数')
477
+ }
478
+ if (!this.roomMap[id]) {
479
+ return
480
+ }
481
+ const index = this.data.roomData.indexOf(this.roomMap[id])
482
+ if (index >= 0) {
483
+ this.data.roomData.splice(index, 1)
484
+ }
485
+ const groupIds = (this.roomMap[id].groupId || 'defaultRoomGroup').split(',')
486
+ groupIds.forEach(groupId => {
487
+ if (this.data.groupBindRoomMap[groupId]) {
488
+ const bindIndex = this.data.groupBindRoomMap[groupId].indexOf(this.roomMap[id])
489
+ if (bindIndex >= 0) {
490
+ this.data.groupBindRoomMap[groupId].splice(bindIndex, 1)
491
+ }
492
+ }
493
+ const qwAccountId = this.roomMap[id].qwAccountId
494
+ if (qwAccountId && this.data.accountBindFriendMap[qwAccountId] && this.data.accountBindFriendMap[qwAccountId][groupId]) {
495
+ const bindIndex = this.data.accountBindFriendMap[qwAccountId][groupId].indexOf(this.roomMap[id])
496
+ if (bindIndex >= 0) {
497
+ this.data.accountBindFriendMap[qwAccountId][groupId].splice(bindIndex, 1)
498
+ }
499
+ }
500
+ })
501
+ const room = this.roomMap[id]
502
+ delete this.roomMap[id]
503
+ this.onRoomRemoved && this.onRoomRemoved({
504
+ room
505
+ })
506
+ }
507
+
508
+ updateRoom (id, props) {
509
+ if (!id) {
510
+ throw new Error('缺少必须参数')
511
+ }
512
+ if (!this.roomMap[id]) {
513
+ return
514
+ }
515
+ if (!props || typeof props !== 'object') {
516
+ return
517
+ }
518
+ Object.keys(props).forEach((key) => {
519
+ Vue.set(this.roomMap[id], key, props[key])
520
+ })
521
+ }
522
+
523
+ loadFriendGroupData () {
524
+ if (this._cacheLoadFriendGroupPromise) {
525
+ return this._cacheLoadFriendGroupPromise
526
+ }
527
+ this._cacheLoadFriendGroupPromise = this.loadContactsFriendGroupDataMethod().then((rs) => {
528
+ this.setFriendGroup(rs.data)
529
+ return rs
530
+ })
531
+ return this._cacheLoadFriendGroupPromise
532
+ }
533
+
534
+ reloadFriendGroupData () {
535
+ if (this._cacheLoadFriendGroupPromise) {
536
+ this._cacheLoadFriendGroupPromise = null
537
+ }
538
+ return this.loadFriendGroupData()
539
+ }
540
+
541
+ /**
542
+ * 缓存方式刷新数量
543
+ * 根据qwAccountId缓存
544
+ */
545
+ refreshAllFriendGroupCount (params) {
546
+ const { qwAccountId, ...nextParams } = Object.assign({
547
+ qwAccountId: null
548
+ }, params)
549
+ if (!this._cacheFriendGroupCountMap) {
550
+ this._cacheFriendGroupCountMap = {}
551
+ }
552
+ if (!this._cacheFriendGroupCountMap[qwAccountId]) {
553
+ this._cacheFriendGroupCountMap[qwAccountId] = this.getContactsFriendGroupCountMethod(Object.assign({}, nextParams, {
554
+ qwAccountIds: qwAccountId ? [qwAccountId] : null,
555
+ groupIds: (this.data.friendGroupData || []).map(v => v.id)
556
+ }))
557
+ }
558
+ this._cacheFriendGroupCountMap[qwAccountId].then(rs => {
559
+ if (!rs || !rs.data || !rs.data.length) {
560
+ return
561
+ }
562
+ rs.data.forEach(group => {
563
+ this.updateFriendGroup(group.id, {
564
+ num: group.num
565
+ })
566
+ })
567
+ })
568
+ return this._cacheFriendGroupCountMap[qwAccountId]
569
+ }
570
+
571
+ loadRoomGroupData () {
572
+ if (this._cacheLoadRoomGroupPromise) {
573
+ return this._cacheLoadRoomGroupPromise
574
+ }
575
+ this._cacheLoadRoomGroupPromise = this.loadContactsRoomGroupDataMethod().then((rs) => {
576
+ this.setRoomGroup(rs.data)
577
+ return rs
578
+ })
579
+ return this._cacheLoadRoomGroupPromise
580
+ }
581
+
582
+ reloadRoomGroupData () {
583
+ if (this._cacheLoadRoomGroupPromise) {
584
+ this._cacheLoadRoomGroupPromise = null
585
+ }
586
+ return this.loadRoomGroupData()
587
+ }
588
+
589
+ refreshAllRoomGroupCount (params) {
590
+ const { qwAccountId, ...nextParams } = Object.assign({
591
+ qwAccountId: null
592
+ }, params)
593
+ if (!this._cacheRoomGroupCountMap) {
594
+ this._cacheRoomGroupCountMap = {}
595
+ }
596
+ if (!this._cacheRoomGroupCountMap[qwAccountId]) {
597
+ this._cacheRoomGroupCountMap[qwAccountId] = this.getContactsRoomGroupCountMethod(Object.assign({}, nextParams, {
598
+ qwAccountIds: qwAccountId ? [qwAccountId] : null,
599
+ groupIds: (this.data.roomGroupData || []).map(v => v.id)
600
+ }))
601
+ }
602
+ this._cacheRoomGroupCountMap[qwAccountId].then(rs => {
603
+ if (!rs || !rs.data || !rs.data.length) {
604
+ return
605
+ }
606
+ rs.data.forEach(group => {
607
+ this.updateRoomGroup(group.id, {
608
+ num: group.num
609
+ })
610
+ })
611
+ })
612
+ return this._cacheRoomGroupCountMap[qwAccountId]
613
+ }
614
+
615
+ getFriend (friendId) {
616
+ if (!this.getContactsFriendMethod) {
617
+ return Promise.reject(new Error('getContactsFriendMethod未定义'))
618
+ }
619
+ if (this.friendMap[friendId]) {
620
+ return Promise.resolve({
621
+ data: this.friendMap[friendId]
622
+ })
623
+ }
624
+ return this.getContactsFriendMethod({
625
+ id: friendId
626
+ }).then(rs => {
627
+ this.addFriend(rs.data)
628
+ return rs
629
+ })
630
+ }
631
+
632
+ setRoomMemberData (roomId, data) {
633
+ if (!roomId) {
634
+ throw new Error('群少群id')
635
+ }
636
+ if (data && data.length) {
637
+ Vue.set(this.data.roomBindMemberMap, roomId, data)
638
+ } else {
639
+ Vue.delete(this.data.roomBindMemberMap, roomId)
640
+ }
641
+ }
642
+
643
+ loadRoomMemberData (roomId, params) {
644
+ return this.loadContactsRoomMemberDataMethod(params).then((rs) => {
645
+ this.setRoomMemberData(roomId, rs.data)
646
+ return rs.data
647
+ })
648
+ }
649
+
650
+ loadFriendData (params) {
651
+ params = Object.assign({
652
+ accountId: null,
653
+ keyword: null,
654
+ total: null,
655
+ size: 50
656
+ }, params)
657
+ return this.loadContactsFriendDataMethod(params).then(rs => {
658
+ this.setFriendData(rs.data, false)
659
+ return rs
660
+ })
661
+ }
662
+
663
+ reloadFriendData (params) {
664
+ params = Object.assign({
665
+ accountId: null,
666
+ keyword: null,
667
+ size: 50
668
+ }, params, {
669
+ total: null
670
+ })
671
+ return this.loadContactsFriendDataMethod(params).then(rs => {
672
+ this.setFriendData(rs.data, true)
673
+ return rs
674
+ })
675
+ }
676
+
677
+ searchFriendData (params) {
678
+ params = Object.assign({
679
+ qwAccountId: null,
680
+ keyword: null,
681
+ size: 50
682
+ }, params, {
683
+ total: null
684
+ })
685
+ return this.loadContactsFriendDataMethod(params)
686
+ }
687
+
688
+ loadRoomData (params) {
689
+ return this.loadContactsRoomDataMethod(Object.assign({
690
+ qwAccountId: null,
691
+ keyword: null,
692
+ total: null,
693
+ size: 50
694
+ }, params)).then(rs => {
695
+ this.setRoomData(rs.data, false)
696
+ return rs
697
+ })
698
+ }
699
+
700
+ reloadRoomData (params) {
701
+ return this.loadContactsRoomDataMethod(Object.assign({
702
+ qwAccountId: null,
703
+ keyword: null,
704
+ size: 50
705
+ }, params, {
706
+ total: null
707
+ })).then(rs => {
708
+ this.setRoomData(rs.data, true)
709
+ return rs
710
+ })
711
+ }
712
+
713
+ searchRoomData (params) {
714
+ params = Object.assign({
715
+ qwAccountId: null,
716
+ keyword: null,
717
+ size: 50
718
+ }, params, {
719
+ total: null
720
+ })
721
+ return this.loadContactsRoomDataMethod(params)
722
+ }
723
+
724
+ getRoom (id) {
725
+ if (!this.getContactsRoomMethod) {
726
+ return Promise.reject(new Error('getContactsRoomMethod未定义'))
727
+ }
728
+ if (this.roomMap[id]) {
729
+ return Promise.resolve({
730
+ data: this.roomMap[id]
731
+ })
732
+ }
733
+ return this.getContactsRoomMethod({
734
+ id
735
+ }).then(rs => {
736
+ this.addRoom(rs.data)
737
+ return rs
738
+ })
739
+ }
740
+
741
+ markModify () {
742
+ this.data.isModify = true
743
+ }
744
+
745
+ unmarkModify () {
746
+ this.data.isModify = false
747
+ }
748
+
749
+ reset () {
750
+ this.lastRequestTime = null
751
+ this.data.friendGroupData = []
752
+ this.data.roomGroupData = []
753
+ this.data.friendData = []
754
+ this.data.roomData = []
755
+ this.friendMap = {}
756
+ this.roomMap = {}
757
+ this.data.groupBindFriendMap = {}
758
+ this.data.groupBindRoomMap = {}
759
+ this.data.accountBindFriendMap = {}
760
+ this.data.accountBindRoomMap = {}
761
+ this._cacheFriendGroupCountMap = null
762
+ this._cacheRoomGroupCountMap = null
763
+ if (this.cancelConnectRequest) {
764
+ this.cancelConnectRequest()
765
+ this.cancelConnectRequest = null
766
+ }
767
+ if (this.cancelRefreshRequest) {
768
+ this.cancelRefreshRequest()
769
+ this.cancelRefreshRequest = null
770
+ }
771
+ }
772
+ }