@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.
Files changed (51) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/assets/language_arrow_down.svg +3 -0
  3. package/assets/language_check.svg +3 -0
  4. package/components/CustomerServiceChat/chat-header/index-web.vue +215 -13
  5. package/components/CustomerServiceChat/index-web.vue +86 -25
  6. package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +14 -4
  7. package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +19 -16
  8. package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +4 -4
  9. package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +10 -3
  10. package/components/CustomerServiceChat/message-list/index-web.vue +27 -14
  11. package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +1 -0
  12. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +6 -1
  13. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +20 -13
  14. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +7 -6
  15. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-mobile.vue +8 -9
  16. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/form-pc.vue +4 -7
  17. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form/index.vue +6 -12
  18. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-star.vue +25 -9
  19. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue +74 -29
  20. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-transfer-with-desc.vue +46 -0
  21. package/components/CustomerServiceChat/message-toolbar-button/index.vue +13 -2
  22. package/components/CustomerServiceChat/style/web.scss +2 -0
  23. package/constant.ts +21 -1
  24. package/interface.ts +15 -2
  25. package/locales/en/aidesk.ts +4 -4
  26. package/locales/en/index.ts +2 -2
  27. package/locales/en/time.ts +2 -2
  28. package/locales/fil/index.ts +2 -2
  29. package/locales/fil/time.ts +2 -2
  30. package/locales/id/index.ts +2 -2
  31. package/locales/id/time.ts +2 -2
  32. package/locales/ja/index.ts +2 -2
  33. package/locales/ja/time.ts +2 -2
  34. package/locales/ms/index.ts +2 -2
  35. package/locales/ms/time.ts +2 -2
  36. package/locales/ru/index.ts +2 -2
  37. package/locales/ru/time.ts +2 -2
  38. package/locales/th/index.ts +2 -2
  39. package/locales/th/time.ts +2 -2
  40. package/locales/vi/index.ts +2 -2
  41. package/locales/vi/time.ts +2 -2
  42. package/locales/zh_cn/aidesk.ts +1 -1
  43. package/locales/zh_cn/index.ts +2 -2
  44. package/locales/zh_cn/time.ts +2 -2
  45. package/locales/zh_tw/aidesk.ts +1 -1
  46. package/locales/zh_tw/index.ts +2 -2
  47. package/locales/zh_tw/time.ts +2 -2
  48. package/package.json +2 -1
  49. package/server.ts +21 -3
  50. package/utils/index.ts +6 -13
  51. 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
  }
@@ -19,6 +19,8 @@
19
19
  padding: 10px;
20
20
  box-sizing: border-box;
21
21
  display: flex;
22
+ justify-content: space-between;
23
+ width: 100%;
22
24
  }
23
25
 
24
26
  &-message-list {
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: any;
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
  }
@@ -1,6 +1,6 @@
1
1
  const AIDesk = {
2
- "结束人工会话": "End human service",
3
- "转人工服务": "Human service",
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
- "提交评价": "Feedback",
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
- "服务评价": "Feedback",
17
+ "服务评价": "Service Rating",
18
18
  "满意":"Satisfied",
19
19
  "不满意":"Dissatisfied",
20
20
  "感谢您的反馈,我们会持续优化改进":"Thank you for your feedback, we will continue to improve",
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "week(s) ",
3
3
  "天": "day(s)",
4
4
  "小时": "hour(s) ",
@@ -34,4 +34,4 @@ const Time = {
34
34
  "日": "Sun",
35
35
  }
36
36
 
37
- export default Time;
37
+ export default time;
@@ -1,7 +1,7 @@
1
1
  import AIDesk from './aidesk';
2
2
  import TUIChat from './TUIChat';
3
3
  import Component from './component';
4
- import Time from './time';
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
- Time,
21
+ time,
22
22
  },
23
23
  };
24
24
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "linggo/linggo ",
3
3
  "天": "araw",
4
4
  "小时": "oras/oras ",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "Linggo",
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "minggu",
3
3
  "天": "hari",
4
4
  "小时": "jam",
@@ -16,4 +16,4 @@ const Time = {
16
16
  "星期日": "Minggu",
17
17
  }
18
18
 
19
- export default Time;
19
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "週",
3
3
  "天": "日",
4
4
  "小时": "時間",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "日曜日",
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "Minggu",
3
3
  "天": "Hari",
4
4
  "小时": "Jam",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "Ahad"
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
21
+ time,
22
22
  AIDesk,
23
23
  },
24
24
  };
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "неделя",
3
3
  "天": "день",
4
4
  "小时": "час",
@@ -27,4 +27,4 @@ const Time = {
27
27
  "十二月": "декабрь",
28
28
  }
29
29
 
30
- export default Time;
30
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "สัปดาห์",
3
3
  "天": "วัน",
4
4
  "小时": "ชั่วโมง",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "วันอาทิตย์"
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "tuần",
3
3
  "天": "ngày",
4
4
  "小时": "giờ",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "chủ nhật",
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  const AIDesk = {
2
2
  "结束人工会话": "结束会话",
3
- "转人工服务": "转人工服务",
3
+ "转人工服务": "人工服务",
4
4
  "跳转": "跳转",
5
5
  "立即填写": "立即填写",
6
6
  "已提交": "已提交",
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
21
+ time,
22
22
  AIDesk,
23
23
  },
24
24
  };
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "周",
3
3
  "天": "天",
4
4
  "小时": "小时",
@@ -34,4 +34,4 @@ const Time = {
34
34
  "日": "日",
35
35
  }
36
36
 
37
- export default Time;
37
+ export default time;
@@ -1,6 +1,6 @@
1
1
  const AIDesk = {
2
2
  "结束人工会话": "結束會話",
3
- "转人工服务": "轉人工服務",
3
+ "转人工服务": "人工服務",
4
4
  "跳转": "跳轉",
5
5
  "立即填写": "立即填寫",
6
6
  "已提交": "已提交",
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
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
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "週",
3
3
  "天": "天",
4
4
  "小时": "小時",
@@ -34,4 +34,4 @@ const Time = {
34
34
  "日": "日",
35
35
  }
36
36
 
37
- export default Time;
37
+ export default time;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/ai-desk-customer-vue",
3
- "version": "1.5.3",
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: typeof params.robotLang === 'undefined' ? undefined : { language: params.robotLang }
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
  }