@aochuang/client-sdk 1.0.340 → 1.0.341
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/index.js +1 -6
- package/components/session-select/session-select-item.vue +9 -8
- package/components/wechat-chat-control/calling/calling.vue +3 -0
- package/components/wechat-chat-control/voice/voice.vue +4 -0
- package/components/wework-chat-control/company-card/company-card.vue +1 -1
- package/components/wework-chat-control/file-url/file-url.vue +5 -2
- package/components/wework-chat-control/image/image.vue +2 -137
- package/components/wework-chat-control/index.js +6 -6
- package/components/wework-chat-control/text/text.vue +3 -22
- package/components/wework-chat-control/util.js +6 -12
- package/components/wework-chat-control/video/video.vue +2 -10
- package/components/wework-chat-control/voice/voice.vue +1 -1
- package/components/wework-chat-panel/chat-panel-controls/company-card/company-card.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/expression/expression.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/file-url/file-url.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/image/image.vue +36 -0
- package/components/wework-chat-panel/chat-panel-controls/index.js +35 -0
- package/components/wework-chat-panel/chat-panel-controls/jx-sys-text/jx-sys-text.vue +28 -0
- package/components/wework-chat-panel/chat-panel-controls/link/link.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/location/location.vue +35 -0
- package/components/wework-chat-panel/chat-panel-controls/text/text.vue +43 -0
- package/components/wework-chat-panel/chat-panel-controls/unkonw/unkonw.vue +39 -0
- package/components/wework-chat-panel/chat-panel-controls/video/video.vue +37 -0
- package/components/wework-chat-panel/chat-panel-controls/voice/voice.vue +35 -0
- package/components/wework-chat-panel/chat-panel-item.vue +35 -12
- package/components/wework-chat-panel/chat-panel.vue +12 -95
- package/package.json +1 -1
- package/services/client-chat/client-chat-wework/client-chat-concats.js +17 -81
- package/services/client-chat/client-chat-wework/client-chat-message.js +5 -5
- package/services/client-chat/client-chat-wework/client-chat-session.js +2 -50
- package/services/client-chat/client-chat-wework/client-chat-socket.js +1 -5
- package/services/client-chat/client-chat-wework/client-chat.js +6 -258
- package/services/client-chat/client-chat-wework/utils.js +5 -5
- package/components/wework-chat-control/wework-chat-control-config-item.vue +0 -24
- package/components/wework-chat-control/wework-chat-control-config-msg.vue +0 -25
- package/components/wework-chat-control/wework-chat-control-config.vue +0 -62
- package/components/wework-chat-panel/chat-panel-chat-status/chat-panel-chat-status.vue +0 -73
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { link } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsLink',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(link, {
|
|
29
|
+
props: {
|
|
30
|
+
data: props.data
|
|
31
|
+
}
|
|
32
|
+
})])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { location } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsLocation',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(location, {
|
|
29
|
+
props: {
|
|
30
|
+
content: props.data.content
|
|
31
|
+
}
|
|
32
|
+
})])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { text } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsText',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
class: 'sdk-chat-panel-controls-text',
|
|
24
|
+
props: {
|
|
25
|
+
dir: props.dir,
|
|
26
|
+
data: props.data,
|
|
27
|
+
fetchUserMethod: props.fetchUserMethod
|
|
28
|
+
}
|
|
29
|
+
}, [h('div', {
|
|
30
|
+
class: 'sdk-chat-panel-controls-text__main'
|
|
31
|
+
}, [h(text, {
|
|
32
|
+
props: {
|
|
33
|
+
data: props.data
|
|
34
|
+
}
|
|
35
|
+
})])])
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
<style>
|
|
40
|
+
.sdk-chat-panel-controls-text__main{
|
|
41
|
+
padding: 10px;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sdk-chat-panel-box
|
|
3
|
+
:data="data"
|
|
4
|
+
:dir="dir"
|
|
5
|
+
:fetch-user-method="fetchUserMethod"
|
|
6
|
+
>
|
|
7
|
+
<div class="sdk-wework-chat-panel-controls-unkonw__main">
|
|
8
|
+
未知消息
|
|
9
|
+
</div>
|
|
10
|
+
</sdk-chat-panel-box>
|
|
11
|
+
</template>
|
|
12
|
+
<script>
|
|
13
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'SdkWeworkChatPanelControlsUnkonw',
|
|
17
|
+
components: {
|
|
18
|
+
SdkChatPanelBox
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
dir: {
|
|
22
|
+
type: String
|
|
23
|
+
},
|
|
24
|
+
data: {
|
|
25
|
+
type: Object,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
fetchUserMethod: {
|
|
29
|
+
type: Function
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
<style lang="less">
|
|
35
|
+
.sdk-wework-chat-panel-controls-unkonw__main{
|
|
36
|
+
padding: 12px;
|
|
37
|
+
color: #999;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sdk-chat-panel-box
|
|
3
|
+
:data="data"
|
|
4
|
+
:dir="dir"
|
|
5
|
+
:fetch-user-method="fetchUserMethod"
|
|
6
|
+
>
|
|
7
|
+
<sdk-chat-control-video
|
|
8
|
+
:data="data"
|
|
9
|
+
width="240px"
|
|
10
|
+
height="180px"
|
|
11
|
+
></sdk-chat-control-video>
|
|
12
|
+
</sdk-chat-panel-box>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
16
|
+
import { video } from '../../../wework-chat-control'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'SdkWeworkChatPanelControlsVideo',
|
|
20
|
+
components: {
|
|
21
|
+
SdkChatPanelBox,
|
|
22
|
+
SdkChatControlVideo: video
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
dir: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
data: {
|
|
29
|
+
type: Object,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
fetchUserMethod: {
|
|
33
|
+
type: Function
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SdkChatPanelBox from '../../../chat-panel/chat-panel-box'
|
|
3
|
+
import { voice } from '../../../wework-chat-control'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'SdkWeworkChatPanelControlsVoice',
|
|
7
|
+
functional: true,
|
|
8
|
+
props: {
|
|
9
|
+
dir: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fetchUserMethod: {
|
|
17
|
+
type: Function
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const { props } = c
|
|
22
|
+
return h(SdkChatPanelBox, {
|
|
23
|
+
props: {
|
|
24
|
+
dir: props.dir,
|
|
25
|
+
data: props.data,
|
|
26
|
+
fetchUserMethod: props.fetchUserMethod
|
|
27
|
+
}
|
|
28
|
+
}, [h(voice, {
|
|
29
|
+
props: {
|
|
30
|
+
content: props.data.content
|
|
31
|
+
}
|
|
32
|
+
})])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<wechat-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="[0, 1, 2].includes(item.msgType)">
|
|
11
11
|
<sdk-chat-panel-box
|
|
12
12
|
:dir="dir"
|
|
13
13
|
:data="item"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
</sdk-chat-panel-box>
|
|
28
28
|
</template>
|
|
29
|
-
<template v-else-if="item.msgType
|
|
29
|
+
<template v-else-if="[14, 101].includes(item.msgType)">
|
|
30
30
|
<sdk-chat-panel-box
|
|
31
31
|
:dir="dir"
|
|
32
32
|
:data="item"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
</template>
|
|
46
46
|
</sdk-chat-panel-box>
|
|
47
47
|
</template>
|
|
48
|
-
<template v-else-if="item.msgType
|
|
48
|
+
<template v-else-if="[22, 23, 103].includes(item.msgType)">
|
|
49
49
|
<sdk-chat-panel-box
|
|
50
50
|
:dir="dir"
|
|
51
51
|
:data="item"
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
</template>
|
|
290
290
|
</sdk-chat-panel-box>
|
|
291
291
|
</template>
|
|
292
|
-
<template v-else-if="item.msgType == MESSAGE_TYPE.URL
|
|
292
|
+
<template v-else-if="item.msgType == MESSAGE_TYPE.URL">
|
|
293
293
|
<sdk-chat-panel-box
|
|
294
294
|
:dir="dir"
|
|
295
295
|
:data="item"
|
|
@@ -312,6 +312,29 @@
|
|
|
312
312
|
</template>
|
|
313
313
|
</sdk-chat-panel-box>
|
|
314
314
|
</template>
|
|
315
|
+
<template v-else-if="[13, 15, 20, 102].includes(item.msgType)">
|
|
316
|
+
<sdk-chat-panel-box
|
|
317
|
+
:dir="dir"
|
|
318
|
+
:data="item"
|
|
319
|
+
:fetchUserMethod="fetchUserMethod"
|
|
320
|
+
bg-color="#fff"
|
|
321
|
+
br-color="#ddd"
|
|
322
|
+
@user-avatar-click="handleUserAvatarClick"
|
|
323
|
+
@user-avatar-contextmenu="handleUserAvatarContextmenu"
|
|
324
|
+
>
|
|
325
|
+
<template slot-scope="{ updateProp }">
|
|
326
|
+
<sdk-chat-control-file-url
|
|
327
|
+
v-bind="configData"
|
|
328
|
+
:id="item.id"
|
|
329
|
+
:content="msgContent"
|
|
330
|
+
:update-chat-box-prop="updateProp"
|
|
331
|
+
></sdk-chat-control-file-url>
|
|
332
|
+
</template>
|
|
333
|
+
<template slot="append" slot-scope="{ updateProp }">
|
|
334
|
+
<slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
|
|
335
|
+
</template>
|
|
336
|
+
</sdk-chat-panel-box>
|
|
337
|
+
</template>
|
|
315
338
|
<template v-else-if="item.msgType == MESSAGE_TYPE.CUSTOM_EXPRESSION">
|
|
316
339
|
<sdk-chat-panel-box
|
|
317
340
|
:dir="dir"
|
|
@@ -487,7 +510,7 @@
|
|
|
487
510
|
:content="msgContent"
|
|
488
511
|
></sdk-chat-control-empty>
|
|
489
512
|
</template>
|
|
490
|
-
<template v-else>
|
|
513
|
+
<!-- <template v-else>
|
|
491
514
|
<sdk-chat-panel-box
|
|
492
515
|
:dir="dir"
|
|
493
516
|
:data="item"
|
|
@@ -500,10 +523,10 @@
|
|
|
500
523
|
:content="msgContent"
|
|
501
524
|
></sdk-chat-control-unknow>
|
|
502
525
|
</sdk-chat-panel-box>
|
|
503
|
-
</template>
|
|
526
|
+
</template> -->
|
|
504
527
|
</div>
|
|
505
528
|
</template>
|
|
506
|
-
</
|
|
529
|
+
</wechat-chat-control-config-msg>
|
|
507
530
|
</template>
|
|
508
531
|
<script>
|
|
509
532
|
import SdkChatPanelBox from '../chat-panel/chat-panel-box'
|
|
@@ -541,10 +564,10 @@ import {
|
|
|
541
564
|
unknow as SdkChatControlUnknow
|
|
542
565
|
} from '../wework-chat-control'
|
|
543
566
|
import { MESSAGE_TYPE } from '../wework-chat-control/util'
|
|
544
|
-
import
|
|
567
|
+
import WechatChatControlConfigMsg from '../wechat-chat-control/wechat-chat-control-config-msg.vue'
|
|
545
568
|
|
|
546
569
|
export default {
|
|
547
|
-
name: '
|
|
570
|
+
name: 'SdkWechatPanelItem',
|
|
548
571
|
components: {
|
|
549
572
|
SdkChatPanelBox,
|
|
550
573
|
SdkChatControlText,
|
|
@@ -578,7 +601,7 @@ export default {
|
|
|
578
601
|
// SdkChatControlRevokeMeMessage,
|
|
579
602
|
// SdkChatControlRevokeOtherMessage,
|
|
580
603
|
// SdkChatControlRevokeYouMessage,
|
|
581
|
-
|
|
604
|
+
WechatChatControlConfigMsg
|
|
582
605
|
},
|
|
583
606
|
props: {
|
|
584
607
|
dir: {
|
|
@@ -624,4 +647,4 @@ export default {
|
|
|
624
647
|
}
|
|
625
648
|
}
|
|
626
649
|
}
|
|
627
|
-
</script>
|
|
650
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<sdk-chat-panel
|
|
3
3
|
ref="panel"
|
|
4
|
-
v-bind="props"
|
|
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
|
-
<template slot="chat-append" slot-scope="{ item, updateProp }">
|
|
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,23 +37,18 @@
|
|
|
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>
|
|
43
40
|
</template>
|
|
44
41
|
</sdk-chat-panel>
|
|
45
42
|
</template>
|
|
46
43
|
<script>
|
|
47
44
|
import SdkChatPanel from '../chat-panel'
|
|
48
45
|
import ChatPanelItem from './chat-panel-item.vue'
|
|
49
|
-
import ChatPanelChatStatus from './chat-panel-chat-status/chat-panel-chat-status.vue'
|
|
50
46
|
|
|
51
47
|
export default {
|
|
52
48
|
name: 'SdkWeworkChatPanel',
|
|
53
49
|
components: {
|
|
54
50
|
SdkChatPanel,
|
|
55
|
-
ChatPanelItem
|
|
56
|
-
ChatPanelChatStatus
|
|
51
|
+
ChatPanelItem
|
|
57
52
|
},
|
|
58
53
|
props: {
|
|
59
54
|
mode: {
|
|
@@ -64,8 +59,7 @@ export default {
|
|
|
64
59
|
}
|
|
65
60
|
},
|
|
66
61
|
keyField: {
|
|
67
|
-
type: String
|
|
68
|
-
default: 'id'
|
|
62
|
+
type: String
|
|
69
63
|
},
|
|
70
64
|
startDate: {
|
|
71
65
|
type: Number
|
|
@@ -94,6 +88,9 @@ export default {
|
|
|
94
88
|
type: Boolean,
|
|
95
89
|
default: true
|
|
96
90
|
},
|
|
91
|
+
renderControl: {
|
|
92
|
+
type: Function
|
|
93
|
+
},
|
|
97
94
|
fetchUserMethod: {
|
|
98
95
|
type: Function
|
|
99
96
|
},
|
|
@@ -129,33 +126,12 @@ export default {
|
|
|
129
126
|
},
|
|
130
127
|
contextChatId: {
|
|
131
128
|
type: String
|
|
132
|
-
},
|
|
133
|
-
onBeforeSelectionChange: {
|
|
134
|
-
type: Function
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
data () {
|
|
138
|
-
return {
|
|
139
|
-
checkMsgMap: {}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
computed: {
|
|
143
|
-
props () {
|
|
144
|
-
const { config, ...nextProps } = this.$props
|
|
145
|
-
return nextProps
|
|
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
129
|
}
|
|
157
130
|
},
|
|
158
131
|
methods: {
|
|
132
|
+
handleRenderControl ({ item }) {
|
|
133
|
+
return ChatControls[item.msgType] || ChatControls.unkonw
|
|
134
|
+
},
|
|
159
135
|
handleIsSenderMethod ({ item }) {
|
|
160
136
|
return !!item.send
|
|
161
137
|
},
|
|
@@ -172,67 +148,8 @@ export default {
|
|
|
172
148
|
this.currentContextChat = null
|
|
173
149
|
return this.$refs.panel && this.$refs.panel.reload()
|
|
174
150
|
},
|
|
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
|
-
},
|
|
232
151
|
handleChatContext (item, evt) {
|
|
233
|
-
this.$emit('chat-contextmenu',
|
|
234
|
-
item
|
|
235
|
-
}, evt)
|
|
152
|
+
this.$emit('chat-contextmenu', item, evt)
|
|
236
153
|
},
|
|
237
154
|
handleChatViewContext ({ item }) {
|
|
238
155
|
this.$emit('chat-view-context', {
|
package/package.json
CHANGED
|
@@ -126,7 +126,11 @@ export default class ClientChatContacts {
|
|
|
126
126
|
*/
|
|
127
127
|
roomBindMemberMap: {},
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
/**
|
|
130
|
+
* 标记通讯录是否修改了
|
|
131
|
+
* 如果修改了,比如接收到了分配好友的会话时,一定通讯录变了,变了的时候界面需要根据这个状态刷新通讯录
|
|
132
|
+
*/
|
|
133
|
+
isModify: false
|
|
130
134
|
})
|
|
131
135
|
|
|
132
136
|
friendMap = {}
|
|
@@ -233,6 +237,10 @@ export default class ClientChatContacts {
|
|
|
233
237
|
return this.data.roomGroupData
|
|
234
238
|
}
|
|
235
239
|
|
|
240
|
+
get isModify () {
|
|
241
|
+
return this.data.isModify
|
|
242
|
+
}
|
|
243
|
+
|
|
236
244
|
setRoomGroup (data) {
|
|
237
245
|
this.data.roomGroupData = []
|
|
238
246
|
if (data && data.length) {
|
|
@@ -483,10 +491,10 @@ export default class ClientChatContacts {
|
|
|
483
491
|
}
|
|
484
492
|
}
|
|
485
493
|
const qwAccountId = this.roomMap[id].qwAccountId
|
|
486
|
-
if (qwAccountId && this.data.
|
|
487
|
-
const bindIndex = this.data.
|
|
494
|
+
if (qwAccountId && this.data.accountBindFriendMap[qwAccountId] && this.data.accountBindFriendMap[qwAccountId][groupId]) {
|
|
495
|
+
const bindIndex = this.data.accountBindFriendMap[qwAccountId][groupId].indexOf(this.roomMap[id])
|
|
488
496
|
if (bindIndex >= 0) {
|
|
489
|
-
this.data.
|
|
497
|
+
this.data.accountBindFriendMap[qwAccountId][groupId].splice(bindIndex, 1)
|
|
490
498
|
}
|
|
491
499
|
}
|
|
492
500
|
})
|
|
@@ -620,37 +628,6 @@ export default class ClientChatContacts {
|
|
|
620
628
|
return rs
|
|
621
629
|
})
|
|
622
630
|
}
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* 强制从服务端刷新好友资料,绕过本地缓存。
|
|
626
|
-
*/
|
|
627
|
-
refreshFriend (friendId) {
|
|
628
|
-
if (!friendId) {
|
|
629
|
-
return Promise.reject('缺少好友id')
|
|
630
|
-
}
|
|
631
|
-
if (!this.getContactsFriendMethod) {
|
|
632
|
-
return Promise.reject(new Error('getContactsFriendMethod未定义'))
|
|
633
|
-
}
|
|
634
|
-
return this.getContactsFriendMethod({
|
|
635
|
-
id: friendId
|
|
636
|
-
}).then(rs => {
|
|
637
|
-
if (!rs || !rs.data) {
|
|
638
|
-
return Promise.reject('未找到好友' + friendId)
|
|
639
|
-
}
|
|
640
|
-
if (this.friendMap[friendId]) {
|
|
641
|
-
const nextKeys = Object.keys(rs.data)
|
|
642
|
-
Object.keys(this.friendMap[friendId]).forEach(key => {
|
|
643
|
-
if (!nextKeys.includes(key)) {
|
|
644
|
-
Vue.delete(this.friendMap[friendId], key)
|
|
645
|
-
}
|
|
646
|
-
})
|
|
647
|
-
this.updateFriend(friendId, rs.data)
|
|
648
|
-
} else {
|
|
649
|
-
this.addFriend(rs.data)
|
|
650
|
-
}
|
|
651
|
-
return rs
|
|
652
|
-
})
|
|
653
|
-
}
|
|
654
631
|
|
|
655
632
|
setRoomMemberData (roomId, data) {
|
|
656
633
|
if (!roomId) {
|
|
@@ -761,52 +738,12 @@ export default class ClientChatContacts {
|
|
|
761
738
|
})
|
|
762
739
|
}
|
|
763
740
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
return Promise.reject('缺少群id')
|
|
767
|
-
}
|
|
768
|
-
if (!this.getContactsRoomMethod) {
|
|
769
|
-
return Promise.reject(new Error('getContactsRoomMethod未定义'))
|
|
770
|
-
}
|
|
771
|
-
return this.getContactsRoomMethod({
|
|
772
|
-
id
|
|
773
|
-
}).then(rs => {
|
|
774
|
-
if (!rs || !rs.data) {
|
|
775
|
-
return Promise.reject('未找到群' + id)
|
|
776
|
-
}
|
|
777
|
-
const localRoom = this.roomMap[id]
|
|
778
|
-
if (localRoom) {
|
|
779
|
-
this.removeRoom(id)
|
|
780
|
-
const nextKeys = Object.keys(rs.data)
|
|
781
|
-
Object.keys(localRoom).forEach(key => {
|
|
782
|
-
if (!nextKeys.includes(key)) {
|
|
783
|
-
Vue.delete(localRoom, key)
|
|
784
|
-
}
|
|
785
|
-
})
|
|
786
|
-
Object.keys(rs.data).forEach(key => {
|
|
787
|
-
Vue.set(localRoom, key, rs.data[key])
|
|
788
|
-
})
|
|
789
|
-
}
|
|
790
|
-
this.addRoom(localRoom || rs.data)
|
|
791
|
-
return rs
|
|
792
|
-
})
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
isModify (qwAccountId) {
|
|
796
|
-
return !!(qwAccountId && this.data.modifiedAccountMap[qwAccountId])
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
markModify (qwAccountIds) {
|
|
800
|
-
const ids = Array.isArray(qwAccountIds) ? qwAccountIds : [qwAccountIds]
|
|
801
|
-
ids.filter(Boolean).forEach(id => {
|
|
802
|
-
Vue.set(this.data.modifiedAccountMap, id, true)
|
|
803
|
-
})
|
|
741
|
+
markModify () {
|
|
742
|
+
this.data.isModify = true
|
|
804
743
|
}
|
|
805
744
|
|
|
806
|
-
unmarkModify (
|
|
807
|
-
|
|
808
|
-
Vue.delete(this.data.modifiedAccountMap, qwAccountId)
|
|
809
|
-
}
|
|
745
|
+
unmarkModify () {
|
|
746
|
+
this.data.isModify = false
|
|
810
747
|
}
|
|
811
748
|
|
|
812
749
|
reset () {
|
|
@@ -821,7 +758,6 @@ export default class ClientChatContacts {
|
|
|
821
758
|
this.data.groupBindRoomMap = {}
|
|
822
759
|
this.data.accountBindFriendMap = {}
|
|
823
760
|
this.data.accountBindRoomMap = {}
|
|
824
|
-
this.data.modifiedAccountMap = {}
|
|
825
761
|
this._cacheFriendGroupCountMap = null
|
|
826
762
|
this._cacheRoomGroupCountMap = null
|
|
827
763
|
if (this.cancelConnectRequest) {
|
|
@@ -833,4 +769,4 @@ export default class ClientChatContacts {
|
|
|
833
769
|
this.cancelRefreshRequest = null
|
|
834
770
|
}
|
|
835
771
|
}
|
|
836
|
-
}
|
|
772
|
+
}
|