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
|
@@ -40,6 +40,7 @@ var CustomerService = function(props) {
|
|
|
40
40
|
var _useState4 = _sliced_to_array(useState(""), 2), keyWord = _useState4[0], setKeyWord = _useState4[1]; //搜索内容
|
|
41
41
|
var _useState5 = _sliced_to_array(useState([]), 2), questionsList = _useState5[0], setQuestionsList = _useState5[1]; //问题列表
|
|
42
42
|
var _useState6 = _sliced_to_array(useState([]), 2), hotQuestionsList = _useState6[0], setHotQuestionsList = _useState6[1]; //热门问题
|
|
43
|
+
// const [videoHotQuestionsList, setVideoHotQuestionsList] = useState([]); //热门问题
|
|
43
44
|
var _useState7 = _sliced_to_array(useState(false), 2), greetingMessage = _useState7[0], setGreetingMessage = _useState7[1]; //聊天记录列表是否请求完成
|
|
44
45
|
var _useState8 = _sliced_to_array(useState(1), 2), pageNum = _useState8[0], setPageNum = _useState8[1]; //页码
|
|
45
46
|
var _useState9 = _sliced_to_array(useState(0), 2), pageNumHistory = _useState9[0], setPageNumHistory = _useState9[1]; //用于搜索历史记录后的页码
|
|
@@ -65,7 +66,8 @@ var CustomerService = function(props) {
|
|
|
65
66
|
var _useState29 = _sliced_to_array(useState(""), 2), viewBase64 = _useState29[0], setViewBase64 = _useState29[1]; //图片预览
|
|
66
67
|
var _useState30 = _sliced_to_array(useState(false), 2), visible = _useState30[0], setVisible = _useState30[1]; //是否显示图片预览
|
|
67
68
|
var _useState31 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState31[0], setBottomRecommendationQuestions = _useState31[1]; //底部推荐问题
|
|
68
|
-
var _useState32 = _sliced_to_array(useState(
|
|
69
|
+
var _useState32 = _sliced_to_array(useState(false), 2), showScreenshot = _useState32[0], setShowScreenshot = _useState32[1]; //是否显示截图 主要用于newlabo页面
|
|
70
|
+
var _useState33 = _sliced_to_array(useState(-1), 2), saveShowType = _useState33[0], setSaveShowType = _useState33[1]; //保存截图时的状态
|
|
69
71
|
var timer = useRef(null); //文本框输入时
|
|
70
72
|
var receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
71
73
|
// let voiceCountdownTimer = useRef(null); //语音录制倒计时
|
|
@@ -77,6 +79,7 @@ var CustomerService = function(props) {
|
|
|
77
79
|
var scrollTopHei = useRef(0);
|
|
78
80
|
var isPosition = useRef(true);
|
|
79
81
|
var recommendeQuestionID = useRef([]); //推荐问题id
|
|
82
|
+
var videoHotQuestionsList = useRef([]); //视频热门问题
|
|
80
83
|
var mid = props.userData.mid;
|
|
81
84
|
var remarkable = new Remarkable({
|
|
82
85
|
highlight: function highlight(str, lang) {
|
|
@@ -91,6 +94,15 @@ var CustomerService = function(props) {
|
|
|
91
94
|
return ""; // use external default escaping
|
|
92
95
|
}
|
|
93
96
|
});
|
|
97
|
+
useEffect(function() {
|
|
98
|
+
if (config && config.type == "video") {
|
|
99
|
+
//获取热门推荐
|
|
100
|
+
videoPageQuestiionsList(1);
|
|
101
|
+
}
|
|
102
|
+
setShowType(initShowType);
|
|
103
|
+
}, [
|
|
104
|
+
initShowType
|
|
105
|
+
]);
|
|
94
106
|
useEffect(function() {
|
|
95
107
|
var handleScroll = function handleScroll() {
|
|
96
108
|
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
@@ -138,56 +150,33 @@ var CustomerService = function(props) {
|
|
|
138
150
|
}
|
|
139
151
|
scrollTopHei.current = scrollTop;
|
|
140
152
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// 获取 video 元素和 canvas 元素
|
|
144
|
-
// var video = document.getElementById('container_html5_api');
|
|
145
|
-
// // const canvas = document.createElement('canvas');
|
|
146
|
-
// const canvas = document.getElementById('canvas_test');
|
|
147
|
-
// var context = canvas.getContext('2d');
|
|
148
|
-
// // 设置 canvas 尺寸
|
|
149
|
-
// canvas.width = video.videoWidth/4;
|
|
150
|
-
// canvas.height = video.videoHeight/4;
|
|
151
|
-
// // 在 canvas 上绘制 video 的当前帧
|
|
152
|
-
// context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
153
|
-
// // 使用 html2canvas 对 canvas 进行截图
|
|
154
|
-
// html2canvas(canvas,{
|
|
155
|
-
// scale: 1,
|
|
156
|
-
// useCORS: true,
|
|
157
|
-
// logging: true,
|
|
158
|
-
// }).then(function(screenshot) {
|
|
159
|
-
// // 将截图显示在页面上,或者进行其他操作
|
|
160
|
-
// document.body.appendChild(screenshot);
|
|
161
|
-
// setTimeout(()=>{
|
|
162
|
-
// let url = screenshot.toDataURL('image/png');
|
|
163
|
-
// console.log(url);
|
|
164
|
-
// },3000)
|
|
165
|
-
// // console.log("container_html5_apicontainer_html5_api",screenshot)
|
|
166
|
-
// // console.log(screenshot.toDataURL('image/jpeg'))
|
|
167
|
-
// });
|
|
168
|
-
// // 显示图片或者做其他操作
|
|
153
|
+
//|| showScreenshot
|
|
154
|
+
if (showType == 5 || showScreenshot) {
|
|
169
155
|
try {
|
|
170
156
|
setImgBese64("");
|
|
171
|
-
html2canvas(document.getElementsByTagName(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
158
|
+
// // ignoreElements:(element)=>{
|
|
159
|
+
// // if(element.compareDocumentPosition(dom)===2)return true
|
|
160
|
+
// // return false
|
|
161
|
+
// // }
|
|
162
|
+
// }).then((canvas)=>{
|
|
163
|
+
// console.log(canvas,22222);
|
|
164
|
+
// setTimeout(()=>{
|
|
165
|
+
var dom = document.getElementById(screenshotAreaId);
|
|
166
|
+
html2canvas(dom, {
|
|
167
|
+
useCORS: true,
|
|
168
|
+
// allowTaint: true, // 污染处理
|
|
169
|
+
scale: 1
|
|
170
|
+
}).then(function(canvas) {
|
|
171
|
+
// document.body.appendChild(canvas);
|
|
172
|
+
// document.body.appendChild(canvas);
|
|
173
|
+
console.log(canvas, 99999);
|
|
174
|
+
// var base64URL = canvas.toDataURL('image/jpeg')
|
|
175
|
+
var base64URL = canvas.toDataURL("image/jpg", 1.0);
|
|
176
|
+
setImgBese64(base64URL);
|
|
190
177
|
});
|
|
178
|
+
// },100)
|
|
179
|
+
// })
|
|
191
180
|
} catch (error) {
|
|
192
181
|
console.log(error);
|
|
193
182
|
}
|
|
@@ -209,7 +198,8 @@ var CustomerService = function(props) {
|
|
|
209
198
|
}, [
|
|
210
199
|
historyMessageList,
|
|
211
200
|
showType,
|
|
212
|
-
pageCount
|
|
201
|
+
pageCount,
|
|
202
|
+
showScreenshot
|
|
213
203
|
]);
|
|
214
204
|
useEffect(function() {
|
|
215
205
|
resettingBottomHei();
|
|
@@ -228,16 +218,21 @@ var CustomerService = function(props) {
|
|
|
228
218
|
buttomHei,
|
|
229
219
|
showType
|
|
230
220
|
]);
|
|
221
|
+
//创建聊天室并获取聊天室列表
|
|
231
222
|
useEffect(function() {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
223
|
+
createRooms("AI").then(function(res) {
|
|
224
|
+
setRoomId(res.data.id);
|
|
225
|
+
});
|
|
226
|
+
roomsListTimer();
|
|
227
|
+
return function() {
|
|
228
|
+
clearTimeout(receiveMessageTimer.current);
|
|
229
|
+
// clearTimeout(voiceCountdownTimer.current);
|
|
230
|
+
clearTimeout(listTimer.current);
|
|
231
|
+
clearTimeout(timer.current);
|
|
232
|
+
clearTimeout(roomMessage.current);
|
|
233
|
+
clearTimeout(chatRoomList.current);
|
|
234
|
+
};
|
|
235
|
+
}, []);
|
|
241
236
|
useEffect(function() {
|
|
242
237
|
if (roomId != "") {
|
|
243
238
|
if (lastId == "") {
|
|
@@ -258,21 +253,6 @@ var CustomerService = function(props) {
|
|
|
258
253
|
}, [
|
|
259
254
|
roomId
|
|
260
255
|
]);
|
|
261
|
-
//创建聊天室并获取聊天室列表
|
|
262
|
-
useEffect(function() {
|
|
263
|
-
createRooms("AI").then(function(res) {
|
|
264
|
-
setRoomId(res.data.id);
|
|
265
|
-
});
|
|
266
|
-
roomsListTimer();
|
|
267
|
-
return function() {
|
|
268
|
-
clearTimeout(receiveMessageTimer.current);
|
|
269
|
-
// clearTimeout(voiceCountdownTimer.current);
|
|
270
|
-
clearTimeout(listTimer.current);
|
|
271
|
-
clearTimeout(timer.current);
|
|
272
|
-
clearTimeout(roomMessage.current);
|
|
273
|
-
clearTimeout(chatRoomList.current);
|
|
274
|
-
};
|
|
275
|
-
}, []);
|
|
276
256
|
//进入页面,发送打招呼信息
|
|
277
257
|
useEffect(function() {
|
|
278
258
|
//老师的聊天窗口不发送打招呼信息
|
|
@@ -291,9 +271,8 @@ var CustomerService = function(props) {
|
|
|
291
271
|
scrollToBottom();
|
|
292
272
|
}
|
|
293
273
|
}, [
|
|
294
|
-
greetingMessage
|
|
295
|
-
|
|
296
|
-
]);
|
|
274
|
+
greetingMessage
|
|
275
|
+
]); //hotQuestionsList
|
|
297
276
|
//查找需要复制的代码
|
|
298
277
|
var findCopyContent = function(e) {
|
|
299
278
|
var source = findParent(e.target, styles.copyCode);
|
|
@@ -336,10 +315,9 @@ var CustomerService = function(props) {
|
|
|
336
315
|
var questionsList = [];
|
|
337
316
|
var obj = {};
|
|
338
317
|
if (type == 1) {
|
|
339
|
-
|
|
318
|
+
console.log(hotQuestionsList, "33322221111");
|
|
340
319
|
questionsList = hotQuestionsList.map(function(item, index) {
|
|
341
320
|
if (index < 3) {
|
|
342
|
-
questionsId.push(item.id);
|
|
343
321
|
return {
|
|
344
322
|
key: "messageSource",
|
|
345
323
|
value: item.id,
|
|
@@ -350,7 +328,6 @@ var CustomerService = function(props) {
|
|
|
350
328
|
return null;
|
|
351
329
|
}
|
|
352
330
|
});
|
|
353
|
-
recommendeQuestionID.current = questionsId; //保存推荐问题id
|
|
354
331
|
questionsList = questionsList.filter(function(i) {
|
|
355
332
|
return i != null;
|
|
356
333
|
});
|
|
@@ -692,9 +669,9 @@ var CustomerService = function(props) {
|
|
|
692
669
|
}
|
|
693
670
|
console.log(type, "接受答案77777");
|
|
694
671
|
//获取下面的推荐问题
|
|
695
|
-
if
|
|
696
|
-
|
|
697
|
-
}
|
|
672
|
+
// if(type == 2){
|
|
673
|
+
// videoPageQuestiionsList(2);
|
|
674
|
+
// }
|
|
698
675
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
699
676
|
if (res.data.id) {
|
|
700
677
|
if (pageNumHistory <= 1) {
|
|
@@ -730,6 +707,10 @@ var CustomerService = function(props) {
|
|
|
730
707
|
sendingExistingIssues(2, dataObj, "");
|
|
731
708
|
testLabQuestion(obj.message, questions.answer, "");
|
|
732
709
|
}
|
|
710
|
+
if (type == 2 && config && config.type == "video") {
|
|
711
|
+
//先请求问题列表
|
|
712
|
+
videoPageQuestiionsList(2);
|
|
713
|
+
}
|
|
733
714
|
});
|
|
734
715
|
};
|
|
735
716
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
@@ -758,8 +739,8 @@ var CustomerService = function(props) {
|
|
|
758
739
|
});
|
|
759
740
|
});
|
|
760
741
|
}, 60 * 1000);
|
|
761
|
-
if (
|
|
762
|
-
var params =
|
|
742
|
+
if (config && config.type == "video" && config.params) {
|
|
743
|
+
var params = config.params;
|
|
763
744
|
var videoId = params.videoId;
|
|
764
745
|
var watchTime = params.videoProgress;
|
|
765
746
|
var courseId = getQuery("yc_id");
|
|
@@ -773,6 +754,7 @@ var CustomerService = function(props) {
|
|
|
773
754
|
"watchTime": watchTime
|
|
774
755
|
}
|
|
775
756
|
];
|
|
757
|
+
obj.regenerate = false;
|
|
776
758
|
}
|
|
777
759
|
var data = JSON.stringify(obj);
|
|
778
760
|
setKeyWord("");
|
|
@@ -813,6 +795,10 @@ var CustomerService = function(props) {
|
|
|
813
795
|
});
|
|
814
796
|
scrollToBottom();
|
|
815
797
|
}
|
|
798
|
+
if (config && config.type == "video") {
|
|
799
|
+
//先请求问题列表
|
|
800
|
+
videoPageQuestiionsList(3);
|
|
801
|
+
}
|
|
816
802
|
//使用fetchEventSource接收数据
|
|
817
803
|
var eventSource = fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
|
|
818
804
|
method: "POST",
|
|
@@ -919,6 +905,7 @@ var CustomerService = function(props) {
|
|
|
919
905
|
}
|
|
920
906
|
if (msg.finished) {
|
|
921
907
|
setFinished(true); //发送结束
|
|
908
|
+
videoPageQuestiionsList(2);
|
|
922
909
|
// isPosition.current = true;
|
|
923
910
|
setTimeout(function() {
|
|
924
911
|
isPosition.current = true;
|
|
@@ -985,9 +972,23 @@ var CustomerService = function(props) {
|
|
|
985
972
|
} else {
|
|
986
973
|
var newHistoryMessageList2 = list1.map(function(item) {
|
|
987
974
|
message = item.message + obj.message;
|
|
975
|
+
var extraInfo = [];
|
|
976
|
+
// message = '抱歉,我暂时无法回答这样的问题。'
|
|
977
|
+
if (message == "抱歉,我暂时无法回答这样的问题。") {
|
|
978
|
+
extraInfo = videoHotQuestionsList.current.map(function(str, index) {
|
|
979
|
+
return {
|
|
980
|
+
key: "messageSource",
|
|
981
|
+
value: str.id,
|
|
982
|
+
question: str.question,
|
|
983
|
+
answer: str.answer,
|
|
984
|
+
welcomeMessage: true
|
|
985
|
+
};
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
988
|
if (item.id == id) {
|
|
989
989
|
return _object_spread_props(_object_spread({}, item), {
|
|
990
|
-
message: message
|
|
990
|
+
message: message,
|
|
991
|
+
extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
|
|
991
992
|
});
|
|
992
993
|
} else {
|
|
993
994
|
return item;
|
|
@@ -1305,6 +1306,7 @@ var CustomerService = function(props) {
|
|
|
1305
1306
|
};
|
|
1306
1307
|
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
|
|
1307
1308
|
var getQuestiionsList = function(value, flag) {
|
|
1309
|
+
// console.log(flag,'dlfkvdmflkvmdfklv');
|
|
1308
1310
|
var data = {};
|
|
1309
1311
|
if (flag == 1) {
|
|
1310
1312
|
data = {
|
|
@@ -1314,7 +1316,7 @@ var CustomerService = function(props) {
|
|
|
1314
1316
|
} else if (flag == 3) {
|
|
1315
1317
|
data = {
|
|
1316
1318
|
page: 1,
|
|
1317
|
-
maxPageSize:
|
|
1319
|
+
maxPageSize: 5,
|
|
1318
1320
|
question: value,
|
|
1319
1321
|
sectionId: getQuery("s_id")
|
|
1320
1322
|
};
|
|
@@ -1344,30 +1346,43 @@ var CustomerService = function(props) {
|
|
|
1344
1346
|
} else {
|
|
1345
1347
|
setQuestionsList(questionList);
|
|
1346
1348
|
}
|
|
1347
|
-
if (questionList.length <
|
|
1349
|
+
if (questionList.length < 5 && flag == 3) {
|
|
1348
1350
|
console.log("视频页面,联想问题小于4个");
|
|
1349
1351
|
//视频页面,联想问题小于4个
|
|
1350
|
-
|
|
1352
|
+
http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
|
|
1353
|
+
params: {
|
|
1354
|
+
page: 1,
|
|
1355
|
+
maxPageSize: 5 - questionList.length
|
|
1356
|
+
}
|
|
1357
|
+
}).then(function(res) {
|
|
1358
|
+
if (res.data.questions) {
|
|
1359
|
+
setQuestionsList(function(questionList) {
|
|
1360
|
+
return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1351
1364
|
}
|
|
1352
1365
|
}
|
|
1353
1366
|
});
|
|
1354
1367
|
};
|
|
1355
|
-
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2
|
|
1368
|
+
//获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
|
|
1356
1369
|
var videoPageQuestiionsList = function() {
|
|
1357
1370
|
var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
|
|
1358
|
-
console.log(props, 3333333);
|
|
1359
|
-
var config = props.config;
|
|
1371
|
+
console.log(flag, props, 3333333);
|
|
1360
1372
|
if (config && config.type == "video" && config.params) {
|
|
1361
1373
|
var params = config.params;
|
|
1362
1374
|
var videoId = params.videoId;
|
|
1363
1375
|
var watchTime = params.videoProgress;
|
|
1364
1376
|
var courseId = getQuery("yc_id");
|
|
1365
1377
|
var sectionId = params.VideoBriefSummaryId;
|
|
1378
|
+
// let courseId="20899",
|
|
1379
|
+
// sectionId= "462347",
|
|
1380
|
+
// videoId= "29707",
|
|
1381
|
+
// watchTime= 262
|
|
1366
1382
|
if (videoId && courseId && sectionId) {
|
|
1383
|
+
console.log(recommendeQuestionID.current, "recommendeQuestionID.current");
|
|
1367
1384
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
|
|
1368
|
-
"recommendedQuestions":
|
|
1369
|
-
""
|
|
1370
|
-
],
|
|
1385
|
+
"recommendedQuestions": recommendeQuestionID.current,
|
|
1371
1386
|
"contexts": [
|
|
1372
1387
|
{
|
|
1373
1388
|
"type": "VIDEO",
|
|
@@ -1377,22 +1392,32 @@ var CustomerService = function(props) {
|
|
|
1377
1392
|
"watchTime": watchTime
|
|
1378
1393
|
}
|
|
1379
1394
|
],
|
|
1380
|
-
"maximum": 5
|
|
1395
|
+
"maximum": flag == 1 || flag == 2 ? 3 : 5
|
|
1381
1396
|
}).then(function(res) {
|
|
1382
|
-
console.log(res, 333333);
|
|
1383
1397
|
if (res.data.total > 0) {
|
|
1384
1398
|
var data = res.data.questions;
|
|
1399
|
+
if (flag == 3) {
|
|
1400
|
+
// setQuestionsList(data);
|
|
1401
|
+
// setVideoHotQuestionsList(data);
|
|
1402
|
+
videoHotQuestionsList.current = data;
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1385
1405
|
if (flag == 2) {
|
|
1386
1406
|
setBottomRecommendationQuestions(data);
|
|
1387
1407
|
} else {
|
|
1388
1408
|
setHotQuestionsList(data);
|
|
1389
1409
|
}
|
|
1410
|
+
// let ids:any[] = [];
|
|
1411
|
+
// data.map((str: { id: string; })=>{
|
|
1412
|
+
// ids.push(str.id);
|
|
1413
|
+
// })
|
|
1414
|
+
// recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1390
1415
|
resettingBottomHei();
|
|
1391
1416
|
scrollToBottom();
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1417
|
+
// console.log(data,99999);
|
|
1418
|
+
// if(data.length < 4){
|
|
1419
|
+
// getQuestiionsList('',4)
|
|
1420
|
+
// }
|
|
1396
1421
|
}
|
|
1397
1422
|
}).catch(function() {});
|
|
1398
1423
|
}
|
|
@@ -1777,9 +1802,6 @@ var CustomerService = function(props) {
|
|
|
1777
1802
|
var timeObj = parseDate(item.createdAt);
|
|
1778
1803
|
// console.log(item.message);
|
|
1779
1804
|
var message = item.message;
|
|
1780
|
-
if (message == "抱歉,我暂时无法回答这样的问题。" && props.config && props.config.type == "video") {
|
|
1781
|
-
videoPageQuestiionsList(2);
|
|
1782
|
-
}
|
|
1783
1805
|
var li;
|
|
1784
1806
|
// 是否需要显示日期
|
|
1785
1807
|
var itemIndex = historyMessageList.findIndex(function(ite) {
|
|
@@ -2039,23 +2061,36 @@ var CustomerService = function(props) {
|
|
|
2039
2061
|
})
|
|
2040
2062
|
]
|
|
2041
2063
|
}),
|
|
2042
|
-
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/
|
|
2043
|
-
className: styles.association_problem,
|
|
2044
|
-
children:
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2064
|
+
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", {
|
|
2065
|
+
className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? "association_problem_flag" : ""),
|
|
2066
|
+
children: [
|
|
2067
|
+
item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ _jsx("li", {
|
|
2068
|
+
className: styles.related_issues_flag,
|
|
2069
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
2070
|
+
children: "相关问题"
|
|
2071
|
+
})
|
|
2072
|
+
}),
|
|
2073
|
+
JSON.parse(item.extraInfo).map(function(list, index) {
|
|
2074
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
2075
|
+
onClick: function() {
|
|
2076
|
+
sendMessage(list, 1);
|
|
2077
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
|
|
2078
|
+
setBottomRecommendationQuestions([]);
|
|
2079
|
+
resettingBottomHei();
|
|
2080
|
+
},
|
|
2081
|
+
children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2082
|
+
children: [
|
|
2083
|
+
index + 1,
|
|
2084
|
+
".",
|
|
2085
|
+
list.question
|
|
2086
|
+
]
|
|
2087
|
+
})
|
|
2088
|
+
}, i + "_" + index + "_" + list.value);
|
|
2089
|
+
})
|
|
2090
|
+
]
|
|
2056
2091
|
}),
|
|
2057
2092
|
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
2058
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
2093
|
+
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
2059
2094
|
//召唤老师回答按钮
|
|
2060
2095
|
isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
|
|
2061
2096
|
return item.short == "TeacherAnswer";
|
|
@@ -2281,11 +2316,9 @@ var CustomerService = function(props) {
|
|
|
2281
2316
|
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") {
|
|
2282
2317
|
findTeacherBtn = true;
|
|
2283
2318
|
}
|
|
2319
|
+
/// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
|
|
2284
2320
|
return /*#__PURE__*/ _jsxs("div", {
|
|
2285
2321
|
className: "".concat(styles.operate_modal_bottom),
|
|
2286
|
-
style: {
|
|
2287
|
-
position: showStopBtn && isPosition.current ? "sticky" : "relative"
|
|
2288
|
-
},
|
|
2289
2322
|
children: [
|
|
2290
2323
|
/*#__PURE__*/ _jsxs("p", {
|
|
2291
2324
|
className: styles.stop_generate,
|
|
@@ -2555,6 +2588,7 @@ var CustomerService = function(props) {
|
|
|
2555
2588
|
className: styles.icon_close,
|
|
2556
2589
|
onClick: function() {
|
|
2557
2590
|
setScreenshotBese64("");
|
|
2591
|
+
resettingBottomHei();
|
|
2558
2592
|
},
|
|
2559
2593
|
children: /*#__PURE__*/ _jsx(CustomRoundClose, {})
|
|
2560
2594
|
}),
|
|
@@ -2607,6 +2641,7 @@ var CustomerService = function(props) {
|
|
|
2607
2641
|
"讲解这张图片涉及到的知识内容"
|
|
2608
2642
|
]
|
|
2609
2643
|
}),
|
|
2644
|
+
/*#__PURE__*/ _jsx("br", {}),
|
|
2610
2645
|
/*#__PURE__*/ _jsxs("p", {
|
|
2611
2646
|
onClick: function() {
|
|
2612
2647
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -2670,7 +2705,7 @@ var CustomerService = function(props) {
|
|
|
2670
2705
|
var roomList = contactsList;
|
|
2671
2706
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
2672
2707
|
console.log(props, 333333);
|
|
2673
|
-
if (
|
|
2708
|
+
if (config && config.type == "video") {
|
|
2674
2709
|
getQuestiionsList(String(e.target.value), 3);
|
|
2675
2710
|
} else {
|
|
2676
2711
|
getQuestiionsList(String(e.target.value), 2);
|
|
@@ -2767,7 +2802,11 @@ var CustomerService = function(props) {
|
|
|
2767
2802
|
onClick: function() {
|
|
2768
2803
|
if (!finished) return;
|
|
2769
2804
|
setSaveShowType(showType);
|
|
2770
|
-
|
|
2805
|
+
if (showType == 3) {
|
|
2806
|
+
setShowScreenshot(true);
|
|
2807
|
+
} else {
|
|
2808
|
+
setShowType(5);
|
|
2809
|
+
}
|
|
2771
2810
|
},
|
|
2772
2811
|
children: /*#__PURE__*/ _jsx(CustomScreenshot, {})
|
|
2773
2812
|
})
|
|
@@ -2927,17 +2966,20 @@ var CustomerService = function(props) {
|
|
|
2927
2966
|
});
|
|
2928
2967
|
}
|
|
2929
2968
|
};
|
|
2969
|
+
//视频页面底部推荐问题
|
|
2930
2970
|
var renderBottomAssociationProblem = function() {
|
|
2931
2971
|
return /*#__PURE__*/ _jsx("div", {
|
|
2932
2972
|
className: styles.issues_list_flag,
|
|
2933
|
-
style: {
|
|
2934
|
-
bottom: "".concat(buttomHei, "px")
|
|
2935
|
-
},
|
|
2936
2973
|
id: "BottomAssociationProblem",
|
|
2937
2974
|
children: bottomRecommendationQuestions.map(function(item) {
|
|
2938
2975
|
return /*#__PURE__*/ _jsx("p", {
|
|
2939
2976
|
onClick: function() {
|
|
2940
2977
|
sendMessage(item, 1);
|
|
2978
|
+
if (config && config.type == "video") {
|
|
2979
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
|
|
2980
|
+
setBottomRecommendationQuestions([]);
|
|
2981
|
+
resettingBottomHei();
|
|
2982
|
+
}
|
|
2941
2983
|
},
|
|
2942
2984
|
children: item.question
|
|
2943
2985
|
}, item.id);
|
|
@@ -3149,7 +3191,7 @@ var CustomerService = function(props) {
|
|
|
3149
3191
|
})
|
|
3150
3192
|
]
|
|
3151
3193
|
}),
|
|
3152
|
-
showType == 3
|
|
3194
|
+
showType == 3 && /*#__PURE__*/ _jsxs("div", {
|
|
3153
3195
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3154
3196
|
id: "",
|
|
3155
3197
|
onClick: function() {
|
|
@@ -3260,12 +3302,12 @@ var CustomerService = function(props) {
|
|
|
3260
3302
|
})
|
|
3261
3303
|
})
|
|
3262
3304
|
]
|
|
3263
|
-
})
|
|
3264
|
-
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3305
|
+
}),
|
|
3306
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3265
3307
|
children: [
|
|
3266
3308
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
3267
3309
|
title: "AI助手",
|
|
3268
|
-
open: true,
|
|
3310
|
+
open: showType == 4 ? true : false,
|
|
3269
3311
|
onCancel: function() {
|
|
3270
3312
|
onCancel();
|
|
3271
3313
|
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
@@ -3351,7 +3393,7 @@ var CustomerService = function(props) {
|
|
|
3351
3393
|
})
|
|
3352
3394
|
]
|
|
3353
3395
|
}),
|
|
3354
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
3396
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs("div", {
|
|
3355
3397
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3356
3398
|
id: "",
|
|
3357
3399
|
children: [
|
|
@@ -3449,7 +3491,7 @@ var CustomerService = function(props) {
|
|
|
3449
3491
|
})
|
|
3450
3492
|
]
|
|
3451
3493
|
}),
|
|
3452
|
-
showType == 5 && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3494
|
+
(showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3453
3495
|
imgBese64: imgBese64,
|
|
3454
3496
|
saveScreenshotBese64: function(base64) {
|
|
3455
3497
|
setScreenshotBese64(base64);
|
|
@@ -3458,9 +3500,15 @@ var CustomerService = function(props) {
|
|
|
3458
3500
|
} else {
|
|
3459
3501
|
setShowType(1);
|
|
3460
3502
|
}
|
|
3503
|
+
setShowScreenshot(false);
|
|
3461
3504
|
},
|
|
3462
3505
|
cancelScreenshot: function() {
|
|
3463
|
-
|
|
3506
|
+
if (saveShowType != -1) {
|
|
3507
|
+
setShowType(saveShowType);
|
|
3508
|
+
} else {
|
|
3509
|
+
setShowType(1);
|
|
3510
|
+
}
|
|
3511
|
+
setShowScreenshot(false);
|
|
3464
3512
|
}
|
|
3465
3513
|
}),
|
|
3466
3514
|
viewBase64 && visible && /*#__PURE__*/ _jsx(ViewImage, {
|