@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,201 @@
1
+ <template>
2
+ <div
3
+ class="ui-context-menu"
4
+ :class="{'is-active': boxVisible}"
5
+ v-show="innerData.length"
6
+ >
7
+ <ui-context-menu-box
8
+ ref="menubox"
9
+ :visible="boxVisible && innerShowData.length > 0"
10
+ :left="boxLeft"
11
+ :top="boxTop"
12
+ >
13
+ <template
14
+ v-for="(item, index) in innerData"
15
+ >
16
+ <ui-context-menu-group
17
+ v-if="item.items && item.visible !== false"
18
+ v-bind="item"
19
+ :active="handleRenderIsActive(item)"
20
+ :key="'group-' + index"
21
+ @mouseenter="handleItemMouseEnter(item)"
22
+ @item-click="handleGroupItemClick"
23
+ @group-click="handleGroupClick"
24
+ ></ui-context-menu-group>
25
+ <ui-context-menu-item
26
+ v-else-if="item.visible !== false"
27
+ v-bind="item"
28
+ :key="'item' + index"
29
+ :active="handleRenderIsActive(item)"
30
+ @mouseleave="handleItemMouseLeave(item)"
31
+ @mouseenter="handleItemMouseEnter(item)"
32
+ @click="handleItemClick(item)"
33
+ ></ui-context-menu-item>
34
+ </template>
35
+ </ui-context-menu-box>
36
+ </div>
37
+ </template>
38
+ <script>
39
+ import UiContextMenuBox from './context-menu-box'
40
+ import UiContextMenuGroup from './context-menu-group'
41
+ import UiContextMenuItem from './context-menu-item'
42
+
43
+ import {
44
+ getOptimalCoordinate,
45
+ getWindowRect,
46
+ createRectByXY,
47
+ getElementRect
48
+ } from './utils.js'
49
+
50
+ export default {
51
+ name: 'UiContextMenu',
52
+ components: {
53
+ UiContextMenuBox,
54
+ UiContextMenuGroup,
55
+ UiContextMenuItem
56
+ },
57
+ props: {
58
+ value: {
59
+ type: Boolean
60
+ },
61
+ left: {
62
+ type: Number,
63
+ default: 0
64
+ },
65
+ top: {
66
+ type: Number,
67
+ default: 0
68
+ },
69
+ data: {
70
+ type: Array,
71
+ default: () => []
72
+ }
73
+ },
74
+ data () {
75
+ return {
76
+ boxVisible: false,
77
+ activeSubItem: null,
78
+ boxLeft: 0,
79
+ boxTop: 0
80
+ }
81
+ },
82
+ computed: {
83
+ innerData () {
84
+ return (this.data).filter(v => {
85
+ if (typeof v.visible === 'function') {
86
+ return v.visible()
87
+ } else {
88
+ return v.visible !== false
89
+ }
90
+ })
91
+ },
92
+ innerShowData () {
93
+ return this.innerData.filter(v => !v.divided)
94
+ }
95
+ },
96
+ mounted () {
97
+ window.document.addEventListener('mousewheel', this.handleDocumentMouseWheel)
98
+ window.document.addEventListener('mousedown', this.handleDocumentMouseDown)
99
+ // window.document.addEventListener('contextmenu', this.handleDocumentContextMenu)
100
+ },
101
+ watch: {
102
+ value: {
103
+ immediate: true,
104
+ handler (val) {
105
+ val ? this.open(this.left, this.top) : this.close()
106
+ }
107
+ }
108
+ },
109
+ methods: {
110
+ handleGroupClick () {
111
+ this.close()
112
+ },
113
+ handleGroupItemClick ({ item }) {
114
+ if (!item.disabled) {
115
+ if (item.click) {
116
+ item.click({
117
+ item
118
+ })
119
+ }
120
+ this.$emit('item-click', {
121
+ item
122
+ })
123
+ }
124
+ this.close()
125
+ },
126
+ handleItemClick (item) {
127
+ const disabled = typeof item.disabled === 'function' ? item.disabled() : item.disabled
128
+ if (!disabled) {
129
+ if (item.click) {
130
+ item.click({
131
+ item
132
+ })
133
+ }
134
+ this.$emit('item-click', {
135
+ item
136
+ })
137
+ }
138
+ this.close()
139
+ },
140
+ handleDocumentMouseWheel (e) {
141
+ if (this.boxVisible) {
142
+ e.preventDefault()
143
+ e.stopPropagation()
144
+ }
145
+ },
146
+ handleDocumentMouseDown (e) {
147
+ this.close()
148
+ },
149
+ handleItemMouseEnter (item) {
150
+ const disabled = typeof item.disabled === 'function' ? item.disabled() : item.disabled
151
+ if (disabled) {
152
+ this.activeSubItem = null
153
+ } else {
154
+ this.activeSubItem = item
155
+ }
156
+ },
157
+ handleItemMouseLeave (item) {
158
+ this.activeSubItem = null
159
+ },
160
+ handleRenderIsActive (item) {
161
+ return this.activeSubItem === item
162
+ },
163
+ open (x = 0, y = 0) {
164
+ const baseRect = createRectByXY(x, y)
165
+ const windowRect = getWindowRect()
166
+ const elementRect = getElementRect(this.$refs.menubox.$el)
167
+ const rect = getOptimalCoordinate(baseRect, windowRect, elementRect)
168
+ this.boxVisible = true
169
+ this.boxLeft = rect.left
170
+ this.boxTop = rect.top
171
+ this.$emit('input', true)
172
+ },
173
+ close () {
174
+ this.boxVisible = false
175
+ this.activeSubItem = null
176
+ this.$emit('input', false)
177
+ }
178
+ },
179
+ beforeUnmount () {
180
+ window.document.removeEventListener('mousewheel', this.handleDocumentMouseWheel)
181
+ window.document.removeEventListener('mousedown', this.handleDocumentMouseDown)
182
+ // window.document.removeEventListener('contextmenu', this.handleDocumentContextMenu)
183
+ }
184
+ }
185
+ </script>
186
+ <style>
187
+ .ui-context-menu * {
188
+ box-sizing: content-box;
189
+ }
190
+ .ui-context-menu{
191
+ color: #333;
192
+ }
193
+ .ui-context-menu.is-active{
194
+ position: fixed;
195
+ left: 0;
196
+ top: 0;
197
+ right: 0;
198
+ bottom: 0;
199
+ z-index: 30000;
200
+ }
201
+ </style>
@@ -0,0 +1,3 @@
1
+ import ContextMenu from './context-menu.vue'
2
+
3
+ export default ContextMenu
@@ -0,0 +1,138 @@
1
+ function getSumRangeRect (baseRect, rangeRect) {
2
+ const rt = {
3
+ left: baseRect.right,
4
+ top: baseRect.top - rangeRect.top,
5
+ bottom: rangeRect.bottom,
6
+ right: rangeRect.right
7
+ }
8
+ rt.width = rt.right - rt.left
9
+ rt.height = rt.bottom - rt.top
10
+ const rb = {
11
+ left: baseRect.right,
12
+ top: rangeRect.top,
13
+ right: rangeRect.right,
14
+ bottom: rangeRect.bottom
15
+ }
16
+ rb.width = rb.right - rb.left
17
+ rb.height = rb.bottom - rb.top
18
+ const lt = {
19
+ left: rangeRect.left,
20
+ top: baseRect.top - rangeRect.top,
21
+ bottom: rangeRect.bottom,
22
+ right: baseRect.left
23
+ }
24
+ lt.width = lt.right - lt.left
25
+ lt.height = lt.bottom - lt.top
26
+ const lb = {
27
+ left: rangeRect.left,
28
+ top: rangeRect.top,
29
+ right: baseRect.left,
30
+ bottom: rangeRect.bottom
31
+ }
32
+ lb.width = lb.right - lb.left
33
+ lb.height = lb.bottom - lb.top
34
+ return {
35
+ rt,
36
+ rb,
37
+ lt,
38
+ lb
39
+ }
40
+ }
41
+
42
+ /**
43
+ * 获取最佳定位坐标
44
+ * @param { Object } baseRect - 基点容器坐标大小
45
+ * @param { Object } rangeRect - 范围容器坐标大小
46
+ * @param { Object } elementRect - 元素容器坐标大小
47
+ */
48
+ export function getOptimalCoordinate (baseRect, rangeRect, elementRect) {
49
+ const { rt, rb, lt, lb } = getSumRangeRect(baseRect, rangeRect)
50
+ let returnRect = null
51
+ if (rt.width >= elementRect.width && rt.height >= elementRect.height) {
52
+ returnRect = {
53
+ left: rt.left,
54
+ top: rt.top,
55
+ right: rt.left + elementRect.width,
56
+ bottom: rt.top + elementRect.height,
57
+ width: elementRect.width,
58
+ height: elementRect.height
59
+ }
60
+ } else if (rb.width >= elementRect.width && rb.height >= elementRect.height) {
61
+ returnRect = {
62
+ left: rb.left,
63
+ right: rb.left + elementRect.width,
64
+ top: rb.bottom - elementRect.height,
65
+ bottom: rb.bottom,
66
+ width: elementRect.width,
67
+ height: elementRect.height
68
+ }
69
+ } else if (lt.width >= elementRect.width && lt.height >= elementRect.height) {
70
+ returnRect = {
71
+ left: lt.right - elementRect.width,
72
+ right: lt.right,
73
+ top: lt.top,
74
+ bottom: lt.top + elementRect.height,
75
+ width: elementRect.width,
76
+ height: elementRect.height
77
+ }
78
+ } else if (lb.width >= elementRect.width && lb.height >= elementRect.height) {
79
+ returnRect = {
80
+ left: lt.right - elementRect.width,
81
+ right: lt.right,
82
+ top: lb.bottom - elementRect.height,
83
+ bottom: lb.bottom,
84
+ width: elementRect.width,
85
+ height: elementRect.height
86
+ }
87
+ } else {
88
+ returnRect = {
89
+ left: rt.left,
90
+ top: rt.top,
91
+ right: rt.left + elementRect.width,
92
+ bottom: rt.top + elementRect.height,
93
+ width: elementRect.width,
94
+ height: elementRect.height
95
+ }
96
+ }
97
+ return returnRect
98
+ }
99
+
100
+ /**
101
+ * 获取窗口坐标大小
102
+ */
103
+ export function getWindowRect () {
104
+ return {
105
+ left: 0,
106
+ top: 0,
107
+ width: window.innerWidth,
108
+ height: window.innerHeight,
109
+ right: window.innerWidth,
110
+ bottom: window.innerHeight
111
+ }
112
+ }
113
+
114
+ /**
115
+ * 根据鼠标时间对象创建坐标尺寸
116
+ */
117
+ export function createRectByXY (x, y) {
118
+ return {
119
+ left: x,
120
+ top: y,
121
+ right: x,
122
+ bottom: y,
123
+ width: 0,
124
+ height: 0
125
+ }
126
+ }
127
+
128
+ export function getElementRect (element, offsetY = 0) {
129
+ const rect = element.getBoundingClientRect()
130
+ return {
131
+ left: rect.left,
132
+ top: rect.top + offsetY,
133
+ right: rect.right,
134
+ bottom: rect.bottom + offsetY,
135
+ width: rect.width,
136
+ height: rect.height
137
+ }
138
+ }
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755860383442" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4771" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M0 0m72.576 0l878.848 0q72.576 0 72.576 72.576l0 878.848q0 72.576-72.576 72.576l-878.848 0q-72.576 0-72.576-72.576l0-878.848q0-72.576 72.576-72.576Z" fill="#EFEFEE" p-id="4772"></path><path d="M508.928 750.976h-220.16c-23.808 0-32.512-9.6-33.408-33.408a62.336 62.336 0 0 1 39.68-64c45.952-21.504 91.392-44.416 136.96-66.944 27.776-13.696 32-34.944 12.8-58.368a162.048 162.048 0 0 1-41.088-112.128 309.76 309.76 0 0 1 2.176-64 106.368 106.368 0 0 1 163.712-62.72 102.4 102.4 0 0 1 46.08 87.04 344.704 344.704 0 0 1-3.072 73.472 192 192 0 0 1-41.984 82.432c-15.36 18.688-12.8 38.4 8.704 50.304 40.448 21.376 82.048 40.576 123.136 60.8 19.2 9.344 39.936 15.872 52.736 36.48a72.576 72.576 0 0 1 7.936 48.256c-2.176 15.36-12.8 22.784-30.976 22.784z" fill="#C2C1C1" p-id="4773"></path></svg>
@@ -0,0 +1,29 @@
1
+ <script>
2
+ import SdkAvatar from '../avatar'
3
+
4
+ export default {
5
+ name: 'SdkFriendAvatar',
6
+ functional: true,
7
+ props: {
8
+ src: {
9
+ type: String
10
+ },
11
+ round: {
12
+ type: Boolean
13
+ },
14
+ size: {
15
+ type: String,
16
+ default: 'small'
17
+ }
18
+ },
19
+ render (h, c) {
20
+ const { src, ...nextProps } = c.props
21
+ return h(SdkAvatar, {
22
+ class: ['sdk-friend-avatar', c.data.staticClass],
23
+ props: Object.assign({}, nextProps, {
24
+ src: src || require('./default.svg')
25
+ })
26
+ })
27
+ }
28
+ }
29
+ </script>
@@ -0,0 +1,3 @@
1
+ import FriendAvatar from './friend-avatar.vue'
2
+
3
+ export default FriendAvatar
@@ -0,0 +1,3 @@
1
+ import { Image } from '@aochuang/common/components'
2
+
3
+ export default Image
@@ -0,0 +1,17 @@
1
+ import Badge from './badge'
2
+ import Avatar from './avatar'
3
+ import UserAvatar from './user-avatar'
4
+ import FriendAvatar from './friend-avatar'
5
+ import RoomAvatar from './room-avatar'
6
+ import ContextMenu from './context-menu'
7
+ import ScrollLoadMore from './scroll-load-more'
8
+
9
+ export default {
10
+ Avatar,
11
+ UserAvatar,
12
+ FriendAvatar,
13
+ RoomAvatar,
14
+ Badge,
15
+ ContextMenu,
16
+ ScrollLoadMore
17
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg t="1755860383442" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4771" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
4
+ <path d="M0 0m72.576 0l878.848 0q72.576 0 72.576 72.576l0 878.848q0 72.576-72.576 72.576l-878.848 0q-72.576 0-72.576-72.576l0-878.848q0-72.576 72.576-72.576Z" fill="#EFEFEE" p-id="4772"></path>
5
+ <path d="M512.03580317 303.16011854a101.43037616 101.43037616 0 1 0 0 202.86075235 101.43037616 101.43037616 0 0 0 0-202.86075235zM380.42335603 351.74501811a77.585466 77.585466 0 1 0 24.31035136 145.46827333c4.04575804-2.11238694 6.08653863-3.186482 6.55197982-5.33467209 0.4654412-2.1481901-1.07409506-4.22477388-4.26057704-8.4137446A130.71736793 130.71736793 0 0 1 380.70978136 404.59049471c0-14.14225153 2.25559961-27.7832587 6.40876716-40.56498984 1.61114258-5.01244358 2.43461545-7.51866537 1.25311088-9.38043013-1.1457014-1.86176476-3.43710416-2.21979644-7.94830337-2.86425347zM386.15186297 549.95135854c4.94083724-3.04326932 11.67183291-6.87420834 18.51023809-10.56193469 9.02239844-4.83342774 13.56940085-7.26804319 13.13976281-10.52613152-0.39383486-3.22228515-5.01244358-4.40378971-14.28546421-6.65938933a145.89791136 145.89791136 0 0 0-116.57511641 20.90905037 250.90860436 250.90860436 0 0 1-5.01244357 3.22228515c-9.38043013 5.9075228-24.99061156 15.78919729-35.55254626 27.46103019-6.73099566 7.37545268-13.42618817 17.47194619-14.64349589 30.00305515-1.28891407 13.35458183 3.93834852 25.8498876 14.07064519 36.73405081 13.56940085 14.50028322 30.07466148 27.81906187 54.49242236 31.54259139 5.72850695 0.89507921 8.59276042 1.32471724 10.3113125-0.4654412 1.68274892-1.79015842 1.07409506-5.15565626-0.214819-11.92245509a73.07426677 73.07426677 0 0 1-0.85927605-21.33868838c2.5062218-24.09553236 16.14722896-41.60328172 26.49434464-52.1652164 16.1114258-16.3262448 38.30939022-29.32279494 50.12443581-36.23280645zM619.33789894 539.38942386c6.83840517 3.68772636 13.56940085 7.51866537 18.51023809 10.56193468 11.81504558 6.91001151 34.01301 19.90656165 50.1244358 36.23280644 10.34711568 10.56193469 23.98812285 28.06968405 26.49434464 52.16521641 0.7876697 7.44705904 0.42963802 14.57188955-0.82347288 21.33868838-1.28891407 6.76679885-1.93337108 10.16809983-0.214819 11.92245509 1.71855208 1.79015842 4.5470024 1.3605204 10.27550933 0.46544119 24.41776087-3.68772636 40.9588247-17.04230817 54.49242235-31.54259138 10.13229667-10.88416321 15.39536242-23.34366582 14.0706452-36.73405081-1.21730773-12.53110895-7.91250022-22.62760245-14.6434959-30.00305515-10.56193469-11.67183291-26.13631296-21.5535074-35.51674308-27.46103019l-5.01244358-3.22228515a145.89791136 145.89791136 0 0 0-116.61091957-20.90905036c-9.23721745 2.25559961-13.89162935 3.40130101-14.32126737 6.65938933-0.35803168 3.25808833 4.15316753 5.69270379 13.17556597 10.52613151zM612.7143128 491.87861935c-0.4654412-2.1481901 1.07409506-4.22477388 4.26057703-8.4137446A130.71736793 130.71736793 0 0 0 643.29021864 404.59049471c0-14.14225153-2.25559961-27.7832587-6.37296399-40.56498984-1.64694575-5.01244358-2.43461545-7.51866537-1.28891405-9.38043013 1.18150456-1.86176476 3.43710416-2.21979644 7.94830337-2.86425347a77.585466 77.585466 0 1 1-24.31035136 145.46827333c-4.00995487-2.1481901-6.08653863-3.22228515-6.55197982-5.37047526z" fill="#C2C1C1" p-id="3996"></path><path d="M409.17330026 571.03942475a195.84333132 195.84333132 0 0 1 205.76080898-1e-8c1.86176476 1.1457014 4.18897071 2.5062218 6.9100115 4.08156121 12.20888044 7.16063367 31.65000089 18.54604125 44.89717322 31.97222941 8.30633507 8.48535093 16.61267016 20.01397116 18.11640322 34.37104168 1.61114258 15.39536242-4.90503407 29.6092203-17.36453668 41.92551024-20.55101869 20.33619967-46.04287461 37.45011417-79.44723075 37.45011418H436.02567658c-33.36855297 0-58.86040889-17.11391451-79.41142757-37.45011418-12.45950261-12.31628994-18.97567927-26.56595097-17.36453668-41.88970707 1.50373308-14.39287372 9.81006815-25.92149394 18.11640322-34.37104169 13.24717233-13.46199133 32.65248962-24.81159572 44.86137005-31.97222941l0.1074095-0.07160634a346.5746704 346.5746704 0 0 0 6.80260199-4.04575802z" fill="#C2C1C1" p-id="3997"></path>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ import RoomAvatar from './room-avatar.vue'
2
+
3
+ export default RoomAvatar
@@ -0,0 +1,29 @@
1
+ <script>
2
+ import SdkAvatar from '../avatar'
3
+
4
+ export default {
5
+ name: 'SdkRoomAvatar',
6
+ functional: true,
7
+ props: {
8
+ src: {
9
+ type: String
10
+ },
11
+ round: {
12
+ type: Boolean
13
+ },
14
+ size: {
15
+ type: String,
16
+ default: 'small'
17
+ }
18
+ },
19
+ render (h, c) {
20
+ const { src, ...nextProps } = c.props
21
+ return h(SdkAvatar, {
22
+ class: ['sdk-room-avatar', c.data.staticClass],
23
+ props: Object.assign({}, nextProps, {
24
+ src: src || require('./default.svg')
25
+ })
26
+ })
27
+ }
28
+ }
29
+ </script>
@@ -0,0 +1,3 @@
1
+ import ScrollLoadMore from './scroll-load-more.vue'
2
+
3
+ export default ScrollLoadMore
@@ -0,0 +1,195 @@
1
+ <template>
2
+ <div class="sdk-scroll-load-more" @scroll="handleScroll">
3
+ <template v-if="reloading">
4
+ <div class="sdk-scroll-load-more__reloading">
5
+ <slot name="loading">
6
+ 数据加载中...
7
+ </slot>
8
+ </div>
9
+ </template>
10
+ <template v-else-if="!data || !data.length">
11
+ <div class="sdk-scroll-load-more__empty">暂无相关数据</div>
12
+ </template>
13
+ <template v-else>
14
+ <slot :loading="loading" :reloading="reloading" :not-more="notMore"></slot>
15
+ </template>
16
+ <template v-if="!reloading && loading">
17
+ <div class="sdk-scroll-load-more__loading">
18
+ <ui-loading size="mini" text="数据加载中..."></ui-loading>
19
+ </div>
20
+ </template>
21
+ <template v-else-if="showLoadMoreButton">
22
+ <div class="sdk-scroll-load-more__loadmore" @click="handleLoadMoreClick">加载更多数据</div>
23
+ </template>
24
+ <template v-else-if="notMore && (data && pageSize && data.length > pageSize)">
25
+ <div class="sdk-scroll-load-more__notmore">数据加载完毕~</div>
26
+ </template>
27
+ </div>
28
+ </template>
29
+ <script>
30
+ import UiLoading from '@aochuang/common/components/loading'
31
+
32
+ export default {
33
+ name: 'SdkScrollLoadMore',
34
+ components: {
35
+ UiLoading
36
+ },
37
+ props: {
38
+ data: {
39
+ type: Array
40
+ },
41
+ pageSize: {
42
+ type: [Number, Boolean],
43
+ default: 40
44
+ },
45
+ autoLoad: {
46
+ type: Boolean,
47
+ default: true
48
+ },
49
+ queryMethod: {
50
+ type: Function
51
+ }
52
+ },
53
+ data () {
54
+ return {
55
+ reloading: false,
56
+ notMore: false,
57
+ loading: false
58
+ }
59
+ },
60
+ computed: {
61
+ showLoadMoreButton () {
62
+ return !this.reloading && !this.loading && !this.notMore && this.pageSize && this.data && this.data.length
63
+ }
64
+ },
65
+ created () {
66
+ if (this.autoLoad) {
67
+ this.reload()
68
+ }
69
+ },
70
+ methods: {
71
+ scrollTop (top) {
72
+ this.$el.scrollTop = top
73
+ },
74
+ handleScroll (evt) {
75
+ if (this.loading || this.notMore) {
76
+ this.$emit('scroll', evt)
77
+ } else {
78
+ const scrollTop = evt.target.scrollTop + evt.target.clientHeight
79
+ if (evt.target.scrollHeight - 10 <= scrollTop) {
80
+ if (this.lastScrollTop === scrollTop) {
81
+ return
82
+ }
83
+ this.lastScrollTop = scrollTop
84
+ this.loadMoreData()
85
+ }
86
+ this.$emit('scroll', evt)
87
+ }
88
+ },
89
+ reload (filters) {
90
+ this.pageIndex = 0
91
+ this.notMore = false
92
+ this.$el && (this.$el.scrollTop = 0)
93
+ this.reloading = true
94
+ return Promise.all([this.loadData(false, filters)]).then(rs => {
95
+ return rs[0]
96
+ }).finally(() => {
97
+ this.reloading = false
98
+ })
99
+ },
100
+ loadMoreData () {
101
+ if (this.notMore) {
102
+ return
103
+ }
104
+ this.pageIndex++
105
+ return this.loadData()
106
+ },
107
+ handleLoadMoreClick () {
108
+ if (this.loading) {
109
+ return
110
+ }
111
+ return this.loadMoreData()
112
+ },
113
+ loadData (isLoading, filters) {
114
+ if (!this.queryMethod) {
115
+ return Promise.reject()
116
+ }
117
+ if (this.loading) {
118
+ return
119
+ }
120
+ const params = {}
121
+ if (this.pageSize) {
122
+ params.pageIndex = this.pageIndex
123
+ params.pageSize = this.pageSize
124
+ }
125
+ if (isLoading !== false) {
126
+ this.loading = true
127
+ }
128
+ return this.queryMethod(Object.assign({}, filters, {
129
+ isReload: params.pageIndex === 0
130
+ }, params)).then((data) => {
131
+ if (!this.pageSize) {
132
+ this.notMore = true
133
+ } else {
134
+ if (data && data.length < this.pageSize) {
135
+ this.notMore = true
136
+ }
137
+ }
138
+ return data
139
+ }).finally(() => {
140
+ if (isLoading !== false) {
141
+ this.loading = false
142
+ }
143
+ })
144
+ }
145
+ }
146
+ }
147
+ </script>
148
+ <style>
149
+ .sdk-scroll-load-more{
150
+ height: 100%;
151
+ overflow: auto;
152
+ position: relative;
153
+ }
154
+ .sdk-scroll-load-more__reloading,
155
+ .sdk-scroll-load-more__empty{
156
+ height: 100%;
157
+ display: flex;
158
+ flex-direction: column;
159
+ align-items: center;
160
+ justify-content: center;
161
+ color: #999;
162
+ font-size: 12px;
163
+ padding: 24px 12px;
164
+ box-sizing: border-box;
165
+ position: absolute;
166
+ top: 0;
167
+ left: 0;
168
+ right: 0;
169
+ bottom: 0;
170
+ background-color: #fff;
171
+ }
172
+ .sdk-scroll-load-more__notmore{
173
+ text-align: center;
174
+ color: #999;
175
+ padding: 12px;
176
+ }
177
+ .sdk-scroll-load-more__loadmore{
178
+ text-align: center;
179
+ color: #52a1e4;
180
+ padding: 12px;
181
+ cursor: pointer;
182
+ }
183
+ .sdk-scroll-load-more__loadmore:hover{
184
+ color: #2b82cf;
185
+ }
186
+ .sdk-scroll-load-more__loading{
187
+ color: #999;
188
+ padding: 12px;
189
+ display: flex;
190
+ flex-direction: row;
191
+ align-items: center;
192
+ justify-content: center;
193
+ position: relative;
194
+ }
195
+ </style>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755860383442" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4771" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M0 0m72.576 0l878.848 0q72.576 0 72.576 72.576l0 878.848q0 72.576-72.576 72.576l-878.848 0q-72.576 0-72.576-72.576l0-878.848q0-72.576 72.576-72.576Z" fill="#EFEFEE" p-id="4772"></path><path d="M508.928 750.976h-220.16c-23.808 0-32.512-9.6-33.408-33.408a62.336 62.336 0 0 1 39.68-64c45.952-21.504 91.392-44.416 136.96-66.944 27.776-13.696 32-34.944 12.8-58.368a162.048 162.048 0 0 1-41.088-112.128 309.76 309.76 0 0 1 2.176-64 106.368 106.368 0 0 1 163.712-62.72 102.4 102.4 0 0 1 46.08 87.04 344.704 344.704 0 0 1-3.072 73.472 192 192 0 0 1-41.984 82.432c-15.36 18.688-12.8 38.4 8.704 50.304 40.448 21.376 82.048 40.576 123.136 60.8 19.2 9.344 39.936 15.872 52.736 36.48a72.576 72.576 0 0 1 7.936 48.256c-2.176 15.36-12.8 22.784-30.976 22.784z" fill="#C2C1C1" p-id="4773"></path></svg>
@@ -0,0 +1,3 @@
1
+ import UserAvatar from './user-avatar.vue'
2
+
3
+ export default UserAvatar
@@ -0,0 +1,29 @@
1
+ <script>
2
+ import SdkAvatar from '../avatar'
3
+
4
+ export default {
5
+ name: 'SdkUserAvatar',
6
+ functional: true,
7
+ props: {
8
+ src: {
9
+ type: String
10
+ },
11
+ round: {
12
+ type: Boolean
13
+ },
14
+ size: {
15
+ type: String,
16
+ default: 'small'
17
+ }
18
+ },
19
+ render (h, c) {
20
+ const { src, ...nextProps } = c.props
21
+ return h(SdkAvatar, {
22
+ class: ['sdk-user-avatar', c.data.staticClass],
23
+ props: Object.assign({}, nextProps, {
24
+ src: src || require('./default.svg')
25
+ })
26
+ })
27
+ }
28
+ }
29
+ </script>