bhd-components 0.7.9 → 0.7.11
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/README.md +2 -3
- package/dist/{d634a723.esm.es5.production.js → 901ed6b6.esm.es5.production.js} +1 -1
- package/dist/{072bdcac.esm.es5.development.js → facd5ad8.esm.es5.development.js} +1 -1
- package/dist/index.esm.es5.development.css +2050 -1918
- package/dist/index.esm.es5.development.js +186 -138
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/contactsList.js +1 -1
- package/es2017/customerService/index.js +183 -132
- package/es2017/customerService/index.module.less +34 -2
- package/es2017/customerService/index2.module.less +48 -4
- package/esm/customerService/contactsList.js +1 -1
- package/esm/customerService/index.js +181 -133
- package/esm/customerService/index.module.less +34 -2
- package/esm/customerService/index2.module.less +48 -4
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ const ContactsList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
114
114
|
}) : /*#__PURE__*/ _jsxs("div", {
|
|
115
115
|
className: `${styles.teacher_layout} ${type == 3 ? styles.teacher_layout_newlabo : ""}`,
|
|
116
116
|
style: {
|
|
117
|
-
left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
117
|
+
left: type == 3 ? document.getElementById("box") && document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
118
118
|
},
|
|
119
119
|
children: [
|
|
120
120
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -38,6 +38,7 @@ const CustomerService = (props)=>{
|
|
|
38
38
|
const [keyWord, setKeyWord] = useState(""); //搜索内容
|
|
39
39
|
const [questionsList, setQuestionsList] = useState([]); //问题列表
|
|
40
40
|
const [hotQuestionsList, setHotQuestionsList] = useState([]); //热门问题
|
|
41
|
+
// const [videoHotQuestionsList, setVideoHotQuestionsList] = useState([]); //热门问题
|
|
41
42
|
const [greetingMessage, setGreetingMessage] = useState(false); //聊天记录列表是否请求完成
|
|
42
43
|
const [pageNum, setPageNum] = useState(1); //页码
|
|
43
44
|
const [pageNumHistory, setPageNumHistory] = useState(0); //用于搜索历史记录后的页码
|
|
@@ -63,6 +64,7 @@ const CustomerService = (props)=>{
|
|
|
63
64
|
const [viewBase64, setViewBase64] = useState(""); //图片预览
|
|
64
65
|
const [visible, setVisible] = useState(false); //是否显示图片预览
|
|
65
66
|
const [bottomRecommendationQuestions, setBottomRecommendationQuestions] = useState([]); //底部推荐问题
|
|
67
|
+
const [showScreenshot, setShowScreenshot] = useState(false); //是否显示截图 主要用于newlabo页面
|
|
66
68
|
const [saveShowType, setSaveShowType] = useState(-1); //保存截图时的状态
|
|
67
69
|
const timer = useRef(null); //文本框输入时
|
|
68
70
|
let receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
@@ -75,6 +77,7 @@ const CustomerService = (props)=>{
|
|
|
75
77
|
let scrollTopHei = useRef(0);
|
|
76
78
|
let isPosition = useRef(true);
|
|
77
79
|
let recommendeQuestionID = useRef([]); //推荐问题id
|
|
80
|
+
let videoHotQuestionsList = useRef([]); //视频热门问题
|
|
78
81
|
const mid = props.userData.mid;
|
|
79
82
|
const remarkable = new Remarkable({
|
|
80
83
|
highlight: function(str, lang) {
|
|
@@ -90,56 +93,42 @@ const CustomerService = (props)=>{
|
|
|
90
93
|
}
|
|
91
94
|
});
|
|
92
95
|
useEffect(()=>{
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
105
|
-
// // 使用 html2canvas 对 canvas 进行截图
|
|
106
|
-
// html2canvas(canvas,{
|
|
107
|
-
// scale: 1,
|
|
108
|
-
// useCORS: true,
|
|
109
|
-
// logging: true,
|
|
110
|
-
// }).then(function(screenshot) {
|
|
111
|
-
// // 将截图显示在页面上,或者进行其他操作
|
|
112
|
-
// document.body.appendChild(screenshot);
|
|
113
|
-
// setTimeout(()=>{
|
|
114
|
-
// let url = screenshot.toDataURL('image/png');
|
|
115
|
-
// console.log(url);
|
|
116
|
-
// },3000)
|
|
117
|
-
// // console.log("container_html5_apicontainer_html5_api",screenshot)
|
|
118
|
-
// // console.log(screenshot.toDataURL('image/jpeg'))
|
|
119
|
-
// });
|
|
120
|
-
// // 显示图片或者做其他操作
|
|
96
|
+
if (config && config.type == 'video') {
|
|
97
|
+
//获取热门推荐
|
|
98
|
+
videoPageQuestiionsList(1);
|
|
99
|
+
}
|
|
100
|
+
setShowType(initShowType);
|
|
101
|
+
}, [
|
|
102
|
+
initShowType
|
|
103
|
+
]);
|
|
104
|
+
useEffect(()=>{
|
|
105
|
+
//|| showScreenshot
|
|
106
|
+
if (showType == 5 || showScreenshot) {
|
|
121
107
|
try {
|
|
122
108
|
setImgBese64('');
|
|
123
|
-
html2canvas(document.getElementsByTagName('html')[0]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
109
|
+
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
110
|
+
// // ignoreElements:(element)=>{
|
|
111
|
+
// // if(element.compareDocumentPosition(dom)===2)return true
|
|
112
|
+
// // return false
|
|
113
|
+
// // }
|
|
114
|
+
// }).then((canvas)=>{
|
|
115
|
+
// console.log(canvas,22222);
|
|
116
|
+
// setTimeout(()=>{
|
|
117
|
+
let dom = document.getElementById(screenshotAreaId);
|
|
118
|
+
html2canvas(dom, {
|
|
119
|
+
useCORS: true,
|
|
120
|
+
// allowTaint: true, // 污染处理
|
|
121
|
+
scale: 1
|
|
122
|
+
}).then(function(canvas) {
|
|
123
|
+
// document.body.appendChild(canvas);
|
|
124
|
+
// document.body.appendChild(canvas);
|
|
125
|
+
console.log(canvas, 99999);
|
|
126
|
+
// var base64URL = canvas.toDataURL('image/jpeg')
|
|
127
|
+
let base64URL = canvas.toDataURL("image/jpg", 1.0);
|
|
128
|
+
setImgBese64(base64URL);
|
|
142
129
|
});
|
|
130
|
+
// },100)
|
|
131
|
+
// })
|
|
143
132
|
} catch (error) {
|
|
144
133
|
console.log(error);
|
|
145
134
|
}
|
|
@@ -207,7 +196,8 @@ const CustomerService = (props)=>{
|
|
|
207
196
|
}, [
|
|
208
197
|
historyMessageList,
|
|
209
198
|
showType,
|
|
210
|
-
pageCount
|
|
199
|
+
pageCount,
|
|
200
|
+
showScreenshot
|
|
211
201
|
]);
|
|
212
202
|
useEffect(()=>{
|
|
213
203
|
resettingBottomHei();
|
|
@@ -226,16 +216,21 @@ const CustomerService = (props)=>{
|
|
|
226
216
|
buttomHei,
|
|
227
217
|
showType
|
|
228
218
|
]);
|
|
219
|
+
//创建聊天室并获取聊天室列表
|
|
229
220
|
useEffect(()=>{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
221
|
+
createRooms("AI").then((res)=>{
|
|
222
|
+
setRoomId(res.data.id);
|
|
223
|
+
});
|
|
224
|
+
roomsListTimer();
|
|
225
|
+
return ()=>{
|
|
226
|
+
clearTimeout(receiveMessageTimer.current);
|
|
227
|
+
// clearTimeout(voiceCountdownTimer.current);
|
|
228
|
+
clearTimeout(listTimer.current);
|
|
229
|
+
clearTimeout(timer.current);
|
|
230
|
+
clearTimeout(roomMessage.current);
|
|
231
|
+
clearTimeout(chatRoomList.current);
|
|
232
|
+
};
|
|
233
|
+
}, []);
|
|
239
234
|
useEffect(()=>{
|
|
240
235
|
if (roomId != "") {
|
|
241
236
|
if (lastId == "") {
|
|
@@ -256,21 +251,6 @@ const CustomerService = (props)=>{
|
|
|
256
251
|
}, [
|
|
257
252
|
roomId
|
|
258
253
|
]);
|
|
259
|
-
//创建聊天室并获取聊天室列表
|
|
260
|
-
useEffect(()=>{
|
|
261
|
-
createRooms("AI").then((res)=>{
|
|
262
|
-
setRoomId(res.data.id);
|
|
263
|
-
});
|
|
264
|
-
roomsListTimer();
|
|
265
|
-
return ()=>{
|
|
266
|
-
clearTimeout(receiveMessageTimer.current);
|
|
267
|
-
// clearTimeout(voiceCountdownTimer.current);
|
|
268
|
-
clearTimeout(listTimer.current);
|
|
269
|
-
clearTimeout(timer.current);
|
|
270
|
-
clearTimeout(roomMessage.current);
|
|
271
|
-
clearTimeout(chatRoomList.current);
|
|
272
|
-
};
|
|
273
|
-
}, []);
|
|
274
254
|
//进入页面,发送打招呼信息
|
|
275
255
|
useEffect(()=>{
|
|
276
256
|
//老师的聊天窗口不发送打招呼信息
|
|
@@ -289,9 +269,8 @@ const CustomerService = (props)=>{
|
|
|
289
269
|
scrollToBottom();
|
|
290
270
|
}
|
|
291
271
|
}, [
|
|
292
|
-
greetingMessage
|
|
293
|
-
|
|
294
|
-
]);
|
|
272
|
+
greetingMessage
|
|
273
|
+
]); //hotQuestionsList
|
|
295
274
|
//查找需要复制的代码
|
|
296
275
|
const findCopyContent = (e)=>{
|
|
297
276
|
let source = findParent(e.target, styles.copyCode);
|
|
@@ -332,10 +311,9 @@ const CustomerService = (props)=>{
|
|
|
332
311
|
let questionsList = [];
|
|
333
312
|
let obj = {};
|
|
334
313
|
if (type == 1) {
|
|
335
|
-
|
|
314
|
+
console.log(hotQuestionsList, '33322221111');
|
|
336
315
|
questionsList = hotQuestionsList.map((item, index)=>{
|
|
337
316
|
if (index < 3) {
|
|
338
|
-
questionsId.push(item.id);
|
|
339
317
|
return {
|
|
340
318
|
key: "messageSource",
|
|
341
319
|
value: item.id,
|
|
@@ -346,7 +324,6 @@ const CustomerService = (props)=>{
|
|
|
346
324
|
return null;
|
|
347
325
|
}
|
|
348
326
|
});
|
|
349
|
-
recommendeQuestionID.current = questionsId; //保存推荐问题id
|
|
350
327
|
questionsList = questionsList.filter((i)=>i != null);
|
|
351
328
|
obj = {
|
|
352
329
|
roomId: roomId,
|
|
@@ -676,9 +653,9 @@ const CustomerService = (props)=>{
|
|
|
676
653
|
}
|
|
677
654
|
console.log(type, '接受答案77777');
|
|
678
655
|
//获取下面的推荐问题
|
|
679
|
-
if
|
|
680
|
-
|
|
681
|
-
}
|
|
656
|
+
// if(type == 2){
|
|
657
|
+
// videoPageQuestiionsList(2);
|
|
658
|
+
// }
|
|
682
659
|
http.post(`${urllocation}/chat-service/public/v1.0/history-messages`, obj).then((res)=>{
|
|
683
660
|
if (res.data.id) {
|
|
684
661
|
if (pageNumHistory <= 1) {
|
|
@@ -714,6 +691,10 @@ const CustomerService = (props)=>{
|
|
|
714
691
|
sendingExistingIssues(2, dataObj, "");
|
|
715
692
|
testLabQuestion(obj.message, questions.answer, "");
|
|
716
693
|
}
|
|
694
|
+
if (type == 2 && config && config.type == 'video') {
|
|
695
|
+
//先请求问题列表
|
|
696
|
+
videoPageQuestiionsList(2);
|
|
697
|
+
}
|
|
717
698
|
});
|
|
718
699
|
};
|
|
719
700
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
@@ -740,8 +721,8 @@ const CustomerService = (props)=>{
|
|
|
740
721
|
});
|
|
741
722
|
});
|
|
742
723
|
}, 60 * 1000);
|
|
743
|
-
if (
|
|
744
|
-
let params =
|
|
724
|
+
if (config && config.type == 'video' && config.params) {
|
|
725
|
+
let params = config.params;
|
|
745
726
|
let videoId = params.videoId;
|
|
746
727
|
let watchTime = params.videoProgress;
|
|
747
728
|
let courseId = getQuery('yc_id');
|
|
@@ -755,6 +736,7 @@ const CustomerService = (props)=>{
|
|
|
755
736
|
"watchTime": watchTime
|
|
756
737
|
}
|
|
757
738
|
];
|
|
739
|
+
obj.regenerate = false;
|
|
758
740
|
}
|
|
759
741
|
let data = JSON.stringify(obj);
|
|
760
742
|
setKeyWord("");
|
|
@@ -795,6 +777,10 @@ const CustomerService = (props)=>{
|
|
|
795
777
|
});
|
|
796
778
|
scrollToBottom();
|
|
797
779
|
}
|
|
780
|
+
if (config && config.type == 'video') {
|
|
781
|
+
//先请求问题列表
|
|
782
|
+
videoPageQuestiionsList(3);
|
|
783
|
+
}
|
|
798
784
|
//使用fetchEventSource接收数据
|
|
799
785
|
const eventSource = fetchEventSource(`${urllocation}/chat-service/public/v1.0/chat-with-ai/messages`, {
|
|
800
786
|
method: "POST",
|
|
@@ -895,6 +881,7 @@ const CustomerService = (props)=>{
|
|
|
895
881
|
}
|
|
896
882
|
if (msg.finished) {
|
|
897
883
|
setFinished(true); //发送结束
|
|
884
|
+
videoPageQuestiionsList(2);
|
|
898
885
|
// isPosition.current = true;
|
|
899
886
|
setTimeout(()=>{
|
|
900
887
|
isPosition.current = true;
|
|
@@ -959,9 +946,23 @@ const CustomerService = (props)=>{
|
|
|
959
946
|
} else {
|
|
960
947
|
let newHistoryMessageList2 = list1.map((item)=>{
|
|
961
948
|
message = item.message + obj.message;
|
|
949
|
+
let extraInfo = [];
|
|
950
|
+
// message = '抱歉,我暂时无法回答这样的问题。'
|
|
951
|
+
if (message == '抱歉,我暂时无法回答这样的问题。') {
|
|
952
|
+
extraInfo = videoHotQuestionsList.current.map((str, index)=>{
|
|
953
|
+
return {
|
|
954
|
+
key: "messageSource",
|
|
955
|
+
value: str.id,
|
|
956
|
+
question: str.question,
|
|
957
|
+
answer: str.answer,
|
|
958
|
+
welcomeMessage: true
|
|
959
|
+
};
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
962
|
if (item.id == id) {
|
|
963
963
|
return _object_spread_props(_object_spread({}, item), {
|
|
964
|
-
message: message
|
|
964
|
+
message: message,
|
|
965
|
+
extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
|
|
965
966
|
});
|
|
966
967
|
} else {
|
|
967
968
|
return item;
|
|
@@ -1268,6 +1269,7 @@ const CustomerService = (props)=>{
|
|
|
1268
1269
|
};
|
|
1269
1270
|
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
|
|
1270
1271
|
const getQuestiionsList = (value, flag)=>{
|
|
1272
|
+
// console.log(flag,'dlfkvdmflkvmdfklv');
|
|
1271
1273
|
let data = {};
|
|
1272
1274
|
if (flag == 1) {
|
|
1273
1275
|
data = {
|
|
@@ -1277,7 +1279,7 @@ const CustomerService = (props)=>{
|
|
|
1277
1279
|
} else if (flag == 3) {
|
|
1278
1280
|
data = {
|
|
1279
1281
|
page: 1,
|
|
1280
|
-
maxPageSize:
|
|
1282
|
+
maxPageSize: 5,
|
|
1281
1283
|
question: value,
|
|
1282
1284
|
sectionId: getQuery('s_id')
|
|
1283
1285
|
};
|
|
@@ -1310,29 +1312,45 @@ const CustomerService = (props)=>{
|
|
|
1310
1312
|
} else {
|
|
1311
1313
|
setQuestionsList(questionList);
|
|
1312
1314
|
}
|
|
1313
|
-
if (questionList.length <
|
|
1315
|
+
if (questionList.length < 5 && flag == 3) {
|
|
1314
1316
|
console.log('视频页面,联想问题小于4个');
|
|
1315
1317
|
//视频页面,联想问题小于4个
|
|
1316
|
-
|
|
1318
|
+
http.get(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions`, {
|
|
1319
|
+
params: {
|
|
1320
|
+
page: 1,
|
|
1321
|
+
maxPageSize: 5 - questionList.length
|
|
1322
|
+
}
|
|
1323
|
+
}).then((res)=>{
|
|
1324
|
+
if (res.data.questions) {
|
|
1325
|
+
setQuestionsList((questionList)=>{
|
|
1326
|
+
return [
|
|
1327
|
+
...questionList,
|
|
1328
|
+
...res.data.questions
|
|
1329
|
+
];
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1317
1333
|
}
|
|
1318
1334
|
}
|
|
1319
1335
|
});
|
|
1320
1336
|
};
|
|
1321
|
-
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2
|
|
1337
|
+
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
|
|
1322
1338
|
const videoPageQuestiionsList = (flag = 1)=>{
|
|
1323
|
-
console.log(props, 3333333);
|
|
1324
|
-
let config = props.config;
|
|
1339
|
+
console.log(flag, props, 3333333);
|
|
1325
1340
|
if (config && config.type == 'video' && config.params) {
|
|
1326
1341
|
let params = config.params;
|
|
1327
1342
|
let videoId = params.videoId;
|
|
1328
1343
|
let watchTime = params.videoProgress;
|
|
1329
1344
|
let courseId = getQuery('yc_id');
|
|
1330
1345
|
let sectionId = params.VideoBriefSummaryId;
|
|
1346
|
+
// let courseId="20899",
|
|
1347
|
+
// sectionId= "462347",
|
|
1348
|
+
// videoId= "29707",
|
|
1349
|
+
// watchTime= 262
|
|
1331
1350
|
if (videoId && courseId && sectionId) {
|
|
1351
|
+
console.log(recommendeQuestionID.current, 'recommendeQuestionID.current');
|
|
1332
1352
|
http.post(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions:recommend`, {
|
|
1333
|
-
"recommendedQuestions":
|
|
1334
|
-
''
|
|
1335
|
-
],
|
|
1353
|
+
"recommendedQuestions": recommendeQuestionID.current,
|
|
1336
1354
|
"contexts": [
|
|
1337
1355
|
{
|
|
1338
1356
|
"type": "VIDEO",
|
|
@@ -1342,22 +1360,32 @@ const CustomerService = (props)=>{
|
|
|
1342
1360
|
"watchTime": watchTime
|
|
1343
1361
|
}
|
|
1344
1362
|
],
|
|
1345
|
-
"maximum": 5
|
|
1363
|
+
"maximum": flag == 1 || flag == 2 ? 3 : 5
|
|
1346
1364
|
}).then((res)=>{
|
|
1347
|
-
console.log(res, 333333);
|
|
1348
1365
|
if (res.data.total > 0) {
|
|
1349
1366
|
let data = res.data.questions;
|
|
1367
|
+
if (flag == 3) {
|
|
1368
|
+
// setQuestionsList(data);
|
|
1369
|
+
// setVideoHotQuestionsList(data);
|
|
1370
|
+
videoHotQuestionsList.current = data;
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1350
1373
|
if (flag == 2) {
|
|
1351
1374
|
setBottomRecommendationQuestions(data);
|
|
1352
1375
|
} else {
|
|
1353
1376
|
setHotQuestionsList(data);
|
|
1354
1377
|
}
|
|
1378
|
+
// let ids:any[] = [];
|
|
1379
|
+
// data.map((str: { id: string; })=>{
|
|
1380
|
+
// ids.push(str.id);
|
|
1381
|
+
// })
|
|
1382
|
+
// recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1355
1383
|
resettingBottomHei();
|
|
1356
1384
|
scrollToBottom();
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1385
|
+
// console.log(data,99999);
|
|
1386
|
+
// if(data.length < 4){
|
|
1387
|
+
// getQuestiionsList('',4)
|
|
1388
|
+
// }
|
|
1361
1389
|
}
|
|
1362
1390
|
}).catch(()=>{});
|
|
1363
1391
|
}
|
|
@@ -1728,9 +1756,6 @@ const CustomerService = (props)=>{
|
|
|
1728
1756
|
let timeObj = parseDate(item.createdAt);
|
|
1729
1757
|
// console.log(item.message);
|
|
1730
1758
|
let message = item.message;
|
|
1731
|
-
if (message == '抱歉,我暂时无法回答这样的问题。' && props.config && props.config.type == 'video') {
|
|
1732
|
-
videoPageQuestiionsList(2);
|
|
1733
|
-
}
|
|
1734
1759
|
let li;
|
|
1735
1760
|
// 是否需要显示日期
|
|
1736
1761
|
let itemIndex = historyMessageList.findIndex((ite)=>ite.id === item.id);
|
|
@@ -2013,23 +2038,36 @@ const CustomerService = (props)=>{
|
|
|
2013
2038
|
})
|
|
2014
2039
|
]
|
|
2015
2040
|
}),
|
|
2016
|
-
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/
|
|
2017
|
-
className: styles.association_problem
|
|
2018
|
-
children:
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2041
|
+
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsxs("ul", {
|
|
2042
|
+
className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? 'association_problem_flag' : ''}`,
|
|
2043
|
+
children: [
|
|
2044
|
+
item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
|
|
2045
|
+
className: styles.related_issues_flag,
|
|
2046
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
2047
|
+
children: "相关问题"
|
|
2048
|
+
})
|
|
2049
|
+
}),
|
|
2050
|
+
JSON.parse(item.extraInfo).map((list, index)=>{
|
|
2051
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
2052
|
+
onClick: ()=>{
|
|
2053
|
+
sendMessage(list, 1);
|
|
2054
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
|
|
2055
|
+
setBottomRecommendationQuestions([]);
|
|
2056
|
+
resettingBottomHei();
|
|
2057
|
+
},
|
|
2058
|
+
children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2059
|
+
children: [
|
|
2060
|
+
index + 1,
|
|
2061
|
+
".",
|
|
2062
|
+
list.question
|
|
2063
|
+
]
|
|
2064
|
+
})
|
|
2065
|
+
}, i + "_" + index + "_" + list.value);
|
|
2066
|
+
})
|
|
2067
|
+
]
|
|
2030
2068
|
}),
|
|
2031
2069
|
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
2032
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
2070
|
+
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != '123456_date' && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
2033
2071
|
//召唤老师回答按钮
|
|
2034
2072
|
isAiChatWindow && item.findTeacher && userData.modules.some((item)=>item.short == "TeacherAnswer") && /*#__PURE__*/ _jsx("div", {
|
|
2035
2073
|
className: `${styles.operate_modal_bottom} `,
|
|
@@ -2243,11 +2281,9 @@ const CustomerService = (props)=>{
|
|
|
2243
2281
|
if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl") {
|
|
2244
2282
|
findTeacherBtn = true;
|
|
2245
2283
|
}
|
|
2284
|
+
/// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
|
|
2246
2285
|
return /*#__PURE__*/ _jsxs("div", {
|
|
2247
2286
|
className: `${styles.operate_modal_bottom}`,
|
|
2248
|
-
style: {
|
|
2249
|
-
position: showStopBtn && isPosition.current ? 'sticky' : 'relative'
|
|
2250
|
-
},
|
|
2251
2287
|
children: [
|
|
2252
2288
|
/*#__PURE__*/ _jsxs("p", {
|
|
2253
2289
|
className: styles.stop_generate,
|
|
@@ -2503,6 +2539,7 @@ const CustomerService = (props)=>{
|
|
|
2503
2539
|
className: styles.icon_close,
|
|
2504
2540
|
onClick: ()=>{
|
|
2505
2541
|
setScreenshotBese64('');
|
|
2542
|
+
resettingBottomHei();
|
|
2506
2543
|
},
|
|
2507
2544
|
children: /*#__PURE__*/ _jsx(CustomRoundClose, {})
|
|
2508
2545
|
}),
|
|
@@ -2555,6 +2592,7 @@ const CustomerService = (props)=>{
|
|
|
2555
2592
|
"讲解这张图片涉及到的知识内容"
|
|
2556
2593
|
]
|
|
2557
2594
|
}),
|
|
2595
|
+
/*#__PURE__*/ _jsx("br", {}),
|
|
2558
2596
|
/*#__PURE__*/ _jsxs("p", {
|
|
2559
2597
|
onClick: ()=>{
|
|
2560
2598
|
setHistoryMessageList((historyMessageList)=>{
|
|
@@ -2618,7 +2656,7 @@ const CustomerService = (props)=>{
|
|
|
2618
2656
|
let roomList = contactsList;
|
|
2619
2657
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
2620
2658
|
console.log(props, 333333);
|
|
2621
|
-
if (
|
|
2659
|
+
if (config && config.type == 'video') {
|
|
2622
2660
|
getQuestiionsList(String(e.target.value), 3);
|
|
2623
2661
|
} else {
|
|
2624
2662
|
getQuestiionsList(String(e.target.value), 2);
|
|
@@ -2709,7 +2747,11 @@ const CustomerService = (props)=>{
|
|
|
2709
2747
|
onClick: ()=>{
|
|
2710
2748
|
if (!finished) return;
|
|
2711
2749
|
setSaveShowType(showType);
|
|
2712
|
-
|
|
2750
|
+
if (showType == 3) {
|
|
2751
|
+
setShowScreenshot(true);
|
|
2752
|
+
} else {
|
|
2753
|
+
setShowType(5);
|
|
2754
|
+
}
|
|
2713
2755
|
},
|
|
2714
2756
|
children: /*#__PURE__*/ _jsx(CustomScreenshot, {})
|
|
2715
2757
|
})
|
|
@@ -2863,17 +2905,20 @@ const CustomerService = (props)=>{
|
|
|
2863
2905
|
});
|
|
2864
2906
|
}
|
|
2865
2907
|
};
|
|
2908
|
+
//视频页面底部推荐问题
|
|
2866
2909
|
const renderBottomAssociationProblem = ()=>{
|
|
2867
2910
|
return /*#__PURE__*/ _jsx("div", {
|
|
2868
2911
|
className: styles.issues_list_flag,
|
|
2869
|
-
style: {
|
|
2870
|
-
bottom: `${buttomHei}px`
|
|
2871
|
-
},
|
|
2872
2912
|
id: "BottomAssociationProblem",
|
|
2873
2913
|
children: bottomRecommendationQuestions.map((item)=>{
|
|
2874
2914
|
return /*#__PURE__*/ _jsx("p", {
|
|
2875
2915
|
onClick: ()=>{
|
|
2876
2916
|
sendMessage(item, 1);
|
|
2917
|
+
if (config && config.type == 'video') {
|
|
2918
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
|
|
2919
|
+
setBottomRecommendationQuestions([]);
|
|
2920
|
+
resettingBottomHei();
|
|
2921
|
+
}
|
|
2877
2922
|
},
|
|
2878
2923
|
children: item.question
|
|
2879
2924
|
}, item.id);
|
|
@@ -3085,7 +3130,7 @@ const CustomerService = (props)=>{
|
|
|
3085
3130
|
})
|
|
3086
3131
|
]
|
|
3087
3132
|
}),
|
|
3088
|
-
showType == 3
|
|
3133
|
+
showType == 3 && /*#__PURE__*/ _jsxs("div", {
|
|
3089
3134
|
className: `${styles.ChatWindow_Drawer}`,
|
|
3090
3135
|
id: "",
|
|
3091
3136
|
onClick: ()=>{
|
|
@@ -3196,12 +3241,12 @@ const CustomerService = (props)=>{
|
|
|
3196
3241
|
})
|
|
3197
3242
|
})
|
|
3198
3243
|
]
|
|
3199
|
-
})
|
|
3200
|
-
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3244
|
+
}),
|
|
3245
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3201
3246
|
children: [
|
|
3202
3247
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
3203
3248
|
title: "AI助手",
|
|
3204
|
-
open: true,
|
|
3249
|
+
open: showType == 4 ? true : false,
|
|
3205
3250
|
onCancel: ()=>{
|
|
3206
3251
|
onCancel();
|
|
3207
3252
|
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
@@ -3287,7 +3332,7 @@ const CustomerService = (props)=>{
|
|
|
3287
3332
|
})
|
|
3288
3333
|
]
|
|
3289
3334
|
}),
|
|
3290
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
3335
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs("div", {
|
|
3291
3336
|
className: `${styles.ChatWindow_Drawer}`,
|
|
3292
3337
|
id: "",
|
|
3293
3338
|
children: [
|
|
@@ -3385,7 +3430,7 @@ const CustomerService = (props)=>{
|
|
|
3385
3430
|
})
|
|
3386
3431
|
]
|
|
3387
3432
|
}),
|
|
3388
|
-
showType == 5 && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3433
|
+
(showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3389
3434
|
imgBese64: imgBese64,
|
|
3390
3435
|
saveScreenshotBese64: (base64)=>{
|
|
3391
3436
|
setScreenshotBese64(base64);
|
|
@@ -3394,9 +3439,15 @@ const CustomerService = (props)=>{
|
|
|
3394
3439
|
} else {
|
|
3395
3440
|
setShowType(1);
|
|
3396
3441
|
}
|
|
3442
|
+
setShowScreenshot(false);
|
|
3397
3443
|
},
|
|
3398
3444
|
cancelScreenshot: ()=>{
|
|
3399
|
-
|
|
3445
|
+
if (saveShowType != -1) {
|
|
3446
|
+
setShowType(saveShowType);
|
|
3447
|
+
} else {
|
|
3448
|
+
setShowType(1);
|
|
3449
|
+
}
|
|
3450
|
+
setShowScreenshot(false);
|
|
3400
3451
|
}
|
|
3401
3452
|
}),
|
|
3402
3453
|
viewBase64 && visible && /*#__PURE__*/ _jsx(ViewImage, {
|