@tencentcloud/ai-desk-customer-vue 1.5.3 → 1.5.5
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 +17 -0
- package/assets/language_arrow_down.svg +3 -0
- package/assets/language_check.svg +3 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +215 -13
- package/components/CustomerServiceChat/index-web.vue +86 -25
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +14 -4
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +19 -16
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +4 -4
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +10 -3
- package/components/CustomerServiceChat/message-list/index-web.vue +27 -14
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +6 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +20 -13
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +7 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-mobile.vue +8 -9
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-pc.vue +4 -7
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/index.vue +6 -12
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-star.vue +25 -9
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue +74 -29
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-transfer-with-desc.vue +46 -0
- package/components/CustomerServiceChat/message-toolbar-button/index.vue +13 -2
- package/components/CustomerServiceChat/style/web.scss +2 -0
- package/constant.ts +21 -1
- package/interface.ts +15 -2
- package/locales/en/aidesk.ts +4 -4
- package/locales/en/index.ts +2 -2
- package/locales/en/time.ts +2 -2
- package/locales/fil/index.ts +2 -2
- package/locales/fil/time.ts +2 -2
- package/locales/id/index.ts +2 -2
- package/locales/id/time.ts +2 -2
- package/locales/ja/index.ts +2 -2
- package/locales/ja/time.ts +2 -2
- package/locales/ms/index.ts +2 -2
- package/locales/ms/time.ts +2 -2
- package/locales/ru/index.ts +2 -2
- package/locales/ru/time.ts +2 -2
- package/locales/th/index.ts +2 -2
- package/locales/th/time.ts +2 -2
- package/locales/vi/index.ts +2 -2
- package/locales/vi/time.ts +2 -2
- package/locales/zh_cn/aidesk.ts +1 -1
- package/locales/zh_cn/index.ts +2 -2
- package/locales/zh_cn/time.ts +2 -2
- package/locales/zh_tw/aidesk.ts +1 -1
- package/locales/zh_tw/index.ts +2 -2
- package/locales/zh_tw/time.ts +2 -2
- package/package.json +2 -1
- package/server.ts +21 -3
- package/utils/index.ts +6 -13
- package/utils/utils.ts +44 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['text', isPC && 'text-select']">
|
|
3
|
+
{{ description }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { customerServicePayloadType } from '../../../../../../interface';
|
|
9
|
+
import { isPC } from '../../../../../../utils/env';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
payload: customerServicePayloadType;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
props: {
|
|
17
|
+
payload: {
|
|
18
|
+
type: Object as () => customerServicePayloadType,
|
|
19
|
+
default: () => ({}),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
setup(props: Props) {
|
|
23
|
+
return {
|
|
24
|
+
description: props.payload.description,
|
|
25
|
+
isPC,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
<style lang="scss" scoped>
|
|
31
|
+
.text-select {
|
|
32
|
+
-webkit-user-select: text;
|
|
33
|
+
-moz-user-select: text;
|
|
34
|
+
-ms-user-select: text;
|
|
35
|
+
user-select: text;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.text {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
text-size-adjust: none;
|
|
42
|
+
font-family: PingFangSC-Regular;
|
|
43
|
+
overflow-wrap: break-word;
|
|
44
|
+
word-break: normal;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<template v-for="(item, index) in props.toolbarButtonList">
|
|
4
4
|
<ToolbarButtonHumanService v-if="item.presetId === TOOLBAR_BUTTON_TYPE.HUMAN_SERVICE && shouldRender(item) && !isInHumanService" :title="item.title" :icon="item.icon"/>
|
|
5
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"/>
|
|
6
|
+
<ToolbarButtonEndHumanService v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.END_HUMAN_SERVICE && shouldRender(item) && ((item.displayFlag === 1 && isInSession) || isInHumanService)" :title="item.title" :icon="item.icon"/>
|
|
7
7
|
<div v-else-if="shouldRender(item) && !item.presetId" :key="index"
|
|
8
8
|
:class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick(item, index)">
|
|
9
9
|
<Icon v-if="item.icon" class="toolbar-button-icon" :file="item.icon" width="18px" height="18px"/>
|
|
@@ -27,7 +27,7 @@ import { isH5 } from '../../../utils/env';
|
|
|
27
27
|
import { ToolbarButtonModel } from '../../../interface';
|
|
28
28
|
import Icon from '../../common/Icon.vue';
|
|
29
29
|
import { TOOLBAR_BUTTON_TYPE } from '../../../constant';
|
|
30
|
-
import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo } from '../../../utils/utils';
|
|
30
|
+
import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo, isNonEmptyObject, transferToTaskFlow, transferToHuman } from '../../../utils/utils';
|
|
31
31
|
import ToolbarButtonHumanService from './toolbar-button-human-service.vue';
|
|
32
32
|
import ToolbarButtonServiceRating from './toolbar-button-service-rating.vue';
|
|
33
33
|
import ToolbarButtonEndHumanService from './toolbar-button-end-human-service.vue';
|
|
@@ -39,6 +39,7 @@ const props = withDefaults(defineProps<IProps>(), {});
|
|
|
39
39
|
|
|
40
40
|
const isInHumanService = ref(false);
|
|
41
41
|
const currentConversation = ref<IConversationModel>();
|
|
42
|
+
const isInSession = ref(true);
|
|
42
43
|
|
|
43
44
|
onMounted(() => {
|
|
44
45
|
TUIStore.watch(StoreName.CONV, {
|
|
@@ -46,6 +47,7 @@ onMounted(() => {
|
|
|
46
47
|
});
|
|
47
48
|
TUIStore.watch(StoreName.CUSTOM, {
|
|
48
49
|
isInHumanService: onInHumanServiceUpdate,
|
|
50
|
+
isInSession: onInSessionUpdate
|
|
49
51
|
});
|
|
50
52
|
});
|
|
51
53
|
|
|
@@ -55,6 +57,7 @@ onUnmounted(() => {
|
|
|
55
57
|
});
|
|
56
58
|
TUIStore.unwatch(StoreName.CUSTOM, {
|
|
57
59
|
isInHumanService: onInHumanServiceUpdate,
|
|
60
|
+
isInSession: onInSessionUpdate
|
|
58
61
|
});
|
|
59
62
|
});
|
|
60
63
|
|
|
@@ -66,6 +69,10 @@ const onInHumanServiceUpdate = (value: boolean) => {
|
|
|
66
69
|
isInHumanService.value = value;
|
|
67
70
|
};
|
|
68
71
|
|
|
72
|
+
const onInSessionUpdate = (value: boolean) => {
|
|
73
|
+
isInSession.value = value;
|
|
74
|
+
}
|
|
75
|
+
|
|
69
76
|
function onClick(item:ToolbarButtonModel, index: number) {
|
|
70
77
|
if (item.type === 1 && item.content) {
|
|
71
78
|
TUIChatService.sendTextMessage({
|
|
@@ -78,6 +85,10 @@ function onClick(item:ToolbarButtonModel, index: number) {
|
|
|
78
85
|
});
|
|
79
86
|
} else if (item.type === 2 && item.content) {
|
|
80
87
|
openSafeUrl(item.content);
|
|
88
|
+
} else if (item.type === 3 && isNonEmptyObject(item.content)) {
|
|
89
|
+
transferToTaskFlow(getTo(currentConversation.value), item.content.taskFlowID, item.content.description);
|
|
90
|
+
} else if (item.type === 4 && isNonEmptyObject(item.content)) {
|
|
91
|
+
transferToHuman(getTo(currentConversation.value), item.content.groupID, item.content.specificMemberList, item.content.description);
|
|
81
92
|
} else if (props.toolbarButtonList !== undefined && typeof props.toolbarButtonList[index].clickEvent === 'function') {
|
|
82
93
|
props.toolbarButtonList[index].clickEvent();
|
|
83
94
|
}
|
package/constant.ts
CHANGED
|
@@ -23,6 +23,7 @@ export const CUSTOM_MESSAGE_SRC = {
|
|
|
23
23
|
PRODUCT_CARD: '22',
|
|
24
24
|
SATISFACTION_CON: '23',
|
|
25
25
|
USER_SATISFACTION: '24',
|
|
26
|
+
BOT_STATUS: '25',
|
|
26
27
|
SEAT_STATUS: '26',
|
|
27
28
|
USER_END_SESSION: '27',
|
|
28
29
|
ORDER:'28',
|
|
@@ -31,9 +32,12 @@ export const CUSTOM_MESSAGE_SRC = {
|
|
|
31
32
|
STREAM_TEXT: '31',
|
|
32
33
|
MULTI_BRANCH: '32',
|
|
33
34
|
MULTI_FORM: '33',
|
|
35
|
+
TRANSFER_TO_TASK_FLOW: '34',
|
|
34
36
|
THINKING: '35',
|
|
35
37
|
CONCURRENCY_LIMIT: '36',
|
|
36
38
|
TIMEOUT_WARNING: '37',
|
|
39
|
+
TRANSFER_TO_HUMAN: '39',
|
|
40
|
+
SESSION_RESTARTED: '40',
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
// im message extra type
|
|
@@ -142,6 +146,8 @@ export const WHITE_LIST = [
|
|
|
142
146
|
CUSTOM_MESSAGE_SRC.CONCURRENCY_LIMIT,
|
|
143
147
|
CUSTOM_MESSAGE_SRC.ORDER,
|
|
144
148
|
CUSTOM_MESSAGE_SRC.TIMEOUT_WARNING,
|
|
149
|
+
CUSTOM_MESSAGE_SRC.TRANSFER_TO_TASK_FLOW,
|
|
150
|
+
CUSTOM_MESSAGE_SRC.TRANSFER_TO_HUMAN,
|
|
145
151
|
];
|
|
146
152
|
|
|
147
153
|
export const TOOLBAR_BUTTON_TYPE = {
|
|
@@ -165,4 +171,18 @@ export enum ReadState {
|
|
|
165
171
|
AllRead,
|
|
166
172
|
NotShow,
|
|
167
173
|
PartiallyRead,
|
|
168
|
-
};
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
export const SUPPORTED_LANGUAGES = {
|
|
178
|
+
en: {name: 'English', codeForShow: 'En'},
|
|
179
|
+
fil: {name: 'Filipino', codeForShow: 'Fil'},
|
|
180
|
+
id: {name: 'Bahasa Indonesia', codeForShow: 'Id'},
|
|
181
|
+
ja: {name: '日本語', codeForShow: 'Ja'},
|
|
182
|
+
ms: {name: 'Bahasa Melayu', codeForShow: 'Ms'},
|
|
183
|
+
th: {name: 'ภาษาไทย', codeForShow: 'Th'},
|
|
184
|
+
vi: {name: 'Tiếng Việt', codeForShow: 'Vi'},
|
|
185
|
+
zh: {name: '中文简体', codeForShow: 'Zh'},
|
|
186
|
+
zh_tw: {name: '中文繁體', codeForShow: 'Zh-TW'},
|
|
187
|
+
ru: {name:'Русский', codeForShow: 'Ru'}
|
|
188
|
+
}
|
package/interface.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface customerServicePayloadType {
|
|
|
3
3
|
chatbotPlugin?: number | string;
|
|
4
4
|
customerServicePlugin?: number | string;
|
|
5
5
|
src: string | number;
|
|
6
|
-
content
|
|
6
|
+
content?: any;
|
|
7
7
|
subtype?: string;
|
|
8
8
|
isFinished?: number;
|
|
9
9
|
chunks?: string[];
|
|
@@ -16,6 +16,7 @@ export interface customerServicePayloadType {
|
|
|
16
16
|
nodeID?: string;
|
|
17
17
|
env?: string;
|
|
18
18
|
}
|
|
19
|
+
description?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
interface IMenuItem {
|
|
@@ -190,12 +191,13 @@ export interface ToolbarButtonModel {
|
|
|
190
191
|
title: string, // 名称
|
|
191
192
|
icon?: string, // 图标
|
|
192
193
|
type?: number, // 类型 1:关键词回复 2:跳转链接
|
|
193
|
-
content?: string, // 发送的文本或跳转的链接
|
|
194
|
+
content?: string | ITransferToTaskFlowModel | ITransferToHumanModel, // 发送的文本或跳转的链接
|
|
194
195
|
presetId?: ToolbarButtonPresetType, // 若要显示已有功能,填写相关type
|
|
195
196
|
isPreset?: number, // 是否是预置功能 0:非预置 1:预置类型
|
|
196
197
|
isEnabled?: number, // 是否显示
|
|
197
198
|
renderCondition?: () => {}, // [UIKit] 是否显示
|
|
198
199
|
clickEvent?: () => void, // [UIKit] 点击事件
|
|
200
|
+
displayFlag?: number,
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
// 输入框功能 已有功能
|
|
@@ -225,4 +227,15 @@ export interface QuickOrderModel {
|
|
|
225
227
|
pic?: string,
|
|
226
228
|
url: string,
|
|
227
229
|
customField?: QuickOrderCustomFieldModel[],
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface ITransferToTaskFlowModel {
|
|
233
|
+
taskFlowID: number;
|
|
234
|
+
description?: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface ITransferToHumanModel {
|
|
238
|
+
groupID?: number;
|
|
239
|
+
specificMemberList?: Array<string>;
|
|
240
|
+
description?: string;
|
|
228
241
|
}
|
package/locales/en/aidesk.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const AIDesk = {
|
|
2
|
-
"结束人工会话": "End
|
|
3
|
-
"转人工服务": "
|
|
2
|
+
"结束人工会话": "End Conversation",
|
|
3
|
+
"转人工服务": "Agent Transfer",
|
|
4
4
|
"跳转": "Open",
|
|
5
5
|
"立即填写": "Fill now",
|
|
6
6
|
"已提交": "Submitted",
|
|
@@ -11,10 +11,10 @@ const AIDesk = {
|
|
|
11
11
|
"请输入内容":"Please enter the content",
|
|
12
12
|
"如果满意请给好评哦~":"If you're satisfied, please give a good review~",
|
|
13
13
|
"请对本次服务进行评价": "Please rate this service",
|
|
14
|
-
"提交评价": "
|
|
14
|
+
"提交评价": "Service Rating",
|
|
15
15
|
"并发限制": "There are currently too many users accessing the service. Please try again later",
|
|
16
16
|
"分支选项异常": "Content is abnormal, please check the task flow configuration",
|
|
17
|
-
"服务评价": "
|
|
17
|
+
"服务评价": "Service Rating",
|
|
18
18
|
"满意":"Satisfied",
|
|
19
19
|
"不满意":"Dissatisfied",
|
|
20
20
|
"感谢您的反馈,我们会持续优化改进":"Thank you for your feedback, we will continue to improve",
|
package/locales/en/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/en/time.ts
CHANGED
package/locales/fil/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AIDesk from './aidesk';
|
|
2
2
|
import TUIChat from './TUIChat';
|
|
3
3
|
import Component from './component';
|
|
4
|
-
import
|
|
4
|
+
import time from './time';
|
|
5
5
|
const messages = {
|
|
6
6
|
fil: {
|
|
7
7
|
"取消": 'Kanselahin',
|
|
@@ -18,7 +18,7 @@ const messages = {
|
|
|
18
18
|
AIDesk,
|
|
19
19
|
TUIChat,
|
|
20
20
|
Component,
|
|
21
|
-
|
|
21
|
+
time,
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
|
package/locales/fil/time.ts
CHANGED
package/locales/id/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/id/time.ts
CHANGED
package/locales/ja/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/ja/time.ts
CHANGED
package/locales/ms/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/ms/time.ts
CHANGED
package/locales/ru/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -18,7 +18,7 @@ const messages = {
|
|
|
18
18
|
"拍照": 'Сделать фото',
|
|
19
19
|
TUIChat,
|
|
20
20
|
Component,
|
|
21
|
-
|
|
21
|
+
time,
|
|
22
22
|
AIDesk,
|
|
23
23
|
},
|
|
24
24
|
};
|
package/locales/ru/time.ts
CHANGED
package/locales/th/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/th/time.ts
CHANGED
package/locales/vi/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/vi/time.ts
CHANGED
package/locales/zh_cn/aidesk.ts
CHANGED
package/locales/zh_cn/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -18,7 +18,7 @@ const messages = {
|
|
|
18
18
|
"拍照": '拍照',
|
|
19
19
|
TUIChat,
|
|
20
20
|
Component,
|
|
21
|
-
|
|
21
|
+
time,
|
|
22
22
|
AIDesk,
|
|
23
23
|
},
|
|
24
24
|
};
|
package/locales/zh_cn/time.ts
CHANGED
package/locales/zh_tw/aidesk.ts
CHANGED
package/locales/zh_tw/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TUIChat from './TUIChat';
|
|
2
2
|
import Component from './component';
|
|
3
|
-
import
|
|
3
|
+
import time from './time';
|
|
4
4
|
import AIDesk from './aidesk';
|
|
5
5
|
|
|
6
6
|
const messages = {
|
|
@@ -19,7 +19,7 @@ const messages = {
|
|
|
19
19
|
AIDesk,
|
|
20
20
|
TUIChat,
|
|
21
21
|
Component,
|
|
22
|
-
|
|
22
|
+
time,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
package/locales/zh_tw/time.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/ai-desk-customer-vue",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Vue2/Vue3 UIKit for AI Desk",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@tiptap/pm": "2.0.0-beta.220",
|
|
33
33
|
"@tiptap/suggestion": "2.0.0-beta.220",
|
|
34
34
|
"@types/lodash": "^4.14.202",
|
|
35
|
+
"countries-and-timezones": "^3.8.0",
|
|
35
36
|
"dayjs": "^1.11.10",
|
|
36
37
|
"lodash": "^4.17.21",
|
|
37
38
|
"marked": "^6.0.0",
|
package/server.ts
CHANGED
|
@@ -13,14 +13,17 @@ import TUIChatEngine, {
|
|
|
13
13
|
SendMessageParams,
|
|
14
14
|
SendMessageOptions,
|
|
15
15
|
TUIUserService,
|
|
16
|
+
TUIStore,
|
|
17
|
+
StoreName,
|
|
16
18
|
} from '@tencentcloud/chat-uikit-engine';
|
|
17
19
|
import Log from './utils/logger';
|
|
18
20
|
import { version } from './package.json'
|
|
19
21
|
import { Toast, TOAST_TYPE } from "./components/common/Toast/index-web";
|
|
20
|
-
import { switchReadStatus } from "./utils/utils";
|
|
22
|
+
import { switchReadStatus, transferToHuman, transferToTaskFlow } from "./utils/utils";
|
|
21
23
|
import state from "./utils/state";
|
|
22
|
-
import { USER_DEFAULT_AVATAR } from "./constant";
|
|
24
|
+
import { CUSTOM_MESSAGE_SRC, USER_DEFAULT_AVATAR } from "./constant";
|
|
23
25
|
import { vueVersion } from "./adapter-vue-web";
|
|
26
|
+
import { ITransferToHumanModel, ITransferToTaskFlowModel } from './interface';
|
|
24
27
|
|
|
25
28
|
interface IInitWithProfile {
|
|
26
29
|
SDKAppID: number,
|
|
@@ -119,6 +122,7 @@ export default class TUICustomerServer {
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
public unInit() {
|
|
125
|
+
this.isLoggedIn = false;
|
|
122
126
|
return TUIChatEngine.logout();
|
|
123
127
|
}
|
|
124
128
|
|
|
@@ -199,6 +203,14 @@ export default class TUICustomerServer {
|
|
|
199
203
|
}
|
|
200
204
|
}
|
|
201
205
|
|
|
206
|
+
public transferToTaskFlow(options: ITransferToTaskFlowModel) {
|
|
207
|
+
transferToTaskFlow(this.currentCustomerServiceID, options.taskFlowID, options.description);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
public transferToHuman(options: ITransferToHumanModel) {
|
|
211
|
+
transferToHuman(this.currentCustomerServiceID, options.groupID, options.specificMemberList, options.description);
|
|
212
|
+
}
|
|
213
|
+
|
|
202
214
|
public onCall(method: string, params: any) {
|
|
203
215
|
Log.l(`TUICustomerServer.onCall method:${method} params:`, params);
|
|
204
216
|
if (method === TUIConstants.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION) {
|
|
@@ -218,6 +230,7 @@ export default class TUICustomerServer {
|
|
|
218
230
|
|
|
219
231
|
// 激活会话服务流
|
|
220
232
|
private activeServiceFlow(params: any) {
|
|
233
|
+
Log.i(`activeServiceFlow params: language:${params.robotLang} country:${params.country} timezone:${params.timezone}`)
|
|
221
234
|
TUIChatService.sendCustomMessage({
|
|
222
235
|
to: params.conversationID.slice(3),
|
|
223
236
|
conversationType: TUIChatEngine.TYPES.CONV_C2C,
|
|
@@ -225,9 +238,14 @@ export default class TUICustomerServer {
|
|
|
225
238
|
data: JSON.stringify({
|
|
226
239
|
src: '7',
|
|
227
240
|
customerServicePlugin: 0,
|
|
228
|
-
triggeredContent:
|
|
241
|
+
triggeredContent: {
|
|
242
|
+
language: params.robotLang,
|
|
243
|
+
country: params.country,
|
|
244
|
+
timezone: params.timezone,
|
|
245
|
+
}
|
|
229
246
|
}),
|
|
230
247
|
},
|
|
231
248
|
}, { onlineUserOnly: true });
|
|
249
|
+
TUIStore.update(StoreName.CUSTOM, "isInSession", true);
|
|
232
250
|
}
|
|
233
251
|
}
|