@aochuang/client-sdk 1.0.378 → 1.0.379-wework

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/common/.DS_Store +0 -0
  2. package/components/.DS_Store +0 -0
  3. package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +4 -40
  4. package/components/chat-editor/chat-editor.vue +5 -75
  5. package/components/index.js +6 -1
  6. package/components/session-select/session-select-item.vue +8 -9
  7. package/components/wechat-chat-control/.DS_Store +0 -0
  8. package/components/wechat-chat-control/location/location.vue +3 -3
  9. package/components/wechat-chat-control/transfer/.DS_Store +0 -0
  10. package/components/wechat-chat-control/url/.DS_Store +0 -0
  11. package/components/wechat-chat-control/voice/.DS_Store +0 -0
  12. package/components/wework-chat-control/channel-card/channel-card.vue +144 -0
  13. package/components/wework-chat-control/channel-live/channel-live.vue +7 -2
  14. package/components/wework-chat-control/company-card/company-card.vue +1 -1
  15. package/components/wework-chat-control/custom-expression/custom-expression.vue +2 -1
  16. package/components/wework-chat-control/file-url/file-url.vue +34 -16
  17. package/components/wework-chat-control/image/image.vue +137 -2
  18. package/components/wework-chat-control/index.js +15 -7
  19. package/components/wework-chat-control/link/.DS_Store +0 -0
  20. package/components/wework-chat-control/location/location.vue +3 -3
  21. package/components/wework-chat-control/merge-message/merge-message-panel.vue +63 -0
  22. package/components/wework-chat-control/merge-message/merge-message.vue +84 -0
  23. package/components/wework-chat-control/merge-message/util.js +59 -0
  24. package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
  25. package/components/wework-chat-control/metting/meeting-video.svg +4 -0
  26. package/components/wework-chat-control/metting/metting.vue +181 -0
  27. package/components/wework-chat-control/red-envelopes/red-envelopes.vue +3 -2
  28. package/components/wework-chat-control/text/text-default.vue +99 -0
  29. package/components/wework-chat-control/text/text-quote.vue +138 -0
  30. package/components/wework-chat-control/text/text.vue +27 -143
  31. package/components/wework-chat-control/url/url-channel-live.vue +53 -0
  32. package/components/wework-chat-control/url/url-miniprogram.vue +6 -7
  33. package/components/wework-chat-control/url/url.vue +26 -2
  34. package/components/wework-chat-control/util.js +26 -17
  35. package/components/wework-chat-control/video/.DS_Store +0 -0
  36. package/components/wework-chat-control/video/video.vue +10 -2
  37. package/components/wework-chat-control/voice/voice.vue +9 -2
  38. package/components/wework-chat-control/wework-chat-control-config-item.vue +24 -0
  39. package/components/wework-chat-control/wework-chat-control-config-msg.vue +25 -0
  40. package/{uni-components/chat-control/chat-control-config.vue → components/wework-chat-control/wework-chat-control-config.vue} +16 -13
  41. package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +73 -0
  42. package/components/wework-chat-panel/chat-panel-item.vue +56 -25
  43. package/components/wework-chat-panel/chat-panel.vue +96 -13
  44. package/package.json +10 -3
  45. package/services/.DS_Store +0 -0
  46. package/services/client-chat/client-chat-wework/client-chat-account.js +84 -1
  47. package/services/client-chat/client-chat-wework/client-chat-concats.js +81 -17
  48. package/services/client-chat/client-chat-wework/client-chat-message.js +121 -11
  49. package/services/client-chat/client-chat-wework/client-chat-session.js +271 -191
  50. package/services/client-chat/client-chat-wework/client-chat-socket.js +13 -1
  51. package/services/client-chat/client-chat-wework/client-chat.js +404 -84
  52. package/services/client-chat/client-chat-wework/utils.js +5 -5
  53. package/services/socket/socket.js +14 -4
  54. package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +0 -35
  55. package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +0 -36
  56. package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +0 -35
  57. package/components/wework-chat-panel/chat-panel-controls/image/image.vue +0 -36
  58. package/components/wework-chat-panel/chat-panel-controls/index.js +0 -35
  59. package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +0 -28
  60. package/components/wework-chat-panel/chat-panel-controls/link/link.vue +0 -35
  61. package/components/wework-chat-panel/chat-panel-controls/location/location.vue +0 -35
  62. package/components/wework-chat-panel/chat-panel-controls/text/text.vue +0 -43
  63. package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +0 -39
  64. package/components/wework-chat-panel/chat-panel-controls/video/video.vue +0 -37
  65. package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +0 -35
  66. package/uni-common/account-portray/account-portray.vue +0 -51
  67. package/uni-common/account-select/account-select-item.vue +0 -172
  68. package/uni-common/account-select/account-select.vue +0 -252
  69. package/uni-common/all-friend-avatar/all-friend-avatar.vue +0 -49
  70. package/uni-common/friend-avatar/default.svg +0 -1
  71. package/uni-common/friend-avatar/friend-avatar.vue +0 -27
  72. package/uni-common/friend-avatar/index.js +0 -3
  73. package/uni-common/friend-loader/friend-loader.vue +0 -53
  74. package/uni-common/friend-portray/friend-portray.vue +0 -56
  75. package/uni-common/group-avatar/default.svg +0 -1
  76. package/uni-common/group-avatar/group-avatar.vue +0 -18
  77. package/uni-common/group-avatar/index.js +0 -3
  78. package/uni-common/room-avatar/default.svg +0 -6
  79. package/uni-common/room-avatar/index.js +0 -3
  80. package/uni-common/room-avatar/room-avatar.vue +0 -27
  81. package/uni-common/room-loader/room-loader.vue +0 -53
  82. package/uni-common/room-portray/room-portray.vue +0 -56
  83. package/uni-components/chat-control/calling/calling.vue +0 -91
  84. package/uni-components/chat-control/calling/phone-fill.svg +0 -1
  85. package/uni-components/chat-control/calling/vidicon-fill.svg +0 -1
  86. package/uni-components/chat-control/channel-video/channel-video.vue +0 -89
  87. package/uni-components/chat-control/channel-video-card/channel-video-card.vue +0 -105
  88. package/uni-components/chat-control/channel-video-live/channel-video-live.vue +0 -92
  89. package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +0 -20
  90. package/uni-components/chat-control/chat-control-config-item/index.js +0 -3
  91. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +0 -25
  92. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +0 -21
  93. package/uni-components/chat-control/chat-control.vue +0 -218
  94. package/uni-components/chat-control/company-card/company-card.vue +0 -123
  95. package/uni-components/chat-control/const.js +0 -28
  96. package/uni-components/chat-control/expression/expression.vue +0 -41
  97. package/uni-components/chat-control/image/image.vue +0 -68
  98. package/uni-components/chat-control/index.js +0 -89
  99. package/uni-components/chat-control/location/location.vue +0 -110
  100. package/uni-components/chat-control/member-change/member-change.vue +0 -32
  101. package/uni-components/chat-control/quote-message/quote-message.vue +0 -216
  102. package/uni-components/chat-control/real-time-position/real-time-position.vue +0 -62
  103. package/uni-components/chat-control/redpacket/red-envelope.svg +0 -1
  104. package/uni-components/chat-control/redpacket/redpacket.vue +0 -75
  105. package/uni-components/chat-control/share-card/share-card.vue +0 -101
  106. package/uni-components/chat-control/system/system.vue +0 -69
  107. package/uni-components/chat-control/system-batch-message/system-batch-message.vue +0 -30
  108. package/uni-components/chat-control/system-text/system-text.vue +0 -32
  109. package/uni-components/chat-control/text/text.vue +0 -67
  110. package/uni-components/chat-control/text-with-at/text-with-at.vue +0 -51
  111. package/uni-components/chat-control/transfer/red-transfer.svg +0 -1
  112. package/uni-components/chat-control/transfer/transfer.vue +0 -80
  113. package/uni-components/chat-control/unkonw/unkonw.vue +0 -37
  114. package/uni-components/chat-control/url/icons/file-excel-line.svg +0 -1
  115. package/uni-components/chat-control/url/icons/file-info-line.svg +0 -1
  116. package/uni-components/chat-control/url/icons/file-music-line.svg +0 -1
  117. package/uni-components/chat-control/url/icons/file-pdf-line.svg +0 -1
  118. package/uni-components/chat-control/url/icons/file-ppt-line.svg +0 -1
  119. package/uni-components/chat-control/url/icons/file-settings-line.svg +0 -1
  120. package/uni-components/chat-control/url/icons/file-text-line.svg +0 -1
  121. package/uni-components/chat-control/url/icons/file-unknow-line.svg +0 -1
  122. package/uni-components/chat-control/url/icons/file-word-line.svg +0 -1
  123. package/uni-components/chat-control/url/icons/file-zip-line.svg +0 -1
  124. package/uni-components/chat-control/url/icons/index.js +0 -24
  125. package/uni-components/chat-control/url/miniprogram.svg +0 -1
  126. package/uni-components/chat-control/url/url-miniprogram.vue +0 -116
  127. package/uni-components/chat-control/url/url.vue +0 -306
  128. package/uni-components/chat-control/url-new/icons/file-excel-line.svg +0 -1
  129. package/uni-components/chat-control/url-new/icons/file-info-line.svg +0 -1
  130. package/uni-components/chat-control/url-new/icons/file-music-line.svg +0 -1
  131. package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +0 -1
  132. package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +0 -1
  133. package/uni-components/chat-control/url-new/icons/file-settings-line.svg +0 -1
  134. package/uni-components/chat-control/url-new/icons/file-text-line.svg +0 -1
  135. package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +0 -1
  136. package/uni-components/chat-control/url-new/icons/file-word-line.svg +0 -1
  137. package/uni-components/chat-control/url-new/icons/file-zip-line.svg +0 -1
  138. package/uni-components/chat-control/url-new/icons/index.js +0 -24
  139. package/uni-components/chat-control/url-new/url-new.vue +0 -110
  140. package/uni-components/chat-control/utils.js +0 -12
  141. package/uni-components/chat-control/video/video.vue +0 -156
  142. package/uni-components/chat-control/voice/voice.vue +0 -166
  143. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +0 -84
  144. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +0 -28
  145. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +0 -85
  146. package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +0 -157
  147. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +0 -158
  148. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +0 -61
  149. package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +0 -58
  150. package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +0 -54
  151. package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +0 -42
  152. package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +0 -42
  153. package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +0 -25
  154. package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +0 -158
  155. package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +0 -75
  156. package/uni-components/chat-editor/chat-editor.vue +0 -257
  157. package/uni-components/chat-editor/index.js +0 -10
  158. package/uni-components/chat-editor/util.js +0 -65
  159. package/uni-components/chat-panel/chat-panel-chats-box.vue +0 -238
  160. package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +0 -273
  161. package/uni-components/chat-panel/chat-panel-chats-item.vue +0 -578
  162. package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +0 -71
  163. package/uni-components/chat-panel/chat-panel-chats.vue +0 -368
  164. package/uni-components/chat-panel/chat-panel.vue +0 -227
  165. package/uni-components/contacts-group-select/contacts-group-select-item.vue +0 -85
  166. package/uni-components/contacts-group-select/contacts-group-select-panel.vue +0 -119
  167. package/uni-components/contacts-group-select/contacts-group-select.vue +0 -150
Binary file
Binary file
@@ -19,12 +19,11 @@
19
19
  <span
20
20
  class="sdk-chat-editor-suggestions__close"
21
21
  title="关闭"
22
- @mousedown.prevent.stop
23
- @click.stop="handleCloseClick"
22
+ @click="handleCloseClick"
24
23
  ></span>
25
24
  </div>
26
25
  </div>
27
- <div class="sdk-chat-editor-suggestions__body" ref="body" @scroll="handleBodyScroll">
26
+ <div class="sdk-chat-editor-suggestions__body" ref="body">
28
27
  <template v-if="data && data.length">
29
28
  <div class="sdk-chat-editor-suggestions__list">
30
29
  <div
@@ -40,9 +39,6 @@
40
39
  </div>
41
40
  </div>
42
41
  </template>
43
- <div v-if="loadingMore" class="sdk-chat-editor-suggestions__load-more">
44
- <ui-loading size="mini" text="加载中..."></ui-loading>
45
- </div>
46
42
  </div>
47
43
  <div class="sdk-chat-editor-suggestions__foot">
48
44
  <ui-icon name="information-line"></ui-icon> 提示:
@@ -72,20 +68,8 @@ export default {
72
68
  type: Boolean,
73
69
  default: false
74
70
  },
75
- loadingMore: {
76
- type: Boolean,
77
- default: false
78
- },
79
71
  confirmMethod: {
80
72
  type: Function
81
- },
82
- loadMoreEnabled: {
83
- type: Boolean,
84
- default: false
85
- },
86
- hasMore: {
87
- type: Boolean,
88
- default: false
89
73
  }
90
74
  },
91
75
  data () {
@@ -122,16 +106,7 @@ export default {
122
106
  },
123
107
  methods: {
124
108
  handleCloseClick () {
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
- }
109
+ this.closed = true
135
110
  },
136
111
  handleItemMouseEnter (item) {
137
112
  this.focusId = item.id
@@ -205,10 +180,7 @@ export default {
205
180
  checkAutoFocus () {
206
181
  if (!this.data || !this.data.length) {
207
182
  this.focusId = null
208
- return
209
- }
210
- const hasFocusedItem = this.data.some(item => item.id === this.focusId)
211
- if (!hasFocusedItem) {
183
+ } else {
212
184
  this.focusId = this.data[0].id
213
185
  }
214
186
  },
@@ -325,14 +297,6 @@ export default {
325
297
  overflow: auto;
326
298
  position: relative;
327
299
  }
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
- }
336
300
  .sdk-chat-editor-suggestions__foot{
337
301
  color: #999;
338
302
  line-height: 24px;
@@ -46,13 +46,8 @@
46
46
  ref="suggestions"
47
47
  :keyword="suggestionsKeyword"
48
48
  :loading="suggestioning"
49
- :loading-more="suggestionsLoadingMore"
50
49
  :data="suggestionsData"
51
50
  :confirm-method="handleSuggestionsConfirmMethod"
52
- :load-more-enabled="suggestionsLoadMore"
53
- :has-more="suggestionsHasMore"
54
- @load-more="handleSuggestionsLoadMore"
55
- @close="handleSuggestionsClose"
56
51
  @closed="handleSuggestionsClosed"
57
52
  >
58
53
  <template slot="item" slot-scope="scope">
@@ -88,14 +83,6 @@ export default {
88
83
  fetchSuggestionsMethod: {
89
84
  type: Function
90
85
  },
91
- suggestionsLoadMore: {
92
- type: Boolean,
93
- default: false
94
- },
95
- suggestionsPageSize: {
96
- type: Number,
97
- default: 20
98
- },
99
86
  confirmSuggestionsMethod: {
100
87
  type: Function
101
88
  },
@@ -112,8 +99,6 @@ export default {
112
99
  sending: false,
113
100
  popoverActive: false,
114
101
  suggestioning: false,
115
- suggestionsLoadingMore: false,
116
- suggestionsHasMore: false,
117
102
  suggestionsData: [],
118
103
  suggestionsKeyword: null,
119
104
  inputValue: this.value || ''
@@ -142,30 +127,6 @@ export default {
142
127
  },
143
128
  handleSuggestionsClosed () {
144
129
  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
- })
169
130
  },
170
131
  handleSuggestionsConfirmMethod ({ item }) {
171
132
  const next = () => {
@@ -294,58 +255,29 @@ export default {
294
255
  this.loadSuggestions(nearest, nearsetInfo)
295
256
  }, 200)
296
257
  },
297
- loadSuggestions (keyword, nearestInfo, options = {}) {
258
+ loadSuggestions (keyword, nearestInfo) {
298
259
  if (!this.fetchSuggestionsMethod) {
299
260
  return
300
261
  }
301
- const isLoadMore = !!options.isLoadMore
302
262
  keyword = this.normalizeSuggestionsKeyword(nearestInfo, keyword)
303
- if (!isLoadMore) {
304
- this.suggestionsHasMore = false
305
- }
306
263
  const requestId = (this._suggestionsRequestId || 0) + 1
307
264
  this._suggestionsRequestId = requestId
308
- if (isLoadMore) {
309
- this.suggestionsLoadingMore = true
310
- } else {
311
- this.suggestioning = true
312
- }
265
+ this.suggestioning = true
313
266
  this.suggestionsKeyword = keyword
314
267
  this.popoverActive = true
315
268
  clearTimeout(this._loadSuggestionsTimer)
316
269
  return this.fetchSuggestionsMethod({
317
270
  keyword,
318
271
  nearestInfo,
319
- isAtContext: !!(nearestInfo && nearestInfo.isAtContext),
320
- isLoadMore,
321
- lastItem: options.lastItem || null
272
+ isAtContext: !!(nearestInfo && nearestInfo.isAtContext)
322
273
  }).then(rs => {
323
274
  if (requestId !== this._suggestionsRequestId) {
324
275
  return
325
276
  }
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
277
+ this.suggestionsData = rs || []
342
278
  }).finally(() => {
343
279
  if (requestId === this._suggestionsRequestId) {
344
- if (isLoadMore) {
345
- this.suggestionsLoadingMore = false
346
- } else {
347
- this.suggestioning = false
348
- }
280
+ this.suggestioning = false
349
281
  }
350
282
  })
351
283
  },
@@ -362,8 +294,6 @@ export default {
362
294
  this._suggestionsRequestId = (this._suggestionsRequestId || 0) + 1
363
295
  this.$refs.suggestions && this.$refs.suggestions.close()
364
296
  this.suggestioning = false
365
- this.suggestionsLoadingMore = false
366
- this.suggestionsHasMore = false
367
297
  this.popoverActive = false
368
298
  },
369
299
  hasCurrentSuggestionsContext () {
@@ -11,6 +11,7 @@ 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'
14
15
  import { MESSAGE_TYPE, formatShortMessage, formatShortSessionMessage } from './wechat-chat-control/util'
15
16
  import { MESSAGE_TYPE as MESSAGE_TYPE_W } from './wework-chat-control/util'
16
17
 
@@ -21,6 +22,10 @@ export default {
21
22
  WechatChatControlConfig,
22
23
  WechatChatControlConfigMsg,
23
24
  WechatChatControlConfigItem,
25
+ WeworkChatControls,
26
+ WeworkChatControlConfig,
27
+ WeworkChatControlConfigMsg,
28
+ WeworkChatControlConfigItem,
24
29
  MESSAGE_TYPE,
25
30
  MESSAGE_TYPE_W,
26
31
  AccountSelect,
@@ -40,4 +45,4 @@ export default {
40
45
  ChatRoomProfile,
41
46
  WechatChatPanel,
42
47
  WeworkChatPanel
43
- }
48
+ }
@@ -5,14 +5,13 @@
5
5
  <div class="sdk-session-item__avatar-image">
6
6
  <slot name="avatar"></slot>
7
7
  </div>
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>
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>
16
15
  </div>
17
16
  <div class="sdk-session-item__main">
18
17
  <div class="sdk-session-item__row">
@@ -142,7 +141,7 @@ export default {
142
141
  border-radius: 3px;
143
142
  }
144
143
  .sdk-session-item__avatar-badge{
145
- position: absolute;
144
+ position: absolute;
146
145
  &.is-mute {
147
146
  left: calc(~'100% - 7px');
148
147
  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 type="amap" :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 :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 type="amap" :map-key="mapKey" :enable-link="false" width="52" height="52" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
24
+ <ac-static-map :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>
@@ -0,0 +1,144 @@
1
+ <template>
2
+ <div class="sdk-chat-control-channel-card" :class="['sdk-chat-control-channel-card--' + type]">
3
+ <template v-if="type === 'default' || type === 'thumb'">
4
+ <div class="sdk-chat-control-channel-card__main">
5
+ <div class="sdk-chat-control-channel-card__avatar">
6
+ <sdk-avatar :src="avatar" :radius="false" size="medium"></sdk-avatar>
7
+ </div>
8
+ <div class="sdk-chat-control-channel-card__fields">
9
+ <div class="sdk-chat-control-channel-card__title">{{name}}</div>
10
+ <div class="sdk-chat-control-channel-card__summary">{{description}}</div>
11
+ </div>
12
+ </div>
13
+ <div class="sdk-chat-control-channel-card__foot">
14
+ <span class="sdk-chat-control-channel-card__category">视频号名片</span>
15
+ </div>
16
+ </template>
17
+ <template v-else-if="type === 'quote'">
18
+ <div class="sdk-chat-control-channel-card__icon"></div>
19
+ <div class="sdk-chat-control-channel-card__title">{{name}}</div>
20
+ <div class="sdk-chat-control-channel-card__avatar">
21
+ <sdk-avatar :src="avatar" :radius="false" size="medium"></sdk-avatar>
22
+ </div>
23
+ </template>
24
+ </div>
25
+ </template>
26
+ <script>
27
+ import { parse } from '../../../utils/json'
28
+ import SdkAvatar from '../../../common/avatar'
29
+ import { formatOssPath } from '@aochuang/common/utils/oss'
30
+
31
+ export default {
32
+ name: 'SdkChatControlChannelCard',
33
+ components: {
34
+ SdkAvatar
35
+ },
36
+ props: {
37
+ id: {
38
+ type: String
39
+ },
40
+ content: {
41
+ type: [String, Object]
42
+ },
43
+ type: {
44
+ type: String,
45
+ default: 'default',
46
+ validator (value) {
47
+ return ['quote', 'default', 'thumb'].includes(value)
48
+ }
49
+ },
50
+ updateChatBoxProp: {
51
+ type: Function
52
+ }
53
+ },
54
+ computed: {
55
+ nextContent () {
56
+ return parse(this.content) || {}
57
+ },
58
+ description () {
59
+ return this.nextContent.desc || ''
60
+ },
61
+ name () {
62
+ return (this.nextContent.title || '').replace(/^\[视频号名片\]\s*/, '')
63
+ },
64
+ avatar () {
65
+ return formatOssPath(this.nextContent.imageUrl)
66
+ },
67
+ url () {
68
+ return this.nextContent.url
69
+ }
70
+ },
71
+ created () {
72
+ if (this.url && this.updateChatBoxProp) {
73
+ this.updateChatBoxProp('href', this.url)
74
+ }
75
+ }
76
+ }
77
+ </script>
78
+ <style lang="less">
79
+ .sdk-chat-control-channel-card--default,
80
+ .sdk-chat-control-channel-card--thumb{
81
+ width: 248px;
82
+ max-width: 100%;
83
+ line-height: 1.5em;
84
+ .sdk-chat-control-channel-card__main{
85
+ display: flex;
86
+ flex-direction: row;
87
+ padding: 10px;
88
+ }
89
+ .sdk-chat-control-channel-card__fields{
90
+ flex: 1;
91
+ min-width: 0;
92
+ padding-left: 10px;
93
+ }
94
+ .sdk-chat-control-channel-card__title{
95
+ font-size: 14px;
96
+ overflow: hidden;
97
+ text-overflow: ellipsis;
98
+ white-space: nowrap;
99
+ }
100
+ .sdk-chat-control-channel-card__summary{
101
+ color: #888;
102
+ font-size: 12px;
103
+ overflow: hidden;
104
+ text-overflow: ellipsis;
105
+ white-space: nowrap;
106
+ margin-top: 6px;
107
+ }
108
+ .sdk-chat-control-channel-card__foot{
109
+ border-top: 1px solid #eee;
110
+ height: 24px;
111
+ line-height: 24px;
112
+ padding: 0 10px;
113
+ box-sizing: content-box;
114
+ }
115
+ .sdk-chat-control-channel-card__category{
116
+ color: #999;
117
+ font-size: 12px;
118
+ }
119
+ }
120
+ .sdk-chat-control-channel-card--thumb{
121
+ border: 1px solid #eee;
122
+ background-color: #fff;
123
+ border-radius: 4px;
124
+ }
125
+ .sdk-chat-control-channel-card--quote {
126
+ display: flex;
127
+ flex-direction: row;
128
+ .sdk-chat-control-channel-card__icon {
129
+ display: inline-block;
130
+ width: 18px;
131
+ height: 18px;
132
+ margin-right: 4px;
133
+ min-width: 18px;
134
+ vertical-align: top;
135
+ margin-top: 2px;
136
+ color: #999;
137
+ background: url('../company-card/quote-icon.svg') no-repeat 50% 50%;
138
+ background-size: cover;
139
+ }
140
+ .sdk-chat-control-channel-card__title{
141
+ margin-right: 6px;
142
+ }
143
+ }
144
+ </style>
@@ -78,7 +78,7 @@ export default {
78
78
  return formatOssPath(this.nextContent.coverUrl)
79
79
  },
80
80
  avatar () {
81
- return formatOssPath(this.nextContent.avatar)
81
+ return formatOssPath(this.nextContent.headUrl || this.nextContent.avatar)
82
82
  },
83
83
  nickname () {
84
84
  return this.nextContent.nickname
@@ -104,6 +104,12 @@ 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
+ }
107
113
  .sdk-chat-wework-panel-control-channel-live--default,
108
114
  .sdk-chat-wework-panel-control-channel-live--thumb {
109
115
  max-width: 280px;
@@ -113,7 +119,6 @@ export default {
113
119
  }
114
120
  .sdk-chat-wework-panel-control-channel-live__cover{
115
121
  height: 200px;
116
- background-color: #eee;
117
122
  }
118
123
  .sdk-chat-wework-panel-control-channel-live__row{
119
124
  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,9 +21,10 @@ export default {
21
21
  }
22
22
  },
23
23
  render (h, c) {
24
+ const content = parse(c.props.content) || {}
24
25
  return h(Image, {
25
26
  props: {
26
- src: parse(c.props.content).linkUrl,
27
+ src: content.url,
27
28
  width: c.props.type === 'quote' ? '60px' : null,
28
29
  height: c.props.type === 'quote' ? '60px' : '120px',
29
30
  fit: 'contain'
@@ -7,9 +7,11 @@
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="innerAllowDownload" @click.stop.prevent>
11
- <ui-button type="primary" link :click="handleDownloadClick">下载</ui-button>
12
- </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>
13
15
  </div>
14
16
  </span>
15
17
  <span v-if="fileIcon" class="sdk-chat-wework-control-file-url__icon">
@@ -28,6 +30,7 @@
28
30
  import FileIcon from './icons'
29
31
  import { parse } from '../../../utils/json'
30
32
  import { formatFileSize } from '../../../utils/file'
33
+ import { formatOssPath } from '@aochuang/common/utils/oss'
31
34
 
32
35
  export default {
33
36
  name: 'SdkChatControlFileUrl',
@@ -66,18 +69,17 @@ export default {
66
69
  },
67
70
  data () {
68
71
  return {
69
- nextContent: {}
72
+ nextContent: {},
73
+ downloading: false
70
74
  }
71
75
  },
72
76
  computed: {
73
77
  url () {
74
- return this.nextContent.url || this.nextContent.resUrl
78
+ const url = this.nextContent.resPath || this.nextContent.url || this.nextContent.resUrl
79
+ return url ? formatOssPath(url) : url
75
80
  },
76
81
  name () {
77
- if (!this.nextContent.title) {
78
- return this.url
79
- }
80
- return this.nextContent.title
82
+ return this.nextContent.fileName || this.nextContent.title || this.url
81
83
  },
82
84
  size () {
83
85
  return this.nextContent.totalLen
@@ -106,6 +108,9 @@ export default {
106
108
  }
107
109
  return this.allowDownload
108
110
  },
111
+ canDownload () {
112
+ return this.type !== 'quote' && this.innerAllowDownload && typeof this.downloadMethod === 'function'
113
+ },
109
114
  border () {
110
115
  if (this.type === 'quote') {
111
116
  return false
@@ -115,24 +120,37 @@ export default {
115
120
  },
116
121
  created () {
117
122
  this.nextContent = parse(this.content) || {}
118
- if (this.url && this.updateChatBoxProp) {
119
- this.updateChatBoxProp('href', this.url)
120
- }
121
123
  },
122
124
  methods: {
123
125
  handleDownloadClick () {
124
- if (!this.downloadMethod) {
126
+ if (!this.canDownload || this.downloading) {
125
127
  return
126
128
  }
127
- return this.downloadMethod({
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({
128
137
  content: this.nextContent,
129
138
  updateContentProp: (prop, value) => {
130
- if (!['url'].includes(prop)) {
139
+ if (!['resPath', 'url'].includes(prop)) {
131
140
  throw new Error('不支持的更新属性' + prop)
132
141
  }
133
142
  this.$set(this.nextContent, prop, value)
134
- }
143
+ this.$emit('content-update', this.nextContent)
144
+ },
145
+ updateContentProps: updateContent
135
146
  })
147
+ if (result && result.finally) {
148
+ this.downloading = true
149
+ result.finally(() => {
150
+ this.downloading = false
151
+ })
152
+ }
153
+ return result
136
154
  }
137
155
  },
138
156
  beforeDestroy () {