@aochuang/client-sdk 1.0.377 → 1.0.378-wework
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/location/location.vue +3 -3
- 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 +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 +138 -0
- package/components/wework-chat-control/text/text.vue +27 -143
- 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-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 +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 +121 -11
- package/services/client-chat/client-chat-wework/client-chat-session.js +271 -191
- package/services/client-chat/client-chat-wework/client-chat-socket.js +13 -1
- package/services/client-chat/client-chat-wework/client-chat.js +403 -84
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/services/socket/socket.js +14 -4
- 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
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="sdk-wechat-chat-control-config">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
1
|
<script>
|
|
7
2
|
export default {
|
|
8
|
-
name: '
|
|
3
|
+
name: 'SdkWeworkChatControlConfig',
|
|
9
4
|
provide () {
|
|
10
5
|
return {
|
|
11
|
-
|
|
6
|
+
SdkWeworkChatControlConfig: this
|
|
12
7
|
}
|
|
13
8
|
},
|
|
14
9
|
inject: {
|
|
15
10
|
// 可以继承上级的
|
|
16
|
-
|
|
11
|
+
SdkWeworkChatControlConfig: {
|
|
17
12
|
default: null
|
|
18
13
|
}
|
|
19
|
-
},
|
|
14
|
+
},
|
|
20
15
|
props: {
|
|
21
16
|
/**
|
|
22
|
-
* 这个是组件级别的配置,
|
|
17
|
+
* 这个是组件级别的配置,weworkChatPanel是消息级别的配置,后面是消息级别配置覆盖组件级别的配置
|
|
23
18
|
* {
|
|
24
19
|
* 1: {
|
|
25
20
|
* formatter () {
|
|
@@ -39,6 +34,9 @@ export default {
|
|
|
39
34
|
type: Function
|
|
40
35
|
}
|
|
41
36
|
},
|
|
37
|
+
render () {
|
|
38
|
+
return this.$slots.default
|
|
39
|
+
},
|
|
42
40
|
methods: {
|
|
43
41
|
getControlConfig (msgType) {
|
|
44
42
|
if (!this.controlConfig) {
|
|
@@ -47,13 +45,18 @@ export default {
|
|
|
47
45
|
return this.controlConfig[msgType]
|
|
48
46
|
},
|
|
49
47
|
getMessageConfig (msgData) {
|
|
48
|
+
const controlConfig = this.getControlConfig(msgData.msgType)
|
|
50
49
|
if (!this.messageConfig) {
|
|
51
|
-
return
|
|
50
|
+
return controlConfig
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
const messageConfig = this.messageConfig({
|
|
54
53
|
item: msgData
|
|
55
54
|
})
|
|
55
|
+
if (!messageConfig) {
|
|
56
|
+
return controlConfig
|
|
57
|
+
}
|
|
58
|
+
return Object.assign({}, controlConfig, messageConfig)
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
|
-
</script>
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sdk-wework-panel-chat-status">
|
|
3
|
+
<!-- status: 0 success, 1 sending, 2 failed, 3 timeout -->
|
|
4
|
+
<template v-if="data.status === 1">
|
|
5
|
+
<ui-loading size="mini"></ui-loading>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-else-if="data.status === 2">
|
|
8
|
+
<bi-tooltip :text="data.resultMsg || '发送失败'">
|
|
9
|
+
<span class="sdk-wework-panel-chat-status__error">
|
|
10
|
+
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m0-486.997334L391.338667 330.965333 330.965333 391.338667 451.669333 512l-120.704 120.661333 60.373334 60.373334L512 572.330667l120.661333 120.704 60.373334-60.373334L572.330667 512l120.704-120.661333-60.373334-60.373334L512 451.669333z" fill="currentColor"></path></svg>
|
|
11
|
+
</span>
|
|
12
|
+
</bi-tooltip>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-else-if="data.status === 3">
|
|
15
|
+
<bi-tooltip :text="data.resultMsg || '发送超时'">
|
|
16
|
+
<span class="sdk-wework-panel-chat-status__error">
|
|
17
|
+
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 938.666667C276.352 938.666667 85.333333 747.648 85.333333 512S276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667z m42.666667-426.666667V298.666667h-85.333334v298.666666h256v-85.333333h-170.666666z" fill="currentColor"></path></svg>
|
|
18
|
+
</span>
|
|
19
|
+
</bi-tooltip>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-if="data.recalled">
|
|
22
|
+
<bi-tooltip text="消息已撤回">
|
|
23
|
+
<span class="sdk-wework-panel-chat-status__error sdk-wework-panel-chat-status__recalled">
|
|
24
|
+
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0c282.752 0 512 229.248 512 512s-229.248 512-512 512S0 794.752 0 512 229.248 0 512 0z m-50.261333 255.317333c-7.765333-39.338667-39.893333-15.36-39.893334-15.36l-213.76 192c-47.616 34.944-2.730667 60.458667-2.730666 60.458667l211.541333 190.933333c42.410667 33.066667 45.866667-17.749333 45.866667-17.749333v-86.442667c215.125333-70.144 303.36 208.341333 303.36 208.341334 7.936 15.957333 13.824 0 13.824 0C862.933333 368.682667 461.952 348.586667 461.952 348.586667z" fill="currentColor"></path></svg>
|
|
25
|
+
</span>
|
|
26
|
+
</bi-tooltip>
|
|
27
|
+
</template>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import { Tooltip as BiTooltip } from '@aochuang/common/common'
|
|
33
|
+
import { Loading as UiLoading } from '@aochuang/common/components'
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'SdkWeworkPanelChatStatus',
|
|
37
|
+
components: {
|
|
38
|
+
BiTooltip,
|
|
39
|
+
UiLoading
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
data: {
|
|
43
|
+
type: Object,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
updateChatBoxProp: {
|
|
47
|
+
type: Function
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="less">
|
|
54
|
+
.sdk-wework-panel-chat-status__error {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
color: #c00;
|
|
60
|
+
width: 16px;
|
|
61
|
+
height: 16px;
|
|
62
|
+
svg {
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
.sdk-wework-panel-chat-status__recalled {
|
|
68
|
+
opacity: .6;
|
|
69
|
+
}
|
|
70
|
+
.sdk-wework-panel-chat-status {
|
|
71
|
+
margin: 0 6px;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<wework-chat-control-config-msg
|
|
3
3
|
:msgData="item"
|
|
4
4
|
>
|
|
5
5
|
<template slot-scope="{ configData }">
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<template v-if="item.msgType !== '_EMPTY_'">
|
|
8
8
|
<slot name="chat-prefix" :item="item"></slot>
|
|
9
9
|
</template>
|
|
10
|
-
<template v-if="
|
|
10
|
+
<template v-if="item.msgType === MESSAGE_TYPE.TEXT || item.msgType === MESSAGE_TYPE.TEXT_W">
|
|
11
11
|
<sdk-chat-panel-box
|
|
12
12
|
:dir="dir"
|
|
13
13
|
:data="item"
|
|
@@ -16,17 +16,20 @@
|
|
|
16
16
|
@user-avatar-click="handleUserAvatarClick"
|
|
17
17
|
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
18
18
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<template slot-scope="{ setFootVnode }">
|
|
20
|
+
<sdk-chat-control-text
|
|
21
|
+
v-bind="configData"
|
|
22
|
+
:id="item.id"
|
|
23
|
+
:content="msgContent"
|
|
24
|
+
:set-chat-box-foot-vnode="setFootVnode"
|
|
25
|
+
></sdk-chat-control-text>
|
|
26
|
+
</template>
|
|
24
27
|
<template slot="append" slot-scope="{ updateProp }">
|
|
25
28
|
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
26
29
|
</template>
|
|
27
30
|
</sdk-chat-panel-box>
|
|
28
31
|
</template>
|
|
29
|
-
<template v-else-if="
|
|
32
|
+
<template v-else-if="item.msgType === MESSAGE_TYPE.IMAGE">
|
|
30
33
|
<sdk-chat-panel-box
|
|
31
34
|
:dir="dir"
|
|
32
35
|
:data="item"
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
</template>
|
|
46
49
|
</sdk-chat-panel-box>
|
|
47
50
|
</template>
|
|
48
|
-
<template v-else-if="
|
|
51
|
+
<template v-else-if="item.msgType === MESSAGE_TYPE.VIDEO">
|
|
49
52
|
<sdk-chat-panel-box
|
|
50
53
|
:dir="dir"
|
|
51
54
|
:data="item"
|
|
@@ -289,7 +292,7 @@
|
|
|
289
292
|
</template>
|
|
290
293
|
</sdk-chat-panel-box>
|
|
291
294
|
</template>
|
|
292
|
-
<template v-else-if="item.msgType == MESSAGE_TYPE.
|
|
295
|
+
<template v-else-if="item.msgType == MESSAGE_TYPE.URLFile">
|
|
293
296
|
<sdk-chat-panel-box
|
|
294
297
|
:dir="dir"
|
|
295
298
|
:data="item"
|
|
@@ -300,19 +303,19 @@
|
|
|
300
303
|
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
301
304
|
>
|
|
302
305
|
<template slot-scope="{ updateProp }">
|
|
303
|
-
<sdk-chat-control-url
|
|
306
|
+
<sdk-chat-control-file-url
|
|
304
307
|
v-bind="configData"
|
|
305
308
|
:id="item.id"
|
|
306
309
|
:content="msgContent"
|
|
307
310
|
:update-chat-box-prop="updateProp"
|
|
308
|
-
></sdk-chat-control-url>
|
|
311
|
+
></sdk-chat-control-file-url>
|
|
309
312
|
</template>
|
|
310
313
|
<template slot="append" slot-scope="{ updateProp }">
|
|
311
314
|
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
312
315
|
</template>
|
|
313
316
|
</sdk-chat-panel-box>
|
|
314
317
|
</template>
|
|
315
|
-
<template v-else-if="
|
|
318
|
+
<template v-else-if="item.msgType == MESSAGE_TYPE.URL || item.msgType == MESSAGE_TYPE.URLNew">
|
|
316
319
|
<sdk-chat-panel-box
|
|
317
320
|
:dir="dir"
|
|
318
321
|
:data="item"
|
|
@@ -323,12 +326,12 @@
|
|
|
323
326
|
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
324
327
|
>
|
|
325
328
|
<template slot-scope="{ updateProp }">
|
|
326
|
-
<sdk-chat-control-
|
|
329
|
+
<sdk-chat-control-url
|
|
327
330
|
v-bind="configData"
|
|
328
331
|
:id="item.id"
|
|
329
332
|
:content="msgContent"
|
|
330
333
|
:update-chat-box-prop="updateProp"
|
|
331
|
-
></sdk-chat-control-
|
|
334
|
+
></sdk-chat-control-url>
|
|
332
335
|
</template>
|
|
333
336
|
<template slot="append" slot-scope="{ updateProp }">
|
|
334
337
|
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
@@ -353,19 +356,43 @@
|
|
|
353
356
|
</template>
|
|
354
357
|
</sdk-chat-panel-box>
|
|
355
358
|
</template>
|
|
356
|
-
<template v-else-if="item.msgType
|
|
359
|
+
<template v-else-if="item.msgType === MESSAGE_TYPE.MEETING">
|
|
357
360
|
<sdk-chat-panel-box
|
|
358
361
|
:dir="dir"
|
|
359
362
|
:data="item"
|
|
360
363
|
:fetchUserMethod="fetchUserMethod"
|
|
364
|
+
:blank="true"
|
|
361
365
|
@user-avatar-click="handleUserAvatarClick"
|
|
362
366
|
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
363
367
|
>
|
|
364
|
-
<
|
|
368
|
+
<template slot-scope="{ updateProp }">
|
|
369
|
+
<sdk-chat-control-metting
|
|
370
|
+
v-bind="configData"
|
|
371
|
+
:id="item.id"
|
|
372
|
+
:content="msgContent"
|
|
373
|
+
:initiator="item.qwAccountName || item.contactName || item.ownerAccountUserName"
|
|
374
|
+
:update-chat-box-prop="updateProp"
|
|
375
|
+
></sdk-chat-control-metting>
|
|
376
|
+
</template>
|
|
377
|
+
<template slot="append" slot-scope="{ updateProp }">
|
|
378
|
+
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
379
|
+
</template>
|
|
380
|
+
</sdk-chat-panel-box>
|
|
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
|
|
365
392
|
v-bind="configData"
|
|
366
393
|
:id="item.id"
|
|
367
394
|
:content="msgContent"
|
|
368
|
-
></sdk-chat-control-
|
|
395
|
+
></sdk-chat-control-merge-message>
|
|
369
396
|
<template slot="append" slot-scope="{ updateProp }">
|
|
370
397
|
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
371
398
|
</template>
|
|
@@ -510,7 +537,7 @@
|
|
|
510
537
|
:content="msgContent"
|
|
511
538
|
></sdk-chat-control-empty>
|
|
512
539
|
</template>
|
|
513
|
-
|
|
540
|
+
<template v-else>
|
|
514
541
|
<sdk-chat-panel-box
|
|
515
542
|
:dir="dir"
|
|
516
543
|
:data="item"
|
|
@@ -523,10 +550,10 @@
|
|
|
523
550
|
:content="msgContent"
|
|
524
551
|
></sdk-chat-control-unknow>
|
|
525
552
|
</sdk-chat-panel-box>
|
|
526
|
-
</template>
|
|
553
|
+
</template>
|
|
527
554
|
</div>
|
|
528
555
|
</template>
|
|
529
|
-
</
|
|
556
|
+
</wework-chat-control-config-msg>
|
|
530
557
|
</template>
|
|
531
558
|
<script>
|
|
532
559
|
import SdkChatPanelBox from '../chat-panel/chat-panel-box'
|
|
@@ -545,6 +572,8 @@ import {
|
|
|
545
572
|
channelVideo as SdkChatControlChannelVideo,
|
|
546
573
|
// channelVideoCard as SdkChatControlChannelVideoCard,
|
|
547
574
|
channelLive as SdkChatControlChannelLive,
|
|
575
|
+
metting as SdkChatControlMetting,
|
|
576
|
+
mergeMessage as SdkChatControlMergeMessage,
|
|
548
577
|
url as SdkChatControlUrl,
|
|
549
578
|
fileUrl as SdkChatControlFileUrl,
|
|
550
579
|
jxSysText as SdkChatControlJxSysText,
|
|
@@ -564,10 +593,10 @@ import {
|
|
|
564
593
|
unknow as SdkChatControlUnknow
|
|
565
594
|
} from '../wework-chat-control'
|
|
566
595
|
import { MESSAGE_TYPE } from '../wework-chat-control/util'
|
|
567
|
-
import
|
|
596
|
+
import WeworkChatControlConfigMsg from '../wework-chat-control/wework-chat-control-config-msg.vue'
|
|
568
597
|
|
|
569
598
|
export default {
|
|
570
|
-
name: '
|
|
599
|
+
name: 'SdkWeworkPanelItem',
|
|
571
600
|
components: {
|
|
572
601
|
SdkChatPanelBox,
|
|
573
602
|
SdkChatControlText,
|
|
@@ -583,6 +612,8 @@ export default {
|
|
|
583
612
|
SdkChatControlChannelVideo,
|
|
584
613
|
// SdkChatControlChannelVideoCard,
|
|
585
614
|
SdkChatControlChannelLive,
|
|
615
|
+
SdkChatControlMetting,
|
|
616
|
+
SdkChatControlMergeMessage,
|
|
586
617
|
SdkChatControlFileUrl,
|
|
587
618
|
// SdkChatControlTextWithAt,
|
|
588
619
|
SdkChatControlUrl,
|
|
@@ -601,7 +632,7 @@ export default {
|
|
|
601
632
|
// SdkChatControlRevokeMeMessage,
|
|
602
633
|
// SdkChatControlRevokeOtherMessage,
|
|
603
634
|
// SdkChatControlRevokeYouMessage,
|
|
604
|
-
|
|
635
|
+
WeworkChatControlConfigMsg
|
|
605
636
|
},
|
|
606
637
|
props: {
|
|
607
638
|
dir: {
|
|
@@ -647,4 +678,4 @@ export default {
|
|
|
647
678
|
}
|
|
648
679
|
}
|
|
649
680
|
}
|
|
650
|
-
</script>
|
|
681
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<sdk-chat-panel
|
|
3
3
|
ref="panel"
|
|
4
|
-
v-bind="
|
|
4
|
+
v-bind="props"
|
|
5
5
|
:is-sender-method="handleIsSenderMethod"
|
|
6
6
|
@initloaded="handleChatsInitLoaded"
|
|
7
7
|
@chat-contextmenu="handleChatContext"
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
:fetch-user-method="fetchUserMethod"
|
|
18
18
|
:config="config"
|
|
19
19
|
>
|
|
20
|
-
|
|
20
|
+
<template slot="chat-append" slot-scope="{ item, updateProp }">
|
|
21
21
|
<chat-panel-chat-status
|
|
22
22
|
:data="item"
|
|
23
23
|
:update-chat-box-prop="updateProp"
|
|
24
24
|
></chat-panel-chat-status>
|
|
25
|
-
</template>
|
|
25
|
+
</template>
|
|
26
26
|
<template slot="chat-prefix" slot-scope="{ item }">
|
|
27
27
|
<template v-if="selectable && handleFilterSelectMessageMethod(item)">
|
|
28
28
|
<div class="sdk-wechat-chat-panel__checkbox">
|
|
@@ -37,18 +37,23 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
<template slot="main">
|
|
39
39
|
<slot name="main"></slot>
|
|
40
|
+
<template v-if="selectable">
|
|
41
|
+
<slot name="selection" :total="checkTotal"></slot>
|
|
42
|
+
</template>
|
|
40
43
|
</template>
|
|
41
44
|
</sdk-chat-panel>
|
|
42
45
|
</template>
|
|
43
46
|
<script>
|
|
44
47
|
import SdkChatPanel from '../chat-panel'
|
|
45
48
|
import ChatPanelItem from './chat-panel-item.vue'
|
|
49
|
+
import ChatPanelChatStatus from './chat-panel-chat-status/chat-panel-chat-status.vue'
|
|
46
50
|
|
|
47
51
|
export default {
|
|
48
52
|
name: 'SdkWeworkChatPanel',
|
|
49
53
|
components: {
|
|
50
54
|
SdkChatPanel,
|
|
51
|
-
ChatPanelItem
|
|
55
|
+
ChatPanelItem,
|
|
56
|
+
ChatPanelChatStatus
|
|
52
57
|
},
|
|
53
58
|
props: {
|
|
54
59
|
mode: {
|
|
@@ -59,7 +64,8 @@ export default {
|
|
|
59
64
|
}
|
|
60
65
|
},
|
|
61
66
|
keyField: {
|
|
62
|
-
type: String
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'id'
|
|
63
69
|
},
|
|
64
70
|
startDate: {
|
|
65
71
|
type: Number
|
|
@@ -88,9 +94,6 @@ export default {
|
|
|
88
94
|
type: Boolean,
|
|
89
95
|
default: true
|
|
90
96
|
},
|
|
91
|
-
renderControl: {
|
|
92
|
-
type: Function
|
|
93
|
-
},
|
|
94
97
|
fetchUserMethod: {
|
|
95
98
|
type: Function
|
|
96
99
|
},
|
|
@@ -126,14 +129,35 @@ export default {
|
|
|
126
129
|
},
|
|
127
130
|
contextChatId: {
|
|
128
131
|
type: String
|
|
132
|
+
},
|
|
133
|
+
onBeforeSelectionChange: {
|
|
134
|
+
type: Function
|
|
129
135
|
}
|
|
130
136
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
data () {
|
|
138
|
+
return {
|
|
139
|
+
checkMsgMap: {}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
computed: {
|
|
143
|
+
props () {
|
|
144
|
+
const { config, ...nextProps } = this.$props
|
|
145
|
+
return nextProps
|
|
134
146
|
},
|
|
147
|
+
checkTotal () {
|
|
148
|
+
return Object.keys(this.checkMsgMap).length
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
watch: {
|
|
152
|
+
selectable () {
|
|
153
|
+
if (!this.selectable) {
|
|
154
|
+
this.checkMsgMap = {}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
methods: {
|
|
135
159
|
handleIsSenderMethod ({ item }) {
|
|
136
|
-
return !!item.
|
|
160
|
+
return !!item.isSend
|
|
137
161
|
},
|
|
138
162
|
handleChatsInitLoaded () {
|
|
139
163
|
this.$emit('initloaded')
|
|
@@ -148,8 +172,67 @@ export default {
|
|
|
148
172
|
this.currentContextChat = null
|
|
149
173
|
return this.$refs.panel && this.$refs.panel.reload()
|
|
150
174
|
},
|
|
175
|
+
handleFilterSelectMessageMethod (msg) {
|
|
176
|
+
if (!this.filterSelectMessageMethod) {
|
|
177
|
+
return true
|
|
178
|
+
}
|
|
179
|
+
return this.filterSelectMessageMethod({
|
|
180
|
+
item: msg
|
|
181
|
+
})
|
|
182
|
+
},
|
|
183
|
+
handleMsgCheckboxChange (msg, value) {
|
|
184
|
+
if (value) {
|
|
185
|
+
this.selectChat(msg)
|
|
186
|
+
} else {
|
|
187
|
+
this.unselectChat(msg)
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
selectChat (chat) {
|
|
191
|
+
if (!chat) {
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
if (!this.selectable) {
|
|
195
|
+
console.warn('未开启选择')
|
|
196
|
+
return
|
|
197
|
+
}
|
|
198
|
+
if (this.onBeforeSelectionChange && this.onBeforeSelectionChange({
|
|
199
|
+
chat,
|
|
200
|
+
value: true
|
|
201
|
+
}) === false) {
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
this.$set(this.checkMsgMap, chat[this.keyField], chat)
|
|
205
|
+
},
|
|
206
|
+
unselectChat (chat) {
|
|
207
|
+
if (!chat) {
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
if (!this.selectable) {
|
|
211
|
+
console.warn('未开启选择')
|
|
212
|
+
return
|
|
213
|
+
}
|
|
214
|
+
if (this.onBeforeSelectionChange && this.onBeforeSelectionChange({
|
|
215
|
+
chat,
|
|
216
|
+
value: false
|
|
217
|
+
}) === false) {
|
|
218
|
+
return
|
|
219
|
+
}
|
|
220
|
+
this.$delete(this.checkMsgMap, chat[this.keyField])
|
|
221
|
+
},
|
|
222
|
+
unselectAllChat () {
|
|
223
|
+
return Object.keys(this.checkMsgMap).map(key => {
|
|
224
|
+
return this.unselectChat(this.checkMsgMap[key])
|
|
225
|
+
})
|
|
226
|
+
},
|
|
227
|
+
getSelectChats () {
|
|
228
|
+
return Object.keys(this.checkMsgMap).map(key => {
|
|
229
|
+
return this.checkMsgMap[key]
|
|
230
|
+
})
|
|
231
|
+
},
|
|
151
232
|
handleChatContext (item, evt) {
|
|
152
|
-
this.$emit('chat-contextmenu',
|
|
233
|
+
this.$emit('chat-contextmenu', {
|
|
234
|
+
item
|
|
235
|
+
}, evt)
|
|
153
236
|
},
|
|
154
237
|
handleChatViewContext ({ item }) {
|
|
155
238
|
this.$emit('chat-view-context', {
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aochuang/client-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.378-wework",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"files": [
|
|
6
|
+
"common",
|
|
7
|
+
"components",
|
|
8
|
+
"services",
|
|
9
|
+
"utils",
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./components/index.js"
|
|
7
14
|
},
|
|
8
15
|
"repository": {
|
|
9
16
|
"type": "git",
|
|
Binary file
|
|
@@ -146,6 +146,21 @@ export default class ClientChatMessage {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
if (fireEvent !== false) {
|
|
149
|
+
// 先执行onAddMessageSuccess再发add-message事件,保证会话的getSession轮询先由这里发起、更新会话的回调排在最前面,
|
|
150
|
+
// 外部监听add-message后再调getSession只是复用同一个轮询
|
|
151
|
+
// try/catch是为了避免回调里的异常把add-message事件吞掉(外部的新消息提醒、本地消息缓存都依赖这个事件)
|
|
152
|
+
try {
|
|
153
|
+
this.onAddMessageSuccess && this.onAddMessageSuccess({
|
|
154
|
+
data,
|
|
155
|
+
lastMessageTime,
|
|
156
|
+
isBeforeLastMessage
|
|
157
|
+
})
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error('[client-chat-message] onAddMessageSuccess error', {
|
|
160
|
+
messageId: data.id,
|
|
161
|
+
error
|
|
162
|
+
})
|
|
163
|
+
}
|
|
149
164
|
// 如果消息包含这种情况,就不能往外发送add-message事件
|
|
150
165
|
// 因为例如群发的消息,他没有会话,导致前端在处理来了新消息通知铃声提醒,获取会话一直获取不到,然后会总是发送请求
|
|
151
166
|
if (!isBeforeLastMessage && !isAutoReadMessage(data) && !shouldIgnoreSessionByMessage(data) && !isDeletedMsg(data) && !isBlockedMsg(data)) {
|
|
@@ -153,11 +168,6 @@ export default class ClientChatMessage {
|
|
|
153
168
|
data
|
|
154
169
|
})
|
|
155
170
|
}
|
|
156
|
-
this.onAddMessageSuccess && this.onAddMessageSuccess({
|
|
157
|
-
data,
|
|
158
|
-
lastMessageTime,
|
|
159
|
-
isBeforeLastMessage
|
|
160
|
-
})
|
|
161
171
|
}
|
|
162
172
|
}
|
|
163
173
|
|