@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.
- package/components/chat-editor/chat-editor-suggestions/chat-editor-suggestions.vue +40 -4
- package/components/chat-editor/chat-editor.vue +75 -5
- package/components/index.js +1 -6
- package/components/session-select/session-select-item.vue +9 -8
- package/components/wechat-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/channel-live/channel-live.vue +2 -7
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/custom-expression/custom-expression.vue +1 -2
- package/components/wework-chat-control/file-url/file-url.vue +16 -34
- package/components/wework-chat-control/image/image.vue +2 -137
- package/components/wework-chat-control/index.js +7 -15
- package/components/wework-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/red-envelopes/red-envelopes.vue +2 -3
- package/components/wework-chat-control/text/text.vue +144 -24
- package/components/wework-chat-control/url/url-miniprogram.vue +7 -6
- package/components/wework-chat-control/url/url.vue +2 -26
- package/components/wework-chat-control/util.js +17 -26
- package/components/wework-chat-control/video/video.vue +2 -10
- package/components/wework-chat-control/voice/voice.vue +2 -9
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
- package/components/wework-chat-panel/chat-panel-item.vue +25 -56
- package/components/wework-chat-panel/chat-panel.vue +13 -96
- package/package.json +3 -10
- package/services/client-chat/client-chat-wechat/client-chat-message.js +15 -5
- package/services/client-chat/client-chat-wechat/client-chat-session.js +13 -50
- package/services/client-chat/client-chat-wechat/client-chat.js +4 -48
- 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
- package/services/client-chat/client-chat-wework/client-chat-account.js +1 -84
- package/services/client-chat/client-chat-wework/client-chat-concats.js +17 -81
- package/services/client-chat/client-chat-wework/client-chat-message.js +5 -45
- package/services/client-chat/client-chat-wework/client-chat-session.js +4 -59
- package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -13
- package/services/client-chat/client-chat-wework/client-chat.js +11 -320
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/uni-common/account-portray/account-portray.vue +51 -0
- package/uni-common/account-select/account-select-item.vue +172 -0
- package/uni-common/account-select/account-select.vue +252 -0
- package/uni-common/all-friend-avatar/all-friend-avatar.vue +49 -0
- package/uni-common/friend-avatar/default.svg +1 -0
- package/uni-common/friend-avatar/friend-avatar.vue +27 -0
- package/uni-common/friend-avatar/index.js +3 -0
- package/uni-common/friend-loader/friend-loader.vue +53 -0
- package/uni-common/friend-portray/friend-portray.vue +56 -0
- package/uni-common/group-avatar/default.svg +1 -0
- package/uni-common/group-avatar/group-avatar.vue +18 -0
- package/uni-common/group-avatar/index.js +3 -0
- package/uni-common/room-avatar/default.svg +6 -0
- package/uni-common/room-avatar/index.js +3 -0
- package/uni-common/room-avatar/room-avatar.vue +27 -0
- package/uni-common/room-loader/room-loader.vue +53 -0
- package/uni-common/room-portray/room-portray.vue +56 -0
- package/uni-components/chat-control/calling/calling.vue +91 -0
- package/uni-components/chat-control/calling/phone-fill.svg +1 -0
- package/uni-components/chat-control/calling/vidicon-fill.svg +1 -0
- package/uni-components/chat-control/channel-video/channel-video.vue +89 -0
- package/uni-components/chat-control/channel-video-card/channel-video-card.vue +105 -0
- package/uni-components/chat-control/channel-video-live/channel-video-live.vue +92 -0
- package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +20 -0
- package/uni-components/chat-control/chat-control-config-item/index.js +3 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +25 -0
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +21 -0
- package/{components/wework-chat-control/wework-chat-control-config.vue → uni-components/chat-control/chat-control-config.vue} +13 -16
- package/uni-components/chat-control/chat-control.vue +218 -0
- package/uni-components/chat-control/company-card/company-card.vue +123 -0
- package/uni-components/chat-control/const.js +28 -0
- package/uni-components/chat-control/expression/expression.vue +41 -0
- package/uni-components/chat-control/image/image.vue +68 -0
- package/uni-components/chat-control/index.js +89 -0
- package/uni-components/chat-control/location/location.vue +110 -0
- package/uni-components/chat-control/member-change/member-change.vue +32 -0
- package/uni-components/chat-control/quote-message/quote-message.vue +216 -0
- package/uni-components/chat-control/real-time-position/real-time-position.vue +62 -0
- package/uni-components/chat-control/redpacket/red-envelope.svg +1 -0
- package/uni-components/chat-control/redpacket/redpacket.vue +75 -0
- package/uni-components/chat-control/share-card/share-card.vue +101 -0
- package/uni-components/chat-control/system/system.vue +69 -0
- package/uni-components/chat-control/system-batch-message/system-batch-message.vue +30 -0
- package/uni-components/chat-control/system-text/system-text.vue +32 -0
- package/uni-components/chat-control/text/text.vue +67 -0
- package/uni-components/chat-control/text-with-at/text-with-at.vue +51 -0
- package/uni-components/chat-control/transfer/red-transfer.svg +1 -0
- package/uni-components/chat-control/transfer/transfer.vue +80 -0
- package/uni-components/chat-control/unkonw/unkonw.vue +37 -0
- package/uni-components/chat-control/url/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url/icons/index.js +24 -0
- package/uni-components/chat-control/url/miniprogram.svg +1 -0
- package/uni-components/chat-control/url/url-miniprogram.vue +116 -0
- package/uni-components/chat-control/url/url.vue +306 -0
- package/uni-components/chat-control/url-new/icons/file-excel-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-info-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-music-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-settings-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-text-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-word-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/file-zip-line.svg +1 -0
- package/uni-components/chat-control/url-new/icons/index.js +24 -0
- package/uni-components/chat-control/url-new/url-new.vue +110 -0
- package/uni-components/chat-control/utils.js +12 -0
- package/uni-components/chat-control/video/video.vue +156 -0
- package/uni-components/chat-control/voice/voice.vue +166 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +84 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +28 -0
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +85 -0
- package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +157 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +158 -0
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +61 -0
- package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +58 -0
- package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +54 -0
- package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +42 -0
- package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +25 -0
- package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +158 -0
- package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +75 -0
- package/uni-components/chat-editor/chat-editor.vue +257 -0
- package/uni-components/chat-editor/index.js +10 -0
- package/uni-components/chat-editor/util.js +65 -0
- package/uni-components/chat-panel/chat-panel-chats-box.vue +238 -0
- package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +273 -0
- package/uni-components/chat-panel/chat-panel-chats-item.vue +578 -0
- package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +71 -0
- package/uni-components/chat-panel/chat-panel-chats.vue +368 -0
- package/uni-components/chat-panel/chat-panel.vue +227 -0
- package/uni-components/contacts-group-select/contacts-group-select-item.vue +85 -0
- package/uni-components/contacts-group-select/contacts-group-select-panel.vue +119 -0
- package/uni-components/contacts-group-select/contacts-group-select.vue +150 -0
- package/common/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/wechat-chat-control/.DS_Store +0 -0
- package/components/wechat-chat-control/transfer/.DS_Store +0 -0
- package/components/wechat-chat-control/url/.DS_Store +0 -0
- package/components/wechat-chat-control/voice/.DS_Store +0 -0
- package/components/wework-chat-control/channel-card/channel-card.vue +0 -144
- package/components/wework-chat-control/link/.DS_Store +0 -0
- package/components/wework-chat-control/merge-message/merge-message-panel.vue +0 -63
- package/components/wework-chat-control/merge-message/merge-message.vue +0 -84
- package/components/wework-chat-control/merge-message/util.js +0 -59
- package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
- package/components/wework-chat-control/metting/meeting-video.svg +0 -4
- package/components/wework-chat-control/metting/metting.vue +0 -181
- package/components/wework-chat-control/text/text-default.vue +0 -99
- package/components/wework-chat-control/text/text-quote.vue +0 -105
- package/components/wework-chat-control/url/url-channel-live.vue +0 -53
- package/components/wework-chat-control/video/.DS_Store +0 -0
- package/components/wework-chat-control/wework-chat-control-config-item.vue +0 -24
- package/components/wework-chat-control/wework-chat-control-config-msg.vue +0 -25
- package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +0 -73
- package/services/.DS_Store +0 -0
|
@@ -19,9 +19,6 @@ import jxSysText from './jx-sys-text/jx-sys-text.vue'
|
|
|
19
19
|
// import textWithAt from './text-with-at/text-with-at.vue'
|
|
20
20
|
import channelVideo from './channel-video/channel-video.vue'
|
|
21
21
|
import channelLive from './channel-live/channel-live.vue'
|
|
22
|
-
import metting from './metting/metting.vue'
|
|
23
|
-
import mergeMessage from './merge-message/merge-message.vue'
|
|
24
|
-
import mergeMessagePanel from './merge-message/merge-message-panel.vue'
|
|
25
22
|
// import channelVideoCard from './channel-video-card/channel-video-card.vue'
|
|
26
23
|
// import music from './music/music.vue'
|
|
27
24
|
// import transfer from './transfer/transfer.vue'
|
|
@@ -29,9 +26,9 @@ import url from './url/url.vue'
|
|
|
29
26
|
// import quoteMessage from './quote-message/quote-message.vue'
|
|
30
27
|
import empty from './empty/empty.vue'
|
|
31
28
|
import unknow from './unknow/unknow.vue'
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
29
|
+
// import WechatChatControlConfig from './wechat-chat-control-config.vue'
|
|
30
|
+
// import WechatChatControlConfigMsg from './wechat-chat-control-config-msg.vue'
|
|
31
|
+
// import WechatChatControlConfigItem from './wechat-chat-control-config-item.vue'
|
|
35
32
|
// import revokeMeMessage from './revoke-me-message/revoke-me-message.vue'
|
|
36
33
|
// import revokeOtherMessage from './revoke-other-message/revoke-other-message.vue'
|
|
37
34
|
// import revokeYouMessage from './revoke-you-message/revoke-you-message.vue'
|
|
@@ -48,8 +45,8 @@ export const chatControls = {
|
|
|
48
45
|
[MESSAGE_TYPE.COMPANY_CARD]: companyCard,
|
|
49
46
|
[MESSAGE_TYPE.VIDEO]: video,
|
|
50
47
|
[MESSAGE_TYPE.CUSTOM_EXPRESSION]: customExpression,
|
|
48
|
+
[MESSAGE_TYPE.CUSTOM_EXPRESSION_W]: customExpression,
|
|
51
49
|
[MESSAGE_TYPE.LOCATION]: location,
|
|
52
|
-
[MESSAGE_TYPE.URLFile]: fileUrl,
|
|
53
50
|
[MESSAGE_TYPE.URL]: url,
|
|
54
51
|
[MESSAGE_TYPE.URLNew]: fileUrl,
|
|
55
52
|
// [MESSAGE_TYPE.CALLING]: calling,
|
|
@@ -65,8 +62,6 @@ export const chatControls = {
|
|
|
65
62
|
[MESSAGE_TYPE.CHANNEL_VIDEO]: channelVideo,
|
|
66
63
|
// [MESSAGE_TYPE.CHANNEL_VIDEO_CARD]: channelVideoCard, // 视频号名片
|
|
67
64
|
[MESSAGE_TYPE.CHANNEL_VIDEO_LIVE]: channelLive, // 视频号直播
|
|
68
|
-
[MESSAGE_TYPE.MEETING]: metting,
|
|
69
|
-
[MESSAGE_TYPE.MERGE_MESSAGE]: mergeMessage,
|
|
70
65
|
// [MESSAGE_TYPE.SYSTEM_BATCH_MESSAGE]: systemBatchMessage,
|
|
71
66
|
// [MESSAGE_TYPE.REVOKE_ME_MESSAGE]: revokeMeMessage,
|
|
72
67
|
// [MESSAGE_TYPE.REVOKE_OTHER_MESSAGE]: revokeOtherMessage,
|
|
@@ -98,9 +93,6 @@ export {
|
|
|
98
93
|
channelVideo, // 视频号
|
|
99
94
|
// channelVideoCard,
|
|
100
95
|
channelLive, // 视频号直播
|
|
101
|
-
metting,
|
|
102
|
-
mergeMessage,
|
|
103
|
-
mergeMessagePanel,
|
|
104
96
|
// music,
|
|
105
97
|
// transfer,
|
|
106
98
|
empty,
|
|
@@ -108,7 +100,7 @@ export {
|
|
|
108
100
|
// revokeMeMessage,
|
|
109
101
|
// revokeOtherMessage,
|
|
110
102
|
// revokeYouMessage,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
// WechatChatControlConfig,
|
|
104
|
+
// WechatChatControlConfigMsg,
|
|
105
|
+
// WechatChatControlConfigItem
|
|
114
106
|
}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div class="sdk-chat-wework-control-location__body">
|
|
10
10
|
<div v-if="offline" class="sdk-chat-wework-control-location__offline">
|
|
11
|
-
<div class="sdk-chat-wework-control-location__offline-label"
|
|
11
|
+
<div class="sdk-chat-wework-control-location__offline-label">腾讯地图经纬度坐标:</div>
|
|
12
12
|
<div class="sdk-chat-wework-control-location__offline-value">{{longitude}}、{{latitude}}</div>
|
|
13
13
|
<div class="sdk-chat-wework-control-location__offline-tips">提示:离线模式无法显示地图</div>
|
|
14
14
|
</div>
|
|
15
|
-
<ac-static-map
|
|
15
|
+
<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>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<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>
|
|
23
23
|
</span>
|
|
24
24
|
<span class="sdk-chat-wework-control-location__title">{{address}}</span>
|
|
25
|
-
<ac-static-map
|
|
25
|
+
<ac-static-map :map-key="mapKey" :enable-link="false" width="52" height="52" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
</div>
|
|
@@ -63,10 +63,10 @@ export default {
|
|
|
63
63
|
return parse(this.content) || {}
|
|
64
64
|
},
|
|
65
65
|
title () {
|
|
66
|
-
return this.nextContent.
|
|
66
|
+
return this.nextContent.wish
|
|
67
67
|
},
|
|
68
68
|
description () {
|
|
69
|
-
return
|
|
69
|
+
return ''
|
|
70
70
|
},
|
|
71
71
|
category () {
|
|
72
72
|
return '微红包'
|
|
@@ -105,7 +105,6 @@ export default {
|
|
|
105
105
|
flex: 1;
|
|
106
106
|
min-width: 0;
|
|
107
107
|
line-height: 1.3em;
|
|
108
|
-
padding-top: 6px;
|
|
109
108
|
}
|
|
110
109
|
.sdk-wework-control-redpacket__title{
|
|
111
110
|
line-height: 22px;
|
|
@@ -1,37 +1,157 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="sdk-chat-wework-control-text"
|
|
4
|
+
:class="['sdk-chat-wework-control-text--' + type]"
|
|
5
|
+
>
|
|
6
|
+
<div class="sdk-chat-wework-control-text__main">
|
|
7
|
+
<template v-if="hasScroll">
|
|
8
|
+
<ui-popover
|
|
9
|
+
:value="showPopover"
|
|
10
|
+
@input="handleShowPopoverChange"
|
|
11
|
+
>
|
|
12
|
+
<template slot="reference">
|
|
13
|
+
<div class="sdk-chat-wework-control-text__content"
|
|
14
|
+
v-html="html"
|
|
15
|
+
ref="popoverContent"
|
|
16
|
+
></div>
|
|
17
|
+
</template>
|
|
18
|
+
<div class="sdk-chat-wework-control-text__popover" v-html="html" :style="{'width': popoverWidth}"></div>
|
|
19
|
+
</ui-popover>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-else>
|
|
22
|
+
<div class="sdk-chat-wework-control-text__content"
|
|
23
|
+
v-html="html"
|
|
24
|
+
ref="content"
|
|
25
|
+
></div>
|
|
26
|
+
</template>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
6
29
|
</template>
|
|
7
30
|
<script>
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
function parseContent (content) {
|
|
12
|
-
if (typeof content !== 'string') return content
|
|
13
|
-
try { return JSON.parse(content) } catch (e) { return content }
|
|
14
|
-
}
|
|
31
|
+
import { Popover as UiPopover } from '@aochuang/common/components'
|
|
32
|
+
import { html2Escape } from '../../../utils/string'
|
|
15
33
|
|
|
16
34
|
export default {
|
|
17
35
|
name: 'SdkChatControlText',
|
|
18
|
-
components: {
|
|
19
|
-
|
|
36
|
+
components: {
|
|
37
|
+
UiPopover
|
|
38
|
+
},
|
|
20
39
|
props: {
|
|
21
|
-
id: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
id: {
|
|
41
|
+
type: String
|
|
42
|
+
},
|
|
43
|
+
content: {
|
|
44
|
+
type: String
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: 'default',
|
|
49
|
+
validator (value) {
|
|
50
|
+
return ['quote', 'default', 'thumb'].includes(value)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
formatter: {
|
|
54
|
+
type: Function
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
data () {
|
|
58
|
+
return {
|
|
59
|
+
hasScroll: false,
|
|
60
|
+
showPopover: false,
|
|
61
|
+
popoverWidth: null
|
|
62
|
+
}
|
|
27
63
|
},
|
|
28
64
|
computed: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
65
|
+
nextContent () {
|
|
66
|
+
return this.content
|
|
67
|
+
},
|
|
68
|
+
text () {
|
|
69
|
+
return this.nextContent
|
|
70
|
+
},
|
|
71
|
+
html () {
|
|
72
|
+
let content = this.nextContent
|
|
73
|
+
if (this.formatter) {
|
|
74
|
+
content = this.formatter({
|
|
75
|
+
content: this.nextContent
|
|
76
|
+
})
|
|
77
|
+
} else {
|
|
78
|
+
content = html2Escape(content)
|
|
79
|
+
}
|
|
80
|
+
if (!content) {
|
|
81
|
+
return ''
|
|
82
|
+
}
|
|
83
|
+
content = content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, item => {
|
|
84
|
+
return `<a href="${item}" target='_blank'>${item}</a>`
|
|
85
|
+
})
|
|
86
|
+
return content.trim()
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
mounted () {
|
|
90
|
+
if (this.$refs.content) {
|
|
91
|
+
this.hasScroll = this.$refs.content.scrollHeight > this.$refs.content.clientHeight
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
handleShowPopoverChange (visible) {
|
|
96
|
+
if (this.$refs.popoverContent && visible) {
|
|
97
|
+
this.popoverWidth = this.$refs.popoverContent.offsetWidth + 'px'
|
|
98
|
+
}
|
|
99
|
+
this.$nextTick(() => {
|
|
100
|
+
this.showPopover = visible
|
|
101
|
+
})
|
|
34
102
|
}
|
|
35
103
|
}
|
|
36
104
|
}
|
|
37
105
|
</script>
|
|
106
|
+
<style lang="less">
|
|
107
|
+
.sdk-chat-wework-control-text--default {
|
|
108
|
+
.sdk-chat-wework-control-text__main{
|
|
109
|
+
padding: 10px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
.sdk-chat-wework-control-text--quote {
|
|
113
|
+
.sdk-chat-wework-control-text__content{
|
|
114
|
+
display: -webkit-box;
|
|
115
|
+
-webkit-box-orient: vertical;
|
|
116
|
+
-webkit-line-clamp: 2; /* 限制显示3行 */
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
max-width: 420px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.sdk-chat-wework-control-text--thumb {
|
|
122
|
+
background-color: #fff;
|
|
123
|
+
border: 1px solid #eee;
|
|
124
|
+
border-radius: 3px;
|
|
125
|
+
padding: 6px 10px;
|
|
126
|
+
.sdk-chat-wework-control-text__content{
|
|
127
|
+
display: -webkit-box;
|
|
128
|
+
-webkit-box-orient: vertical;
|
|
129
|
+
-webkit-line-clamp: 3; /* 限制显示3行 */
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
.sdk-chat-wework-control-text__main{
|
|
134
|
+
white-space: pre-wrap;
|
|
135
|
+
line-height: 1.5em;
|
|
136
|
+
word-break: break-all;
|
|
137
|
+
img {
|
|
138
|
+
vertical-align: top;
|
|
139
|
+
}
|
|
140
|
+
a {
|
|
141
|
+
color: #4387ff;
|
|
142
|
+
&:hover {
|
|
143
|
+
color: #4387ff;
|
|
144
|
+
text-decoration: underline;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.sdk-chat-wework-control-text__popover{
|
|
149
|
+
white-space: pre-wrap;
|
|
150
|
+
line-height: 1.5em;
|
|
151
|
+
word-break: break-all;
|
|
152
|
+
padding: 10px;
|
|
153
|
+
img {
|
|
154
|
+
vertical-align: top;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
</template>
|
|
52
52
|
<script>
|
|
53
|
-
import { parse } from '../../../utils/json'
|
|
53
|
+
import { parse, parseXml } from '../../../utils/json'
|
|
54
54
|
import { formatOssPath } from '@aochuang/common/utils/oss'
|
|
55
55
|
|
|
56
56
|
export default {
|
|
@@ -76,25 +76,26 @@ export default {
|
|
|
76
76
|
return parse(this.content)
|
|
77
77
|
},
|
|
78
78
|
miniprogramData () {
|
|
79
|
+
let data = null
|
|
79
80
|
if (!this.nextContent) {
|
|
80
|
-
return
|
|
81
|
+
return data
|
|
81
82
|
}
|
|
82
83
|
return this.nextContent
|
|
83
84
|
},
|
|
84
85
|
icon () {
|
|
85
|
-
return
|
|
86
|
+
return this.miniprogramData.weappIconUrl
|
|
86
87
|
},
|
|
87
88
|
title () {
|
|
88
89
|
return this.miniprogramData.title
|
|
89
90
|
},
|
|
90
91
|
url () {
|
|
91
|
-
return this.miniprogramData.url
|
|
92
|
+
return this.miniprogramData.msg && this.miniprogramData.msg.appmsg ? this.miniprogramData.msg.appmsg.url : ''
|
|
92
93
|
},
|
|
93
94
|
desc () {
|
|
94
|
-
return this.miniprogramData.
|
|
95
|
+
return this.miniprogramData.appName
|
|
95
96
|
},
|
|
96
97
|
cover () {
|
|
97
|
-
return
|
|
98
|
+
return this.miniprogramData.thumbOssUrl
|
|
98
99
|
},
|
|
99
100
|
border () {
|
|
100
101
|
return !this.SdkChatPanelBox
|
|
@@ -4,24 +4,6 @@ import UrlMerge from './url-merge'
|
|
|
4
4
|
import UrlMiniprogram from './url-miniprogram'
|
|
5
5
|
import UrlFile from './url-file'
|
|
6
6
|
import UrlLink from './url-link'
|
|
7
|
-
import UrlChannelLive from './url-channel-live'
|
|
8
|
-
import ChannelCard from '../channel-card/channel-card'
|
|
9
|
-
|
|
10
|
-
const CHANNEL_CARD_TITLE_PREFIX = '[视频号名片]'
|
|
11
|
-
|
|
12
|
-
function isChannelLiveUrl (url) {
|
|
13
|
-
try {
|
|
14
|
-
return new URL(url).hostname === 'channels.weixin.qq.com'
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function isChannelCardContent (content) {
|
|
21
|
-
return isChannelLiveUrl(content && content.url) &&
|
|
22
|
-
typeof content.title === 'string' &&
|
|
23
|
-
content.title.startsWith(CHANNEL_CARD_TITLE_PREFIX)
|
|
24
|
-
}
|
|
25
7
|
|
|
26
8
|
export default {
|
|
27
9
|
name: 'SdkChatPanelControlsUrl',
|
|
@@ -73,7 +55,7 @@ export default {
|
|
|
73
55
|
beforeLoad: props.beforeLoadMergeMethod
|
|
74
56
|
}
|
|
75
57
|
})
|
|
76
|
-
} else if (content.
|
|
58
|
+
} else if (content.type === 2) {
|
|
77
59
|
return h(UrlMiniprogram, {
|
|
78
60
|
props: {
|
|
79
61
|
id: props.id,
|
|
@@ -106,13 +88,7 @@ export default {
|
|
|
106
88
|
}
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
|
-
|
|
110
|
-
if (isChannelCardContent(content)) {
|
|
111
|
-
component = ChannelCard
|
|
112
|
-
} else if (isChannelLiveUrl(content && content.url)) {
|
|
113
|
-
component = UrlChannelLive
|
|
114
|
-
}
|
|
115
|
-
return h(component, {
|
|
91
|
+
return h(UrlLink, {
|
|
116
92
|
props: {
|
|
117
93
|
id: props.id,
|
|
118
94
|
content,
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
export const MESSAGE_TYPE = {
|
|
2
2
|
TEXT: 0,
|
|
3
3
|
TEXT_W: 1,
|
|
4
|
-
MERGE_MESSAGE: 4,
|
|
5
4
|
IMAGE: 14,
|
|
6
|
-
URLFile: 15,
|
|
7
5
|
VOICE: 16,
|
|
8
|
-
VIDEO:
|
|
6
|
+
VIDEO: 23,
|
|
9
7
|
CUSTOM_EXPRESSION: 29,
|
|
8
|
+
CUSTOM_EXPRESSION_W: 104,
|
|
10
9
|
// MUSIC: 1040187441,
|
|
11
10
|
// ROOM_CALLING: 64,
|
|
12
|
-
SHARE_CARD:
|
|
11
|
+
SHARE_CARD: 41,
|
|
13
12
|
// COMPANY_CARD: 41,
|
|
14
13
|
// VIDEO: 43,
|
|
15
14
|
// CUSTOM_EXPRESSION: 47,
|
|
@@ -33,8 +32,7 @@ export const MESSAGE_TYPE = {
|
|
|
33
32
|
// QUOTE_MESSAGE: 822083633,
|
|
34
33
|
CHANNEL_VIDEO: 141,
|
|
35
34
|
// CHANNEL_VIDEO_CARD: 771751985, // 视频号名片
|
|
36
|
-
CHANNEL_VIDEO_LIVE: 146
|
|
37
|
-
MEETING: 579
|
|
35
|
+
CHANNEL_VIDEO_LIVE: 146 // 视频号直播
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
function html2Escape (sHtml) {
|
|
@@ -68,14 +66,6 @@ function toJson (data) {
|
|
|
68
66
|
return data
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
function getTextContent (content) {
|
|
72
|
-
const data = typeof content === 'string' ? toJson(content) : content
|
|
73
|
-
if (data && typeof data === 'object') {
|
|
74
|
-
return data.text || ''
|
|
75
|
-
}
|
|
76
|
-
return content
|
|
77
|
-
}
|
|
78
|
-
|
|
79
69
|
/**
|
|
80
70
|
* 格式化为短消息
|
|
81
71
|
*/
|
|
@@ -83,8 +73,10 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
83
73
|
let shortMessage = msgContent
|
|
84
74
|
switch (msgType) {
|
|
85
75
|
case MESSAGE_TYPE.TEXT:
|
|
76
|
+
shortMessage = msgContent
|
|
77
|
+
break
|
|
86
78
|
case MESSAGE_TYPE.TEXT_W:
|
|
87
|
-
shortMessage =
|
|
79
|
+
shortMessage = msgContent
|
|
88
80
|
break
|
|
89
81
|
case MESSAGE_TYPE.TEXT_WITH_AT:
|
|
90
82
|
let {atId, content, text} = toJson(msgContent) || {}
|
|
@@ -93,9 +85,6 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
93
85
|
case MESSAGE_TYPE.IMAGE:
|
|
94
86
|
shortMessage = '[图片消息]'
|
|
95
87
|
break
|
|
96
|
-
case MESSAGE_TYPE.MERGE_MESSAGE:
|
|
97
|
-
shortMessage = '[聊天记录]'
|
|
98
|
-
break
|
|
99
88
|
case MESSAGE_TYPE.VIDEO:
|
|
100
89
|
shortMessage = '[视频消息]'
|
|
101
90
|
break
|
|
@@ -116,15 +105,20 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
116
105
|
case MESSAGE_TYPE.SYSTEM:
|
|
117
106
|
shortMessage = formatSystemMessage(msgContent)
|
|
118
107
|
break
|
|
119
|
-
case MESSAGE_TYPE.URLFile:
|
|
120
|
-
shortMessage = '[文件消息]'
|
|
121
|
-
break
|
|
122
108
|
case MESSAGE_TYPE.URL:
|
|
123
109
|
case MESSAGE_TYPE.URLNew:
|
|
124
110
|
const jsonObj = toJson(msgContent)
|
|
125
111
|
if (typeof jsonObj === 'object') {
|
|
126
|
-
if(jsonObj.
|
|
112
|
+
if(jsonObj.type === 'file') {
|
|
113
|
+
shortMessage = '[文件消息]'
|
|
114
|
+
} else if(jsonObj.type === 'link') {
|
|
115
|
+
shortMessage = '[链接消息]'
|
|
116
|
+
} else if(jsonObj.type === 'miniprogram') {
|
|
127
117
|
shortMessage = '[小程序消息]'
|
|
118
|
+
} else if (jsonObj.type === 'music') {
|
|
119
|
+
shortMessage = '[音乐消息]'
|
|
120
|
+
} else if (jsonObj.type === 'merged') {
|
|
121
|
+
shortMessage = '[合并消息]'
|
|
128
122
|
} else {
|
|
129
123
|
shortMessage = '[链接消息]'
|
|
130
124
|
}
|
|
@@ -166,9 +160,6 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
166
160
|
case MESSAGE_TYPE.CHANNEL_VIDEO_LIVE:
|
|
167
161
|
shortMessage = '[视频号直播]'
|
|
168
162
|
break
|
|
169
|
-
case MESSAGE_TYPE.MEETING:
|
|
170
|
-
shortMessage = '[会议消息]'
|
|
171
|
-
break
|
|
172
163
|
case MESSAGE_TYPE.ROOM_CALLING:
|
|
173
164
|
case MESSAGE_TYPE.CALLING:
|
|
174
165
|
shortMessage = '[语音通话消息]'
|
|
@@ -233,4 +224,4 @@ export function formatShortSessionMessage (session, contextFn) {
|
|
|
233
224
|
}
|
|
234
225
|
}
|
|
235
226
|
return formatShortMessage(session.lastMsgType, session.lastMsgContent)
|
|
236
|
-
}
|
|
227
|
+
}
|
|
@@ -147,9 +147,7 @@ export default {
|
|
|
147
147
|
if (typeof this.nextContent === 'string') {
|
|
148
148
|
url = this.nextContent
|
|
149
149
|
} else if (this.nextContent && typeof this.nextContent === 'object') {
|
|
150
|
-
if (this.nextContent.
|
|
151
|
-
url = this.nextContent.resPath
|
|
152
|
-
} else if (this.nextContent.videoPath) {
|
|
150
|
+
if (this.nextContent.videoPath) {
|
|
153
151
|
url = this.nextContent.videoPath
|
|
154
152
|
} else {
|
|
155
153
|
url = this.nextContent.tencentUrl
|
|
@@ -165,7 +163,7 @@ export default {
|
|
|
165
163
|
if (!this.nextContent) {
|
|
166
164
|
return
|
|
167
165
|
}
|
|
168
|
-
return this.nextContent.
|
|
166
|
+
return this.nextContent.previewImgUrl
|
|
169
167
|
},
|
|
170
168
|
innerCover () {
|
|
171
169
|
return formatOssPath(this.cover)
|
|
@@ -204,12 +202,6 @@ export default {
|
|
|
204
202
|
throw new Error('不支持的更新属性' + prop)
|
|
205
203
|
}
|
|
206
204
|
this.$set(this.nextContent, prop, value)
|
|
207
|
-
},
|
|
208
|
-
updateContentProps: (data) => {
|
|
209
|
-
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
210
|
-
throw new Error('updateContentProps只支持更新数据对象')
|
|
211
|
-
}
|
|
212
|
-
this.nextContent = data
|
|
213
205
|
}
|
|
214
206
|
})
|
|
215
207
|
if (rs && rs.finally) {
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
import { parse } from '../../../utils/json'
|
|
54
54
|
import { unique } from '../../../utils/string'
|
|
55
55
|
import AcVoicePlayer from '@aochuang/common/common/voice-player'
|
|
56
|
-
import { formatOssPath } from '@aochuang/common/utils/oss'
|
|
57
56
|
|
|
58
57
|
const ConvertStatusEnum = {
|
|
59
58
|
NORMAL: -1, // 没有转换
|
|
@@ -133,14 +132,8 @@ export default {
|
|
|
133
132
|
return parse(this.content) || {}
|
|
134
133
|
},
|
|
135
134
|
voiceSrc () {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
const voiceSrc = this.nextContent.resPath
|
|
140
|
-
if (!voiceSrc) {
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
return formatOssPath(voiceSrc)
|
|
135
|
+
let url = this.nextContent.url || this.nextContent.resUrl
|
|
136
|
+
return url
|
|
144
137
|
},
|
|
145
138
|
nextId () {
|
|
146
139
|
return this.id || unique()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { companyCard } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsCompanyCard',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(companyCard, {
|
|
29
|
+
props: {
|
|
30
|
+
data: props.data
|
|
31
|
+
}
|
|
32
|
+
})])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { expression } from '../../../wework-chat-control'
|
|
3
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsExpression',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(expression, {
|
|
29
|
+
props: {
|
|
30
|
+
data: props.data
|
|
31
|
+
},
|
|
32
|
+
key: c.data.key
|
|
33
|
+
})])
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { fileUrl } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsFileUrl',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(fileUrl, {
|
|
29
|
+
props: {
|
|
30
|
+
content: props.data.content
|
|
31
|
+
}
|
|
32
|
+
})])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { image } from '../../../wework-chat-control'
|
|
3
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsImage',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(image, {
|
|
29
|
+
props: {
|
|
30
|
+
data: props.data
|
|
31
|
+
},
|
|
32
|
+
key: c.data.key
|
|
33
|
+
})])
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|