@tencentcloud/ai-desk-customer-vue 1.1.0 → 1.4.0
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/CHANGELOG.md +16 -3
- package/assets/customer_avatar.png +0 -0
- package/assets/face.svg +10 -0
- package/assets/files.svg +5 -0
- package/assets/image.svg +8 -0
- package/assets/rating_tool_icon.svg +5 -0
- package/assets/rating_tool_icon_h5.svg +1 -0
- package/assets/video.svg +8 -0
- package/assets/video_h5.svg +1 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +16 -14
- package/components/CustomerServiceChat/index-web.vue +72 -16
- package/components/CustomerServiceChat/message-input/index-web.vue +31 -5
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +24 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +1 -1
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.vue +1 -1
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +6 -8
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +11 -16
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +61 -18
- package/components/CustomerServiceChat/message-input-toolbar/rating-tool/index.vue +72 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/h5.scss +10 -1
- package/components/CustomerServiceChat/message-input-toolbar/user-define-input-tool.vue +80 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +9 -14
- package/components/CustomerServiceChat/message-list/index-web.vue +34 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +65 -19
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/marked.ts +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-branch.vue +30 -11
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-concurrency-limit.vue +40 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +29 -7
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +107 -73
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +53 -52
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/input-mobile.vue +73 -80
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/label-mobile.vue +21 -24
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-mobile/radios-mobile.vue +115 -116
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/input-pc.vue +69 -73
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/label-pc.vue +21 -25
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/component-pc/radio-pc.vue +87 -77
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-mobile.vue +213 -200
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-pc.vue +122 -113
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/index.vue +7 -7
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-order.vue +141 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue +5 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue +25 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-file.vue +1 -1
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +18 -6
- package/components/CustomerServiceChat/message-list/style/web.scss +2 -1
- package/components/CustomerServiceChat/message-toolbar-button/index.vue +111 -42
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-end-human-service.vue +59 -0
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-human-service.vue +55 -0
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-service-rating.vue +59 -0
- package/components/common/BottomPopup/index.vue +1 -1
- package/constant.ts +25 -4
- package/interface.ts +35 -5
- package/locales/en/aidesk.ts +6 -3
- package/locales/fil/aidesk.ts +4 -1
- package/locales/id/aidesk.ts +7 -4
- package/locales/ja/aidesk.ts +5 -2
- package/locales/ms/aidesk.ts +5 -2
- package/locales/ru/aidesk.ts +6 -3
- package/locales/th/aidesk.ts +4 -1
- package/locales/vi/aidesk.ts +5 -2
- package/locales/zh_cn/aidesk.ts +5 -3
- package/locales/zh_tw/aidesk.ts +4 -1
- package/package.json +1 -1
- package/server.ts +11 -2
- package/utils/state.js +30 -0
- package/utils/utils.ts +48 -1
- package/assets/face.png +0 -0
- package/assets/files.png +0 -0
- package/assets/image.png +0 -0
- package/assets/video.png +0 -0
|
@@ -1,75 +1,144 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</
|
|
13
|
-
|
|
2
|
+
<div class="toolbar-button-container">
|
|
3
|
+
<template v-for="(item, index) in props.toolbarButtonList">
|
|
4
|
+
<ToolbarButtonHumanService v-if="item.presetId === TOOLBAR_BUTTON_TYPE.HUMAN_SERVICE && shouldRender(item) && !isInHumanService" :title="item.title" :icon="item.icon"/>
|
|
5
|
+
<ToolbarButtonServiceRating v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.SERVICE_RATING && shouldRender(item) && isInHumanService" :title="item.title" :icon="item.icon"/>
|
|
6
|
+
<ToolbarButtonEndHumanService v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.END_HUMAN_SERVICE && shouldRender(item) && isInHumanService" :title="item.title" :icon="item.icon"/>
|
|
7
|
+
<div v-else-if="shouldRender(item) && !item.presetId" :key="index"
|
|
8
|
+
:class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick(item, index)">
|
|
9
|
+
<Icon v-if="item.icon" class="toolbar-button-icon" :file="item.icon" width="18px" height="18px"/>
|
|
10
|
+
<div class="toolbar-button-text">
|
|
11
|
+
{{ item.title }}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
</div>
|
|
14
16
|
</template>
|
|
15
17
|
<script lang="ts" setup>
|
|
18
|
+
import vue from '../../../adapter-vue';
|
|
19
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
20
|
+
import {
|
|
21
|
+
TUIChatService,
|
|
22
|
+
TUIStore,
|
|
23
|
+
StoreName,
|
|
24
|
+
IConversationModel
|
|
25
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
16
26
|
import { isH5 } from '../../../utils/env';
|
|
17
27
|
import { ToolbarButtonModel } from '../../../interface';
|
|
18
28
|
import Icon from '../../common/Icon.vue';
|
|
19
|
-
|
|
29
|
+
import { TOOLBAR_BUTTON_TYPE } from '../../../constant';
|
|
30
|
+
import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo } from '../../../utils/utils';
|
|
31
|
+
import ToolbarButtonHumanService from './toolbar-button-human-service.vue';
|
|
32
|
+
import ToolbarButtonServiceRating from './toolbar-button-service-rating.vue';
|
|
33
|
+
import ToolbarButtonEndHumanService from './toolbar-button-end-human-service.vue';
|
|
20
34
|
interface IProps {
|
|
21
|
-
|
|
35
|
+
toolbarButtonList?: ToolbarButtonModel[] | undefined;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
const props = withDefaults(defineProps<IProps>(), {
|
|
25
|
-
|
|
38
|
+
const props = withDefaults(defineProps<IProps>(), {});
|
|
39
|
+
|
|
40
|
+
const isInHumanService = ref(false);
|
|
41
|
+
const currentConversation = ref<IConversationModel>();
|
|
42
|
+
|
|
43
|
+
onMounted(() => {
|
|
44
|
+
TUIStore.watch(StoreName.CONV, {
|
|
45
|
+
currentConversation: onCurrentConversationUpdate,
|
|
46
|
+
});
|
|
47
|
+
TUIStore.watch(StoreName.CUSTOM, {
|
|
48
|
+
isInHumanService: onInHumanServiceUpdate,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
onUnmounted(() => {
|
|
53
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
54
|
+
currentConversation: onCurrentConversationUpdate,
|
|
55
|
+
});
|
|
56
|
+
TUIStore.unwatch(StoreName.CUSTOM, {
|
|
57
|
+
isInHumanService: onInHumanServiceUpdate,
|
|
58
|
+
});
|
|
26
59
|
});
|
|
27
60
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
const onCurrentConversationUpdate = (conversation: IConversationModel) => {
|
|
62
|
+
currentConversation.value = conversation;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const onInHumanServiceUpdate = (value: boolean) => {
|
|
66
|
+
isInHumanService.value = value;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
function onClick(item:ToolbarButtonModel, index: number) {
|
|
70
|
+
if (item.type === 1 && item.content) {
|
|
71
|
+
TUIChatService.sendTextMessage({
|
|
72
|
+
to: getTo(currentConversation?.value),
|
|
73
|
+
conversationType: currentConversation?.value?.type,
|
|
74
|
+
payload: {
|
|
75
|
+
text: item.content
|
|
76
|
+
},
|
|
77
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
78
|
+
});
|
|
79
|
+
} else if (item.type === 2 && item.content) {
|
|
80
|
+
openSafeUrl(item.content);
|
|
81
|
+
} else if (props.toolbarButtonList !== undefined && typeof props.toolbarButtonList[index].clickEvent === 'function') {
|
|
82
|
+
props.toolbarButtonList[index].clickEvent();
|
|
83
|
+
}
|
|
32
84
|
}
|
|
33
85
|
|
|
34
86
|
function shouldRender(item: ToolbarButtonModel) {
|
|
87
|
+
if (item.isEnabled === 1) {
|
|
88
|
+
return true;
|
|
89
|
+
} else if (item.isEnabled === 0) {
|
|
90
|
+
return false;
|
|
91
|
+
} else if (item.renderCondition) {
|
|
35
92
|
return typeof item.renderCondition === 'function' ? item.renderCondition() : false;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
36
95
|
}
|
|
37
96
|
|
|
38
97
|
</script>
|
|
39
98
|
<style>
|
|
40
99
|
.toolbar-button-container {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: row !important;
|
|
102
|
+
margin: 5px !important;
|
|
103
|
+
align-items: center ;
|
|
104
|
+
overflow-x: auto; /* 允许横向滚动 */
|
|
105
|
+
scrollbar-width: none; /* Firefox 隐藏滚动条 */
|
|
106
|
+
-ms-overflow-style: none; /* IE/Edge 隐藏滚动条 */
|
|
107
|
+
&::-webkit-scrollbar {
|
|
108
|
+
display: none; /* Chrome 隐藏滚动条 */
|
|
109
|
+
}
|
|
45
110
|
}
|
|
46
111
|
|
|
47
112
|
.toolbar-button {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
113
|
+
border: 1px solid #E7EAEF;
|
|
114
|
+
padding: 5px 10px;
|
|
115
|
+
border-radius: 20px;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
margin-left: 10px;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
user-select: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.toolbar-button:first-child {
|
|
125
|
+
margin-left: 5px;
|
|
57
126
|
}
|
|
58
127
|
|
|
59
128
|
.toolbar-button-h5 {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
129
|
+
border: none;
|
|
130
|
+
background-color: #fff;
|
|
131
|
+
box-shadow: 0px 2px 2px 0px rgba(70, 98, 140, 0.06);
|
|
63
132
|
}
|
|
64
133
|
|
|
65
134
|
.toolbar-button-icon {
|
|
66
|
-
|
|
135
|
+
margin-right: 3px;
|
|
67
136
|
}
|
|
68
137
|
.toolbar-button-text {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
138
|
+
font-size: 12px;
|
|
139
|
+
text-overflow: ellipsis;
|
|
140
|
+
max-width: 100px;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
font-family: PingFangSC-Regular;
|
|
74
143
|
}
|
|
75
144
|
</style>
|
package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-end-human-service.vue
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick">
|
|
3
|
+
<Icon v-if="props.icon" class="toolbar-button-icon" :file="props.icon" width="14px" height="14px"/>
|
|
4
|
+
<div class="toolbar-button-text">
|
|
5
|
+
{{ props.title || TUITranslateService.t('AIDesk.结束人工会话') }}
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import vue from '../../../adapter-vue';
|
|
11
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
12
|
+
import { isH5 } from '../../../utils/env';
|
|
13
|
+
import Icon from '../../common/Icon.vue';
|
|
14
|
+
import { TUITranslateService, TUIChatService, IConversationModel, TUIStore, StoreName } from '@tencentcloud/chat-uikit-engine';
|
|
15
|
+
import { CUSTOM_MESSAGE_SRC } from '../../../constant';
|
|
16
|
+
import { isEnabledMessageReadReceiptGlobal, getTo } from '../../../utils/utils';
|
|
17
|
+
const currentConversation = ref<IConversationModel>();
|
|
18
|
+
interface IProps {
|
|
19
|
+
title?:string;
|
|
20
|
+
icon?:string | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
24
|
+
title: '',
|
|
25
|
+
icon: ''
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
TUIStore.watch(StoreName.CONV, {
|
|
30
|
+
currentConversation: onCurrentConversationUpdate,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
onUnmounted(() => {
|
|
35
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
36
|
+
currentConversation: onCurrentConversationUpdate,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const onCurrentConversationUpdate = (conversation: IConversationModel) => {
|
|
41
|
+
currentConversation.value = conversation;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onClick = () => {
|
|
45
|
+
TUIChatService.sendCustomMessage({
|
|
46
|
+
to: getTo(currentConversation?.value),
|
|
47
|
+
conversationType: currentConversation?.value?.type,
|
|
48
|
+
payload: {
|
|
49
|
+
data: JSON.stringify({
|
|
50
|
+
customerServicePlugin: 0,
|
|
51
|
+
src: CUSTOM_MESSAGE_SRC.USER_END_SESSION,
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
55
|
+
},{ onlineUserOnly:true });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
</script>
|
|
59
|
+
<style></style>
|
package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-human-service.vue
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick">
|
|
3
|
+
<Icon v-if="props.icon" class="toolbar-button-icon" :file="props.icon" width="14px" height="14px"/>
|
|
4
|
+
<div class="toolbar-button-text">
|
|
5
|
+
{{ props.title || TUITranslateService.t('AIDesk.转人工服务') }}
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import vue from '../../../adapter-vue';
|
|
11
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
12
|
+
import { isH5 } from '../../../utils/env';
|
|
13
|
+
import Icon from '../../common/Icon.vue';
|
|
14
|
+
import { TUITranslateService, TUIChatService, IConversationModel, StoreName, TUIStore } from '@tencentcloud/chat-uikit-engine';
|
|
15
|
+
import { isEnabledMessageReadReceiptGlobal, getTo } from '../../../utils/utils';
|
|
16
|
+
const currentConversation = ref<IConversationModel>();
|
|
17
|
+
interface IProps {
|
|
18
|
+
title?:string;
|
|
19
|
+
icon?:string | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
23
|
+
title: '',
|
|
24
|
+
icon: ''
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
TUIStore.watch(StoreName.CONV, {
|
|
29
|
+
currentConversation: onCurrentConversationUpdate,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
35
|
+
currentConversation: onCurrentConversationUpdate,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const onCurrentConversationUpdate = (conversation: IConversationModel) => {
|
|
40
|
+
currentConversation.value = conversation;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const onClick = () => {
|
|
44
|
+
TUIChatService.sendTextMessage({
|
|
45
|
+
to: getTo(currentConversation?.value),
|
|
46
|
+
conversationType: currentConversation?.value?.type,
|
|
47
|
+
payload: {
|
|
48
|
+
text: TUITranslateService.t('AIDesk.转人工服务')
|
|
49
|
+
},
|
|
50
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
</script>
|
|
55
|
+
<style></style>
|
package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-service-rating.vue
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick">
|
|
3
|
+
<Icon v-if="props.icon" class="toolbar-button-icon" :file="props.icon" width="14px" height="14px"/>
|
|
4
|
+
<div class="toolbar-button-text">
|
|
5
|
+
{{ props.title || TUITranslateService.t('AIDesk.服务评价') }}
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import vue from '../../../adapter-vue';
|
|
11
|
+
const { ref, onMounted, onUnmounted } = vue;
|
|
12
|
+
import { isH5 } from '../../../utils/env';
|
|
13
|
+
import Icon from '../../common/Icon.vue';
|
|
14
|
+
import { TUITranslateService, TUIChatService, IConversationModel, StoreName, TUIStore } from '@tencentcloud/chat-uikit-engine';
|
|
15
|
+
import { CUSTOM_MESSAGE_SRC } from '../../../constant';
|
|
16
|
+
import { isEnabledMessageReadReceiptGlobal, getTo } from '../../../utils/utils';
|
|
17
|
+
const currentConversation = ref<IConversationModel>();
|
|
18
|
+
interface IProps {
|
|
19
|
+
title?:string;
|
|
20
|
+
icon?:string | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
24
|
+
title: '',
|
|
25
|
+
icon: ''
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
TUIStore.watch(StoreName.CONV, {
|
|
30
|
+
currentConversation: onCurrentConversationUpdate,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
onUnmounted(() => {
|
|
35
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
36
|
+
currentConversation: onCurrentConversationUpdate,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const onCurrentConversationUpdate = (conversation: IConversationModel) => {
|
|
41
|
+
currentConversation.value = conversation;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onClick = () => {
|
|
45
|
+
TUIChatService.sendCustomMessage({
|
|
46
|
+
to: getTo(currentConversation?.value),
|
|
47
|
+
conversationType: currentConversation?.value?.type,
|
|
48
|
+
payload: {
|
|
49
|
+
data:JSON.stringify({
|
|
50
|
+
src: CUSTOM_MESSAGE_SRC.USER_SATISFACTION,
|
|
51
|
+
customerServicePlugin: 0,
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
|
|
55
|
+
},{ onlineUserOnly: true });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
</script>
|
|
59
|
+
<style></style>
|
package/constant.ts
CHANGED
|
@@ -23,12 +23,16 @@ export const CUSTOM_MESSAGE_SRC = {
|
|
|
23
23
|
PRODUCT_CARD: '22',
|
|
24
24
|
SATISFACTION_CON: '23',
|
|
25
25
|
USER_SATISFACTION: '24',
|
|
26
|
+
SEAT_STATUS: '26',
|
|
27
|
+
USER_END_SESSION: '27',
|
|
28
|
+
ORDER:'28',
|
|
26
29
|
ROBOT_MSG: '29',
|
|
27
30
|
RICH_TEXT: '30',
|
|
28
31
|
STREAM_TEXT: '31',
|
|
29
|
-
MULTI_BRANCH:'32',
|
|
30
|
-
MULTI_FORM:'33',
|
|
31
|
-
THINKING:'35',
|
|
32
|
+
MULTI_BRANCH: '32',
|
|
33
|
+
MULTI_FORM: '33',
|
|
34
|
+
THINKING: '35',
|
|
35
|
+
CONCURRENCY_LIMIT: '36',
|
|
32
36
|
};
|
|
33
37
|
|
|
34
38
|
// im message extra type
|
|
@@ -134,4 +138,21 @@ export const WHITE_LIST = [
|
|
|
134
138
|
CUSTOM_MESSAGE_SRC.STREAM_TEXT,
|
|
135
139
|
CUSTOM_MESSAGE_SRC.MULTI_BRANCH,
|
|
136
140
|
CUSTOM_MESSAGE_SRC.MULTI_FORM,
|
|
137
|
-
|
|
141
|
+
CUSTOM_MESSAGE_SRC.CONCURRENCY_LIMIT,
|
|
142
|
+
CUSTOM_MESSAGE_SRC.ORDER,
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
export const TOOLBAR_BUTTON_TYPE = {
|
|
146
|
+
HUMAN_SERVICE: 'humanService',
|
|
147
|
+
SERVICE_RATING: 'serviceRating',
|
|
148
|
+
END_HUMAN_SERVICE: 'endHumanService',
|
|
149
|
+
}
|
|
150
|
+
export const INPUT_TOOLBAR_TYPE = {
|
|
151
|
+
EMOJI: 'emoji',
|
|
152
|
+
IMAGE: 'image',
|
|
153
|
+
FILE: 'file',
|
|
154
|
+
VIDEO: 'video',
|
|
155
|
+
RATING: 'rating',
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const USER_DEFAULT_AVATAR = 'https://web.sdk.qcloud.com/im/desk/assets/user_default_avatar.png';
|
package/interface.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TOOLBAR_BUTTON_TYPE,INPUT_TOOLBAR_TYPE } from './constant';
|
|
1
2
|
export interface customerServicePayloadType {
|
|
2
3
|
chatbotPlugin?: number | string;
|
|
3
4
|
customerServicePlugin?: number | string;
|
|
@@ -9,6 +10,12 @@ export interface customerServicePayloadType {
|
|
|
9
10
|
status?:number;
|
|
10
11
|
nodeStatus?:number;
|
|
11
12
|
thinkingStatus?:number;
|
|
13
|
+
optionType?: number;
|
|
14
|
+
taskInfo?: {
|
|
15
|
+
taskID?: number;
|
|
16
|
+
nodeID?: string;
|
|
17
|
+
env?: string;
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
interface IMenuItem {
|
|
@@ -176,9 +183,32 @@ export interface ISendMessagePayload {
|
|
|
176
183
|
atUserList?: string[];
|
|
177
184
|
}
|
|
178
185
|
|
|
186
|
+
// 快捷按钮已有功能
|
|
187
|
+
export type ToolbarButtonPresetType = typeof TOOLBAR_BUTTON_TYPE[keyof typeof TOOLBAR_BUTTON_TYPE];
|
|
188
|
+
|
|
179
189
|
export interface ToolbarButtonModel {
|
|
180
|
-
title:string,
|
|
181
|
-
icon?:string,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
190
|
+
title: string, // 名称
|
|
191
|
+
icon?: string, // 图标
|
|
192
|
+
type?: number, // 类型 1:关键词回复 2:跳转链接
|
|
193
|
+
content?: string, // 发送的文本或跳转的链接
|
|
194
|
+
presetId?: ToolbarButtonPresetType, // 若要显示已有功能,填写相关type
|
|
195
|
+
isPreset?: number, // 是否是预置功能 0:非预置 1:预置类型
|
|
196
|
+
isEnabled?: number, // 是否显示
|
|
197
|
+
renderCondition?: () => {}, // [UIKit] 是否显示
|
|
198
|
+
clickEvent?: () => void, // [UIKit] 点击事件
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// 输入框功能 已有功能
|
|
202
|
+
export type InputToolbarPresetType = typeof INPUT_TOOLBAR_TYPE[keyof typeof INPUT_TOOLBAR_TYPE];
|
|
203
|
+
|
|
204
|
+
export interface InputToolbarModel {
|
|
205
|
+
title?: string, // 名称
|
|
206
|
+
icon?: string, // 图标
|
|
207
|
+
type?: number, // 类型 1:关键词回复 2:跳转链接
|
|
208
|
+
content?: string, // 发送的文本或跳转的链接
|
|
209
|
+
isPreset?: number, // 是否是预置功能 0:非预置 1:预置类型
|
|
210
|
+
presetId?: InputToolbarPresetType, // 若要显示已有功能,填写相关type
|
|
211
|
+
isEnabled?: number, // 是否显示
|
|
212
|
+
renderCondition?: () => {},// [UIKit] 是否显示
|
|
213
|
+
clickEvent?: () => void,// [UIKit] 点击事件
|
|
214
|
+
}
|
package/locales/en/aidesk.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const AIDesk = {
|
|
2
|
-
"结束人工会话": "
|
|
3
|
-
"转人工服务": "
|
|
2
|
+
"结束人工会话": "End human service",
|
|
3
|
+
"转人工服务": "Human service",
|
|
4
4
|
"跳转": "Goto",
|
|
5
5
|
"立即填写": "Fill now",
|
|
6
6
|
"已提交": "Submitted",
|
|
@@ -12,5 +12,8 @@ const AIDesk = {
|
|
|
12
12
|
"如果满意请给好评哦~":"If you're satisfied, please give a good review~",
|
|
13
13
|
"请对本次服务进行评价": "Please rate this service",
|
|
14
14
|
"提交评价": "Feedback",
|
|
15
|
+
"并发限制": "There are currently too many users accessing the service. Please try again later",
|
|
16
|
+
"分支选项异常": "Content is abnormal, please check the task flow configuration",
|
|
17
|
+
"服务评价": "Feedback",
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/fil/aidesk.ts
CHANGED
|
@@ -12,5 +12,8 @@ const AIDesk = {
|
|
|
12
12
|
"如果满意请给好评哦~":"Kung nasiyahan ka, mangyaring magbigay ng magandang pagsusuri~",
|
|
13
13
|
"请对本次服务进行评价": "Mangyaring suriin ang serbisyong ito",
|
|
14
14
|
"提交评价": "Ipasa ang pagsusuri",
|
|
15
|
+
"并发限制": "Maraming tao ang naghahanap ng tulong ngayon, subukan muli mamaya",
|
|
16
|
+
"分支选项异常": "Ang nilalaman ay abnormal, pakisuri ang configuration ng task flow",
|
|
17
|
+
"服务评价": "Pagsusuri ng Serbisyo",
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/id/aidesk.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const AIDesk = {
|
|
2
|
-
"结束人工会话": "
|
|
3
|
-
"转人工服务": "
|
|
2
|
+
"结束人工会话": "Selesai",
|
|
3
|
+
"转人工服务": "Layanan manusia",
|
|
4
4
|
"跳转": "Goto",
|
|
5
5
|
"立即填写": "Isi sekarang",
|
|
6
6
|
"已提交": "Terkirim",
|
|
@@ -11,6 +11,9 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容":"Silakan masukkan konten",
|
|
12
12
|
"如果满意请给好评哦~":"Jika Anda puas, silakan berikan ulasan yang bagus~",
|
|
13
13
|
"请对本次服务进行评价": "Silakan beri penilaian untuk layanan ini",
|
|
14
|
-
"提交评价": "Kirim Ulasan"
|
|
14
|
+
"提交评价": "Kirim Ulasan",
|
|
15
|
+
"服务评价": "Ulasan Layanan",
|
|
16
|
+
"并发限制": "Saat ini banyak pengguna yang mengakses. Mohon coba lagi nanti",
|
|
17
|
+
"分支选项异常": "Konten tidak normal, silakan periksa konfigurasi alur tugas"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/ja/aidesk.ts
CHANGED
|
@@ -11,6 +11,9 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容":"内容を入力してください",
|
|
12
12
|
"如果满意请给好评哦~":"ご満足いただけましたら、ぜひ良いレビューをお願いします〜",
|
|
13
13
|
"请对本次服务进行评价": "このサービスについて評価をお願いします",
|
|
14
|
-
"提交评价": "評価を提出する"
|
|
14
|
+
"提交评价": "評価を提出する",
|
|
15
|
+
"服务评价": "サービス評価",
|
|
16
|
+
"并发限制": "現在アクセスが集中しております。しばらくしてから再度お試しください",
|
|
17
|
+
"分支选项异常": "コンテンツに異常があります。タスクフローの設定を確認してください"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/ms/aidesk.ts
CHANGED
|
@@ -11,6 +11,9 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容":"Sila masukkan kandungan",
|
|
12
12
|
"如果满意请给好评哦~":"Jika anda berpuas hati, sila berikan ulasan yang baik~",
|
|
13
13
|
"请对本次服务进行评价": "Sila beri penilaian untuk perkhidmatan ini",
|
|
14
|
-
"提交评价": "Hantar Penilaian"
|
|
14
|
+
"提交评价": "Hantar Penilaian",
|
|
15
|
+
"服务评价": "Penilaian Perkhidmatan",
|
|
16
|
+
"并发限制": "Terdapat terlalu ramai pengguna pada masa ini. Sila cuba lagi nanti",
|
|
17
|
+
"分支选项异常": "Kandungan tidak normal, sila semak konfigurasi aliran tugas"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/ru/aidesk.ts
CHANGED
|
@@ -10,7 +10,10 @@ const AIDesk = {
|
|
|
10
10
|
"Hi,我是": "Привет, я ",
|
|
11
11
|
"请输入内容":"Пожалуйста, введите содержание",
|
|
12
12
|
"如果满意请给好评哦~":"Если вы удовлетворены, пожалуйста, оставьте хороший отзыв~",
|
|
13
|
-
"请对本次服务进行评价": "Оцените обслуживание",
|
|
14
|
-
"提交评价": "Отправить оценку"
|
|
13
|
+
"请对本次服务进行评价": "Оцените обслуживание",
|
|
14
|
+
"提交评价": "Отправить оценку",
|
|
15
|
+
"服务评价": "Оценка услуги",
|
|
16
|
+
"并发限制": "В данный момент слишком много пользователей. Попробуйте позже",
|
|
17
|
+
"分支选项异常": "Содержимое аномально, пожалуйста, проверьте конфигурацию потока задач"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/th/aidesk.ts
CHANGED
|
@@ -12,5 +12,8 @@ const AIDesk = {
|
|
|
12
12
|
"如果满意请给好评哦~": "หากพอใจแล้วก็อย่าลืมรีวิวให้ด้วยนะ~",
|
|
13
13
|
"请对本次服务进行评价": "กรุณาประเมินบริการครั้งนี้",
|
|
14
14
|
"提交评价": "ส่งการประเมิน",
|
|
15
|
+
"服务评价": "การประเมินบริการ",
|
|
16
|
+
"并发限制": "ปัจจุบันมีผู้ใช้งานจำนวนมาก กรุณาลองใหม่ในภายหลัง",
|
|
17
|
+
"分支选项异常": "เนื้อหาผิดปกติ กรุณาตรวจสอบการตั้งค่ากระบวนการงาน"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/vi/aidesk.ts
CHANGED
|
@@ -11,6 +11,9 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容":"Vui lòng nhập nội dung",
|
|
12
12
|
"如果满意请给好评哦~":"Nếu bạn hài lòng, hãy cho chúng tôi một đánh giá tốt nhé~",
|
|
13
13
|
"请对本次服务进行评价": "Vui lòng đánh giá dịch vụ này",
|
|
14
|
-
"提交评价": "Gửi đánh giá"
|
|
14
|
+
"提交评价": "Gửi đánh giá",
|
|
15
|
+
"服务评价": " Đánh giá dịch vụ",
|
|
16
|
+
"并发限制": "Hiện có quá nhiều người đang truy cập. Vui lòng thử lại sau",
|
|
17
|
+
"分支选项异常": "Nội dung bất thường, vui lòng kiểm tra cấu hình luồng tác vụ"
|
|
15
18
|
}
|
|
16
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/zh_cn/aidesk.ts
CHANGED
|
@@ -11,7 +11,9 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容": "请输入内容",
|
|
12
12
|
"如果满意请给好评哦~": "如果满意请给好评哦~",
|
|
13
13
|
"请对本次服务进行评价": "请对本次服务进行评价",
|
|
14
|
-
"提交评价": "提交评价"
|
|
15
|
-
|
|
14
|
+
"提交评价": "提交评价",
|
|
15
|
+
"服务评价": "服务评价",
|
|
16
|
+
"并发限制": "当前咨询人数较多,请稍后再试",
|
|
17
|
+
"分支选项异常": "内容异常,请检查任务流配置"
|
|
16
18
|
}
|
|
17
|
-
export default AIDesk;
|
|
19
|
+
export default AIDesk;
|
package/locales/zh_tw/aidesk.ts
CHANGED