bhd-components 0.6.2 → 0.6.3
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/dist/{9eaa797e.esm.es5.development.js → a0cd97b9.esm.es5.development.js} +1 -1
- package/dist/{587f2764.esm.es5.production.js → e88a10a0.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.css +1711 -827
- package/dist/index.esm.es5.development.js +511 -383
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/bhdSelect/index.d.ts +3 -0
- package/es2017/bhdSelect/index.js +18 -13
- package/es2017/bhdSelect/index.module.less +4 -1
- package/es2017/customerService/{contactsList/index.js → contactsList.js} +92 -76
- package/es2017/customerService/function.d.ts +1 -1
- package/es2017/customerService/function.js +10 -2
- package/es2017/customerService/{historyFun/index.d.ts → historyFun.d.ts} +0 -1
- package/es2017/customerService/{historyFun/index.js → historyFun.js} +62 -16
- package/es2017/customerService/index.d.ts +3 -3
- package/es2017/customerService/index.js +143 -82
- package/es2017/customerService/index.module.less +496 -6
- package/es2017/customerService/index2.module.less +1282 -0
- package/es2017/typings.d.ts +12 -0
- package/esm/bhdSelect/index.d.ts +3 -0
- package/esm/bhdSelect/index.js +18 -13
- package/esm/bhdSelect/index.module.less +4 -1
- package/esm/customerService/{contactsList/index.js → contactsList.js} +83 -65
- package/esm/customerService/function.d.ts +1 -1
- package/esm/customerService/function.js +10 -1
- package/esm/customerService/{historyFun/index.d.ts → historyFun.d.ts} +0 -1
- package/esm/customerService/{historyFun/index.js → historyFun.js} +63 -16
- package/esm/customerService/index.d.ts +3 -3
- package/esm/customerService/index.js +173 -112
- package/esm/customerService/index.module.less +496 -6
- package/esm/customerService/index2.module.less +1282 -0
- package/esm/typings.d.ts +12 -0
- package/package.json +1 -1
- package/es2017/customerService/contactsList/index.module.less +0 -208
- package/es2017/customerService/historyFun/index.module.less +0 -223
- package/esm/customerService/contactsList/index.module.less +0 -208
- package/esm/customerService/historyFun/index.module.less +0 -223
- /package/es2017/customerService/{contactsList/index.d.ts → contactsList.d.ts} +0 -0
- /package/esm/customerService/{contactsList/index.d.ts → contactsList.d.ts} +0 -0
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
2
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
4
|
import React, { useEffect, useState, useRef } from "react";
|
|
5
5
|
import { Modal, Drawer, Input, Tooltip } from "antd";
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import cssStyle from "./index.module.less";
|
|
7
|
+
import cssStyleOnline from "./index2.module.less";
|
|
8
|
+
let styles = cssStyle;
|
|
9
|
+
if (false) {
|
|
10
|
+
styles = cssStyleOnline;
|
|
11
|
+
}
|
|
8
12
|
import { CustomAiIcon, CustomRecord, CustomFullScreen, CustomExitFullScreen, CustomReloading, CustomCopy, CustomLike, CustomDislike, CustomQuote, CustomSending, CustomContacts, CustomDuihao, CustomSoundRecording, CustomRoundClose } from "../icons/index";
|
|
9
|
-
import { CloseOutlined } from "@ant-design/icons";
|
|
10
|
-
import HistoryFun from "./historyFun
|
|
11
|
-
import ContactsList from "./contactsList
|
|
13
|
+
import { CloseOutlined, RightOutlined } from "@ant-design/icons";
|
|
14
|
+
import HistoryFun from "./historyFun";
|
|
15
|
+
import ContactsList from "./contactsList";
|
|
12
16
|
import { parseDate } from "../utils/Date";
|
|
13
17
|
import { Remarkable } from "remarkable";
|
|
14
18
|
import hljs from "highlight.js";
|
|
@@ -21,7 +25,6 @@ import { useMediaRecorder } from "./useMediaRecorder"; //录音使用文件
|
|
|
21
25
|
import { readMessage, getByteLen, serverUrl, copyText, getDataTime } from "./function"; //一些方法
|
|
22
26
|
const CustomerService = (props)=>{
|
|
23
27
|
let { userData , http , urllocation , onCancel , serverName , fetchEventSource , initShowType , onEvent , stepIds , stepId } = props;
|
|
24
|
-
const [mid, setmid] = useState(props.userData.mid); //当前用户id
|
|
25
28
|
const { bese64String , startRecord , stopRecord } = useMediaRecorder(); //语音转文字
|
|
26
29
|
const [voiceRecordingStatus, setVoiceRecordingStatus] = useState(3); //语音录制状态 3,语音识别完成 2,录制中, 1,录制结束
|
|
27
30
|
const [copyTextOBJ, setCopyTextObj] = useState([]); //复制的消息id
|
|
@@ -57,6 +60,8 @@ const CustomerService = (props)=>{
|
|
|
57
60
|
let roomMessage = useRef(null); //循环当前页面的新消息
|
|
58
61
|
const ctrl = useRef(); //停止生成ai回答时使用
|
|
59
62
|
let childRef = useRef(null); //获取子组件方法
|
|
63
|
+
// const [mid, setmid] = useState(props.userData.mid); //当前用户id
|
|
64
|
+
const mid = props.userData.mid;
|
|
60
65
|
const remarkable = new Remarkable({
|
|
61
66
|
highlight: function(str, lang) {
|
|
62
67
|
if (lang && hljs.getLanguage(lang)) {
|
|
@@ -90,34 +95,36 @@ const CustomerService = (props)=>{
|
|
|
90
95
|
const container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
91
96
|
const scrollTop = container.scrollTop;
|
|
92
97
|
// const scrollBottom = container.scroll;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
98
|
+
const clientHeight = container.clientHeight;
|
|
99
|
+
const scrollHeight = container.scrollHeight;
|
|
100
|
+
// console.log(scrollTop,clientHeight,scrollHeight,'333dfkvmdfv')
|
|
101
|
+
if (clientHeight + scrollTop + 0.5 >= scrollHeight) {
|
|
102
|
+
console.log('到底部了22222');
|
|
103
|
+
// console.log(11111111,pageNumHistory)
|
|
104
|
+
if (pageNumHistory > 1) {
|
|
105
|
+
// console.log(pageNumHistory,'pageNumpageNumpageNum')
|
|
106
|
+
let number = pageNumHistory - 1;
|
|
107
|
+
setPageNumHistory(number);
|
|
108
|
+
clearTimeout(listTimer.current);
|
|
109
|
+
setBottomLoading(true);
|
|
110
|
+
listTimer.current = setTimeout(()=>{
|
|
111
|
+
// console.log("加载下一页", number);
|
|
112
|
+
getHistoryMessage(number, 4);
|
|
113
|
+
}, 1000);
|
|
114
|
+
} else {
|
|
115
|
+
setLastId('');
|
|
112
116
|
}
|
|
113
|
-
}
|
|
117
|
+
}
|
|
114
118
|
if (scrollTop == 0 && pageCount > pageNum && pageCount > 0) {
|
|
119
|
+
console.log('到顶了', pageNum);
|
|
120
|
+
// if(pageNum == 1){
|
|
121
|
+
// setFirstpage(true);//代表是否存在第一页
|
|
122
|
+
// }
|
|
115
123
|
setLoading(true);
|
|
116
124
|
let number = pageNum + 1;
|
|
117
125
|
setPageNum((pageNum)=>{
|
|
118
126
|
return pageNum + 1;
|
|
119
127
|
});
|
|
120
|
-
clearTimeout(listTimer.current);
|
|
121
128
|
listTimer.current = setTimeout(()=>{
|
|
122
129
|
console.log("下拉加载下一页", number);
|
|
123
130
|
getHistoryMessage(number, 2);
|
|
@@ -398,19 +405,23 @@ const CustomerService = (props)=>{
|
|
|
398
405
|
}
|
|
399
406
|
}).then((res)=>{
|
|
400
407
|
if (res.data.id) {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
408
|
+
console.log(pageNum, pageNumHistory, lastId, 'dlskskdsd4444');
|
|
409
|
+
if (pageNum == 1 || pageNumHistory == 1 || pageNumHistory == 0) {
|
|
410
|
+
setHistoryMessageList((historyMessageList)=>{
|
|
411
|
+
let newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
412
|
+
id: res.data.id,
|
|
413
|
+
upvoted: false,
|
|
414
|
+
downvoted: false,
|
|
415
|
+
createdAt: getDataTime(-1)
|
|
416
|
+
}));
|
|
417
|
+
return newHistoryMessageList;
|
|
418
|
+
});
|
|
419
|
+
if (!lastId) {
|
|
420
|
+
setTimeout(()=>{
|
|
421
|
+
scrollToBottom();
|
|
422
|
+
}, 100);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
414
425
|
//判断当前窗口是否是
|
|
415
426
|
if (type == 1) {
|
|
416
427
|
let roomList = [
|
|
@@ -424,7 +435,6 @@ const CustomerService = (props)=>{
|
|
|
424
435
|
return list2.concat(roomList);
|
|
425
436
|
});
|
|
426
437
|
}
|
|
427
|
-
// }
|
|
428
438
|
}
|
|
429
439
|
}).catch((err)=>{
|
|
430
440
|
console.log(err);
|
|
@@ -864,6 +874,7 @@ const CustomerService = (props)=>{
|
|
|
864
874
|
//获取历史消息 flag:1,历史记录点击定位,2,代表是上拉加载,3,存在新的消息-->老师回答等,4,下拉加载,滚动到底部时,主要用于查看历史记录
|
|
865
875
|
const getHistoryMessage = (pageNum, flag, id = "1")=>{
|
|
866
876
|
clearTimeout(roomMessage.current);
|
|
877
|
+
console.log(pageNum, flag, 'dkfjvndfjvndfkvdf');
|
|
867
878
|
// flag == 1 时已经设置好了位置标记
|
|
868
879
|
let last_id = "";
|
|
869
880
|
if (flag == 2 && historyMessageList.length > 0) {
|
|
@@ -963,7 +974,7 @@ const CustomerService = (props)=>{
|
|
|
963
974
|
//不是ai窗口循环查询消息
|
|
964
975
|
let chatWindow = roomList.filter((item)=>item.roomId == rid);
|
|
965
976
|
let isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == 'AI' ? true : false;
|
|
966
|
-
if (!isAiChatWindow && roomList.length > 0) {
|
|
977
|
+
if (!isAiChatWindow && roomList.length > 0 && (pageNum == 1 || pageNumHistory == 0)) {
|
|
967
978
|
getRoomidHistoryMessage(totalNumber, rid);
|
|
968
979
|
}
|
|
969
980
|
}).catch((res)=>{
|
|
@@ -982,7 +993,7 @@ const CustomerService = (props)=>{
|
|
|
982
993
|
params: {
|
|
983
994
|
roomId: rid,
|
|
984
995
|
page: 1,
|
|
985
|
-
maxPageSize: totalNumber
|
|
996
|
+
maxPageSize: totalNumber,
|
|
986
997
|
direction: "desc"
|
|
987
998
|
},
|
|
988
999
|
headers: {
|
|
@@ -993,15 +1004,22 @@ const CustomerService = (props)=>{
|
|
|
993
1004
|
let newHistoryMessageList = [];
|
|
994
1005
|
if (res.data.messages.length > 0) {
|
|
995
1006
|
let dataList = res.data.messages.reverse();
|
|
1007
|
+
let originList = 0;
|
|
1008
|
+
let newList = 0;
|
|
996
1009
|
setHistoryMessageList((historyMessageList)=>{
|
|
997
|
-
|
|
1010
|
+
originList = historyMessageList.length;
|
|
1011
|
+
newHistoryMessageList = historyMessageList.concat(dataList);
|
|
998
1012
|
//去重
|
|
999
1013
|
let res = new Map();
|
|
1000
1014
|
newHistoryMessageList = newHistoryMessageList.filter((a)=>!res.has(a.id) && res.set(a.id, 1));
|
|
1015
|
+
newList = newHistoryMessageList.length;
|
|
1001
1016
|
return newHistoryMessageList;
|
|
1002
1017
|
});
|
|
1003
|
-
|
|
1004
|
-
|
|
1018
|
+
console.log(dataList.length, originList, lastId, 'dfkvdnfkvdfj44444');
|
|
1019
|
+
if (!lastId && originList != newList) {
|
|
1020
|
+
setTimeout(()=>{
|
|
1021
|
+
scrollToBottom();
|
|
1022
|
+
}, 100);
|
|
1005
1023
|
}
|
|
1006
1024
|
}
|
|
1007
1025
|
try {
|
|
@@ -1059,7 +1077,7 @@ const CustomerService = (props)=>{
|
|
|
1059
1077
|
});
|
|
1060
1078
|
console.log(result, '存储的消息');
|
|
1061
1079
|
result.map((item)=>{
|
|
1062
|
-
testLabQuestion(item.question, item.answer, item.id);
|
|
1080
|
+
testLabQuestion(item.question, item.answer, String(item.id));
|
|
1063
1081
|
});
|
|
1064
1082
|
}
|
|
1065
1083
|
}
|
|
@@ -1212,7 +1230,7 @@ const CustomerService = (props)=>{
|
|
|
1212
1230
|
//渲染头部
|
|
1213
1231
|
const renderHeader = ()=>{
|
|
1214
1232
|
let list = roomList.filter((e)=>e.roomId == roomId);
|
|
1215
|
-
let title = '
|
|
1233
|
+
let title = '智能问答';
|
|
1216
1234
|
if (list.length > 0 && list[0].name) {
|
|
1217
1235
|
title = list[0].name;
|
|
1218
1236
|
}
|
|
@@ -1263,6 +1281,7 @@ const CustomerService = (props)=>{
|
|
|
1263
1281
|
]
|
|
1264
1282
|
});
|
|
1265
1283
|
} else {
|
|
1284
|
+
// console.log(roomList,'777668888900')
|
|
1266
1285
|
return /*#__PURE__*/ _jsxs("div", {
|
|
1267
1286
|
className: styles.top,
|
|
1268
1287
|
children: [
|
|
@@ -1273,7 +1292,7 @@ const CustomerService = (props)=>{
|
|
|
1273
1292
|
showType == 1 && /*#__PURE__*/ _jsxs("i", {
|
|
1274
1293
|
className: "lianxiren21",
|
|
1275
1294
|
onClick: ()=>{
|
|
1276
|
-
setShowContacts(
|
|
1295
|
+
setShowContacts(!showContacts);
|
|
1277
1296
|
},
|
|
1278
1297
|
children: [
|
|
1279
1298
|
/*#__PURE__*/ _jsx(CustomContacts, {}),
|
|
@@ -1294,6 +1313,7 @@ const CustomerService = (props)=>{
|
|
|
1294
1313
|
className: "_lishixiao22",
|
|
1295
1314
|
onClick: ()=>{
|
|
1296
1315
|
setShowHistory(true);
|
|
1316
|
+
onEvent(serverName + serverUrl(), "click_智能问答_历史记录", "提交");
|
|
1297
1317
|
},
|
|
1298
1318
|
children: /*#__PURE__*/ _jsx(CustomRecord, {})
|
|
1299
1319
|
}),
|
|
@@ -1473,9 +1493,10 @@ const CustomerService = (props)=>{
|
|
|
1473
1493
|
title: item.quotedMessage,
|
|
1474
1494
|
placement: "leftTop",
|
|
1475
1495
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
1496
|
+
className: styles.text_exceed,
|
|
1476
1497
|
children: [
|
|
1477
1498
|
item.quotedMessage,
|
|
1478
|
-
|
|
1499
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1479
1500
|
]
|
|
1480
1501
|
})
|
|
1481
1502
|
}) : /*#__PURE__*/ _jsx("p", {
|
|
@@ -1575,11 +1596,12 @@ const CustomerService = (props)=>{
|
|
|
1575
1596
|
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
1576
1597
|
overlayClassName: styles.popover_main_content,
|
|
1577
1598
|
title: item.quotedMessage,
|
|
1578
|
-
placement: "
|
|
1599
|
+
placement: "rightTop",
|
|
1579
1600
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
1601
|
+
className: styles.text_exceed,
|
|
1580
1602
|
children: [
|
|
1581
1603
|
item.quotedMessage,
|
|
1582
|
-
|
|
1604
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1583
1605
|
]
|
|
1584
1606
|
})
|
|
1585
1607
|
}) : /*#__PURE__*/ _jsx("p", {
|
|
@@ -1620,7 +1642,7 @@ const CustomerService = (props)=>{
|
|
|
1620
1642
|
return "";
|
|
1621
1643
|
}
|
|
1622
1644
|
};
|
|
1623
|
-
//渲染相关操作按钮
|
|
1645
|
+
//渲染相关操作按钮 header == 1 ai ,== 2 知识库
|
|
1624
1646
|
const renderOperateBtn = (item, isAiChatWindow, i)=>{
|
|
1625
1647
|
//问候语及点赞下面不需要展示相关按钮
|
|
1626
1648
|
let extraInfo = item.extraInfo;
|
|
@@ -1648,7 +1670,13 @@ const CustomerService = (props)=>{
|
|
|
1648
1670
|
recevier: mid,
|
|
1649
1671
|
message: "请告诉我您要召唤的老师名字",
|
|
1650
1672
|
createdAt: getDataTime(-1),
|
|
1651
|
-
findTeacher: true
|
|
1673
|
+
findTeacher: true,
|
|
1674
|
+
extraInfo: item.extraInfo == null ? null : JSON.stringify([
|
|
1675
|
+
{
|
|
1676
|
+
key: "questionId",
|
|
1677
|
+
value: "questionId"
|
|
1678
|
+
}
|
|
1679
|
+
])
|
|
1652
1680
|
});
|
|
1653
1681
|
return newHistoryMessageList;
|
|
1654
1682
|
});
|
|
@@ -1704,7 +1732,7 @@ const CustomerService = (props)=>{
|
|
|
1704
1732
|
if (!isAiChatWindow) return;
|
|
1705
1733
|
//只有最后一条回答,支持发送点赞或踩
|
|
1706
1734
|
if (!item.upvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
1707
|
-
console.log("判断是AI
|
|
1735
|
+
console.log("判断是AI还是智能问答", item);
|
|
1708
1736
|
if (!item.extraInfo && item.sender == "AI") {
|
|
1709
1737
|
aiSendQuestions(1, {
|
|
1710
1738
|
roomId: roomId,
|
|
@@ -1823,6 +1851,8 @@ const CustomerService = (props)=>{
|
|
|
1823
1851
|
question: historyMessageList[i - 1].message,
|
|
1824
1852
|
user: problem.user
|
|
1825
1853
|
});
|
|
1854
|
+
console.log(item, '88888999999');
|
|
1855
|
+
// if(item.extraInfo == null){
|
|
1826
1856
|
setHistoryMessageList((historyMessageList)=>{
|
|
1827
1857
|
let newHistoryMessageList = historyMessageList.concat({
|
|
1828
1858
|
id: -1,
|
|
@@ -1831,10 +1861,40 @@ const CustomerService = (props)=>{
|
|
|
1831
1861
|
recevier: mid,
|
|
1832
1862
|
message: "请告诉我您要召唤的老师名字",
|
|
1833
1863
|
createdAt: getDataTime(-1),
|
|
1834
|
-
findTeacher: true
|
|
1864
|
+
findTeacher: true,
|
|
1865
|
+
extraInfo: item.extraInfo == null ? null : JSON.stringify([
|
|
1866
|
+
{
|
|
1867
|
+
key: "questionId",
|
|
1868
|
+
value: "questionId"
|
|
1869
|
+
}
|
|
1870
|
+
])
|
|
1835
1871
|
});
|
|
1836
1872
|
return newHistoryMessageList;
|
|
1837
1873
|
});
|
|
1874
|
+
// }else{
|
|
1875
|
+
// setHistoryMessageList(
|
|
1876
|
+
// (historyMessageList) => {
|
|
1877
|
+
// let newHistoryMessageList =
|
|
1878
|
+
// historyMessageList.concat({
|
|
1879
|
+
// id: -1,
|
|
1880
|
+
// roomId: roomId,
|
|
1881
|
+
// sender: "AI",
|
|
1882
|
+
// recevier: mid,
|
|
1883
|
+
// message:
|
|
1884
|
+
// "请告诉我您要召唤的老师名字",
|
|
1885
|
+
// createdAt: getDataTime(-1),
|
|
1886
|
+
// findTeacher:true,
|
|
1887
|
+
// extraInfo: JSON.stringify([
|
|
1888
|
+
// {
|
|
1889
|
+
// key: "questionId",
|
|
1890
|
+
// value: "questionId",
|
|
1891
|
+
// },
|
|
1892
|
+
// ])
|
|
1893
|
+
// });
|
|
1894
|
+
// return newHistoryMessageList;
|
|
1895
|
+
// }
|
|
1896
|
+
// );
|
|
1897
|
+
// }
|
|
1838
1898
|
setTimeout(()=>{
|
|
1839
1899
|
scrollToBottom();
|
|
1840
1900
|
}, 200);
|
|
@@ -1905,7 +1965,7 @@ const CustomerService = (props)=>{
|
|
|
1905
1965
|
if (!isAiChatWindow) return;
|
|
1906
1966
|
//只有最后一条回答,支持发送点赞或踩
|
|
1907
1967
|
if (!item.upvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
1908
|
-
console.log("判断是AI
|
|
1968
|
+
console.log("判断是AI还是智能问答", item);
|
|
1909
1969
|
if (!item.extraInfo && item.sender == "AI") {
|
|
1910
1970
|
aiSendQuestions(1, {
|
|
1911
1971
|
roomId: roomId,
|
|
@@ -1958,7 +2018,7 @@ const CustomerService = (props)=>{
|
|
|
1958
2018
|
let placeholder = "";
|
|
1959
2019
|
let disabled = false;
|
|
1960
2020
|
if (voiceRecordingStatus == 2) {
|
|
1961
|
-
placeholder = "
|
|
2021
|
+
placeholder = "语音录制中,请说话...";
|
|
1962
2022
|
} else if (voiceRecordingStatus == 1) {
|
|
1963
2023
|
placeholder = "正在语音识别文字,请稍后...";
|
|
1964
2024
|
} else if (!finished) {
|
|
@@ -2016,7 +2076,7 @@ const CustomerService = (props)=>{
|
|
|
2016
2076
|
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
2017
2077
|
sendToTeacher(2);
|
|
2018
2078
|
} else {
|
|
2019
|
-
sendMessage();
|
|
2079
|
+
sendMessage('', 0);
|
|
2020
2080
|
}
|
|
2021
2081
|
setButtomHei(45);
|
|
2022
2082
|
} else {
|
|
@@ -2101,7 +2161,7 @@ const CustomerService = (props)=>{
|
|
|
2101
2161
|
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
2102
2162
|
sendToTeacher(2);
|
|
2103
2163
|
} else {
|
|
2104
|
-
sendMessage();
|
|
2164
|
+
sendMessage('', 0);
|
|
2105
2165
|
}
|
|
2106
2166
|
onEvent(serverName + serverUrl(), "click_智能问答_ Enter", "提交");
|
|
2107
2167
|
}
|
|
@@ -2118,7 +2178,7 @@ const CustomerService = (props)=>{
|
|
|
2118
2178
|
return /*#__PURE__*/ _jsx("div", {
|
|
2119
2179
|
className: `${styles.issues_list} ${styles.issues_list_teacherList}`,
|
|
2120
2180
|
style: {
|
|
2121
|
-
bottom: `${buttomHei +
|
|
2181
|
+
bottom: `${buttomHei + 14}px`
|
|
2122
2182
|
},
|
|
2123
2183
|
children: teacherList.map((item)=>{
|
|
2124
2184
|
let span = item.name.replaceAll(keyWord, ()=>{
|
|
@@ -2188,12 +2248,6 @@ const CustomerService = (props)=>{
|
|
|
2188
2248
|
if (page != 1) {
|
|
2189
2249
|
setPageNumHistory(page);
|
|
2190
2250
|
}
|
|
2191
|
-
createRooms(receiver);
|
|
2192
|
-
if (childRef.current) {
|
|
2193
|
-
setTimeout(()=>{
|
|
2194
|
-
childRef.current.roomsListTimer();
|
|
2195
|
-
}, 500);
|
|
2196
|
-
}
|
|
2197
2251
|
setPageNum(page);
|
|
2198
2252
|
setLastId(id); //用于定位
|
|
2199
2253
|
//如果是当前聊天室
|
|
@@ -2201,12 +2255,20 @@ const CustomerService = (props)=>{
|
|
|
2201
2255
|
getHistoryMessage(page, 1);
|
|
2202
2256
|
} else {
|
|
2203
2257
|
setRoomId(renewRoomId);
|
|
2258
|
+
if (childRef.current) {
|
|
2259
|
+
if (receiver != mid) {
|
|
2260
|
+
createRooms(receiver);
|
|
2261
|
+
}
|
|
2262
|
+
setTimeout(()=>{
|
|
2263
|
+
childRef.current.roomsListTimer();
|
|
2264
|
+
}, 500);
|
|
2265
|
+
}
|
|
2204
2266
|
}
|
|
2205
2267
|
};
|
|
2206
2268
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2207
2269
|
children: [
|
|
2208
2270
|
/*#__PURE__*/ _jsxs(Drawer, {
|
|
2209
|
-
title: "
|
|
2271
|
+
title: "智能问答",
|
|
2210
2272
|
width: 560,
|
|
2211
2273
|
onClose: ()=>{
|
|
2212
2274
|
onCancel();
|
|
@@ -2285,13 +2347,12 @@ const CustomerService = (props)=>{
|
|
|
2285
2347
|
onClose: ()=>{
|
|
2286
2348
|
setShowHistory(false);
|
|
2287
2349
|
},
|
|
2288
|
-
loadSpecifiedData: loadSpecifiedData
|
|
2289
|
-
roomList: roomList
|
|
2350
|
+
loadSpecifiedData: loadSpecifiedData
|
|
2290
2351
|
})
|
|
2291
2352
|
]
|
|
2292
2353
|
}),
|
|
2293
2354
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
2294
|
-
title: "
|
|
2355
|
+
title: "智能问答",
|
|
2295
2356
|
open: showType == 2 ? true : false,
|
|
2296
2357
|
onCancel: ()=>{
|
|
2297
2358
|
onCancel();
|
|
@@ -2299,6 +2360,7 @@ const CustomerService = (props)=>{
|
|
|
2299
2360
|
},
|
|
2300
2361
|
centered: true,
|
|
2301
2362
|
width: window.innerWidth - 252 > 1214 ? window.innerWidth - 252 : 1214,
|
|
2363
|
+
// @ts-ignore
|
|
2302
2364
|
height: window.innerHeight - 160,
|
|
2303
2365
|
wrapClassName: styles.ChatWindow_Modal,
|
|
2304
2366
|
footer: false,
|
|
@@ -2367,8 +2429,7 @@ const CustomerService = (props)=>{
|
|
|
2367
2429
|
onClose: ()=>{
|
|
2368
2430
|
setShowHistory(false);
|
|
2369
2431
|
},
|
|
2370
|
-
loadSpecifiedData: loadSpecifiedData
|
|
2371
|
-
roomList: roomList
|
|
2432
|
+
loadSpecifiedData: loadSpecifiedData
|
|
2372
2433
|
})
|
|
2373
2434
|
]
|
|
2374
2435
|
})
|
|
@@ -2386,7 +2447,7 @@ const CustomerService = (props)=>{
|
|
|
2386
2447
|
/*#__PURE__*/ _jsx("div", {
|
|
2387
2448
|
className: styles.user,
|
|
2388
2449
|
children: /*#__PURE__*/ _jsx("p", {
|
|
2389
|
-
children: roomList.filter((e)=>e.roomId == roomId).length > 0 && roomList.filter((e)=>e.roomId == roomId)[0].name != undefined ? roomList.filter((e)=>e.roomId == roomId)[0].name : '
|
|
2450
|
+
children: roomList.filter((e)=>e.roomId == roomId).length > 0 && roomList.filter((e)=>e.roomId == roomId)[0].name != undefined ? roomList.filter((e)=>e.roomId == roomId)[0].name : '智能问答'
|
|
2390
2451
|
})
|
|
2391
2452
|
}),
|
|
2392
2453
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -2395,6 +2456,7 @@ const CustomerService = (props)=>{
|
|
|
2395
2456
|
/*#__PURE__*/ _jsx("i", {
|
|
2396
2457
|
onClick: ()=>{
|
|
2397
2458
|
setShowHistory(true);
|
|
2459
|
+
onEvent(serverName + serverUrl(), "click_智能问答_历史记录", "提交");
|
|
2398
2460
|
},
|
|
2399
2461
|
children: /*#__PURE__*/ _jsx(CustomRecord, {})
|
|
2400
2462
|
}),
|
|
@@ -2413,7 +2475,7 @@ const CustomerService = (props)=>{
|
|
|
2413
2475
|
/*#__PURE__*/ _jsx("i", {
|
|
2414
2476
|
className: "lianxiren21",
|
|
2415
2477
|
onClick: ()=>{
|
|
2416
|
-
setShowContacts(
|
|
2478
|
+
setShowContacts(!showContacts);
|
|
2417
2479
|
},
|
|
2418
2480
|
children: /*#__PURE__*/ _jsx(CustomContacts, {})
|
|
2419
2481
|
})
|
|
@@ -2459,8 +2521,7 @@ const CustomerService = (props)=>{
|
|
|
2459
2521
|
onClose: ()=>{
|
|
2460
2522
|
setShowHistory(false);
|
|
2461
2523
|
},
|
|
2462
|
-
loadSpecifiedData: loadSpecifiedData
|
|
2463
|
-
roomList: roomList
|
|
2524
|
+
loadSpecifiedData: loadSpecifiedData
|
|
2464
2525
|
}),
|
|
2465
2526
|
showType == 3 && /*#__PURE__*/ _jsx("div", {
|
|
2466
2527
|
style: {
|
|
@@ -2485,7 +2546,7 @@ const CustomerService = (props)=>{
|
|
|
2485
2546
|
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2486
2547
|
children: [
|
|
2487
2548
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
2488
|
-
title: "
|
|
2549
|
+
title: "智能问答",
|
|
2489
2550
|
open: true,
|
|
2490
2551
|
onCancel: ()=>{
|
|
2491
2552
|
onCancel();
|
|
@@ -2493,6 +2554,7 @@ const CustomerService = (props)=>{
|
|
|
2493
2554
|
},
|
|
2494
2555
|
centered: true,
|
|
2495
2556
|
width: window.innerWidth - 252 > 1214 ? window.innerWidth - 252 : 1214,
|
|
2557
|
+
// @ts-ignore
|
|
2496
2558
|
height: window.innerHeight - 160,
|
|
2497
2559
|
wrapClassName: `${styles.ChatWindow_Modal}`,
|
|
2498
2560
|
footer: false,
|
|
@@ -2561,8 +2623,7 @@ const CustomerService = (props)=>{
|
|
|
2561
2623
|
onClose: ()=>{
|
|
2562
2624
|
setShowHistory(false);
|
|
2563
2625
|
},
|
|
2564
|
-
loadSpecifiedData: loadSpecifiedData
|
|
2565
|
-
roomList: roomList
|
|
2626
|
+
loadSpecifiedData: loadSpecifiedData
|
|
2566
2627
|
})
|
|
2567
2628
|
]
|
|
2568
2629
|
})
|
|
@@ -2580,7 +2641,7 @@ const CustomerService = (props)=>{
|
|
|
2580
2641
|
/*#__PURE__*/ _jsx("div", {
|
|
2581
2642
|
className: styles.user,
|
|
2582
2643
|
children: /*#__PURE__*/ _jsx("p", {
|
|
2583
|
-
children: roomList.filter((e)=>e.roomId == roomId).length > 0 && !roomList.filter((e)=>e.roomId == roomId)[0].name ? roomList.filter((e)=>e.roomId == roomId)[0].name : '
|
|
2644
|
+
children: roomList.filter((e)=>e.roomId == roomId).length > 0 && !roomList.filter((e)=>e.roomId == roomId)[0].name ? roomList.filter((e)=>e.roomId == roomId)[0].name : '智能问答'
|
|
2584
2645
|
})
|
|
2585
2646
|
}),
|
|
2586
2647
|
/*#__PURE__*/ _jsxs("div", {
|