@aochuang/client-sdk 1.0.359 → 1.0.362
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/common/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/index.js +6 -1
- package/components/session-select/session-select-item.vue +8 -9
- package/components/wechat-chat-control/.DS_Store +0 -0
- package/components/wechat-chat-control/image/image.vue +13 -8
- 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/url/url-miniprogram.vue +1 -5
- package/components/wechat-chat-control/voice/.DS_Store +0 -0
- package/components/wework-chat-control/channel-card/channel-card.vue +144 -0
- package/components/wework-chat-control/channel-live/channel-live.vue +7 -2
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/custom-expression/custom-expression.vue +2 -1
- package/components/wework-chat-control/file-url/file-url.vue +34 -16
- package/components/wework-chat-control/image/image.vue +137 -2
- package/components/wework-chat-control/index.js +15 -7
- package/components/wework-chat-control/link/.DS_Store +0 -0
- package/components/wework-chat-control/location/location.vue +3 -3
- package/components/wework-chat-control/merge-message/merge-message-panel.vue +63 -0
- package/components/wework-chat-control/merge-message/merge-message.vue +84 -0
- package/components/wework-chat-control/merge-message/util.js +59 -0
- package/components/wework-chat-control/metting/enterprise-wechat.png +0 -0
- package/components/wework-chat-control/metting/meeting-video.svg +4 -0
- package/components/wework-chat-control/metting/metting.vue +181 -0
- package/components/wework-chat-control/red-envelopes/red-envelopes.vue +3 -2
- package/components/wework-chat-control/text/text-default.vue +99 -0
- package/components/wework-chat-control/text/text-quote.vue +105 -0
- package/components/wework-chat-control/text/text.vue +24 -144
- package/components/wework-chat-control/url/url-channel-live.vue +53 -0
- package/components/wework-chat-control/url/url-miniprogram.vue +6 -7
- package/components/wework-chat-control/url/url.vue +26 -2
- package/components/wework-chat-control/util.js +26 -17
- package/components/wework-chat-control/video/.DS_Store +0 -0
- package/components/wework-chat-control/video/video.vue +10 -2
- package/components/wework-chat-control/voice/voice.vue +9 -2
- package/components/wework-chat-control/wework-chat-control-config-item.vue +24 -0
- package/components/wework-chat-control/wework-chat-control-config-msg.vue +25 -0
- package/{uni-components/chat-control/chat-control-config.vue → components/wework-chat-control/wework-chat-control-config.vue} +16 -13
- package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +73 -0
- package/components/wework-chat-panel/chat-panel-item.vue +56 -25
- package/components/wework-chat-panel/chat-panel.vue +96 -13
- package/package.json +10 -3
- package/services/.DS_Store +0 -0
- package/services/client-chat/client-chat-wechat/client-chat-session.js +92 -196
- package/services/client-chat/client-chat-wechat/client-chat.js +33 -20
- package/services/client-chat/client-chat-wework/client-chat-account.js +84 -1
- package/services/client-chat/client-chat-wework/client-chat-concats.js +81 -17
- package/services/client-chat/client-chat-wework/client-chat-message.js +45 -5
- package/services/client-chat/client-chat-wework/client-chat-session.js +50 -2
- package/services/client-chat/client-chat-wework/client-chat-socket.js +13 -1
- package/services/client-chat/client-chat-wework/client-chat.js +320 -11
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +0 -36
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +0 -36
- package/components/wework-chat-panel/chat-panel-controls/index.js +0 -35
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +0 -28
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +0 -35
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +0 -43
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +0 -39
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +0 -37
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +0 -35
- package/uni-common/account-portray/account-portray.vue +0 -51
- package/uni-common/account-select/account-select-item.vue +0 -172
- package/uni-common/account-select/account-select.vue +0 -252
- package/uni-common/all-friend-avatar/all-friend-avatar.vue +0 -49
- package/uni-common/friend-avatar/default.svg +0 -1
- package/uni-common/friend-avatar/friend-avatar.vue +0 -27
- package/uni-common/friend-avatar/index.js +0 -3
- package/uni-common/friend-loader/friend-loader.vue +0 -53
- package/uni-common/friend-portray/friend-portray.vue +0 -56
- package/uni-common/group-avatar/default.svg +0 -1
- package/uni-common/group-avatar/group-avatar.vue +0 -18
- package/uni-common/group-avatar/index.js +0 -3
- package/uni-common/room-avatar/default.svg +0 -6
- package/uni-common/room-avatar/index.js +0 -3
- package/uni-common/room-avatar/room-avatar.vue +0 -27
- package/uni-common/room-loader/room-loader.vue +0 -53
- package/uni-common/room-portray/room-portray.vue +0 -56
- package/uni-components/chat-control/calling/calling.vue +0 -91
- package/uni-components/chat-control/calling/phone-fill.svg +0 -1
- package/uni-components/chat-control/calling/vidicon-fill.svg +0 -1
- package/uni-components/chat-control/channel-video/channel-video.vue +0 -89
- package/uni-components/chat-control/channel-video-card/channel-video-card.vue +0 -105
- package/uni-components/chat-control/channel-video-live/channel-video-live.vue +0 -92
- package/uni-components/chat-control/chat-control-config-item/chat-control-config-item.vue +0 -20
- package/uni-components/chat-control/chat-control-config-item/index.js +0 -3
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-app.vue +0 -25
- package/uni-components/chat-control/chat-control-config-msg/chat-control-config-msg-h5.vue +0 -21
- package/uni-components/chat-control/chat-control.vue +0 -218
- package/uni-components/chat-control/company-card/company-card.vue +0 -123
- package/uni-components/chat-control/const.js +0 -28
- package/uni-components/chat-control/expression/expression.vue +0 -41
- package/uni-components/chat-control/image/image.vue +0 -68
- package/uni-components/chat-control/index.js +0 -89
- package/uni-components/chat-control/location/location.vue +0 -110
- package/uni-components/chat-control/member-change/member-change.vue +0 -32
- package/uni-components/chat-control/quote-message/quote-message.vue +0 -216
- package/uni-components/chat-control/real-time-position/real-time-position.vue +0 -62
- package/uni-components/chat-control/redpacket/red-envelope.svg +0 -1
- package/uni-components/chat-control/redpacket/redpacket.vue +0 -75
- package/uni-components/chat-control/share-card/share-card.vue +0 -101
- package/uni-components/chat-control/system/system.vue +0 -69
- package/uni-components/chat-control/system-batch-message/system-batch-message.vue +0 -30
- package/uni-components/chat-control/system-text/system-text.vue +0 -32
- package/uni-components/chat-control/text/text.vue +0 -67
- package/uni-components/chat-control/text-with-at/text-with-at.vue +0 -51
- package/uni-components/chat-control/transfer/red-transfer.svg +0 -1
- package/uni-components/chat-control/transfer/transfer.vue +0 -80
- package/uni-components/chat-control/unkonw/unkonw.vue +0 -37
- package/uni-components/chat-control/url/icons/file-excel-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-info-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-music-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-pdf-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-ppt-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-settings-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-text-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-unknow-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-word-line.svg +0 -1
- package/uni-components/chat-control/url/icons/file-zip-line.svg +0 -1
- package/uni-components/chat-control/url/icons/index.js +0 -24
- package/uni-components/chat-control/url/miniprogram.svg +0 -1
- package/uni-components/chat-control/url/url-miniprogram.vue +0 -116
- package/uni-components/chat-control/url/url.vue +0 -306
- package/uni-components/chat-control/url-new/icons/file-excel-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-info-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-music-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-pdf-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-ppt-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-settings-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-text-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-unknow-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-word-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/file-zip-line.svg +0 -1
- package/uni-components/chat-control/url-new/icons/index.js +0 -24
- package/uni-components/chat-control/url-new/url-new.vue +0 -110
- package/uni-components/chat-control/utils.js +0 -12
- package/uni-components/chat-control/video/video.vue +0 -156
- package/uni-components/chat-control/voice/voice.vue +0 -166
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-collect.vue +0 -84
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet-system.vue +0 -28
- package/uni-components/chat-editor/chat-editor-chartlet/chat-editor-chartlet.vue +0 -85
- package/uni-components/chat-editor/chat-editor-func/chat-editor-func.vue +0 -157
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at-panel.vue +0 -158
- package/uni-components/chat-editor/chat-editor-func-at/chat-editor-func-at.vue +0 -61
- package/uni-components/chat-editor/chat-editor-func-button/chat-editor-func-button.vue +0 -58
- package/uni-components/chat-editor/chat-editor-func-file/chat-editor-func-file.vue +0 -54
- package/uni-components/chat-editor/chat-editor-func-image/chat-editor-func-image.vue +0 -42
- package/uni-components/chat-editor/chat-editor-func-video/chat-editor-func-video.vue +0 -42
- package/uni-components/chat-editor/chat-editor-func-voice/chat-editor-func-voice.vue +0 -25
- package/uni-components/chat-editor/chat-editor-message-send/chat-editor-message-send.vue +0 -158
- package/uni-components/chat-editor/chat-editor-quote/chat-editor-quote.vue +0 -75
- package/uni-components/chat-editor/chat-editor.vue +0 -257
- package/uni-components/chat-editor/index.js +0 -10
- package/uni-components/chat-editor/util.js +0 -65
- package/uni-components/chat-panel/chat-panel-chats-box.vue +0 -238
- package/uni-components/chat-panel/chat-panel-chats-forward/chat-panel-chats-forward.vue +0 -273
- package/uni-components/chat-panel/chat-panel-chats-item.vue +0 -578
- package/uni-components/chat-panel/chat-panel-chats-status/chat-panel-chats-status.vue +0 -71
- package/uni-components/chat-panel/chat-panel-chats.vue +0 -368
- package/uni-components/chat-panel/chat-panel.vue +0 -227
- package/uni-components/contacts-group-select/contacts-group-select-item.vue +0 -85
- package/uni-components/contacts-group-select/contacts-group-select-panel.vue +0 -119
- package/uni-components/contacts-group-select/contacts-group-select.vue +0 -150
|
@@ -19,6 +19,9 @@ 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'
|
|
22
25
|
// import channelVideoCard from './channel-video-card/channel-video-card.vue'
|
|
23
26
|
// import music from './music/music.vue'
|
|
24
27
|
// import transfer from './transfer/transfer.vue'
|
|
@@ -26,9 +29,9 @@ import url from './url/url.vue'
|
|
|
26
29
|
// import quoteMessage from './quote-message/quote-message.vue'
|
|
27
30
|
import empty from './empty/empty.vue'
|
|
28
31
|
import unknow from './unknow/unknow.vue'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
import WeworkChatControlConfig from './wework-chat-control-config.vue'
|
|
33
|
+
import WeworkChatControlConfigMsg from './wework-chat-control-config-msg.vue'
|
|
34
|
+
import WeworkChatControlConfigItem from './wework-chat-control-config-item.vue'
|
|
32
35
|
// import revokeMeMessage from './revoke-me-message/revoke-me-message.vue'
|
|
33
36
|
// import revokeOtherMessage from './revoke-other-message/revoke-other-message.vue'
|
|
34
37
|
// import revokeYouMessage from './revoke-you-message/revoke-you-message.vue'
|
|
@@ -45,8 +48,8 @@ export const chatControls = {
|
|
|
45
48
|
[MESSAGE_TYPE.COMPANY_CARD]: companyCard,
|
|
46
49
|
[MESSAGE_TYPE.VIDEO]: video,
|
|
47
50
|
[MESSAGE_TYPE.CUSTOM_EXPRESSION]: customExpression,
|
|
48
|
-
[MESSAGE_TYPE.CUSTOM_EXPRESSION_W]: customExpression,
|
|
49
51
|
[MESSAGE_TYPE.LOCATION]: location,
|
|
52
|
+
[MESSAGE_TYPE.URLFile]: fileUrl,
|
|
50
53
|
[MESSAGE_TYPE.URL]: url,
|
|
51
54
|
[MESSAGE_TYPE.URLNew]: fileUrl,
|
|
52
55
|
// [MESSAGE_TYPE.CALLING]: calling,
|
|
@@ -62,6 +65,8 @@ export const chatControls = {
|
|
|
62
65
|
[MESSAGE_TYPE.CHANNEL_VIDEO]: channelVideo,
|
|
63
66
|
// [MESSAGE_TYPE.CHANNEL_VIDEO_CARD]: channelVideoCard, // 视频号名片
|
|
64
67
|
[MESSAGE_TYPE.CHANNEL_VIDEO_LIVE]: channelLive, // 视频号直播
|
|
68
|
+
[MESSAGE_TYPE.MEETING]: metting,
|
|
69
|
+
[MESSAGE_TYPE.MERGE_MESSAGE]: mergeMessage,
|
|
65
70
|
// [MESSAGE_TYPE.SYSTEM_BATCH_MESSAGE]: systemBatchMessage,
|
|
66
71
|
// [MESSAGE_TYPE.REVOKE_ME_MESSAGE]: revokeMeMessage,
|
|
67
72
|
// [MESSAGE_TYPE.REVOKE_OTHER_MESSAGE]: revokeOtherMessage,
|
|
@@ -93,6 +98,9 @@ export {
|
|
|
93
98
|
channelVideo, // 视频号
|
|
94
99
|
// channelVideoCard,
|
|
95
100
|
channelLive, // 视频号直播
|
|
101
|
+
metting,
|
|
102
|
+
mergeMessage,
|
|
103
|
+
mergeMessagePanel,
|
|
96
104
|
// music,
|
|
97
105
|
// transfer,
|
|
98
106
|
empty,
|
|
@@ -100,7 +108,7 @@ export {
|
|
|
100
108
|
// revokeMeMessage,
|
|
101
109
|
// revokeOtherMessage,
|
|
102
110
|
// revokeYouMessage,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
WeworkChatControlConfig,
|
|
112
|
+
WeworkChatControlConfigMsg,
|
|
113
|
+
WeworkChatControlConfigItem
|
|
106
114
|
}
|
|
Binary file
|
|
@@ -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 :map-key="mapKey" v-else :enable-link="false" width="280" height="160" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
|
|
15
|
+
<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>
|
|
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 :map-key="mapKey" :enable-link="false" width="52" height="52" :lng="longitude" :lat="latitude" @map-created="handleStaticMapCreated"></ac-static-map>
|
|
25
|
+
<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>
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
</div>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-dialog v-model="innerVisible" :title="title" size="small" :close-on-click-modal="true">
|
|
3
|
+
<div class="sdk-wework-chat-control-merge-message__dialog">
|
|
4
|
+
<div v-for="(message, index) in detailMessages" :key="index" class="sdk-wework-chat-control-merge-message__detail-item">
|
|
5
|
+
<img v-if="message.avatar" class="sdk-wework-chat-control-merge-message__avatar" :src="message.avatar" alt="">
|
|
6
|
+
<div v-else class="sdk-wework-chat-control-merge-message__avatar sdk-wework-chat-control-merge-message__avatar--empty">{{ message.sender.slice(0, 1) }}</div>
|
|
7
|
+
<div class="sdk-wework-chat-control-merge-message__detail-main">
|
|
8
|
+
<div class="sdk-wework-chat-control-merge-message__detail-head">
|
|
9
|
+
<span class="sdk-wework-chat-control-merge-message__detail-sender">{{ message.sender }}</span>
|
|
10
|
+
<span v-if="message.corpName" class="sdk-wework-chat-control-merge-message__detail-corp">@{{ message.corpName }}</span>
|
|
11
|
+
<span class="sdk-wework-chat-control-merge-message__detail-time">{{ message.time }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
<ui-image v-if="message.image" :src="message.image" width="160px" height="160px" fit="cover" :previewable="true"></ui-image>
|
|
14
|
+
<div v-else class="sdk-wework-chat-control-merge-message__detail-content">{{ message.detail }}</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div v-if="!detailMessages.length" class="sdk-wework-chat-control-merge-message__dialog-empty">暂无聊天记录</div>
|
|
18
|
+
</div>
|
|
19
|
+
</ui-dialog>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { Dialog as UiDialog, Image as UiImage } from '@aochuang/common/components'
|
|
24
|
+
import { parse } from '../../../utils/json'
|
|
25
|
+
import { normalizeMergeMessage } from './util'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'SdkWeworkChatControlMergeMessagePanel',
|
|
29
|
+
components: { UiDialog, UiImage },
|
|
30
|
+
props: {
|
|
31
|
+
value: { type: Boolean, default: false },
|
|
32
|
+
title: { type: String, default: '聊天记录' },
|
|
33
|
+
messages: { type: [Array, String, Object], default: () => [] }
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
innerVisible: {
|
|
37
|
+
get () { return this.value },
|
|
38
|
+
set (value) { this.$emit('input', value) }
|
|
39
|
+
},
|
|
40
|
+
detailMessages () {
|
|
41
|
+
let messages = this.messages
|
|
42
|
+
if (typeof messages === 'string') messages = parse(messages)
|
|
43
|
+
if (!Array.isArray(messages)) return []
|
|
44
|
+
return messages.map(message => normalizeMergeMessage(message || {}))
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="less">
|
|
51
|
+
.sdk-wework-chat-control-merge-message__dialog { max-height: 560px; overflow-y: auto; padding: 0 24px 24px; }
|
|
52
|
+
.sdk-wework-chat-control-merge-message__detail-item { display: flex; padding: 12px 0; border-bottom: 1px solid #eee; }
|
|
53
|
+
.sdk-wework-chat-control-merge-message__detail-item:last-child { border-bottom: 0; }
|
|
54
|
+
.sdk-wework-chat-control-merge-message__avatar { flex: none; width: 36px; height: 36px; margin-right: 10px; border-radius: 5px; object-fit: cover; }
|
|
55
|
+
.sdk-wework-chat-control-merge-message__avatar--empty { background: #eee; color: #888; font-size: 16px; line-height: 36px; text-align: center; }
|
|
56
|
+
.sdk-wework-chat-control-merge-message__detail-main { flex: 1; min-width: 0; }
|
|
57
|
+
.sdk-wework-chat-control-merge-message__detail-head { display: flex; align-items: baseline; min-height: 20px; line-height: 20px; }
|
|
58
|
+
.sdk-wework-chat-control-merge-message__detail-sender { color: #8b8e98; font-size: 13px; }
|
|
59
|
+
.sdk-wework-chat-control-merge-message__detail-corp { color: #f18b32; font-size: 12px; }
|
|
60
|
+
.sdk-wework-chat-control-merge-message__detail-time { margin-left: auto; padding-left: 12px; color: #9699a3; font-size: 12px; white-space: nowrap; }
|
|
61
|
+
.sdk-wework-chat-control-merge-message__detail-content { padding-top: 4px; color: #222; font-size: 14px; line-height: 22px; white-space: pre-wrap; word-break: break-word; }
|
|
62
|
+
.sdk-wework-chat-control-merge-message__dialog-empty { padding: 24px; color: #999; text-align: center; }
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sdk-wework-chat-control-merge-message" :class="'sdk-wework-chat-control-merge-message--' + type">
|
|
3
|
+
<template v-if="type === 'quote'">
|
|
4
|
+
[聊天记录]{{ title }}
|
|
5
|
+
</template>
|
|
6
|
+
<template v-else>
|
|
7
|
+
<div class="sdk-wework-chat-control-merge-message__card" @click="openDetail">
|
|
8
|
+
<div class="sdk-wework-chat-control-merge-message__title">{{ title }}</div>
|
|
9
|
+
<div v-if="messages.length" class="sdk-wework-chat-control-merge-message__list">
|
|
10
|
+
<div v-for="(message, index) in messages" :key="index" class="sdk-wework-chat-control-merge-message__item">
|
|
11
|
+
<span class="sdk-wework-chat-control-merge-message__sender">{{ message.sender }}</span>
|
|
12
|
+
<span class="sdk-wework-chat-control-merge-message__separator">:</span>
|
|
13
|
+
<span class="sdk-wework-chat-control-merge-message__summary">{{ message.summary }}</span>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div v-else class="sdk-wework-chat-control-merge-message__empty">暂无聊天记录</div>
|
|
17
|
+
<div class="sdk-wework-chat-control-merge-message__foot">聊天记录</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<merge-message-panel v-model="dialogVisible" :title="title" :messages="data.messages"></merge-message-panel>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { parse } from '../../../utils/json'
|
|
26
|
+
import MergeMessagePanel from './merge-message-panel.vue'
|
|
27
|
+
import { getMessageSummary } from './util'
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'SdkWeworkChatControlMergeMessage',
|
|
31
|
+
components: { MergeMessagePanel },
|
|
32
|
+
props: {
|
|
33
|
+
id: { type: String },
|
|
34
|
+
content: { type: [String, Object] },
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'default',
|
|
38
|
+
validator (value) {
|
|
39
|
+
return ['quote', 'default', 'thumb'].includes(value)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data () {
|
|
44
|
+
return { dialogVisible: false }
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
data () {
|
|
48
|
+
const value = parse(this.content)
|
|
49
|
+
return value && typeof value === 'object' ? value : {}
|
|
50
|
+
},
|
|
51
|
+
title () {
|
|
52
|
+
return this.data.title || '聊天记录'
|
|
53
|
+
},
|
|
54
|
+
messages () {
|
|
55
|
+
if (!Array.isArray(this.data.messages)) return []
|
|
56
|
+
return this.data.messages.map(message => ({
|
|
57
|
+
sender: message && (message.senderName || message.name || message.sender || '未知联系人'),
|
|
58
|
+
summary: getMessageSummary(message || {})
|
|
59
|
+
}))
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
openDetail () {
|
|
64
|
+
if (this.type !== 'quote') this.dialogVisible = true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="less">
|
|
71
|
+
.sdk-wework-chat-control-merge-message { display: inline-block; max-width: 100%; color: #222; }
|
|
72
|
+
.sdk-wework-chat-control-merge-message__card { width: 248px; max-width: 100%; overflow: hidden; border-radius: 6px; background: #f1f1f3; }
|
|
73
|
+
.sdk-wework-chat-control-merge-message__title { padding: 11px 12px 6px; overflow: hidden; font-size: 14px; font-weight: 500; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
|
|
74
|
+
.sdk-wework-chat-control-merge-message__list { padding: 0 12px 7px; }
|
|
75
|
+
.sdk-wework-chat-control-merge-message__item { display: flex; min-width: 0; color: #96969b; font-size: 12px; line-height: 18px; }
|
|
76
|
+
.sdk-wework-chat-control-merge-message__sender, .sdk-wework-chat-control-merge-message__separator { flex: none; }
|
|
77
|
+
.sdk-wework-chat-control-merge-message__sender { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
78
|
+
.sdk-wework-chat-control-merge-message__summary { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: break-all; }
|
|
79
|
+
.sdk-wework-chat-control-merge-message__empty { padding: 0 12px 9px; color: #96969b; font-size: 12px; line-height: 18px; }
|
|
80
|
+
.sdk-wework-chat-control-merge-message__foot { height: 27px; padding: 0 12px; border-top: 1px solid rgba(0, 0, 0, .08); color: #999; font-size: 12px; line-height: 27px; }
|
|
81
|
+
.sdk-wework-chat-control-merge-message__card { cursor: pointer; }
|
|
82
|
+
.sdk-wework-chat-control-merge-message--thumb { width: 100%; .sdk-wework-chat-control-merge-message__card { width: 100%; } }
|
|
83
|
+
.sdk-wework-chat-control-merge-message--quote { color: #888; font-size: 12px; }
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { formatOssPath } from '@aochuang/common/utils/oss'
|
|
2
|
+
import { parse } from '../../../utils/json'
|
|
3
|
+
import { MESSAGE_TYPE } from '../util'
|
|
4
|
+
|
|
5
|
+
export const TYPE_LABELS = {
|
|
6
|
+
[MESSAGE_TYPE.IMAGE]: '[图片]', [MESSAGE_TYPE.VOICE]: '[语音]', [MESSAGE_TYPE.VIDEO]: '[视频]',
|
|
7
|
+
[MESSAGE_TYPE.URLFile]: '[文件]', [MESSAGE_TYPE.URL]: '[链接]', [MESSAGE_TYPE.URLNew]: '[文件]',
|
|
8
|
+
[MESSAGE_TYPE.CUSTOM_EXPRESSION]: '[表情]', [MESSAGE_TYPE.LOCATION]: '[位置]',
|
|
9
|
+
[MESSAGE_TYPE.CALLING]: '[语音通话]', [MESSAGE_TYPE.RED_ENVELOPES]: '[红包]',
|
|
10
|
+
[MESSAGE_TYPE.SHARE_CARD]: '[名片]', [MESSAGE_TYPE.CHANNEL_VIDEO]: '[视频号]',
|
|
11
|
+
[MESSAGE_TYPE.CHANNEL_VIDEO_LIVE]: '[视频号直播]', [MESSAGE_TYPE.MEETING]: '[会议]'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const MERGED_TYPE_LABELS = {
|
|
15
|
+
3: '[图片]', 4: '[语音]', 5: '[视频]', 6: '[文件]', 7: '[位置]', 8: '[链接]',
|
|
16
|
+
9: '[名片]', 10: '[表情]', 11: '[语音通话]', 12: '[视频通话]'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function parseMessageContent (content) {
|
|
20
|
+
const parsed = parse(content)
|
|
21
|
+
if (parsed && typeof parsed === 'object') {
|
|
22
|
+
const value = parsed.text || parsed.content || parsed.desc || ''
|
|
23
|
+
return typeof value === 'string' || typeof value === 'number' ? String(value) : ''
|
|
24
|
+
}
|
|
25
|
+
return parsed == null ? '' : String(parsed)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getMessageSummary (message) {
|
|
29
|
+
const type = Number(message && message.contentType)
|
|
30
|
+
const contentText = parseMessageContent(message && message.content)
|
|
31
|
+
if (type === 0 || type === 1 || type === 2) return contentText || '[文本]'
|
|
32
|
+
return MERGED_TYPE_LABELS[type] || TYPE_LABELS[type] || contentText || '[未知消息]'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function formatMessageTime (timestamp) {
|
|
36
|
+
const date = new Date(timestamp)
|
|
37
|
+
if (Number.isNaN(date.getTime())) return ''
|
|
38
|
+
const pad = value => String(value).padStart(2, '0')
|
|
39
|
+
return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日 ${pad(date.getHours())}:${pad(date.getMinutes())}`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function normalizeMergeMessage (message) {
|
|
43
|
+
const item = message || {}
|
|
44
|
+
const content = parse(item.content)
|
|
45
|
+
const contentObject = content && typeof content === 'object' ? content : {}
|
|
46
|
+
const type = Number(item.contentType)
|
|
47
|
+
const rawTime = item.time || item.sendTime || item.timestamp
|
|
48
|
+
let timestamp = Number(rawTime)
|
|
49
|
+
if (timestamp && timestamp < 100000000000) timestamp *= 1000
|
|
50
|
+
const image = contentObject.imageUrl || contentObject.thumbUrl || contentObject.picUrl || contentObject.resPath
|
|
51
|
+
return {
|
|
52
|
+
sender: item.senderName || item.name || item.sender || '未知联系人',
|
|
53
|
+
corpName: item.corpName || item.corp || '',
|
|
54
|
+
avatar: item.avatarUrl || item.senderAvatarUrl || item.avatar || '',
|
|
55
|
+
time: timestamp ? formatMessageTime(timestamp) : '',
|
|
56
|
+
image: (type === 3 || type === MESSAGE_TYPE.IMAGE) && image ? formatOssPath(image) : '',
|
|
57
|
+
detail: getMessageSummary(item)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M725.333333 392.533333 947.754667 236.8a21.333333 21.333333 0 0 1 33.578666 17.493333v515.413334a21.333333 21.333333 0 0 1-33.578666 17.493333L725.333333 631.466667V810.666667a42.666667 42.666667 0 0 1-42.666666 42.666666H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666666V213.333333a42.666667 42.666667 0 0 1 42.666666-42.666666h597.333334a42.666667 42.666667 0 0 1 42.666666 42.666666v179.2z" fill="#fff"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,181 @@
|
|
|
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>
|
|
@@ -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.content
|
|
67
67
|
},
|
|
68
68
|
description () {
|
|
69
|
-
return
|
|
69
|
+
return this.nextContent.receiveText
|
|
70
70
|
},
|
|
71
71
|
category () {
|
|
72
72
|
return '微红包'
|
|
@@ -105,6 +105,7 @@ export default {
|
|
|
105
105
|
flex: 1;
|
|
106
106
|
min-width: 0;
|
|
107
107
|
line-height: 1.3em;
|
|
108
|
+
padding-top: 6px;
|
|
108
109
|
}
|
|
109
110
|
.sdk-wework-control-redpacket__title{
|
|
110
111
|
line-height: 22px;
|
|
@@ -0,0 +1,99 @@
|
|
|
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>
|