@aochuang/client-sdk 1.0.358 → 1.0.360
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/wework-chat-control/index.js +5 -0
- 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/red-envelopes/red-envelopes.vue +3 -2
- package/components/wework-chat-control/util.js +6 -0
- package/components/wework-chat-control/voice/voice.vue +3 -51
- package/components/wework-chat-panel/chat-panel-item.vue +21 -0
- package/package.json +1 -1
|
@@ -20,6 +20,8 @@ import jxSysText from './jx-sys-text/jx-sys-text.vue'
|
|
|
20
20
|
import channelVideo from './channel-video/channel-video.vue'
|
|
21
21
|
import channelLive from './channel-live/channel-live.vue'
|
|
22
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'
|
|
23
25
|
// import channelVideoCard from './channel-video-card/channel-video-card.vue'
|
|
24
26
|
// import music from './music/music.vue'
|
|
25
27
|
// import transfer from './transfer/transfer.vue'
|
|
@@ -64,6 +66,7 @@ export const chatControls = {
|
|
|
64
66
|
// [MESSAGE_TYPE.CHANNEL_VIDEO_CARD]: channelVideoCard, // 视频号名片
|
|
65
67
|
[MESSAGE_TYPE.CHANNEL_VIDEO_LIVE]: channelLive, // 视频号直播
|
|
66
68
|
[MESSAGE_TYPE.MEETING]: metting,
|
|
69
|
+
[MESSAGE_TYPE.MERGE_MESSAGE]: mergeMessage,
|
|
67
70
|
// [MESSAGE_TYPE.SYSTEM_BATCH_MESSAGE]: systemBatchMessage,
|
|
68
71
|
// [MESSAGE_TYPE.REVOKE_ME_MESSAGE]: revokeMeMessage,
|
|
69
72
|
// [MESSAGE_TYPE.REVOKE_OTHER_MESSAGE]: revokeOtherMessage,
|
|
@@ -96,6 +99,8 @@ export {
|
|
|
96
99
|
// channelVideoCard,
|
|
97
100
|
channelLive, // 视频号直播
|
|
98
101
|
metting,
|
|
102
|
+
mergeMessage,
|
|
103
|
+
mergeMessagePanel,
|
|
99
104
|
// music,
|
|
100
105
|
// transfer,
|
|
101
106
|
empty,
|
|
@@ -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
|
+
}
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const MESSAGE_TYPE = {
|
|
2
2
|
TEXT: 0,
|
|
3
3
|
TEXT_W: 1,
|
|
4
|
+
MERGE_MESSAGE: 4,
|
|
4
5
|
IMAGE: 14,
|
|
5
6
|
URLFile: 15,
|
|
6
7
|
VOICE: 16,
|
|
@@ -92,6 +93,9 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
92
93
|
case MESSAGE_TYPE.IMAGE:
|
|
93
94
|
shortMessage = '[图片消息]'
|
|
94
95
|
break
|
|
96
|
+
case MESSAGE_TYPE.MERGE_MESSAGE:
|
|
97
|
+
shortMessage = '[聊天记录]'
|
|
98
|
+
break
|
|
95
99
|
case MESSAGE_TYPE.VIDEO:
|
|
96
100
|
shortMessage = '[视频消息]'
|
|
97
101
|
break
|
|
@@ -121,6 +125,8 @@ export function formatShortMessage (msgType, msgContent) {
|
|
|
121
125
|
if (typeof jsonObj === 'object') {
|
|
122
126
|
if(jsonObj.contentType === 78) {
|
|
123
127
|
shortMessage = '[小程序消息]'
|
|
128
|
+
} else {
|
|
129
|
+
shortMessage = '[链接消息]'
|
|
124
130
|
}
|
|
125
131
|
} else {
|
|
126
132
|
shortMessage = '[链接消息]'
|
|
@@ -20,11 +20,10 @@
|
|
|
20
20
|
ref="player"
|
|
21
21
|
:id="nextId"
|
|
22
22
|
:url="voiceSrc"
|
|
23
|
-
:get-url-method="getUrlMethod"
|
|
24
23
|
:enable-convert-to-wav="enableConvertToWav"
|
|
25
24
|
:update-wav-method="updateWavMethod"
|
|
26
25
|
:seconds="voiceDuration"
|
|
27
|
-
:allow-download="
|
|
26
|
+
:allow-download="allowDownload"
|
|
28
27
|
></ac-voice-player>
|
|
29
28
|
</div>
|
|
30
29
|
</div>
|
|
@@ -102,9 +101,6 @@ export default {
|
|
|
102
101
|
type: Boolean,
|
|
103
102
|
default: true
|
|
104
103
|
},
|
|
105
|
-
downloadMethod: {
|
|
106
|
-
type: Function
|
|
107
|
-
},
|
|
108
104
|
transformVoiceToTextEnable: {
|
|
109
105
|
type: Boolean,
|
|
110
106
|
default: false
|
|
@@ -125,7 +121,6 @@ export default {
|
|
|
125
121
|
},
|
|
126
122
|
data () {
|
|
127
123
|
return {
|
|
128
|
-
downloadedContent: null,
|
|
129
124
|
transformStatus: typeof this.convertStatus === 'number' ? this.convertStatus : ConvertStatusEnum.NORMAL,
|
|
130
125
|
playRate: 1,
|
|
131
126
|
transforming: false,
|
|
@@ -135,13 +130,13 @@ export default {
|
|
|
135
130
|
},
|
|
136
131
|
computed: {
|
|
137
132
|
nextContent () {
|
|
138
|
-
return
|
|
133
|
+
return parse(this.content) || {}
|
|
139
134
|
},
|
|
140
135
|
voiceSrc () {
|
|
141
136
|
if (typeof this.nextContent === 'string') {
|
|
142
137
|
return this.nextContent
|
|
143
138
|
}
|
|
144
|
-
const voiceSrc = this.nextContent.resPath
|
|
139
|
+
const voiceSrc = this.nextContent.resPath
|
|
145
140
|
if (!voiceSrc) {
|
|
146
141
|
return
|
|
147
142
|
}
|
|
@@ -153,9 +148,6 @@ export default {
|
|
|
153
148
|
voiceDuration () {
|
|
154
149
|
return this.nextContent.durationMs ? this.nextContent.durationMs : null
|
|
155
150
|
},
|
|
156
|
-
canDownload () {
|
|
157
|
-
return this.allowDownload && !!this.nextContent.resPath
|
|
158
|
-
},
|
|
159
151
|
isPlaying () {
|
|
160
152
|
return this.AcVoice.isPlaying(this.id)
|
|
161
153
|
},
|
|
@@ -184,46 +176,6 @@ export default {
|
|
|
184
176
|
}
|
|
185
177
|
},
|
|
186
178
|
methods: {
|
|
187
|
-
getUrlMethod () {
|
|
188
|
-
const content = this.nextContent
|
|
189
|
-
const currentUrl = typeof content === 'string'
|
|
190
|
-
? content
|
|
191
|
-
: content.resPath || content.url
|
|
192
|
-
if (currentUrl) {
|
|
193
|
-
return Promise.resolve(currentUrl)
|
|
194
|
-
}
|
|
195
|
-
if (!this.downloadMethod) {
|
|
196
|
-
return Promise.reject(new Error('未找到语音下载方法'))
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const updateContentProps = (data) => {
|
|
200
|
-
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
201
|
-
throw new Error('updateContentProps只支持更新数据对象')
|
|
202
|
-
}
|
|
203
|
-
this.downloadedContent = data
|
|
204
|
-
return data
|
|
205
|
-
}
|
|
206
|
-
const result = this.downloadMethod({
|
|
207
|
-
content,
|
|
208
|
-
updateContentProp: (prop, value) => updateContentProps(Object.assign({}, this.nextContent, {[prop]: value})),
|
|
209
|
-
updateContentProps
|
|
210
|
-
})
|
|
211
|
-
return Promise.resolve(result).then((data) => {
|
|
212
|
-
const resultContent = typeof data === 'string' ? {url: data} : data
|
|
213
|
-
const url = resultContent && (resultContent.resPath || resultContent.url)
|
|
214
|
-
if (url) {
|
|
215
|
-
return url
|
|
216
|
-
}
|
|
217
|
-
const nextContent = this.nextContent
|
|
218
|
-
const nextUrl = typeof nextContent === 'string'
|
|
219
|
-
? nextContent
|
|
220
|
-
: nextContent.resPath || nextContent.url
|
|
221
|
-
if (nextUrl) {
|
|
222
|
-
return nextUrl
|
|
223
|
-
}
|
|
224
|
-
throw new Error('语音下载未返回有效地址')
|
|
225
|
-
})
|
|
226
|
-
},
|
|
227
179
|
handleTransformClick () {
|
|
228
180
|
if (this.transformVoiceToTextMethod) {
|
|
229
181
|
this.transforming = true
|
|
@@ -379,6 +379,25 @@
|
|
|
379
379
|
</template>
|
|
380
380
|
</sdk-chat-panel-box>
|
|
381
381
|
</template>
|
|
382
|
+
<template v-else-if="item.msgType === MESSAGE_TYPE.MERGE_MESSAGE">
|
|
383
|
+
<sdk-chat-panel-box
|
|
384
|
+
:dir="dir"
|
|
385
|
+
:data="item"
|
|
386
|
+
:fetchUserMethod="fetchUserMethod"
|
|
387
|
+
:blank="true"
|
|
388
|
+
@user-avatar-click="handleUserAvatarClick"
|
|
389
|
+
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
390
|
+
>
|
|
391
|
+
<sdk-chat-control-merge-message
|
|
392
|
+
v-bind="configData"
|
|
393
|
+
:id="item.id"
|
|
394
|
+
:content="msgContent"
|
|
395
|
+
></sdk-chat-control-merge-message>
|
|
396
|
+
<template slot="append" slot-scope="{ updateProp }">
|
|
397
|
+
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
398
|
+
</template>
|
|
399
|
+
</sdk-chat-panel-box>
|
|
400
|
+
</template>
|
|
382
401
|
<template v-else-if="item.msgType == MESSAGE_TYPE.CALLING">
|
|
383
402
|
<sdk-chat-panel-box
|
|
384
403
|
:dir="dir"
|
|
@@ -554,6 +573,7 @@ import {
|
|
|
554
573
|
// channelVideoCard as SdkChatControlChannelVideoCard,
|
|
555
574
|
channelLive as SdkChatControlChannelLive,
|
|
556
575
|
metting as SdkChatControlMetting,
|
|
576
|
+
mergeMessage as SdkChatControlMergeMessage,
|
|
557
577
|
url as SdkChatControlUrl,
|
|
558
578
|
fileUrl as SdkChatControlFileUrl,
|
|
559
579
|
jxSysText as SdkChatControlJxSysText,
|
|
@@ -593,6 +613,7 @@ export default {
|
|
|
593
613
|
// SdkChatControlChannelVideoCard,
|
|
594
614
|
SdkChatControlChannelLive,
|
|
595
615
|
SdkChatControlMetting,
|
|
616
|
+
SdkChatControlMergeMessage,
|
|
596
617
|
SdkChatControlFileUrl,
|
|
597
618
|
// SdkChatControlTextWithAt,
|
|
598
619
|
SdkChatControlUrl,
|