@aochuang/client-sdk 1.0.376-wework → 1.0.377

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 (164) hide show
  1. package/components/index.js +1 -6
  2. package/components/session-select/session-select-item.vue +9 -8
  3. package/components/wechat-chat-control/location/location.vue +3 -3
  4. package/components/wework-chat-control/channel-live/channel-live.vue +2 -7
  5. package/components/wework-chat-control/company-card/company-card.vue +1 -1
  6. package/components/wework-chat-control/custom-expression/custom-expression.vue +1 -2
  7. package/components/wework-chat-control/file-url/file-url.vue +16 -34
  8. package/components/wework-chat-control/image/image.vue +2 -137
  9. package/components/wework-chat-control/index.js +7 -15
  10. package/components/wework-chat-control/location/location.vue +3 -3
  11. package/components/wework-chat-control/red-envelopes/red-envelopes.vue +2 -3
  12. package/components/wework-chat-control/text/text.vue +144 -24
  13. package/components/wework-chat-control/url/url-miniprogram.vue +7 -6
  14. package/components/wework-chat-control/url/url.vue +2 -26
  15. package/components/wework-chat-control/util.js +17 -26
  16. package/components/wework-chat-control/video/video.vue +2 -10
  17. package/components/wework-chat-control/voice/voice.vue +2 -9
  18. package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
  19. package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
  20. package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
  21. package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
  22. package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
  23. package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
  24. package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
  25. package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
  26. package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
  27. package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
  28. package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
  29. package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
  30. package/components/wework-chat-panel/chat-panel-item.vue +25 -56
  31. package/components/wework-chat-panel/chat-panel.vue +13 -96
  32. package/package.json +3 -10
  33. package/services/client-chat/client-chat-wework/client-chat-account.js +1 -84
  34. package/services/client-chat/client-chat-wework/client-chat-concats.js +17 -81
  35. package/services/client-chat/client-chat-wework/client-chat-message.js +5 -45
  36. package/services/client-chat/client-chat-wework/client-chat-session.js +4 -59
  37. package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -13
  38. package/services/client-chat/client-chat-wework/client-chat.js +11 -320
  39. package/services/client-chat/client-chat-wework/utils.js +5 -5
  40. package/uni-common/account-portray/account-portray.vue +51 -0
  41. package/uni-common/account-select/account-select-item.vue +172 -0
  42. package/uni-common/account-select/account-select.vue +252 -0
  43. package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
  44. package/uni-common/friend-avatar/default.svg +1 -0
  45. package/uni-common/friend-avatar/friend-avatar.vue +27 -0
  46. package/uni-common/friend-avatar/index.js +3 -0
  47. package/uni-common/friend-loader/friend-loader.vue +53 -0
  48. package/uni-common/friend-portray/friend-portray.vue +56 -0
  49. package/uni-common/group-avatar/default.svg +1 -0
  50. package/uni-common/group-avatar/group-avatar.vue +18 -0
  51. package/uni-common/group-avatar/index.js +3 -0
  52. package/uni-common/room-avatar/default.svg +6 -0
  53. package/uni-common/room-avatar/index.js +3 -0
  54. package/uni-common/room-avatar/room-avatar.vue +27 -0
  55. package/uni-common/room-loader/room-loader.vue +53 -0
  56. package/uni-common/room-portray/room-portray.vue +56 -0
  57. package/uni-components/chat-control/calling/calling.vue +91 -0
  58. package/uni-components/chat-control/calling/phone-fill.svg +1 -0
  59. package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
  60. package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
  61. package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
  62. package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
  63. package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
  64. package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
  65. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
  66. package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
  67. package/{components/wework-chat-control/wework-chat-control-config.vue → uni-components/chat-control/chat-control-config.vue} +13 -16
  68. package/uni-components/chat-control/chat-control.vue +218 -0
  69. package/uni-components/chat-control/company-card/company-card.vue +123 -0
  70. package/uni-components/chat-control/const.js +28 -0
  71. package/uni-components/chat-control/expression/expression.vue +41 -0
  72. package/uni-components/chat-control/image/image.vue +68 -0
  73. package/uni-components/chat-control/index.js +89 -0
  74. package/uni-components/chat-control/location/location.vue +110 -0
  75. package/uni-components/chat-control/member-change/member-change.vue +32 -0
  76. package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
  77. package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
  78. package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
  79. package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
  80. package/uni-components/chat-control/share-card/share-card.vue +101 -0
  81. package/uni-components/chat-control/system/system.vue +69 -0
  82. package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
  83. package/uni-components/chat-control/system-text/system-text.vue +32 -0
  84. package/uni-components/chat-control/text/text.vue +67 -0
  85. package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
  86. package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
  87. package/uni-components/chat-control/transfer/transfer.vue +80 -0
  88. package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
  89. package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
  90. package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
  91. package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
  92. package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
  93. package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
  94. package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
  95. package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
  96. package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
  97. package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
  98. package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
  99. package/uni-components/chat-control/url/icons/index.js +24 -0
  100. package/uni-components/chat-control/url/miniprogram.svg +1 -0
  101. package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
  102. package/uni-components/chat-control/url/url.vue +306 -0
  103. package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
  104. package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
  105. package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
  106. package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
  107. package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
  108. package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
  109. package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
  110. package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
  111. package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
  112. package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
  113. package/uni-components/chat-control/url-new/icons/index.js +24 -0
  114. package/uni-components/chat-control/url-new/url-new.vue +110 -0
  115. package/uni-components/chat-control/utils.js +12 -0
  116. package/uni-components/chat-control/video/video.vue +156 -0
  117. package/uni-components/chat-control/voice/voice.vue +166 -0
  118. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
  119. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
  120. package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
  121. package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
  122. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
  123. package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
  124. package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
  125. package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
  126. package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
  127. package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
  128. package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
  129. package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
  130. package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
  131. package/uni-components/chat-editor/chat-editor.vue +257 -0
  132. package/uni-components/chat-editor/index.js +10 -0
  133. package/uni-components/chat-editor/util.js +65 -0
  134. package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
  135. package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
  136. package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
  137. package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
  138. package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
  139. package/uni-components/chat-panel/chat-panel.vue +227 -0
  140. package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
  141. package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
  142. package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
  143. package/common/.DS_Store +0 -0
  144. package/components/.DS_Store +0 -0
  145. package/components/wechat-chat-control/.DS_Store +0 -0
  146. package/components/wechat-chat-control/transfer/.DS_Store +0 -0
  147. package/components/wechat-chat-control/url/.DS_Store +0 -0
  148. package/components/wechat-chat-control/voice/.DS_Store +0 -0
  149. package/components/wework-chat-control/channel-card/channel-card.vue +0 -144
  150. package/components/wework-chat-control/link/.DS_Store +0 -0
  151. package/components/wework-chat-control/merge-message/merge-message-panel.vue +0 -63
  152. package/components/wework-chat-control/merge-message/merge-message.vue +0 -84
  153. package/components/wework-chat-control/merge-message/util.js +0 -59
  154. package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
  155. package/components/wework-chat-control/metting/meeting-video.svg +0 -4
  156. package/components/wework-chat-control/metting/metting.vue +0 -181
  157. package/components/wework-chat-control/text/text-default.vue +0 -99
  158. package/components/wework-chat-control/text/text-quote.vue +0 -105
  159. package/components/wework-chat-control/url/url-channel-live.vue +0 -53
  160. package/components/wework-chat-control/video/.DS_Store +0 -0
  161. package/components/wework-chat-control/wework-chat-control-config-item.vue +0 -24
  162. package/components/wework-chat-control/wework-chat-control-config-msg.vue +0 -25
  163. package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +0 -73
  164. package/services/.DS_Store +0 -0
@@ -1,181 +0,0 @@
1
- <template>
2
- <div class="sdk-chat-wework-control-metting" :class="'sdk-chat-wework-control-metting--' + type">
3
- <template v-if="type === 'default' || type === 'thumb'">
4
- <div class="sdk-chat-wework-control-metting__card">
5
- <div class="sdk-chat-wework-control-metting__main">
6
- <div class="sdk-chat-wework-control-metting__info">
7
- <div class="sdk-chat-wework-control-metting__title">{{ title }}</div>
8
- <div class="sdk-chat-wework-control-metting__description">{{ description }}</div>
9
- <div class="sdk-chat-wework-control-metting__initiator" v-if="initiatorText">{{ initiatorText }}</div>
10
- </div>
11
- <div class="sdk-chat-wework-control-metting__video-icon">
12
- <img src="./meeting-video.svg" alt="会议" />
13
- </div>
14
- </div>
15
- <div class="sdk-chat-wework-control-metting__brand">
16
- <img src="./enterprise-wechat.png" alt="" />
17
- <span>企业微信</span>
18
- </div>
19
- </div>
20
- </template>
21
- <template v-else-if="type === 'quote'">
22
- <div class="sdk-chat-wework-control-metting__quote-icon">
23
- <img src="./meeting-video.svg" alt="会议" />
24
- </div>
25
- <div class="sdk-chat-wework-control-metting__quote-title">{{ title }}</div>
26
- </template>
27
- </div>
28
- </template>
29
- <script>
30
- import { parse } from '../../../utils/json'
31
-
32
- export default {
33
- name: 'SdkChatControlMetting',
34
- props: {
35
- id: {
36
- type: String
37
- },
38
- content: {
39
- type: [String, Object]
40
- },
41
- initiator: {
42
- type: String
43
- },
44
- updateChatBoxProp: {
45
- type: Function
46
- },
47
- type: {
48
- type: String,
49
- default: 'default',
50
- validator (value) {
51
- return ['quote', 'default', 'thumb'].includes(value)
52
- }
53
- }
54
- },
55
- computed: {
56
- nextContent () {
57
- return parse(this.content) || {}
58
- },
59
- title () {
60
- return this.nextContent.title || '企业微信会议'
61
- },
62
- description () {
63
- return this.nextContent.desc || '会议已开始,请尽快入会'
64
- },
65
- initiatorText () {
66
- return this.initiator ? `发起人:${this.initiator}` : ''
67
- },
68
- url () {
69
- return this.nextContent.url
70
- }
71
- },
72
- created () {
73
- if (this.url && this.updateChatBoxProp) {
74
- this.updateChatBoxProp('href', this.url)
75
- }
76
- }
77
- }
78
- </script>
79
- <style lang="less">
80
- .sdk-chat-wework-control-metting {
81
- display: inline-block;
82
- max-width: 100%;
83
- color: #222;
84
- }
85
- .sdk-chat-wework-control-metting__card {
86
- width: 248px;
87
- max-width: 100%;
88
- padding: 10px 10px 8px;
89
- box-sizing: border-box;
90
- border-radius: 6px;
91
- background-color: #f1f1f3;
92
- }
93
- .sdk-chat-wework-control-metting__main {
94
- display: flex;
95
- align-items: center;
96
- }
97
- .sdk-chat-wework-control-metting__info {
98
- flex: 1;
99
- min-width: 0;
100
- min-height: 64px;
101
- }
102
- .sdk-chat-wework-control-metting__title {
103
- overflow: hidden;
104
- color: #222;
105
- font-size: 14px;
106
- font-weight: 500;
107
- line-height: 20px;
108
- text-overflow: ellipsis;
109
- white-space: nowrap;
110
- margin-bottom: 6px;
111
- }
112
- .sdk-chat-wework-control-metting__description,
113
- .sdk-chat-wework-control-metting__initiator {
114
- overflow: hidden;
115
- color: #8a8a8a;
116
- font-size: 12px;
117
- line-height: 17px;
118
- text-overflow: ellipsis;
119
- white-space: nowrap;
120
- }
121
- .sdk-chat-wework-control-metting__video-icon {
122
- display: flex;
123
- align-items: center;
124
- justify-content: center;
125
- width: 48px;
126
- height: 48px;
127
- min-width: 48px;
128
- margin-left: 10px;
129
- border-radius: 3px;
130
- background-color: #4b91f1;
131
- img {
132
- width: 26px;
133
- height: 26px;
134
- }
135
- }
136
- .sdk-chat-wework-control-metting__brand {
137
- display: flex;
138
- align-items: center;
139
- height: 18px;
140
- margin-top: 6px;
141
- color: #999;
142
- font-size: 12px;
143
- line-height: 18px;
144
- img {
145
- width: 15px;
146
- height: 15px;
147
- margin-right: 4px;
148
- }
149
- }
150
- .sdk-chat-wework-control-metting--thumb {
151
- width: 100%;
152
- .sdk-chat-wework-control-metting__card {
153
- width: 100%;
154
- }
155
- }
156
- .sdk-chat-wework-control-metting--quote {
157
- display: flex;
158
- align-items: center;
159
- max-width: 320px;
160
- .sdk-chat-wework-control-metting__quote-icon {
161
- display: flex;
162
- align-items: center;
163
- justify-content: center;
164
- width: 22px;
165
- height: 22px;
166
- min-width: 22px;
167
- margin-right: 6px;
168
- border-radius: 2px;
169
- background-color: #4b91f1;
170
- img {
171
- width: 14px;
172
- height: 14px;
173
- }
174
- }
175
- .sdk-chat-wework-control-metting__quote-title {
176
- overflow: hidden;
177
- text-overflow: ellipsis;
178
- white-space: nowrap;
179
- }
180
- }
181
- </style>
@@ -1,99 +0,0 @@
1
- <template>
2
- <div class="sdk-chat-wework-control-text" :class="['sdk-chat-wework-control-text--' + type]">
3
- <div class="sdk-chat-wework-control-text__main">
4
- <template v-if="hasScroll">
5
- <ui-popover :value="showPopover" @input="handleShowPopoverChange">
6
- <template slot="reference">
7
- <div class="sdk-chat-wework-control-text__content" v-html="html" ref="popoverContent"></div>
8
- </template>
9
- <div class="sdk-chat-wework-control-text__popover" v-html="html" :style="{'width': popoverWidth}"></div>
10
- </ui-popover>
11
- </template>
12
- <template v-else>
13
- <div class="sdk-chat-wework-control-text__content" v-html="html" ref="content"></div>
14
- </template>
15
- </div>
16
- </div>
17
- </template>
18
- <script>
19
- import {Popover as UiPopover} from '@aochuang/common/components'
20
- import {parseWechatEmoji} from '@aochuang/common/common/wechat-emoji'
21
- import {html2Escape} from '../../../utils/string'
22
-
23
- function parseTextContent (content) {
24
- if (typeof content !== 'string') return content
25
- try {
26
- const data = JSON.parse(content)
27
- return data && typeof data === 'object' ? data : content
28
- } catch (e) {
29
- return content
30
- }
31
- }
32
-
33
- export default {
34
- name: 'SdkChatControlTextDefault',
35
- components: {UiPopover},
36
- props: {
37
- id: {type: String},
38
- content: {type: [String, Object]},
39
- type: {
40
- type: String,
41
- default: 'default',
42
- validator (value) { return ['quote', 'default', 'thumb'].includes(value) }
43
- },
44
- formatter: {type: Function}
45
- },
46
- data () {
47
- return {hasScroll: false, showPopover: false, popoverWidth: null}
48
- },
49
- computed: {
50
- nextContent () { return parseTextContent(this.content) },
51
- text () {
52
- return this.nextContent && typeof this.nextContent === 'object' ? this.nextContent.text || '' : this.nextContent
53
- },
54
- html () {
55
- let content = this.formatter ? this.formatter({content: this.nextContent}) : parseWechatEmoji(html2Escape(String(this.text || '')), false)
56
- if (!content) return ''
57
- content = String(content).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, item => `<a href="${item}" target='_blank'>${item}</a>`)
58
- return content.trim()
59
- }
60
- },
61
- mounted () {
62
- if (this.$refs.content) this.hasScroll = this.$refs.content.scrollHeight > this.$refs.content.clientHeight
63
- },
64
- methods: {
65
- handleShowPopoverChange (visible) {
66
- if (this.$refs.popoverContent && visible) this.popoverWidth = this.$refs.popoverContent.offsetWidth + 'px'
67
- this.$nextTick(() => { this.showPopover = visible })
68
- }
69
- }
70
- }
71
- </script>
72
- <style lang="less">
73
- .sdk-chat-wework-control-text--default .sdk-chat-wework-control-text__main { padding: 10px; }
74
- .sdk-chat-wework-control-text--quote .sdk-chat-wework-control-text__content {
75
- display: -webkit-box;
76
- -webkit-box-orient: vertical;
77
- -webkit-line-clamp: 2;
78
- overflow: hidden;
79
- max-width: 420px;
80
- }
81
- .sdk-chat-wework-control-text--thumb {
82
- background-color: #fff;
83
- border: 1px solid #eee;
84
- border-radius: 3px;
85
- padding: 6px 10px;
86
- }
87
- .sdk-chat-wework-control-text--thumb .sdk-chat-wework-control-text__content {
88
- display: -webkit-box;
89
- -webkit-box-orient: vertical;
90
- -webkit-line-clamp: 3;
91
- overflow: hidden;
92
- }
93
- .sdk-chat-wework-control-text__main { white-space: pre-wrap; line-height: 1.5em; word-break: break-all; }
94
- .sdk-chat-wework-control-text__main img { vertical-align: top; }
95
- .sdk-chat-wework-control-text__main a { color: #4387ff; }
96
- .sdk-chat-wework-control-text__main a:hover { color: #4387ff; text-decoration: underline; }
97
- .sdk-chat-wework-control-text__popover { white-space: pre-wrap; line-height: 1.5em; word-break: break-all; padding: 10px; }
98
- .sdk-chat-wework-control-text__popover img { vertical-align: top; }
99
- </style>
@@ -1,105 +0,0 @@
1
- <template>
2
- <div class="sdk-chat-wework-control-text-quote" :class="['sdk-chat-wework-control-text-quote--' + type]">
3
- <text-default :id="id" :content="mainContent" :type="type" :formatter="formatter"></text-default>
4
- </div>
5
- </template>
6
- <script>
7
- import {parse} from '../../../utils/json'
8
- import {chatControls} from '../index'
9
- import WeworkChatControlConfigMsg from '../wework-chat-control-config-msg.vue'
10
- import TextDefault from './text-default.vue'
11
-
12
- function parseQuoteContent (content) {
13
- if (content && typeof content === 'object') return content
14
- const parsed = parse(content, {})
15
- if (!parsed || typeof parsed !== 'object' || !parsed.quote || typeof content !== 'string') return parsed
16
- // JSON.parse converts large企微 message IDs to imprecise Numbers. Restore the
17
- // original digit sequence before it is sent to the detail endpoint.
18
- const match = content.match(/"messageId"\s*:\s*(?:"([^"]+)"|([0-9]+))/)
19
- if (match) parsed.quote.messageId = match[1] || match[2]
20
- return parsed
21
- }
22
-
23
- export default {
24
- name: 'SdkChatControlTextQuote',
25
- components: {TextDefault, WeworkChatControlConfigMsg},
26
- props: {
27
- id: {type: String},
28
- content: {type: [String, Object]},
29
- type: {type: String, default: 'default'},
30
- formatter: {type: Function},
31
- getQuoteMessage: {type: Function},
32
- setChatBoxFootVnode: {type: Function}
33
- },
34
- data () { return {loading: false, quoteMessageData: null, errorMsg: null} },
35
- computed: {
36
- contentObject () {
37
- return parseQuoteContent(this.content)
38
- },
39
- quoteInfo () { return this.contentObject.quote || {} },
40
- mainContent () {
41
- const value = Object.assign({}, this.contentObject)
42
- delete value.quote
43
- return JSON.stringify(value)
44
- },
45
- quoteText () { return this.quoteInfo.text || '引用消息' },
46
- quoteAuthor () {
47
- const message = this.quoteMessageData || {}
48
- return this.quoteInfo.sendName || message.userName || message.contactName || message.roomName || this.quoteInfo.sendId || '引用消息'
49
- },
50
- quoteControl () {
51
- return chatControls[this.quoteMessageData && this.quoteMessageData.msgType] || TextDefault
52
- },
53
- quoteFootComponent () {
54
- return {
55
- render: h => {
56
- const content = [h('div', {class: 'sdk-chat-wework-control-text-quote__author'}, [this.quoteAuthor])]
57
- if (this.loading) {
58
- content.push(h('div', {class: 'sdk-chat-wework-control-text-quote__status'}, ['引用内容正在加载中...']))
59
- } else if (this.quoteMessageData) {
60
- content.push(h(WeworkChatControlConfigMsg, {
61
- props: {msgData: this.quoteMessageData},
62
- scopedSlots: {
63
- default: ({configData}) => h(this.quoteControl, {
64
- props: Object.assign({}, configData, {id: this.id + '_quote', content: this.quoteMessageData.content, type: 'quote'})
65
- })
66
- }
67
- }))
68
- } else {
69
- content.push(h('div', {class: 'sdk-chat-wework-control-text-quote__content'}, [this.quoteText]))
70
- if (this.errorMsg) content.push(h('div', {class: 'sdk-chat-wework-control-text-quote__status'}, [this.errorMsg]))
71
- }
72
- return h('div', {class: 'sdk-chat-wework-control-text-quote__box'}, content)
73
- }
74
- }
75
- }
76
- },
77
- created () {
78
- if (this.setChatBoxFootVnode) this.setChatBoxFootVnode(this.quoteFootComponent)
79
- if (!this.getQuoteMessage || !this.quoteInfo.messageId || !this.quoteInfo.sendTime) {
80
- this.errorMsg = '未找到引用消息内容,请在手机中确认'
81
- return
82
- }
83
- this.loading = true
84
- this.getQuoteMessage({
85
- msgId: String(this.quoteInfo.messageId),
86
- sendTime: this.quoteInfo.sendTime,
87
- content: this.quoteInfo
88
- }).then(data => {
89
- this.quoteMessageData = data && data.data ? data.data : data
90
- if (!this.quoteMessageData) this.errorMsg = '未找到引用消息内容,请在手机中确认'
91
- if (this.setChatBoxFootVnode) this.setChatBoxFootVnode(this.quoteFootComponent)
92
- }).catch(() => {
93
- this.errorMsg = '未找到引用消息内容,请在手机中确认'
94
- if (this.setChatBoxFootVnode) this.setChatBoxFootVnode(this.quoteFootComponent)
95
- }).finally(() => { this.loading = false })
96
- }
97
- }
98
- </script>
99
- <style lang="less">
100
- .sdk-chat-wework-control-text-quote { min-width: 0; }
101
- .sdk-chat-wework-control-text-quote__box { margin: 10px 0 0; padding: 7px 8px; background: rgba(0, 0, 0, .06); border-radius: 3px; max-width: 420px; line-height: 1.5em; }
102
- .sdk-chat-wework-control-text-quote__author { color: #999; word-break: break-all; }
103
- .sdk-chat-wework-control-text-quote__content, .sdk-chat-wework-control-text-quote__status { white-space: pre-wrap; word-break: break-all; }
104
- .sdk-chat-wework-control-text-quote__status { color: #999; font-size: 12px; }
105
- </style>
@@ -1,53 +0,0 @@
1
- <script>
2
- import { parse } from '../../../utils/json'
3
- import ChannelLive from '../channel-live/channel-live'
4
-
5
- export default {
6
- name: 'SdkWeworkControlUrlChannelLive',
7
- props: {
8
- id: {
9
- type: String
10
- },
11
- content: {
12
- type: [String, Object]
13
- },
14
- type: {
15
- type: String,
16
- default: 'default',
17
- validator (value) {
18
- return ['quote', 'default', 'thumb'].includes(value)
19
- }
20
- },
21
- updateChatBoxProp: {
22
- type: Function
23
- }
24
- },
25
- computed: {
26
- nextContent () {
27
- return parse(this.content) || {}
28
- },
29
- channelLiveContent () {
30
- return {
31
- url: this.nextContent.url,
32
- coverUrl: this.nextContent.imageUrl,
33
- nickname: this.nextContent.desc,
34
- desc: (this.nextContent.title || '').replace(/^\[视频号直播\]\s*/, '')
35
- }
36
- }
37
- },
38
- created () {
39
- if (this.nextContent.url && this.updateChatBoxProp) {
40
- this.updateChatBoxProp('href', this.nextContent.url)
41
- }
42
- },
43
- render (h) {
44
- return h(ChannelLive, {
45
- props: {
46
- id: this.id,
47
- content: this.channelLiveContent,
48
- type: this.type
49
- }
50
- })
51
- }
52
- }
53
- </script>
@@ -1,24 +0,0 @@
1
- <script>
2
- export default {
3
- name: 'SdkWeworkChatControlConfigItem',
4
- functional: true,
5
- inject: {
6
- SdkWeworkChatControlConfig: {
7
- default: null
8
- }
9
- },
10
- props: {
11
- /**
12
- * 消息类型
13
- */
14
- msgType: {
15
- type: [Number, String]
16
- }
17
- },
18
- render (h, c) {
19
- return c.scopedSlots.default({
20
- configData: c.injections.SdkWeworkChatControlConfig ? c.injections.SdkWeworkChatControlConfig.getControlConfig(c.props.msgType) : null
21
- })
22
- }
23
- }
24
- </script>
@@ -1,25 +0,0 @@
1
- <script>
2
- export default {
3
- name: 'SdkWeworkChatControlConfigMsg',
4
- functional: true,
5
- inject: {
6
- SdkWeworkChatControlConfig: {
7
- default: null
8
- }
9
- },
10
- props: {
11
- /**
12
- * 标准的企微客户端消息数据
13
- */
14
- msgData: {
15
- type: Object,
16
- required: true
17
- }
18
- },
19
- render (h, c) {
20
- return c.scopedSlots.default({
21
- configData: c.injections.SdkWeworkChatControlConfig ? c.injections.SdkWeworkChatControlConfig.getMessageConfig(c.props.msgData) : null
22
- })
23
- }
24
- }
25
- </script>
@@ -1,73 +0,0 @@
1
- <template>
2
- <div class="sdk-wework-panel-chat-status">
3
- <!-- status: 0 success, 1 sending, 2 failed, 3 timeout -->
4
- <template v-if="data.status === 1">
5
- <ui-loading size="mini"></ui-loading>
6
- </template>
7
- <template v-else-if="data.status === 2">
8
- <bi-tooltip :text="data.resultMsg || '发送失败'">
9
- <span class="sdk-wework-panel-chat-status__error">
10
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m0-486.997334L391.338667 330.965333 330.965333 391.338667 451.669333 512l-120.704 120.661333 60.373334 60.373334L512 572.330667l120.661333 120.704 60.373334-60.373334L572.330667 512l120.704-120.661333-60.373334-60.373334L512 451.669333z" fill="currentColor"></path></svg>
11
- </span>
12
- </bi-tooltip>
13
- </template>
14
- <template v-else-if="data.status === 3">
15
- <bi-tooltip :text="data.resultMsg || '发送超时'">
16
- <span class="sdk-wework-panel-chat-status__error">
17
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m42.666667-426.666667V298.666667h-85.333334v298.666666h256v-85.333333h-170.666666z" fill="currentColor"></path></svg>
18
- </span>
19
- </bi-tooltip>
20
- </template>
21
- <template v-if="data.recalled">
22
- <bi-tooltip text="消息已撤回">
23
- <span class="sdk-wework-panel-chat-status__error sdk-wework-panel-chat-status__recalled">
24
- <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0c282.752 0 512 229.248 512 512s-229.248 512-512 512S0 794.752 0 512 229.248 0 512 0z m-50.261333 255.317333c-7.765333-39.338667-39.893333-15.36-39.893334-15.36l-213.76 192c-47.616 34.944-2.730667 60.458667-2.730666 60.458667l211.541333 190.933333c42.410667 33.066667 45.866667-17.749333 45.866667-17.749333v-86.442667c215.125333-70.144 303.36 208.341333 303.36 208.341334 7.936 15.957333 13.824 0 13.824 0C862.933333 368.682667 461.952 348.586667 461.952 348.586667z" fill="currentColor"></path></svg>
25
- </span>
26
- </bi-tooltip>
27
- </template>
28
- </div>
29
- </template>
30
-
31
- <script>
32
- import { Tooltip as BiTooltip } from '@aochuang/common/common'
33
- import { Loading as UiLoading } from '@aochuang/common/components'
34
-
35
- export default {
36
- name: 'SdkWeworkPanelChatStatus',
37
- components: {
38
- BiTooltip,
39
- UiLoading
40
- },
41
- props: {
42
- data: {
43
- type: Object,
44
- required: true
45
- },
46
- updateChatBoxProp: {
47
- type: Function
48
- }
49
- }
50
- }
51
- </script>
52
-
53
- <style lang="less">
54
- .sdk-wework-panel-chat-status__error {
55
- display: flex;
56
- flex-direction: row;
57
- align-items: center;
58
- font-size: 12px;
59
- color: #c00;
60
- width: 16px;
61
- height: 16px;
62
- svg {
63
- width: 100%;
64
- height: 100%;
65
- }
66
- }
67
- .sdk-wework-panel-chat-status__recalled {
68
- opacity: .6;
69
- }
70
- .sdk-wework-panel-chat-status {
71
- margin: 0 6px;
72
- }
73
- </style>
Binary file