@aochuang/client-sdk 1.0.376 → 1.0.378

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 (170) hide show
  1. package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +40 -4
  2. package/components/chat-editor/chat-editor.vue +75 -5
  3. package/components/index.js +1 -6
  4. package/components/session-select/session-select-item.vue +9 -8
  5. package/components/wechat-chat-control/location/location.vue +3 -3
  6. package/components/wework-chat-control/channel-live/channel-live.vue +2 -7
  7. package/components/wework-chat-control/company-card/company-card.vue +1 -1
  8. package/components/wework-chat-control/custom-expression/custom-expression.vue +1 -2
  9. package/components/wework-chat-control/file-url/file-url.vue +16 -34
  10. package/components/wework-chat-control/image/image.vue +2 -137
  11. package/components/wework-chat-control/index.js +7 -15
  12. package/components/wework-chat-control/location/location.vue +3 -3
  13. package/components/wework-chat-control/red-envelopes/red-envelopes.vue +2 -3
  14. package/components/wework-chat-control/text/text.vue +144 -24
  15. package/components/wework-chat-control/url/url-miniprogram.vue +7 -6
  16. package/components/wework-chat-control/url/url.vue +2 -26
  17. package/components/wework-chat-control/util.js +17 -26
  18. package/components/wework-chat-control/video/video.vue +2 -10
  19. package/components/wework-chat-control/voice/voice.vue +2 -9
  20. package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
  21. package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
  22. package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
  23. package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
  24. package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
  25. package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
  26. package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
  27. package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
  28. package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
  29. package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
  30. package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
  31. package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
  32. package/components/wework-chat-panel/chat-panel-item.vue +25 -56
  33. package/components/wework-chat-panel/chat-panel.vue +13 -96
  34. package/package.json +3 -10
  35. package/services/client-chat/client-chat-wechat/client-chat-message.js +15 -5
  36. package/services/client-chat/client-chat-wechat/client-chat-session.js +13 -50
  37. package/services/client-chat/client-chat-wechat/client-chat.js +4 -48
  38. package/services/client-chat/client-chat-wechat/docs//350/264/246/345/217/267/346/234/252/350/257/273/346/225/260/351/207/217/344/270/216/344/274/232/350/257/235/346/234/252/350/257/273/346/225/260/351/207/217/344/270/215/344/270/200/350/207/264/351/227/256/351/242/230/344/277/256/345/244/215.md +4 -2
  39. package/services/client-chat/client-chat-wework/client-chat-account.js +1 -84
  40. package/services/client-chat/client-chat-wework/client-chat-concats.js +17 -81
  41. package/services/client-chat/client-chat-wework/client-chat-message.js +5 -45
  42. package/services/client-chat/client-chat-wework/client-chat-session.js +4 -59
  43. package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -13
  44. package/services/client-chat/client-chat-wework/client-chat.js +11 -320
  45. package/services/client-chat/client-chat-wework/utils.js +5 -5
  46. package/uni-common/account-portray/account-portray.vue +51 -0
  47. package/uni-common/account-select/account-select-item.vue +172 -0
  48. package/uni-common/account-select/account-select.vue +252 -0
  49. package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
  50. package/uni-common/friend-avatar/default.svg +1 -0
  51. package/uni-common/friend-avatar/friend-avatar.vue +27 -0
  52. package/uni-common/friend-avatar/index.js +3 -0
  53. package/uni-common/friend-loader/friend-loader.vue +53 -0
  54. package/uni-common/friend-portray/friend-portray.vue +56 -0
  55. package/uni-common/group-avatar/default.svg +1 -0
  56. package/uni-common/group-avatar/group-avatar.vue +18 -0
  57. package/uni-common/group-avatar/index.js +3 -0
  58. package/uni-common/room-avatar/default.svg +6 -0
  59. package/uni-common/room-avatar/index.js +3 -0
  60. package/uni-common/room-avatar/room-avatar.vue +27 -0
  61. package/uni-common/room-loader/room-loader.vue +53 -0
  62. package/uni-common/room-portray/room-portray.vue +56 -0
  63. package/uni-components/chat-control/calling/calling.vue +91 -0
  64. package/uni-components/chat-control/calling/phone-fill.svg +1 -0
  65. package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
  66. package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
  67. package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
  68. package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
  69. package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
  70. package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
  71. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
  72. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
  73. package/{components/wework-chat-control/wework-chat-control-config.vue → uni-components/chat-control/chat-control-config.vue} +13 -16
  74. package/uni-components/chat-control/chat-control.vue +218 -0
  75. package/uni-components/chat-control/company-card/company-card.vue +123 -0
  76. package/uni-components/chat-control/const.js +28 -0
  77. package/uni-components/chat-control/expression/expression.vue +41 -0
  78. package/uni-components/chat-control/image/image.vue +68 -0
  79. package/uni-components/chat-control/index.js +89 -0
  80. package/uni-components/chat-control/location/location.vue +110 -0
  81. package/uni-components/chat-control/member-change/member-change.vue +32 -0
  82. package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
  83. package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
  84. package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
  85. package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
  86. package/uni-components/chat-control/share-card/share-card.vue +101 -0
  87. package/uni-components/chat-control/system/system.vue +69 -0
  88. package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
  89. package/uni-components/chat-control/system-text/system-text.vue +32 -0
  90. package/uni-components/chat-control/text/text.vue +67 -0
  91. package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
  92. package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
  93. package/uni-components/chat-control/transfer/transfer.vue +80 -0
  94. package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
  95. package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
  96. package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
  97. package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
  98. package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
  99. package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
  100. package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
  101. package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
  102. package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
  103. package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
  104. package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
  105. package/uni-components/chat-control/url/icons/index.js +24 -0
  106. package/uni-components/chat-control/url/miniprogram.svg +1 -0
  107. package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
  108. package/uni-components/chat-control/url/url.vue +306 -0
  109. package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
  110. package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
  111. package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
  112. package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
  113. package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
  114. package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
  115. package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
  116. package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
  117. package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
  118. package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
  119. package/uni-components/chat-control/url-new/icons/index.js +24 -0
  120. package/uni-components/chat-control/url-new/url-new.vue +110 -0
  121. package/uni-components/chat-control/utils.js +12 -0
  122. package/uni-components/chat-control/video/video.vue +156 -0
  123. package/uni-components/chat-control/voice/voice.vue +166 -0
  124. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
  125. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
  126. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
  127. package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
  128. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
  129. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
  130. package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
  131. package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
  132. package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
  133. package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
  134. package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
  135. package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
  136. package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
  137. package/uni-components/chat-editor/chat-editor.vue +257 -0
  138. package/uni-components/chat-editor/index.js +10 -0
  139. package/uni-components/chat-editor/util.js +65 -0
  140. package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
  141. package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
  142. package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
  143. package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
  144. package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
  145. package/uni-components/chat-panel/chat-panel.vue +227 -0
  146. package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
  147. package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
  148. package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
  149. package/common/.DS_Store +0 -0
  150. package/components/.DS_Store +0 -0
  151. package/components/wechat-chat-control/.DS_Store +0 -0
  152. package/components/wechat-chat-control/transfer/.DS_Store +0 -0
  153. package/components/wechat-chat-control/url/.DS_Store +0 -0
  154. package/components/wechat-chat-control/voice/.DS_Store +0 -0
  155. package/components/wework-chat-control/channel-card/channel-card.vue +0 -144
  156. package/components/wework-chat-control/link/.DS_Store +0 -0
  157. package/components/wework-chat-control/merge-message/merge-message-panel.vue +0 -63
  158. package/components/wework-chat-control/merge-message/merge-message.vue +0 -84
  159. package/components/wework-chat-control/merge-message/util.js +0 -59
  160. package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
  161. package/components/wework-chat-control/metting/meeting-video.svg +0 -4
  162. package/components/wework-chat-control/metting/metting.vue +0 -181
  163. package/components/wework-chat-control/text/text-default.vue +0 -99
  164. package/components/wework-chat-control/text/text-quote.vue +0 -105
  165. package/components/wework-chat-control/url/url-channel-live.vue +0 -53
  166. package/components/wework-chat-control/video/.DS_Store +0 -0
  167. package/components/wework-chat-control/wework-chat-control-config-item.vue +0 -24
  168. package/components/wework-chat-control/wework-chat-control-config-msg.vue +0 -25
  169. package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +0 -73
  170. package/services/.DS_Store +0 -0
@@ -19,11 +19,12 @@
19
19
  <span
20
20
  class="sdk-chat-editor-suggestions__close"
21
21
  title="关闭"
22
- @click="handleCloseClick"
22
+ @mousedown.prevent.stop
23
+ @click.stop="handleCloseClick"
23
24
  ></span>
24
25
  </div>
25
26
  </div>
26
- <div class="sdk-chat-editor-suggestions__body" ref="body">
27
+ <div class="sdk-chat-editor-suggestions__body" ref="body" @scroll="handleBodyScroll">
27
28
  <template v-if="data && data.length">
28
29
  <div class="sdk-chat-editor-suggestions__list">
29
30
  <div
@@ -39,6 +40,9 @@
39
40
  </div>
40
41
  </div>
41
42
  </template>
43
+ <div v-if="loadingMore" class="sdk-chat-editor-suggestions__load-more">
44
+ <ui-loading size="mini" text="加载中..."></ui-loading>
45
+ </div>
42
46
  </div>
43
47
  <div class="sdk-chat-editor-suggestions__foot">
44
48
  <ui-icon name="information-line"></ui-icon> 提示:
@@ -68,8 +72,20 @@ export default {
68
72
  type: Boolean,
69
73
  default: false
70
74
  },
75
+ loadingMore: {
76
+ type: Boolean,
77
+ default: false
78
+ },
71
79
  confirmMethod: {
72
80
  type: Function
81
+ },
82
+ loadMoreEnabled: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ hasMore: {
87
+ type: Boolean,
88
+ default: false
73
89
  }
74
90
  },
75
91
  data () {
@@ -106,7 +122,16 @@ export default {
106
122
  },
107
123
  methods: {
108
124
  handleCloseClick () {
109
- this.closed = true
125
+ this.$emit('close')
126
+ },
127
+ handleBodyScroll (evt) {
128
+ if (!this.loadMoreEnabled || this.loading || this.loadingMore || !this.hasMore) {
129
+ return
130
+ }
131
+ const target = evt.target
132
+ if (target.scrollHeight - target.scrollTop - target.clientHeight <= 20) {
133
+ this.$emit('load-more')
134
+ }
110
135
  },
111
136
  handleItemMouseEnter (item) {
112
137
  this.focusId = item.id
@@ -180,7 +205,10 @@ export default {
180
205
  checkAutoFocus () {
181
206
  if (!this.data || !this.data.length) {
182
207
  this.focusId = null
183
- } else {
208
+ return
209
+ }
210
+ const hasFocusedItem = this.data.some(item => item.id === this.focusId)
211
+ if (!hasFocusedItem) {
184
212
  this.focusId = this.data[0].id
185
213
  }
186
214
  },
@@ -297,6 +325,14 @@ export default {
297
325
  overflow: auto;
298
326
  position: relative;
299
327
  }
328
+ .sdk-chat-editor-suggestions__load-more {
329
+ height: 28px;
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+ color: #999;
334
+ font-size: 12px;
335
+ }
300
336
  .sdk-chat-editor-suggestions__foot{
301
337
  color: #999;
302
338
  line-height: 24px;
@@ -46,8 +46,13 @@
46
46
  ref="suggestions"
47
47
  :keyword="suggestionsKeyword"
48
48
  :loading="suggestioning"
49
+ :loading-more="suggestionsLoadingMore"
49
50
  :data="suggestionsData"
50
51
  :confirm-method="handleSuggestionsConfirmMethod"
52
+ :load-more-enabled="suggestionsLoadMore"
53
+ :has-more="suggestionsHasMore"
54
+ @load-more="handleSuggestionsLoadMore"
55
+ @close="handleSuggestionsClose"
51
56
  @closed="handleSuggestionsClosed"
52
57
  >
53
58
  <template slot="item" slot-scope="scope">
@@ -83,6 +88,14 @@ export default {
83
88
  fetchSuggestionsMethod: {
84
89
  type: Function
85
90
  },
91
+ suggestionsLoadMore: {
92
+ type: Boolean,
93
+ default: false
94
+ },
95
+ suggestionsPageSize: {
96
+ type: Number,
97
+ default: 20
98
+ },
86
99
  confirmSuggestionsMethod: {
87
100
  type: Function
88
101
  },
@@ -99,6 +112,8 @@ export default {
99
112
  sending: false,
100
113
  popoverActive: false,
101
114
  suggestioning: false,
115
+ suggestionsLoadingMore: false,
116
+ suggestionsHasMore: false,
102
117
  suggestionsData: [],
103
118
  suggestionsKeyword: null,
104
119
  inputValue: this.value || ''
@@ -127,6 +142,30 @@ export default {
127
142
  },
128
143
  handleSuggestionsClosed () {
129
144
  this.suggestionsData = []
145
+ this.suggestionsLoadingMore = false
146
+ this.suggestionsHasMore = false
147
+ },
148
+ handleSuggestionsClose () {
149
+ const range = this.cacheInputRange ? Object.assign({}, this.cacheInputRange) : null
150
+ this.closeSuggestions()
151
+ this.$nextTick(() => {
152
+ this.focus()
153
+ if (range) {
154
+ this.setSelectionByTextRange(range.start, range.end)
155
+ }
156
+ })
157
+ },
158
+ handleSuggestionsLoadMore () {
159
+ if (!this.suggestionsLoadMore || this.suggestioning || this.suggestionsLoadingMore || !this.suggestionsHasMore) {
160
+ return
161
+ }
162
+ const lastItem = this.suggestionsData.length
163
+ ? this.suggestionsData[this.suggestionsData.length - 1]
164
+ : null
165
+ return this.loadSuggestions(this.suggestionsKeyword, this.suggestionsNearsetInfo, {
166
+ isLoadMore: true,
167
+ lastItem
168
+ })
130
169
  },
131
170
  handleSuggestionsConfirmMethod ({ item }) {
132
171
  const next = () => {
@@ -255,29 +294,58 @@ export default {
255
294
  this.loadSuggestions(nearest, nearsetInfo)
256
295
  }, 200)
257
296
  },
258
- loadSuggestions (keyword, nearestInfo) {
297
+ loadSuggestions (keyword, nearestInfo, options = {}) {
259
298
  if (!this.fetchSuggestionsMethod) {
260
299
  return
261
300
  }
301
+ const isLoadMore = !!options.isLoadMore
262
302
  keyword = this.normalizeSuggestionsKeyword(nearestInfo, keyword)
303
+ if (!isLoadMore) {
304
+ this.suggestionsHasMore = false
305
+ }
263
306
  const requestId = (this._suggestionsRequestId || 0) + 1
264
307
  this._suggestionsRequestId = requestId
265
- this.suggestioning = true
308
+ if (isLoadMore) {
309
+ this.suggestionsLoadingMore = true
310
+ } else {
311
+ this.suggestioning = true
312
+ }
266
313
  this.suggestionsKeyword = keyword
267
314
  this.popoverActive = true
268
315
  clearTimeout(this._loadSuggestionsTimer)
269
316
  return this.fetchSuggestionsMethod({
270
317
  keyword,
271
318
  nearestInfo,
272
- isAtContext: !!(nearestInfo && nearestInfo.isAtContext)
319
+ isAtContext: !!(nearestInfo && nearestInfo.isAtContext),
320
+ isLoadMore,
321
+ lastItem: options.lastItem || null
273
322
  }).then(rs => {
274
323
  if (requestId !== this._suggestionsRequestId) {
275
324
  return
276
325
  }
277
- this.suggestionsData = rs || []
326
+ const nextData = rs || []
327
+ if (isLoadMore) {
328
+ const ids = new Set(this.suggestionsData.map(item => item.id))
329
+ this.suggestionsData = this.suggestionsData.concat(nextData.filter(item => {
330
+ if (ids.has(item.id)) {
331
+ return false
332
+ }
333
+ ids.add(item.id)
334
+ return true
335
+ }))
336
+ } else {
337
+ this.suggestionsData = nextData
338
+ }
339
+ this.suggestionsHasMore = this.suggestionsLoadMore &&
340
+ this.suggestionsPageSize > 0 &&
341
+ nextData.length >= this.suggestionsPageSize
278
342
  }).finally(() => {
279
343
  if (requestId === this._suggestionsRequestId) {
280
- this.suggestioning = false
344
+ if (isLoadMore) {
345
+ this.suggestionsLoadingMore = false
346
+ } else {
347
+ this.suggestioning = false
348
+ }
281
349
  }
282
350
  })
283
351
  },
@@ -294,6 +362,8 @@ export default {
294
362
  this._suggestionsRequestId = (this._suggestionsRequestId || 0) + 1
295
363
  this.$refs.suggestions && this.$refs.suggestions.close()
296
364
  this.suggestioning = false
365
+ this.suggestionsLoadingMore = false
366
+ this.suggestionsHasMore = false
297
367
  this.popoverActive = false
298
368
  },
299
369
  hasCurrentSuggestionsContext () {
@@ -11,7 +11,6 @@ import ChatLayout from './chat-layout'
11
11
  import ChatFriendProfile from './chat-friend-profile'
12
12
  import ChatRoomProfile from './chat-room-profile'
13
13
  import { chatControls as WechatChatControls, WechatChatControlConfig, WechatChatControlConfigMsg, WechatChatControlConfigItem } from './wechat-chat-control'
14
- import { chatControls as WeworkChatControls, WeworkChatControlConfig, WeworkChatControlConfigMsg, WeworkChatControlConfigItem } from './wework-chat-control'
15
14
  import { MESSAGE_TYPE, formatShortMessage, formatShortSessionMessage } from './wechat-chat-control/util'
16
15
  import { MESSAGE_TYPE as MESSAGE_TYPE_W } from './wework-chat-control/util'
17
16
 
@@ -22,10 +21,6 @@ export default {
22
21
  WechatChatControlConfig,
23
22
  WechatChatControlConfigMsg,
24
23
  WechatChatControlConfigItem,
25
- WeworkChatControls,
26
- WeworkChatControlConfig,
27
- WeworkChatControlConfigMsg,
28
- WeworkChatControlConfigItem,
29
24
  MESSAGE_TYPE,
30
25
  MESSAGE_TYPE_W,
31
26
  AccountSelect,
@@ -45,4 +40,4 @@ export default {
45
40
  ChatRoomProfile,
46
41
  WechatChatPanel,
47
42
  WeworkChatPanel
48
- }
43
+ }
@@ -5,13 +5,14 @@
5
5
  <div class="sdk-session-item__avatar-image">
6
6
  <slot name="avatar"></slot>
7
7
  </div>
8
- <span v-if="data[unreadMsgCountField]" class="sdk-session-item__avatar-badge" :class="{'is-mute': data[muteField]}">
9
- <sdk-badge
10
- :is-dot="data[muteField]"
11
- :value="data[unreadMsgCountField]"
12
- :max="99"
13
- ></sdk-badge>
14
- </span>
8
+ <sdk-badge
9
+ class="sdk-session-item__avatar-badge"
10
+ :class="{'is-mute': data[muteField]}"
11
+ v-if="data[unreadMsgCountField]"
12
+ :is-dot="data[muteField]"
13
+ :value="data[unreadMsgCountField]"
14
+ :max="99"
15
+ ></sdk-badge>
15
16
  </div>
16
17
  <div class="sdk-session-item__main">
17
18
  <div class="sdk-session-item__row">
@@ -141,7 +142,7 @@ export default {
141
142
  border-radius: 3px;
142
143
  }
143
144
  .sdk-session-item__avatar-badge{
144
- position: absolute;
145
+ position: absolute;
145
146
  &.is-mute {
146
147
  left: calc(~'100% - 7px');
147
148
  top: -6px;
@@ -7,11 +7,11 @@
7
7
  </div>
8
8
  <div class="sdk-chat-control-location__body">
9
9
  <div v-if="offline" class="sdk-chat-control-location__offline">
10
- <div class="sdk-chat-control-location__offline-label">腾讯地图经纬度坐标:</div>
10
+ <div class="sdk-chat-control-location__offline-label">高德地图经纬度坐标:</div>
11
11
  <div class="sdk-chat-control-location__offline-value">{{longitude}}、{{latitude}}</div>
12
12
  <div class="sdk-chat-control-location__offline-tips">提示:离线模式无法显示地图</div>
13
13
  </div>
14
- <ac-static-map :map-key="mapKey" v-else :enable-link="false" width="280" height="160" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
14
+ <ac-static-map type="amap" :map-key="mapKey" v-else :enable-link="false" width="280" height="160" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
15
15
  </div>
16
16
  </div>
17
17
  </template>
@@ -21,7 +21,7 @@
21
21
  <svg t="1752133896251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25831" width="200" height="200"><path d="M512 1012.394667l-271.530667-271.530667a384 384 0 1 1 543.061334 0L512 1012.394667z m211.2-331.861334a298.666667 298.666667 0 1 0-422.4 0L512 891.733333l211.2-211.2zM512 554.666667a85.333333 85.333333 0 1 1 0-170.666667 85.333333 85.333333 0 0 1 0 170.666667z" fill="currentColor" p-id="25832"></path></svg>
22
22
  </span>
23
23
  <span class="sdk-chat-control-location__title">{{address}}</span>
24
- <ac-static-map :map-key="mapKey" :enable-link="false" width="52" height="52" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
24
+ <ac-static-map type="amap" :map-key="mapKey" :enable-link="false" width="52" height="52" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
25
25
  </div>
26
26
  </template>
27
27
  </div>
@@ -78,7 +78,7 @@ export default {
78
78
  return formatOssPath(this.nextContent.coverUrl)
79
79
  },
80
80
  avatar () {
81
- return formatOssPath(this.nextContent.headUrl || this.nextContent.avatar)
81
+ return formatOssPath(this.nextContent.avatar)
82
82
  },
83
83
  nickname () {
84
84
  return this.nextContent.nickname
@@ -104,12 +104,6 @@ export default {
104
104
  border-radius: 4px;
105
105
  }
106
106
  }
107
- .sdk-chat-wework-panel-control-channel-live__cover {
108
- background-color: #000;
109
- }
110
- .sdk-chat-wework-panel-control-channel-live--default {
111
- width: 248px;
112
- }
113
107
  .sdk-chat-wework-panel-control-channel-live--default,
114
108
  .sdk-chat-wework-panel-control-channel-live--thumb {
115
109
  max-width: 280px;
@@ -119,6 +113,7 @@ export default {
119
113
  }
120
114
  .sdk-chat-wework-panel-control-channel-live__cover{
121
115
  height: 200px;
116
+ background-color: #eee;
122
117
  }
123
118
  .sdk-chat-wework-panel-control-channel-live__row{
124
119
  line-height: 1.5em;
@@ -62,7 +62,7 @@ export default {
62
62
  return formatOssPath(this.nextContent.bigheadimgurl)
63
63
  },
64
64
  category () {
65
- return '微名片'
65
+ return '企业微名片'
66
66
  }
67
67
  }
68
68
  }
@@ -21,10 +21,9 @@ export default {
21
21
  }
22
22
  },
23
23
  render (h, c) {
24
- const content = parse(c.props.content) || {}
25
24
  return h(Image, {
26
25
  props: {
27
- src: content.url,
26
+ src: parse(c.props.content).linkUrl,
28
27
  width: c.props.type === 'quote' ? '60px' : null,
29
28
  height: c.props.type === 'quote' ? '60px' : '120px',
30
29
  fit: 'contain'
@@ -7,11 +7,9 @@
7
7
  </div>
8
8
  <div class="sdk-chat-wework-control-file-url__toolbar">
9
9
  <span class="sdk-chat-wework-control-file-url__size" v-if="fileSize">{{fileSize}}</span>
10
- <span class="sdk-chat-wework-control-file-url__download" v-if="canDownload" @click.stop.prevent>
11
- <ui-button type="primary" link :loading="downloading" icon="download-line" :click="handleDownloadClick">
12
- 下载
13
- </ui-button>
14
- </span>
10
+ <!-- <span class="sdk-chat-wework-control-file-url__download" v-if="innerAllowDownload" @click.stop.prevent>
11
+ <ui-button type="primary" link :click="handleDownloadClick">下载</ui-button>
12
+ </span> -->
15
13
  </div>
16
14
  </span>
17
15
  <span v-if="fileIcon" class="sdk-chat-wework-control-file-url__icon">
@@ -30,7 +28,6 @@
30
28
  import FileIcon from './icons'
31
29
  import { parse } from '../../../utils/json'
32
30
  import { formatFileSize } from '../../../utils/file'
33
- import { formatOssPath } from '@aochuang/common/utils/oss'
34
31
 
35
32
  export default {
36
33
  name: 'SdkChatControlFileUrl',
@@ -69,17 +66,18 @@ export default {
69
66
  },
70
67
  data () {
71
68
  return {
72
- nextContent: {},
73
- downloading: false
69
+ nextContent: {}
74
70
  }
75
71
  },
76
72
  computed: {
77
73
  url () {
78
- const url = this.nextContent.resPath || this.nextContent.url || this.nextContent.resUrl
79
- return url ? formatOssPath(url) : url
74
+ return this.nextContent.url || this.nextContent.resUrl
80
75
  },
81
76
  name () {
82
- return this.nextContent.fileName || this.nextContent.title || this.url
77
+ if (!this.nextContent.title) {
78
+ return this.url
79
+ }
80
+ return this.nextContent.title
83
81
  },
84
82
  size () {
85
83
  return this.nextContent.totalLen
@@ -108,9 +106,6 @@ export default {
108
106
  }
109
107
  return this.allowDownload
110
108
  },
111
- canDownload () {
112
- return this.type !== 'quote' && this.innerAllowDownload && typeof this.downloadMethod === 'function'
113
- },
114
109
  border () {
115
110
  if (this.type === 'quote') {
116
111
  return false
@@ -120,37 +115,24 @@ export default {
120
115
  },
121
116
  created () {
122
117
  this.nextContent = parse(this.content) || {}
118
+ if (this.url && this.updateChatBoxProp) {
119
+ this.updateChatBoxProp('href', this.url)
120
+ }
123
121
  },
124
122
  methods: {
125
123
  handleDownloadClick () {
126
- if (!this.canDownload || this.downloading) {
124
+ if (!this.downloadMethod) {
127
125
  return
128
126
  }
129
- const updateContent = data => {
130
- if (!data || typeof data !== 'object' || Array.isArray(data)) {
131
- throw new Error('updateContentProps只支持更新数据对象')
132
- }
133
- this.nextContent = data
134
- this.$emit('content-update', data)
135
- }
136
- const result = this.downloadMethod({
127
+ return this.downloadMethod({
137
128
  content: this.nextContent,
138
129
  updateContentProp: (prop, value) => {
139
- if (!['resPath', 'url'].includes(prop)) {
130
+ if (!['url'].includes(prop)) {
140
131
  throw new Error('不支持的更新属性' + prop)
141
132
  }
142
133
  this.$set(this.nextContent, prop, value)
143
- this.$emit('content-update', this.nextContent)
144
- },
145
- updateContentProps: updateContent
134
+ }
146
135
  })
147
- if (result && result.finally) {
148
- this.downloading = true
149
- result.finally(() => {
150
- this.downloading = false
151
- })
152
- }
153
- return result
154
136
  }
155
137
  },
156
138
  beforeDestroy () {
@@ -1,24 +1,7 @@
1
1
  <template>
2
2
  <div class="sdk-chat-control-image" @click="handleClick">
3
3
  <div class="sdk-chat-control-image__main" :style="{'height': innerHeight, 'max-height': innerMaxHeight + 'px'}">
4
- <template v-if="showDownloadBox">
5
- <div class="sdk-chat-control-image__download" :class="{'is-downloading': downloading}" @click.stop="handleDownloadClick">
6
- <template v-if="downloading">
7
- <div class="sdk-chat-control-image__download-icon">
8
- <ui-loading size="mini"></ui-loading>
9
- </div>
10
- <div class="sdk-chat-control-image__download-text">下载中...</div>
11
- </template>
12
- <template v-else>
13
- <div class="sdk-chat-control-image__download-icon">
14
- <ui-icon name="download-line"></ui-icon>
15
- </div>
16
- <div class="sdk-chat-control-image__download-text">下载</div>
17
- </template>
18
- </div>
19
- <div class="sdk-chat-control-image__download-placeholder"></div>
20
- </template>
21
- <template v-else-if="allowDefrost">
4
+ <template v-if="allowDefrost">
22
5
  <template v-if="defrostMsg">
23
6
  <div class="sdk-chat-control-image__defrost">
24
7
  <div class="sdk-chat-control-image__defrost-icon">
@@ -93,7 +76,6 @@
93
76
  </template>
94
77
  <script>
95
78
  import { Image as UiImage, Button as UiButton, Icon as UiIcon, Loading as UiLoading } from '@aochuang/common/components'
96
- import { parse } from '../../../utils/json'
97
79
  import { isOriginImage, getNewImageSrc} from './util'
98
80
 
99
81
  export default {
@@ -116,17 +98,7 @@ export default {
116
98
  }
117
99
  },
118
100
  content: {
119
- type: [String, Object]
120
- },
121
- allowDownload: {
122
- type: [Boolean, Function],
123
- default: false
124
- },
125
- downloadMethod: {
126
- type: Function
127
- },
128
- cancelDownloadMethod: {
129
- type: Function
101
+ type: String
130
102
  },
131
103
  maxWidth: {
132
104
  type: Number,
@@ -178,35 +150,12 @@ export default {
178
150
  },
179
151
  data () {
180
152
  return {
181
- downloading: false,
182
- downloaded: false,
183
- nextContent: null,
184
153
  defrostMsg: null,
185
154
  errorMsg: null
186
155
  }
187
156
  },
188
157
  computed: {
189
- isDownloadContent () {
190
- return !!(this.nextContent && typeof this.nextContent === 'object' && !Array.isArray(this.nextContent))
191
- },
192
- innerAllowDownload () {
193
- if (typeof this.allowDownload === 'function') {
194
- return this.allowDownload({
195
- content: this.nextContent
196
- })
197
- }
198
- return this.allowDownload
199
- },
200
- showDownloadBox () {
201
- return this.type === 'default' && this.innerAllowDownload && this.isDownloadContent && !this.nextContent.resPath && !this.downloaded
202
- },
203
158
  src () {
204
- if (typeof this.nextContent === 'string') {
205
- return this.nextContent
206
- }
207
- if (this.nextContent && typeof this.nextContent === 'object') {
208
- return this.nextContent.resPath || this.nextContent.url || this.nextContent.thumbnailPath || this.nextContent.midThumbnailPath || ''
209
- }
210
159
  return this.content
211
160
  },
212
161
  innerWidth () {
@@ -261,9 +210,6 @@ export default {
261
210
  return !!this.defrostMethod
262
211
  }
263
212
  },
264
- created () {
265
- this.syncContentState()
266
- },
267
213
  methods: {
268
214
  handleClick () {
269
215
  this.$emit('click')
@@ -271,39 +217,6 @@ export default {
271
217
  handleImageClick () {
272
218
  this.imageClickMethod && this.imageClickMethod()
273
219
  },
274
- handleDownloadClick () {
275
- if (this.downloading) {
276
- return
277
- }
278
- if (!this.downloadMethod) {
279
- return
280
- }
281
- const rs = this.downloadMethod({
282
- content: this.nextContent,
283
- updateContentProp: (prop, value) => {
284
- if (!['url'].includes(prop)) {
285
- throw new Error('不支持的更新属性' + prop)
286
- }
287
- this.$set(this.nextContent, prop, value)
288
- },
289
- updateContentProps: (data) => {
290
- if (!data || typeof data !== 'object' || Array.isArray(data)) {
291
- throw new Error('updateContentProps只支持更新数据对象')
292
- }
293
- this.nextContent = data
294
- }
295
- })
296
- if (rs && rs.finally) {
297
- this.downloading = true
298
- rs.then(() => {
299
- this.downloaded = true
300
- }).finally(() => {
301
- this.downloading = false
302
- })
303
- } else {
304
- this.downloaded = true
305
- }
306
- },
307
220
  handleError () {
308
221
  if (!this.defrostMethod) {
309
222
  return
@@ -323,22 +236,7 @@ export default {
323
236
  handleRefreshClick () {
324
237
  this.errorMsg = null
325
238
  this.defrostMsg = null
326
- },
327
- syncContentState () {
328
- this.nextContent = parse(this.content)
329
- this.downloaded = false
330
- this.downloading = false
331
- this.errorMsg = null
332
- this.defrostMsg = null
333
239
  }
334
- },
335
- watch: {
336
- content () {
337
- this.syncContentState()
338
- }
339
- },
340
- beforeDestroy () {
341
- this.cancelDownloadMethod && this.cancelDownloadMethod()
342
240
  }
343
241
  }
344
242
  </script>
@@ -379,39 +277,6 @@ export default {
379
277
  display: inline-block;
380
278
  line-height: 1em;
381
279
  vertical-align: top;
382
- position: relative;
383
- }
384
- .sdk-chat-control-image__download{
385
- position: absolute;
386
- left: 0;
387
- top: 0;
388
- z-index: 10;
389
- width: 100%;
390
- height: 100%;
391
- background: #000;
392
- display: flex;
393
- flex-direction: column;
394
- align-items: center;
395
- justify-content: center;
396
- color: #ccc;
397
- cursor: pointer;
398
- &:not(.is-downloading):hover {
399
- color: #fff;
400
- }
401
- }
402
- .sdk-chat-control-image__download.is-downloading{
403
- cursor: default;
404
- }
405
- .sdk-chat-control-image__download-icon{
406
- line-height: 1;
407
- margin-bottom: 6px;
408
- }
409
- .sdk-chat-control-image__download-text{
410
- font-size: 12px;
411
- }
412
- .sdk-chat-control-image__download-placeholder{
413
- width: 100%;
414
- height: 100%;
415
280
  }
416
281
  .sdk-chat-control-image__hd{
417
282
  position: absolute;