@tencentcloud/ai-desk-customer-vue 1.0.1 → 1.3.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 +14 -0
- package/assets/send_button_h5.svg +1 -0
- package/components/CustomerServiceChat/index-web.vue +3 -3
- package/components/CustomerServiceChat/message-input/index-web.vue +16 -7
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +5 -2
- package/components/CustomerServiceChat/message-list/index-web.vue +6 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +14 -15
- 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 +25 -6
- 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 +32 -8
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +93 -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 +142 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-number.vue +2 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating/message-rating-star.vue +2 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue +8 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue +89 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-plugin-web.vue +5 -0
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +15 -3
- package/components/common/BottomPopup/index.vue +1 -1
- package/constant.ts +10 -4
- package/locales/en/aidesk.ts +3 -1
- package/locales/fil/aidesk.ts +3 -1
- package/locales/id/aidesk.ts +4 -2
- package/locales/ja/aidesk.ts +4 -2
- package/locales/ms/aidesk.ts +4 -2
- package/locales/ru/aidesk.ts +5 -3
- package/locales/th/aidesk.ts +3 -1
- package/locales/vi/aidesk.ts +4 -2
- package/locales/zh_cn/aidesk.ts +4 -3
- package/locales/zh_tw/aidesk.ts +3 -1
- package/package.json +1 -1
- package/server.ts +53 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.3.0] (2025-5-21)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
- 支持订单消息。
|
|
5
|
+
- 优化表单消息、任务流消息、流式消息、Markdown 图文混排等的交互体验。
|
|
6
|
+
|
|
7
|
+
## [1.1.0] (2025-4-23)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
- 新增 `initWithProfile` 接口,支持用户端带昵称(nickName)和头像(avatar)登录,提升人工客服与用户交互体验。
|
|
11
|
+
- 优化流式消息和 markdown 图文混排的产品体验。
|
|
12
|
+
- 优化发消息体验。
|
|
13
|
+
- 优化组件样式。
|
|
14
|
+
|
|
1
15
|
## [1.0.1] (2025-4-16)
|
|
2
16
|
|
|
3
17
|
### Features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1C66E5"><path d="M440-320h80v-168l64 64 56-56-160-160-160 160 56 56 64-64v168Zm40 240q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
|
|
@@ -119,7 +119,7 @@ const muteText = ref('');
|
|
|
119
119
|
const messageListRef = ref<InstanceType<typeof MessageList>>();
|
|
120
120
|
const emojiOpen = ref(false);
|
|
121
121
|
const toolShowH5 = ref(false);
|
|
122
|
-
const
|
|
122
|
+
const languages = Object.keys(TUILocales);
|
|
123
123
|
const props = withDefaults(defineProps<IProps>(), {
|
|
124
124
|
canCloseChat: true,
|
|
125
125
|
SDKAppID: 0,
|
|
@@ -168,7 +168,7 @@ const initLanguage = () => {
|
|
|
168
168
|
let language;
|
|
169
169
|
if (props.userLang !== '') {
|
|
170
170
|
let userLang = convertLanguageToLowercase(props.userLang);
|
|
171
|
-
if (!
|
|
171
|
+
if (!languages.includes(userLang)) {
|
|
172
172
|
Log.w(`userLang:${props.userLang} is not supported`);
|
|
173
173
|
language = 'en';
|
|
174
174
|
} else {
|
|
@@ -176,7 +176,7 @@ const initLanguage = () => {
|
|
|
176
176
|
}
|
|
177
177
|
} else {
|
|
178
178
|
let navigatorLang = convertLanguageToLowercase(navigator.language);
|
|
179
|
-
if (!
|
|
179
|
+
if (!languages.includes(navigatorLang)) {
|
|
180
180
|
language = 'en';
|
|
181
181
|
} else {
|
|
182
182
|
language = navigatorLang;
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@sendMessage="sendMessage"
|
|
19
19
|
@onTyping="onTyping"
|
|
20
20
|
@blurToolAndEmojiH5="blurToolAndEmojiH5"
|
|
21
|
+
@isInputNotEmpty="isInputNotEmpty"
|
|
21
22
|
/>
|
|
22
23
|
<MessageInputButton
|
|
23
24
|
v-if="!props.isMuted && isPC"
|
|
@@ -26,9 +27,12 @@
|
|
|
26
27
|
<div v-if="isH5" class="emoji-icon" id="emoji-icon-h5" @click="emojiShow">
|
|
27
28
|
<Icon :file="emojiIcon" width="24px" height="24px"/>
|
|
28
29
|
</div>
|
|
29
|
-
<div v-
|
|
30
|
+
<div v-show="isH5 && !showSendButton" class="tool-icon" @click="toolShow">
|
|
30
31
|
<Icon :file="toolIcon" width="24px" height="24px"/>
|
|
31
32
|
</div>
|
|
33
|
+
<div v-show="isH5 && showSendButton" class="send-button-h5" @click="sendMessage">
|
|
34
|
+
<Icon :file="sendButtonIcon" width="34px" height="34px"/>
|
|
35
|
+
</div>
|
|
32
36
|
</div>
|
|
33
37
|
|
|
34
38
|
</div>
|
|
@@ -50,6 +54,7 @@ import { isPC,isH5 } from '../../../utils/env';
|
|
|
50
54
|
import Icon from '../../common/Icon.vue';
|
|
51
55
|
import emojiIcon from '../../../assets/emoji.png';
|
|
52
56
|
import toolIcon from '../../../assets/more_tools.png';
|
|
57
|
+
import sendButtonIcon from '../../../assets/send_button_h5.svg';
|
|
53
58
|
const { ref,onMounted,onBeforeUnmount } = vue;
|
|
54
59
|
|
|
55
60
|
const props = defineProps({
|
|
@@ -83,6 +88,7 @@ const emit = defineEmits(['sendMessage', 'resetReplyOrReference', 'onTyping','sc
|
|
|
83
88
|
const editor = ref<InstanceType<typeof MessageInputEditor>>();
|
|
84
89
|
const currentConversation = ref<IConversationModel>();
|
|
85
90
|
const h5Dialog = ref<HTMLElement>();
|
|
91
|
+
const showSendButton = ref(false);
|
|
86
92
|
|
|
87
93
|
onMounted(() => {
|
|
88
94
|
// document.addEventListener('click', handleClick);
|
|
@@ -126,17 +132,23 @@ const sendMessage = async () => {
|
|
|
126
132
|
await sendMessages(editorContentList, currentConversation.value);
|
|
127
133
|
emit('sendMessage');
|
|
128
134
|
editor.value?.resetEditor();
|
|
135
|
+
showSendButton.value = false;
|
|
129
136
|
};
|
|
130
137
|
|
|
131
138
|
const insertEmoji = (emoji: any) => {
|
|
132
139
|
editor.value?.addEmoji(emoji);
|
|
140
|
+
showSendButton.value = true;
|
|
133
141
|
};
|
|
134
142
|
|
|
135
143
|
const reEdit = (content: any) => {
|
|
136
144
|
editor.value?.resetEditor();
|
|
145
|
+
showSendButton.value = false;
|
|
137
146
|
editor.value?.setEditorContent(content);
|
|
138
147
|
};
|
|
139
148
|
|
|
149
|
+
const isInputNotEmpty = (show: boolean) => {
|
|
150
|
+
showSendButton.value = show;
|
|
151
|
+
}
|
|
140
152
|
|
|
141
153
|
const emojiShow = () => {
|
|
142
154
|
emit('emojiShow');
|
|
@@ -205,11 +217,8 @@ defineExpose({
|
|
|
205
217
|
height: fit-content;
|
|
206
218
|
background: #fff;
|
|
207
219
|
}
|
|
208
|
-
.send-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
padding: 10px 12px;
|
|
212
|
-
margin-left: 5px;
|
|
213
|
-
border-radius: 7px;
|
|
220
|
+
.send-button-h5 {
|
|
221
|
+
margin-right: 10px;
|
|
222
|
+
margin-left: 5px;
|
|
214
223
|
}
|
|
215
224
|
</style>
|
|
@@ -76,7 +76,7 @@ const props = defineProps({
|
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
const emits = defineEmits(['sendMessage', 'onTyping','blurToolAndEmojiH5']);
|
|
79
|
+
const emits = defineEmits(['sendMessage', 'onTyping', 'blurToolAndEmojiH5', 'isInputNotEmpty']);
|
|
80
80
|
const { placeholder, enableDragUpload, enableTyping } = toRefs(props);
|
|
81
81
|
const isEditorEmpty = ref<boolean>(true);
|
|
82
82
|
const isEditorBlur = ref<boolean>(true);
|
|
@@ -214,9 +214,12 @@ function handleEnter(e: any) {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
function handleH5Input() {
|
|
217
|
+
function handleH5Input(e: any) {
|
|
218
218
|
if (isH5) {
|
|
219
219
|
isEditorEmpty.value = editorDom.value?.childNodes ? false : true;
|
|
220
|
+
const hasText = e.target.innerText.trim().length > 0;
|
|
221
|
+
const hasImages = e.target.querySelectorAll('img.custom-image-emoji').length > 0;
|
|
222
|
+
emits('isInputNotEmpty', hasText || hasImages);
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
@resendMessage="resendMessage"
|
|
48
48
|
@handleToggleMessageItem="handleToggleMessageItem"
|
|
49
49
|
@handleH5LongPress="handleH5LongPress"
|
|
50
|
+
@heightChanged="onHeightChanged"
|
|
50
51
|
/>
|
|
51
52
|
<div
|
|
52
53
|
v-else
|
|
@@ -572,6 +573,10 @@ const handleH5LongPress = (e: any, message: IMessageModel, type: string) => {
|
|
|
572
573
|
}
|
|
573
574
|
};
|
|
574
575
|
|
|
576
|
+
function onHeightChanged() {
|
|
577
|
+
scrollToLatestMessage();
|
|
578
|
+
}
|
|
579
|
+
|
|
575
580
|
// re-edit message
|
|
576
581
|
const handleEdit = (message: IMessageModel) => {
|
|
577
582
|
emits('handleEditor', message, 'reedit');
|
|
@@ -611,6 +616,7 @@ async function scrollToLatestMessage() {
|
|
|
611
616
|
if (messageListRef.value) {
|
|
612
617
|
messageListRef.value.scrollTop = scrollHeight - height;
|
|
613
618
|
}
|
|
619
|
+
scrollButtonInstanceRef.value?.hideScrollButton();
|
|
614
620
|
}
|
|
615
621
|
|
|
616
622
|
const handelScrollListScroll = throttle(
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
isNoPadding && isBlink ? 'blink-shadow' : '',
|
|
45
45
|
!isNoPadding && isBlink ? 'blink-content' : '',
|
|
46
46
|
isMultiBranchMsg?'multi-branch-message':'',
|
|
47
|
-
(
|
|
47
|
+
(isProductCardOrOrderMessage && isH5) ? 'product-order-message-bubble-h5' : (isProductCardOrOrderMessage ? 'product-order-message-bubble' : ''),
|
|
48
48
|
isPC ? '':'body-mobile',
|
|
49
49
|
]"
|
|
50
50
|
>
|
|
@@ -204,20 +204,19 @@ const hasEmojiReaction = computed(() => {
|
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
const isMultiBranchMsg = computed(()=>{
|
|
207
|
-
if(message.value?.type == "TIMCustomElem"){
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
if (message.value?.type == "TIMCustomElem") {
|
|
208
|
+
const src = JSON.parse(message.value.payload.data).src;
|
|
209
|
+
if (src === CUSTOM_MESSAGE_SRC.MULTI_BRANCH || src === CUSTOM_MESSAGE_SRC.BRANCH || src === CUSTOM_MESSAGE_SRC.BRANCH_NUMBER) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
212
|
}
|
|
213
|
-
|
|
214
213
|
return false;
|
|
215
214
|
});
|
|
216
215
|
|
|
217
|
-
|
|
218
|
-
const isProductCardMessage = computed(()=>{
|
|
216
|
+
const isProductCardOrOrderMessage = computed(() => {
|
|
219
217
|
if (message.value?.type == "TIMCustomElem") {
|
|
220
|
-
|
|
218
|
+
const src = JSON.parse(message.value.payload.data).src;
|
|
219
|
+
if (src === CUSTOM_MESSAGE_SRC.PRODUCT_CARD || src === CUSTOM_MESSAGE_SRC.ORDER) {
|
|
221
220
|
return true;
|
|
222
221
|
}
|
|
223
222
|
}
|
|
@@ -395,8 +394,8 @@ function scrollTo(scrollHeight: number) {
|
|
|
395
394
|
padding-top: 5px;
|
|
396
395
|
}
|
|
397
396
|
}
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
|
|
398
|
+
|
|
400
399
|
.content-in {
|
|
401
400
|
background: #f3f4f7;
|
|
402
401
|
border-radius: 0 10px 10px;
|
|
@@ -411,12 +410,12 @@ function scrollTo(scrollHeight: number) {
|
|
|
411
410
|
border-radius: 0 10px 10px;
|
|
412
411
|
padding: 0px;
|
|
413
412
|
}
|
|
414
|
-
|
|
415
|
-
.product-message-bubble {
|
|
413
|
+
|
|
414
|
+
.product-order-message-bubble {
|
|
416
415
|
background: #f3f4f7 !important ;
|
|
417
416
|
}
|
|
418
417
|
|
|
419
|
-
.product-message-bubble-h5 {
|
|
418
|
+
.product-order-message-bubble-h5 {
|
|
420
419
|
background: #fff !important ;
|
|
421
420
|
}
|
|
422
421
|
|
|
@@ -10,7 +10,7 @@ export const marked = new Marked(
|
|
|
10
10
|
class="image-container"
|
|
11
11
|
onclick="onMarkdownImageClicked('${safeHref}')"
|
|
12
12
|
style="cursor:pointer;" >
|
|
13
|
-
<img src="${href}" alt="${text}"/>
|
|
13
|
+
<img src="${href}" alt="${text}" onload="onMarkdownImageLoad()"/>
|
|
14
14
|
</div>
|
|
15
15
|
`;
|
|
16
16
|
},
|
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
<div class="branch-card">
|
|
3
3
|
<div
|
|
4
4
|
v-if="content.header || content.title"
|
|
5
|
-
class="branch-body branch-bubble"
|
|
5
|
+
:class="['branch-body',isPC ? 'branch-bubble':'branch-bubble-h5']"
|
|
6
6
|
>
|
|
7
7
|
<Icon :src="iconQuestion" class="branch-title-icon"/>
|
|
8
8
|
{{ content.header || content.title }}
|
|
9
|
-
|
|
9
|
+
</div>
|
|
10
10
|
<div
|
|
11
11
|
v-for="(item, index) in content.items"
|
|
12
12
|
:key="index"
|
|
13
|
-
:class="['branch-body','branch-bubble','branch-item',isSelected ? 'branch-item-selected' : '']"
|
|
13
|
+
:class="['branch-body',isPC ? 'branch-bubble':'branch-bubble-h5','branch-item',isSelected ? 'branch-item-selected' : '', item.content ? '' : 'warning-item']"
|
|
14
14
|
:style="{ borderWidth: content.header ? '1px 0 0px 0' : '' }"
|
|
15
15
|
@click="handleContentListItemClick(item)"
|
|
16
16
|
>
|
|
17
|
-
{{ item.content }}
|
|
17
|
+
{{ item.content || TUITranslateService.t('AIDesk.分支选项异常') }}
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import vue from '../../../../../../adapter-vue';
|
|
24
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
24
25
|
import { customerServicePayloadType } from '../../../../../../interface';
|
|
25
26
|
import iconRight from '../../../../../../assets/iconRight.svg';
|
|
26
27
|
import iconQuestion from '../../../../../../assets/icon_question.png';
|
|
27
28
|
import Icon from './customer-icon.vue';
|
|
29
|
+
import { isPC } from '../../../../../../utils/env';
|
|
28
30
|
const { computed, ref} = vue;
|
|
29
|
-
// const { computed,ref } = vue;
|
|
30
31
|
|
|
31
32
|
interface Props {
|
|
32
33
|
payload: customerServicePayloadType;
|
|
@@ -47,7 +48,7 @@ export default {
|
|
|
47
48
|
default: () => ({}),
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
|
-
emits: ['sendMessage'],
|
|
51
|
+
emits: ['sendMessage', 'heightChanged'],
|
|
51
52
|
setup(props: Props, { emit }) {
|
|
52
53
|
const isSelected = ref<boolean>(false);
|
|
53
54
|
const content = computed(() => {
|
|
@@ -60,6 +61,9 @@ export default {
|
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const handleContentListItemClick = (branch: branchItem) => {
|
|
64
|
+
if (!branch.content) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
63
67
|
if(!isSelected.value) {
|
|
64
68
|
isSelected.value = true;
|
|
65
69
|
emit('sendMessage', { text: branch.content });
|
|
@@ -72,8 +76,13 @@ export default {
|
|
|
72
76
|
iconRight,
|
|
73
77
|
iconQuestion,
|
|
74
78
|
isSelected,
|
|
79
|
+
isPC,
|
|
80
|
+
TUITranslateService
|
|
75
81
|
};
|
|
76
82
|
},
|
|
83
|
+
mounted() {
|
|
84
|
+
this.$emit('heightChanged');
|
|
85
|
+
},
|
|
77
86
|
};
|
|
78
87
|
</script>
|
|
79
88
|
|
|
@@ -107,10 +116,18 @@ export default {
|
|
|
107
116
|
border-radius: 0 10px 10px;
|
|
108
117
|
margin-bottom: 8px;
|
|
109
118
|
}
|
|
119
|
+
.branch-bubble-h5 {
|
|
120
|
+
background: #fff;
|
|
121
|
+
border-radius: 0 10px 10px;
|
|
122
|
+
margin-bottom: 8px;
|
|
123
|
+
}
|
|
110
124
|
.branch-item {
|
|
111
125
|
color:#1c66e5;
|
|
112
126
|
cursor: pointer;
|
|
113
127
|
}
|
|
128
|
+
.warning-item {
|
|
129
|
+
color: #ff9800;
|
|
130
|
+
}
|
|
114
131
|
.branch-card {
|
|
115
132
|
min-width: 250px;
|
|
116
133
|
max-width: 350px;
|
|
@@ -125,5 +142,7 @@ export default {
|
|
|
125
142
|
}
|
|
126
143
|
.branch-title-icon {
|
|
127
144
|
margin-right: 5px;
|
|
145
|
+
align-items: flex-start !important;
|
|
146
|
+
margin-top: 2px;
|
|
128
147
|
}
|
|
129
148
|
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['message-text-container']">
|
|
3
|
+
<span class="text">{{ TUITranslateService.t('AIDesk.并发限制') }}</span>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import {TUITranslateService} from "@tencentcloud/chat-uikit-engine";
|
|
9
|
+
|
|
10
|
+
</script>
|
|
11
|
+
<style lang="scss" scoped>
|
|
12
|
+
.message-text-container {
|
|
13
|
+
display: inline;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text-select {
|
|
17
|
+
-webkit-user-select: text;
|
|
18
|
+
-moz-user-select: text;
|
|
19
|
+
-ms-user-select: text;
|
|
20
|
+
user-select: text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text {
|
|
24
|
+
white-space: pre-wrap;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
text-size-adjust: none;
|
|
27
|
+
font-family: PingFangSC-Regular;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.text:lang(en) {
|
|
33
|
+
white-space: pre-wrap;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
text-size-adjust: none;
|
|
36
|
+
font-family: PingFangSC-Regular;
|
|
37
|
+
overflow-wrap: break-word;
|
|
38
|
+
word-break: normal;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="message-custom">
|
|
3
|
-
|
|
4
3
|
<div class="custom">
|
|
5
4
|
<div
|
|
6
5
|
v-if="
|
|
@@ -13,6 +12,7 @@
|
|
|
13
12
|
<MessageBranch
|
|
14
13
|
:payload="payload"
|
|
15
14
|
@sendMessage="sendTextMessage"
|
|
15
|
+
@heightChanged="onHeightChanged"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
18
|
<div
|
|
@@ -35,13 +35,23 @@
|
|
|
35
35
|
<MessageProductCard :payload="payload" />
|
|
36
36
|
</div>
|
|
37
37
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.RICH_TEXT">
|
|
38
|
-
<MessageRichText
|
|
38
|
+
<MessageRichText
|
|
39
|
+
:payload="payload"
|
|
40
|
+
@heightChanged="onHeightChanged"
|
|
41
|
+
/>
|
|
39
42
|
</div>
|
|
40
43
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.STREAM_TEXT">
|
|
41
|
-
<MessageStream
|
|
44
|
+
<MessageStream
|
|
45
|
+
:payload="payload"
|
|
46
|
+
@heightChanged="onHeightChanged"
|
|
47
|
+
/>
|
|
42
48
|
</div>
|
|
43
49
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_BRANCH">
|
|
44
|
-
<MessageMultiBranch
|
|
50
|
+
<MessageMultiBranch
|
|
51
|
+
:payload="payload"
|
|
52
|
+
@sendMessage="sendTextMessage"
|
|
53
|
+
@heightChanged="onHeightChanged"
|
|
54
|
+
/>
|
|
45
55
|
</div>
|
|
46
56
|
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_FORM && message.flow == 'in'">
|
|
47
57
|
<MessageMultiForm :payload="payload"
|
|
@@ -55,6 +65,12 @@
|
|
|
55
65
|
@sendMessage="sendCustomMessage"
|
|
56
66
|
/>
|
|
57
67
|
</div>
|
|
68
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.CONCURRENCY_LIMIT">
|
|
69
|
+
<MessageConcurrencyLimit />
|
|
70
|
+
</div>
|
|
71
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.ORDER">
|
|
72
|
+
<MessageOrder :payload="payload" />
|
|
73
|
+
</div>
|
|
58
74
|
</div>
|
|
59
75
|
</div>
|
|
60
76
|
</template>
|
|
@@ -72,6 +88,8 @@ import MessageRichText from './message-rich-text.vue';
|
|
|
72
88
|
import MessageStream from './message-stream.vue';
|
|
73
89
|
import MessageMultiBranch from './message-multi-branch/index.vue';
|
|
74
90
|
import MessageMultiForm from './message-multi-form/index.vue';
|
|
91
|
+
import MessageConcurrencyLimit from "./message-concurrency-limit.vue";
|
|
92
|
+
import MessageOrder from './message-order.vue';
|
|
75
93
|
import {
|
|
76
94
|
IMessageModel,
|
|
77
95
|
TUIChatService,
|
|
@@ -90,7 +108,9 @@ export default {
|
|
|
90
108
|
MessageStream,
|
|
91
109
|
MessageMultiBranch,
|
|
92
110
|
MessageMultiForm,
|
|
93
|
-
MessageRating
|
|
111
|
+
MessageRating,
|
|
112
|
+
MessageConcurrencyLimit,
|
|
113
|
+
MessageOrder,
|
|
94
114
|
},
|
|
95
115
|
props: {
|
|
96
116
|
message: {
|
|
@@ -98,7 +118,7 @@ export default {
|
|
|
98
118
|
default: () => ({}),
|
|
99
119
|
},
|
|
100
120
|
},
|
|
101
|
-
emits: ['showFormPopup'],
|
|
121
|
+
emits: ['showFormPopup', 'heightChanged'],
|
|
102
122
|
setup(props: Props, { emit }) {
|
|
103
123
|
const payload = computed<customerServicePayloadType>(() => {
|
|
104
124
|
return props.message && JSONToObject(props.message?.payload?.data);
|
|
@@ -111,7 +131,10 @@ export default {
|
|
|
111
131
|
};
|
|
112
132
|
const handleShowFormPopup = (data: boolean) => {
|
|
113
133
|
emit('showFormPopup', data);
|
|
114
|
-
}
|
|
134
|
+
};
|
|
135
|
+
const onHeightChanged = () => {
|
|
136
|
+
emit('heightChanged');
|
|
137
|
+
};
|
|
115
138
|
|
|
116
139
|
return {
|
|
117
140
|
payload,
|
|
@@ -119,7 +142,8 @@ export default {
|
|
|
119
142
|
sendTextMessage,
|
|
120
143
|
CUSTOM_MESSAGE_SRC,
|
|
121
144
|
sendCustomMessage,
|
|
122
|
-
handleShowFormPopup
|
|
145
|
+
handleShowFormPopup,
|
|
146
|
+
onHeightChanged,
|
|
123
147
|
};
|
|
124
148
|
},
|
|
125
149
|
};
|
|
@@ -1,79 +1,99 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
<div
|
|
10
|
-
v-if="props.payload.status == 0 && !isClicked"
|
|
11
|
-
v-for="(item, index) in props.payload.content.items"
|
|
12
|
-
:key="index"
|
|
13
|
-
class="form-branch-item"
|
|
14
|
-
@click="listItemClick(item)"
|
|
15
|
-
>
|
|
16
|
-
{{ item.content }}
|
|
17
|
-
</div>
|
|
2
|
+
<div class="form-branch-container">
|
|
3
|
+
<div
|
|
4
|
+
v-if="props.payload.content.header"
|
|
5
|
+
:class="['card-title-container',isPC ? 'card-title' : 'card-title-h5']"
|
|
6
|
+
>
|
|
7
|
+
{{ props.payload.content.header }}
|
|
18
8
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
<div
|
|
10
|
+
v-if="props.payload.status == 0 && !isClicked"
|
|
11
|
+
v-for="(item, index) in props.payload.content.items"
|
|
12
|
+
:key="index"
|
|
13
|
+
:class="['form-branch-item', item.content ? '' : 'warning-item']"
|
|
14
|
+
@click="listItemClick(item)"
|
|
15
|
+
>
|
|
16
|
+
{{ item.content || TUITranslateService.t('AIDesk.分支选项异常') }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
22
23
|
import { customerServicePayloadType } from '../../../../../../../interface';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
import { isPC } from '../../../../../../../utils/env'
|
|
25
|
+
interface branchItem {
|
|
26
|
+
content: string;
|
|
27
|
+
desc: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Props {
|
|
31
|
+
payload: customerServicePayloadType;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
props: {
|
|
36
|
+
payload: {
|
|
37
|
+
type: Object as () => customerServicePayloadType,
|
|
38
|
+
default: () => ({content: { header: '', items: [] },status:0}),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
emits: ['input-click'],
|
|
42
|
+
setup(props: Props, { emit }) {
|
|
43
|
+
let isClicked = false;
|
|
44
|
+
const listItemClick = (branch: branchItem): void => {
|
|
45
|
+
if (!branch.content) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
emit('input-click', branch);
|
|
49
|
+
isClicked = true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
props,
|
|
54
|
+
isClicked,
|
|
55
|
+
listItemClick,
|
|
56
|
+
isPC,
|
|
57
|
+
TUITranslateService
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
<style lang="scss">
|
|
63
|
+
.form-branch-container {
|
|
64
|
+
.card-title-container {
|
|
65
|
+
padding: 12px;
|
|
66
|
+
border-radius: 0 10px 10px;
|
|
67
|
+
width:fit-content;
|
|
68
|
+
font-family: PingFangSC-Regular;
|
|
26
69
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
payload: customerServicePayloadType;
|
|
70
|
+
.card-title {
|
|
71
|
+
background-color: #f3f4f7;
|
|
30
72
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<style lang="scss">
|
|
56
|
-
.form-branch-container {
|
|
57
|
-
.card-title {
|
|
58
|
-
background-color: #fbfbfb;
|
|
59
|
-
padding: 12px;
|
|
60
|
-
border-radius: 0 10px 10px;
|
|
61
|
-
width:fit-content;
|
|
62
|
-
font-family: PingFangSC-Regular;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.form-branch-item {
|
|
66
|
-
font-weight: 500;
|
|
67
|
-
color: rgba(54, 141, 255, 1);
|
|
68
|
-
background-color: #fbfbfb;
|
|
69
|
-
border: 1px solid rgba(0, 110, 255, 0.3);
|
|
70
|
-
padding: 12px;
|
|
71
|
-
border-radius: 25px;
|
|
72
|
-
margin-top: 8px;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
width:fit-content;
|
|
75
|
-
font-family: PingFangSC-Regular;
|
|
76
|
-
}
|
|
73
|
+
.card-title-h5 {
|
|
74
|
+
background-color: #fff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.form-branch-item {
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
color: #1C66E5;
|
|
80
|
+
background-color: #fff;
|
|
81
|
+
border: 1px solid rgba(0, 110, 255, 0.3);
|
|
82
|
+
padding: 12px;
|
|
83
|
+
border-radius: 20px;
|
|
84
|
+
margin-top: 8px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
line-height: 16px;
|
|
87
|
+
width:fit-content;
|
|
88
|
+
font-family: PingFangSC-Regular;
|
|
89
|
+
min-width: 50px;
|
|
90
|
+
text-align: center;
|
|
91
|
+
overflow-wrap: break-word;
|
|
92
|
+
word-wrap: break-word;
|
|
93
|
+
word-break: normal;
|
|
94
|
+
}
|
|
95
|
+
.warning-item {
|
|
96
|
+
color: #ff9800;
|
|
77
97
|
}
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
}
|
|
99
|
+
</style>
|