@tencentcloud/ai-desk-customer-vue 1.5.4 → 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 +5 -0
- 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-multi-branch/index.vue +6 -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 +1 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-transfer-with-desc.vue +2 -7
- package/interface.ts +2 -2
- package/package.json +1 -1
- package/utils/utils.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="message-form">
|
|
3
3
|
<BranchPc
|
|
4
|
-
:payload ="
|
|
4
|
+
:payload ="forwardPayload"
|
|
5
5
|
@input-click="handleContentListItemClick"
|
|
6
6
|
/>
|
|
7
7
|
</div>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import vue from '../../../../../../../adapter-vue';
|
|
12
12
|
import BranchPc from './branch-pc.vue';
|
|
13
13
|
import { customerServicePayloadType } from '../../../../../../../interface';
|
|
14
|
-
const { computed} = vue;
|
|
14
|
+
const { computed } = vue;
|
|
15
15
|
|
|
16
16
|
interface branchItem {
|
|
17
17
|
content: string;
|
|
@@ -35,9 +35,6 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
emits: ['sendMessage', 'heightChanged'],
|
|
37
37
|
setup(props: Props, { emit }) {
|
|
38
|
-
const payload = computed<customerServicePayloadType>(() => {
|
|
39
|
-
return props.payload;
|
|
40
|
-
});
|
|
41
38
|
const handleContentListItemClick = (branch: branchItem, cloudCustomData?: string) => {
|
|
42
39
|
emit('sendMessage', { text: branch.content }, cloudCustomData || '');
|
|
43
40
|
};
|
|
@@ -45,8 +42,11 @@ export default {
|
|
|
45
42
|
const handleFormSaveInputSubmit = (text: string) => {
|
|
46
43
|
emit('sendMessage', { text });
|
|
47
44
|
};
|
|
45
|
+
const forwardPayload = computed(() => {
|
|
46
|
+
return props.payload;
|
|
47
|
+
});
|
|
48
48
|
return {
|
|
49
|
-
|
|
49
|
+
forwardPayload,
|
|
50
50
|
handleContentListItemClick,
|
|
51
51
|
handleFormSaveInputSubmit,
|
|
52
52
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="form-mobile-container">
|
|
3
|
-
<div v-if="
|
|
3
|
+
<div v-if="props.payload.nodeStatus !== 2" class="before-form">
|
|
4
4
|
<Icon :src="iconForm" width="60px" height="60px" style="margin:5px 4px"/>
|
|
5
5
|
<div :class="props.payload.nodeStatus === 1 ? 'form-button-disable': 'form-button'" @click="clickShowDialog">
|
|
6
6
|
{{ TUITranslateService.t("AIDesk.立即填写") }}
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
v-for="(item, index) in props.payload.content.inputVariables"
|
|
29
29
|
:key="index"
|
|
30
30
|
>
|
|
31
|
-
<div v-if="
|
|
31
|
+
<div v-if="item.formType == 0 && props.payload.nodeStatus == 0">
|
|
32
32
|
<InputMobile :placeholder="item.placeholder" :variableValue="item.variableValue" :name="item.name" :isRequired="item.isRequired" @input-change="handleInputChange" :validator="item.isRequired == 1 && isValid(item.name)"/>
|
|
33
33
|
</div>
|
|
34
|
-
<div v-else-if="
|
|
34
|
+
<div v-else-if="item.formType == 1 && props.payload.nodeStatus == 0">
|
|
35
35
|
<RadioMobile :chooseItemList="item.chooseItemList" :name="item.name" :isRequired="item.isRequired" @input-change="handleInputChange" :validator="item.isRequired == 1 && isValid(item.name)"/>
|
|
36
36
|
</div>
|
|
37
37
|
<div v-else class="variable-value-container-mobile">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
<div class="button-container"v-if="
|
|
46
|
+
<div class="button-container" v-if="props.payload.nodeStatus === 0">
|
|
47
47
|
<div class="button" @click="handleSendForm">
|
|
48
48
|
{{ TUITranslateService.t("AIDesk.提交") }}
|
|
49
49
|
</div>
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
</FormPopup>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
|
-
<div v-if="
|
|
55
|
+
<div v-if="props.payload.nodeStatus == 2" class="before-form">
|
|
56
56
|
<div class="icon-container">
|
|
57
57
|
<Icon class="form-icon" :src="iconForm" width="60px" height="60px" style="margin:5px 4px"/>
|
|
58
|
-
<Icon v-if="
|
|
58
|
+
<Icon v-if="props.payload.nodeStatus == 2" class="form-icon-check" width="26px" height="26px" :src="iconFormFilled"/>
|
|
59
59
|
</div>
|
|
60
60
|
<div class="form-button" @click="clickShowDialog">
|
|
61
61
|
{{ TUITranslateService.t("AIDesk.查看内容") }}
|
|
@@ -102,7 +102,6 @@ export default {
|
|
|
102
102
|
const showDialog = ref<boolean>(false);
|
|
103
103
|
const mapValue=ref({});
|
|
104
104
|
const isSubmit = ref<boolean>(false);
|
|
105
|
-
const finishSubmit = ref<boolean>(false);
|
|
106
105
|
const hasNullValue = ref<boolean>(true);
|
|
107
106
|
onMounted(() => {
|
|
108
107
|
let inputVariables = props.payload.content.inputVariables ?? [];
|
|
@@ -163,7 +162,6 @@ export default {
|
|
|
163
162
|
}),
|
|
164
163
|
};
|
|
165
164
|
emit('sendMessage', submitData);
|
|
166
|
-
finishSubmit.value = true;
|
|
167
165
|
isSubmit.value = false;
|
|
168
166
|
};
|
|
169
167
|
const handleInputChange = ({name,value}) => {
|
|
@@ -184,7 +182,6 @@ export default {
|
|
|
184
182
|
clickShowDialog,
|
|
185
183
|
iconClose,
|
|
186
184
|
checkValidator,
|
|
187
|
-
finishSubmit,
|
|
188
185
|
showValue,
|
|
189
186
|
mapValue,
|
|
190
187
|
isSubmit,
|
|
@@ -314,6 +311,7 @@ export default {
|
|
|
314
311
|
display:flex;
|
|
315
312
|
flex-direction: column;
|
|
316
313
|
justify-content: center;
|
|
314
|
+
font-family: PingFangSC-Regular;
|
|
317
315
|
.form-button {
|
|
318
316
|
display:flex;
|
|
319
317
|
justify-content: center;
|
|
@@ -321,6 +319,7 @@ export default {
|
|
|
321
319
|
background-color: #1c66e5;
|
|
322
320
|
color:white;
|
|
323
321
|
border-radius:20px;
|
|
322
|
+
min-width: 100px;
|
|
324
323
|
}
|
|
325
324
|
.form-button-disable {
|
|
326
325
|
background-color: #dbdbdb;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="form-title" v-if="checkTip()">
|
|
5
5
|
{{ props.payload.content.tip }}
|
|
6
6
|
</div>
|
|
7
|
-
<div class="form-finish-title-right" v-if="
|
|
7
|
+
<div class="form-finish-title-right" v-if="props.payload.nodeStatus == 2" >
|
|
8
8
|
<Icon :src="iconSucess" style="margin:0px 4px"/>
|
|
9
9
|
<div class="form-finish-title">
|
|
10
10
|
{{ TUITranslateService.t("AIDesk.已提交") }}
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
:key="index"
|
|
18
18
|
>
|
|
19
19
|
<LabelPC :name="item.name" :is-required="item.isRequired" />
|
|
20
|
-
<div v-if="
|
|
20
|
+
<div v-if="item.formType == 0 && props.payload.nodeStatus !== 2">
|
|
21
21
|
<InputPC :placeholder="item.placeholder" :variableValue="item.variableValue" :name="item.name" :isRequired="item.isRequired" @input-change="handleInputChange" :validator="item.isRequired == 1 && isValid(item.name)" :isDisabled="props.payload.nodeStatus === 1"/>
|
|
22
22
|
</div>
|
|
23
|
-
<div v-else-if="
|
|
23
|
+
<div v-else-if="item.formType == 1 && props.payload.nodeStatus !== 2">
|
|
24
24
|
<RadioPC :chooseItemList="item.chooseItemList" :name="item.name" :isRequired="item.isRequired" @input-change="handleInputChange" :validator="item.isRequired == 1 && isValid(item.name)" :isDisabled="props.payload.nodeStatus === 1"/>
|
|
25
25
|
</div>
|
|
26
26
|
<div v-else class="variable-value-container">
|
|
27
27
|
{{ item.variableValue == '' || item.variableValue == null ? mapValue[item.name] : item.variableValue}}
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<div class="button-container"v-if="
|
|
30
|
+
<div class="button-container" v-if="props.payload.nodeStatus !== 2">
|
|
31
31
|
<div :class="props.payload.nodeStatus === 1 ? 'button-disable' : 'button'" @click="handleSendForm">
|
|
32
32
|
{{ TUITranslateService.t("AIDesk.提交") }}
|
|
33
33
|
</div>
|
|
@@ -66,7 +66,6 @@ export default {
|
|
|
66
66
|
setup(props: Props, { emit }) {
|
|
67
67
|
const mapValue=ref({});
|
|
68
68
|
const isSubmit = ref<boolean>(false);
|
|
69
|
-
const finishSubmit = ref<boolean>(false);
|
|
70
69
|
const hasNullValue = ref<boolean>(true);
|
|
71
70
|
onMounted(()=>{
|
|
72
71
|
let inputVariables = props.payload.content.inputVariables ?? [];
|
|
@@ -118,7 +117,6 @@ export default {
|
|
|
118
117
|
}),
|
|
119
118
|
};
|
|
120
119
|
emit('sendMessage', submitData);
|
|
121
|
-
finishSubmit.value = true;
|
|
122
120
|
isSubmit.value = false;
|
|
123
121
|
};
|
|
124
122
|
|
|
@@ -141,7 +139,6 @@ export default {
|
|
|
141
139
|
handleInputChange,
|
|
142
140
|
iconSucess,
|
|
143
141
|
checkValidator,
|
|
144
|
-
finishSubmit,
|
|
145
142
|
showValue,
|
|
146
143
|
mapValue,
|
|
147
144
|
isSubmit,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isPC" class="message-input">
|
|
3
|
-
<FormPC :payload="
|
|
3
|
+
<FormPC :payload="forwardPayload" @sendMessage="handleSendForm" />
|
|
4
4
|
</div>
|
|
5
5
|
<div v-else>
|
|
6
|
-
<FormMobile :payload="
|
|
6
|
+
<FormMobile :payload="forwardPayload" @sendMessage="handleSendForm" @showFormPopup="handleShowFormPopup"/>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
@@ -15,11 +15,6 @@ import { customerServicePayloadType } from '../../../../../../../interface';
|
|
|
15
15
|
import { isPC } from '../../../../../../../utils/env';
|
|
16
16
|
const { computed } = vue;
|
|
17
17
|
|
|
18
|
-
interface branchItem {
|
|
19
|
-
content: string;
|
|
20
|
-
desc: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
interface Props {
|
|
24
19
|
payload: customerServicePayloadType;
|
|
25
20
|
}
|
|
@@ -37,18 +32,17 @@ export default {
|
|
|
37
32
|
},
|
|
38
33
|
emits: ['sendMessage','showFormPopup'],
|
|
39
34
|
setup(props: Props, { emit }) {
|
|
40
|
-
const payloads = computed<customerServicePayloadType>(() => {
|
|
41
|
-
return props.payload;
|
|
42
|
-
});
|
|
43
35
|
const handleSendForm = (data: any) => {
|
|
44
36
|
emit('sendMessage', data);
|
|
45
37
|
};
|
|
46
38
|
const handleShowFormPopup = (data: boolean) => {
|
|
47
39
|
emit('showFormPopup', data);
|
|
48
40
|
}
|
|
49
|
-
|
|
41
|
+
const forwardPayload = computed(() => {
|
|
42
|
+
return props.payload;
|
|
43
|
+
});
|
|
50
44
|
return {
|
|
51
|
-
|
|
45
|
+
forwardPayload,
|
|
52
46
|
handleSendForm,
|
|
53
47
|
isPC,
|
|
54
48
|
handleShowFormPopup
|
|
@@ -30,15 +30,21 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
|
-
<div
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
?
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
<div>
|
|
34
|
+
<div :style="{ marginTop: 10 + 'px', marginBottom: 10 + 'px', wordBreak: 'normal' }">
|
|
35
|
+
{{
|
|
36
|
+
hoverValue === -1
|
|
37
|
+
? value === -1
|
|
38
|
+
? TUITranslateService.t("AIDesk.如果满意请给好评哦~")
|
|
39
|
+
: desc[value]
|
|
40
|
+
: desc[hoverValue]
|
|
41
|
+
}}
|
|
42
|
+
</div>
|
|
43
|
+
<div class="hidden-desc">
|
|
44
|
+
{{ TUITranslateService.t("AIDesk.如果满意请给好评哦~") }}
|
|
45
|
+
</div>
|
|
41
46
|
</div>
|
|
47
|
+
|
|
42
48
|
<button
|
|
43
49
|
class="submit-button"
|
|
44
50
|
:disabled="hasReply || hasExpire"
|
|
@@ -201,11 +207,11 @@ export default {
|
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
.message-rating-star {
|
|
210
|
+
font-family: PingFangSC-Regular;
|
|
204
211
|
text-align: center;
|
|
205
212
|
display: flex;
|
|
206
213
|
flex-flow: column wrap;
|
|
207
214
|
justify-content: center;
|
|
208
|
-
|
|
209
215
|
align-items: center;
|
|
210
216
|
}
|
|
211
217
|
|
|
@@ -228,4 +234,14 @@ export default {
|
|
|
228
234
|
width: 62%;
|
|
229
235
|
}
|
|
230
236
|
|
|
237
|
+
.hidden-desc {
|
|
238
|
+
width: 100%;
|
|
239
|
+
overflow-wrap: break-word;
|
|
240
|
+
word-break: normal;
|
|
241
|
+
visibility: hidden;
|
|
242
|
+
padding: 0;
|
|
243
|
+
margin: 0;
|
|
244
|
+
height: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
231
247
|
</style>
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="['text', isPC && 'text-select']">
|
|
3
|
-
{{
|
|
3
|
+
{{ description }}
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
|
-
import vue from '../../../../../../adapter-vue';
|
|
9
8
|
import { customerServicePayloadType } from '../../../../../../interface';
|
|
10
9
|
import { isPC } from '../../../../../../utils/env';
|
|
11
|
-
const { computed } = vue;
|
|
12
10
|
|
|
13
11
|
interface Props {
|
|
14
12
|
payload: customerServicePayloadType;
|
|
@@ -22,11 +20,8 @@ export default {
|
|
|
22
20
|
},
|
|
23
21
|
},
|
|
24
22
|
setup(props: Props) {
|
|
25
|
-
const payload = computed<customerServicePayloadType>(() => {
|
|
26
|
-
return props.payload;
|
|
27
|
-
});
|
|
28
23
|
return {
|
|
29
|
-
props,
|
|
24
|
+
description: props.payload.description,
|
|
30
25
|
isPC,
|
|
31
26
|
};
|
|
32
27
|
},
|
package/interface.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface customerServicePayloadType {
|
|
|
16
16
|
nodeID?: string;
|
|
17
17
|
env?: string;
|
|
18
18
|
}
|
|
19
|
-
description?: string
|
|
19
|
+
description?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface IMenuItem {
|
|
@@ -235,7 +235,7 @@ export interface ITransferToTaskFlowModel {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
export interface ITransferToHumanModel {
|
|
238
|
-
groupID?:
|
|
238
|
+
groupID?: number;
|
|
239
239
|
specificMemberList?: Array<string>;
|
|
240
240
|
description?: string;
|
|
241
241
|
}
|
package/package.json
CHANGED
package/utils/utils.ts
CHANGED
|
@@ -288,7 +288,7 @@ export function transferToTaskFlow(conversationID: string, taskFlowID: number, d
|
|
|
288
288
|
},{ onlineUserOnly: description ? false : true });
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
export function transferToHuman(conversationID: string, groupID?:
|
|
291
|
+
export function transferToHuman(conversationID: string, groupID?: number, specificMemberList?: Array<string>, description?: string) {
|
|
292
292
|
if (!groupID && (!specificMemberList || specificMemberList.length === 0)) {
|
|
293
293
|
Log.w(`groupID or specificMemberList is required`);
|
|
294
294
|
return;
|