bhd-components 0.6.9 → 0.7.2

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.
@@ -52,9 +52,9 @@ var CustomerService = function(props) {
52
52
  var _useState22 = _sliced_to_array(useState(-1), 2), answerMode = _useState22[0], setAnswerMode = _useState22[1]; //设置回答模式。1,召唤老师回答
53
53
  var _useState23 = _sliced_to_array(useState([]), 2), teacherList = _useState23[0], setTeacherList = _useState23[1]; //老师列表
54
54
  var _useState24 = _sliced_to_array(useState({}), 2), problem = _useState24[0], setProblem = _useState24[1]; //召唤老师回答的问题
55
- // const [roomList,setRoomList] = useState([]);//聊天列表
56
55
  var _useState25 = _sliced_to_array(useState([]), 2), contactsList = _useState25[0], setContactsList = _useState25[1]; //老师列表
57
56
  var _useState26 = _sliced_to_array(useState([]), 2), chatObj = _useState26[0], setChatObj = _useState26[1]; //聊天记录id保存,用来在实验报告中记录
57
+ var _useState27 = _sliced_to_array(useState(""), 2), keyWordProblem = _useState27[0], setKeyWordProblem = _useState27[1]; //历史记录搜索的内容
58
58
  var timer = useRef(null); //文本框输入时
59
59
  var receiveMessageTimer = useRef(null); //接收ai发回的消息
60
60
  var voiceCountdownTimer = useRef(null); //语音录制倒计时
@@ -254,28 +254,48 @@ var CustomerService = function(props) {
254
254
  var questionsList = [];
255
255
  var obj = {};
256
256
  if (type == 1) {
257
- questionsList = hotQuestionsList.map(function(item, index) {
258
- if (index < 3) {
259
- return {
260
- key: "messageSource",
261
- value: item.id,
262
- question: item.question,
263
- answer: item.answer
264
- };
265
- } else {
266
- return null;
267
- }
268
- });
269
- questionsList = questionsList.filter(function(i) {
270
- return i != null;
271
- });
257
+ // questionsList = hotQuestionsList.map((item, index) => {
258
+ // if (index < 3) {
259
+ // return {
260
+ // key: "messageSource",
261
+ // value: item.id,
262
+ // question: item.question,
263
+ // answer: item.answer,
264
+ // };
265
+ // } else {
266
+ // return null;
267
+ // }
268
+ // });
269
+ // questionsList = questionsList.filter((i) => i != null);
272
270
  obj = {
273
271
  roomId: roomId,
274
272
  sender: "AI",
275
273
  recevier: mid,
276
- message: "Hi!我是有问必答的实训云智能客服,请问您遇到了什么问题?",
277
- extraInfos: questionsList
274
+ message: "Hi!我是有问必答的实训云智能客服,请问您遇到了什么问题?"
278
275
  };
276
+ if (pageNumHistory <= 1) {
277
+ setHistoryMessageList(function(historyMessageList) {
278
+ var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
279
+ id: new Date().getTime() + "dede",
280
+ upvoted: false,
281
+ downvoted: false,
282
+ quotedMessage: "",
283
+ createdAt: getDataTime(-1),
284
+ // extraInfo: JSON.stringify(obj.extraInfos),
285
+ extraInfo: JSON.stringify([
286
+ {
287
+ key: "messageSource",
288
+ value: "knowledgebase"
289
+ }
290
+ ])
291
+ }));
292
+ return newHistoryMessageList;
293
+ });
294
+ setTimeout(function() {
295
+ scrollToBottom();
296
+ }, 100);
297
+ }
298
+ return;
279
299
  } else if (type == 2) {
280
300
  obj = {
281
301
  roomId: roomId,
@@ -350,6 +370,23 @@ var CustomerService = function(props) {
350
370
  message: "猜你想问:",
351
371
  extraInfos: questionsList
352
372
  };
373
+ if (pageNumHistory <= 1) {
374
+ setHistoryMessageList(function(historyMessageList) {
375
+ var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
376
+ id: "p" + new Date().getTime(),
377
+ upvoted: false,
378
+ downvoted: false,
379
+ quotedMessage: "",
380
+ createdAt: getDataTime(-1),
381
+ extraInfo: JSON.stringify(obj.extraInfos)
382
+ }));
383
+ return newHistoryMessageList;
384
+ });
385
+ setTimeout(function() {
386
+ scrollToBottom();
387
+ }, 100);
388
+ }
389
+ return;
353
390
  }
354
391
  setKeyWord("");
355
392
  setQuestionsList([]);
@@ -888,7 +925,6 @@ var CustomerService = function(props) {
888
925
  last_id = historyMessageList[0].id;
889
926
  }
890
927
  if (flag != 1 && last_id != "") {
891
- console.log(last_id, "dkfjvndfjvndfkvdflast_idlast_idlast_id");
892
928
  setLastId(last_id);
893
929
  }
894
930
  //取消搜索页码标记
@@ -973,12 +1009,17 @@ var CustomerService = function(props) {
973
1009
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
974
1010
  sendToTeacher(1);
975
1011
  }
1012
+ // if(flag == 1){
1013
+ setTimeout(function() {
1014
+ setKeyWordProblem("");
1015
+ }, 3100);
1016
+ // }
976
1017
  } else {
977
1018
  setPageCount(0);
978
- setGreetingMessage(true);
979
1019
  setBottomLoading(false);
980
1020
  setLoading(false);
981
1021
  setHistoryMessageList([]);
1022
+ setGreetingMessage(true);
982
1023
  //召唤老师回答
983
1024
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
984
1025
  sendToTeacher(1);
@@ -1517,19 +1558,21 @@ var CustomerService = function(props) {
1517
1558
  // }
1518
1559
  //渲染问答
1519
1560
  var renderQuestion = function() {
1520
- if (historyMessageList.length > 0) {
1521
- return /*#__PURE__*/ _jsx("ul", {
1522
- className: styles.message_con,
1523
- children: historyMessageList.map(function(item, i) {
1524
- var timeObj = parseDate(item.createdAt);
1525
- // console.log(item.message);
1526
- var message = item.message;
1527
- var li;
1528
- // 是否需要显示日期
1529
- var itemIndex = historyMessageList.findIndex(function(ite) {
1530
- return ite.id === item.id;
1531
- });
1532
- var time = "";
1561
+ // if (historyMessageList.length > 0) {
1562
+ return /*#__PURE__*/ _jsx("ul", {
1563
+ className: styles.message_con,
1564
+ children: historyMessageList.map(function(item, i) {
1565
+ console.log(item, 444444888888);
1566
+ var timeObj = parseDate(item.createdAt);
1567
+ // console.log(item.message);
1568
+ var message = item.message;
1569
+ var li;
1570
+ // 是否需要显示日期
1571
+ var itemIndex = historyMessageList.findIndex(function(ite) {
1572
+ return ite.id === item.id;
1573
+ });
1574
+ var time = "";
1575
+ if (historyMessageList.length > 1) {
1533
1576
  if (itemIndex <= 0) {
1534
1577
  //第一项
1535
1578
  time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
@@ -1549,256 +1592,265 @@ var CustomerService = function(props) {
1549
1592
  }
1550
1593
  }
1551
1594
  }
1552
- var dataTime = time;
1553
- if (item.sender == mid) {
1554
- //只有引用和复制功能
1555
- li = /*#__PURE__*/ _jsxs(_Fragment, {
1556
- children: [
1557
- dataTime ? /*#__PURE__*/ _jsx("li", {
1558
- className: styles.time,
1559
- children: dataTime
1560
- }) : "",
1561
- /*#__PURE__*/ _jsxs("li", {
1562
- className: styles.left,
1563
- id: lastId == item.id ? "li_flag" : "",
1564
- children: [
1565
- /*#__PURE__*/ _jsx("div", {
1566
- className: styles.main,
1567
- children: /*#__PURE__*/ _jsxs("div", {
1568
- className: styles.main_content,
1569
- children: [
1570
- /*#__PURE__*/ _jsxs("div", {
1571
- className: styles.main_content_flag,
1572
- children: [
1573
- /*#__PURE__*/ _jsx("div", {
1574
- className: styles.operate_modal,
1575
- children: /*#__PURE__*/ _jsxs("p", {
1576
- className: styles.operate,
1577
- children: [
1578
- /*#__PURE__*/ _jsx("i", {
1579
- className: "yinyong_quote1",
1580
- onClick: function() {
1581
- setCitationContent({
1582
- content: item.message,
1583
- id: item.id
1584
- });
1585
- resettingBottomHei();
1586
- onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
1587
- },
1588
- children: /*#__PURE__*/ _jsx(CustomQuote, {})
1589
- }),
1590
- copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
1591
- return list == item.id;
1592
- }) ? /*#__PURE__*/ _jsx("i", {
1593
- className: "tongyong-xuanzhongdui",
1594
- children: /*#__PURE__*/ _jsx(CustomDuihao, {})
1595
- }) : /*#__PURE__*/ _jsx("i", {
1596
- className: "fuzhi21",
1597
- onClick: function() {
1598
- var bol = copyText(item.message);
1599
- if (bol) {
1600
- var obj = copyTextOBJ;
1601
- obj = obj.filter(function(list) {
1602
- return list != item.id;
1603
- });
1604
- obj.push(item.id);
1605
- setCopyTextObj(obj);
1606
- }
1607
- setTimeout(function() {
1608
- var obj = copyTextOBJ;
1609
- obj = obj.filter(function(list) {
1610
- return list != item.id;
1611
- });
1612
- setCopyTextObj(obj);
1613
- }, 3000);
1614
- onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
1615
- },
1616
- children: /*#__PURE__*/ _jsx(CustomCopy, {})
1617
- })
1618
- ]
1619
- })
1620
- }),
1621
- /*#__PURE__*/ _jsx("div", {
1622
- className: styles.content,
1623
- children: /*#__PURE__*/ _jsx("p", {
1624
- dangerouslySetInnerHTML: {
1625
- __html: remarkable.render(message)
1626
- },
1627
- className: styles.content_child
1628
- })
1629
- })
1630
- ]
1631
- }),
1632
- //引用消息
1633
- item.quotedMessage && /*#__PURE__*/ _jsx("div", {
1634
- className: styles.citation_content,
1635
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
1636
- overlayClassName: styles.popover_main_content,
1637
- title: item.quotedMessage,
1638
- placement: "leftTop",
1595
+ }
1596
+ var dataTime = time;
1597
+ if (lastId == item.id && keyWordProblem != "") {
1598
+ message = remarkable.render(message);
1599
+ message = message.replaceAll(keyWordProblem, function(e) {
1600
+ return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
1601
+ });
1602
+ } else {
1603
+ message = remarkable.render(message);
1604
+ }
1605
+ if (item.sender == mid) {
1606
+ //只有引用和复制功能
1607
+ li = /*#__PURE__*/ _jsxs(_Fragment, {
1608
+ children: [
1609
+ dataTime ? /*#__PURE__*/ _jsx("li", {
1610
+ className: styles.time,
1611
+ children: dataTime
1612
+ }) : "",
1613
+ /*#__PURE__*/ _jsxs("li", {
1614
+ className: styles.left,
1615
+ id: lastId == item.id ? "li_flag" : "",
1616
+ children: [
1617
+ /*#__PURE__*/ _jsx("div", {
1618
+ className: styles.main,
1619
+ children: /*#__PURE__*/ _jsxs("div", {
1620
+ className: styles.main_content,
1621
+ children: [
1622
+ /*#__PURE__*/ _jsxs("div", {
1623
+ className: styles.main_content_flag,
1624
+ children: [
1625
+ /*#__PURE__*/ _jsx("div", {
1626
+ className: styles.operate_modal,
1639
1627
  children: /*#__PURE__*/ _jsxs("p", {
1640
- className: styles.text_exceed,
1628
+ className: styles.operate,
1641
1629
  children: [
1642
- item.quotedMessage,
1643
- /*#__PURE__*/ _jsx(RightOutlined, {})
1644
- ]
1645
- })
1646
- }) : /*#__PURE__*/ _jsx("p", {
1647
- children: item.quotedMessage
1648
- })
1649
- })
1650
- ]
1651
- })
1652
- }),
1653
- showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
1654
- className: styles.head_sculpture,
1655
- style: {
1656
- marginLeft: "12px"
1657
- },
1658
- children: /*#__PURE__*/ _jsx("img", {
1659
- src: userData.avatar
1660
- })
1661
- }) : ""
1662
- ]
1663
- }, item.id)
1664
- ]
1665
- });
1666
- } else {
1667
- //获取用户头像
1668
- var headImg = "";
1669
- var chatWindow = [];
1670
- var isAiChatWindow;
1671
- chatWindow = contactsList.filter(function(item) {
1672
- return item.roomId == roomId;
1673
- });
1674
- if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
1675
- headImg = chatWindow[0].headImg;
1676
- }
1677
- // console.log(chatWindow,'chatWindowchatWindow')
1678
- //是否在智能客服窗口
1679
- isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
1680
- var header = 2; //代表是ai头像
1681
- if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
1682
- //使用AI头像
1683
- header = 1;
1684
- }
1685
- li = /*#__PURE__*/ _jsxs(_Fragment, {
1686
- children: [
1687
- dataTime ? /*#__PURE__*/ _jsx("li", {
1688
- className: styles.time,
1689
- children: dataTime
1690
- }) : "",
1691
- /*#__PURE__*/ _jsxs("li", {
1692
- className: styles.right,
1693
- id: lastId == item.id ? "li_flag" : "",
1694
- children: [
1695
- (showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
1696
- className: styles.head_sculpture,
1697
- style: {
1698
- marginRight: "12px"
1699
- },
1700
- children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
1701
- src: knowledge_icon
1702
- }) : /*#__PURE__*/ _jsx("img", {
1703
- src: headImg
1704
- })
1705
- }),
1706
- /*#__PURE__*/ _jsx("div", {
1707
- className: styles.main,
1708
- children: /*#__PURE__*/ _jsxs("div", {
1709
- className: styles.main_content,
1710
- children: [
1711
- /*#__PURE__*/ _jsxs("div", {
1712
- className: styles.main_content_flag,
1713
- children: [
1714
- /*#__PURE__*/ _jsx("div", {
1715
- className: styles.operate_modal,
1716
- children: // 不是最后一行,
1717
- historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
1718
- }),
1719
- /*#__PURE__*/ _jsxs("div", {
1720
- className: styles.content,
1721
- children: [
1722
- /*#__PURE__*/ _jsx("p", {
1723
- dangerouslySetInnerHTML: {
1724
- __html: remarkable.render(message)
1630
+ /*#__PURE__*/ _jsx("i", {
1631
+ className: "yinyong_quote1",
1632
+ onClick: function() {
1633
+ setCitationContent({
1634
+ content: item.message,
1635
+ id: item.id
1636
+ });
1637
+ resettingBottomHei();
1638
+ onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
1725
1639
  },
1726
- className: styles.content_child
1640
+ children: /*#__PURE__*/ _jsx(CustomQuote, {})
1727
1641
  }),
1728
- item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsx("ul", {
1729
- className: styles.association_problem,
1730
- children: JSON.parse(item.extraInfo).map(function(list, index) {
1731
- return /*#__PURE__*/ _jsxs("li", {
1732
- onClick: function() {
1733
- sendMessage(list, 1);
1734
- },
1735
- children: [
1736
- index + 1,
1737
- ".",
1738
- list.question
1739
- ]
1740
- }, i + "_" + index + "_" + list.value);
1741
- })
1642
+ copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
1643
+ return list == item.id;
1644
+ }) ? /*#__PURE__*/ _jsx("i", {
1645
+ className: "tongyong-xuanzhongdui",
1646
+ children: /*#__PURE__*/ _jsx(CustomDuihao, {})
1647
+ }) : /*#__PURE__*/ _jsx("i", {
1648
+ className: "fuzhi21",
1649
+ onClick: function() {
1650
+ var bol = copyText(item.message);
1651
+ if (bol) {
1652
+ var obj = copyTextOBJ;
1653
+ obj = obj.filter(function(list) {
1654
+ return list != item.id;
1655
+ });
1656
+ obj.push(item.id);
1657
+ setCopyTextObj(obj);
1658
+ }
1659
+ setTimeout(function() {
1660
+ var obj = copyTextOBJ;
1661
+ obj = obj.filter(function(list) {
1662
+ return list != item.id;
1663
+ });
1664
+ setCopyTextObj(obj);
1665
+ }, 3000);
1666
+ onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
1667
+ },
1668
+ children: /*#__PURE__*/ _jsx(CustomCopy, {})
1742
1669
  })
1743
1670
  ]
1744
1671
  })
1745
- ]
1746
- }),
1747
- //引用消息
1748
- item.quotedMessage && /*#__PURE__*/ _jsx("div", {
1749
- className: styles.citation_content,
1750
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
1751
- overlayClassName: styles.popover_main_content,
1752
- title: item.quotedMessage,
1753
- placement: "rightTop",
1754
- children: /*#__PURE__*/ _jsxs("p", {
1755
- className: styles.text_exceed,
1756
- children: [
1757
- item.quotedMessage,
1758
- /*#__PURE__*/ _jsx(RightOutlined, {})
1759
- ]
1760
- })
1761
- }) : /*#__PURE__*/ _jsx("p", {
1762
- children: item.quotedMessage
1763
- })
1764
- }),
1765
- //findTeacher//是否在召唤老师过程中,是否是最后一条消息
1766
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
1767
- //召唤老师回答按钮
1768
- isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
1769
- return item.short == "TeacherAnswer";
1770
- }) ? /*#__PURE__*/ _jsx("div", {
1771
- className: "".concat(styles.operate_modal_bottom, " "),
1772
- children: /*#__PURE__*/ _jsx("p", {
1773
- className: styles.stop_findTeacher,
1774
- children: /*#__PURE__*/ _jsx("span", {
1775
- onClick: function() {
1776
- setAnswerMode(-1);
1777
- setTeacherList([]);
1778
- setHistoryMessageList(function(historyMessageList) {
1779
- return historyMessageList.filter(function(item) {
1780
- return item.id != "-1";
1781
- });
1782
- });
1672
+ }),
1673
+ /*#__PURE__*/ _jsx("div", {
1674
+ className: styles.content,
1675
+ children: /*#__PURE__*/ _jsx("p", {
1676
+ dangerouslySetInnerHTML: {
1677
+ __html: message
1783
1678
  },
1784
- children: "停止召唤老师"
1679
+ className: styles.content_child
1785
1680
  })
1786
1681
  })
1787
- }) : ""
1788
- ]
1789
- })
1682
+ ]
1683
+ }),
1684
+ //引用消息
1685
+ item.quotedMessage && /*#__PURE__*/ _jsx("div", {
1686
+ className: styles.citation_content,
1687
+ children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
1688
+ overlayClassName: styles.popover_main_content,
1689
+ title: item.quotedMessage,
1690
+ placement: "leftTop",
1691
+ children: /*#__PURE__*/ _jsxs("p", {
1692
+ className: styles.text_exceed,
1693
+ children: [
1694
+ item.quotedMessage,
1695
+ /*#__PURE__*/ _jsx(RightOutlined, {})
1696
+ ]
1697
+ })
1698
+ }) : /*#__PURE__*/ _jsx("p", {
1699
+ children: item.quotedMessage
1700
+ })
1701
+ })
1702
+ ]
1790
1703
  })
1791
- ]
1792
- }, item.id)
1793
- ]
1794
- });
1704
+ }),
1705
+ showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
1706
+ className: styles.head_sculpture,
1707
+ style: {
1708
+ marginLeft: "12px"
1709
+ },
1710
+ children: /*#__PURE__*/ _jsx("img", {
1711
+ src: userData.avatar
1712
+ })
1713
+ }) : ""
1714
+ ]
1715
+ }, item.id)
1716
+ ]
1717
+ });
1718
+ } else {
1719
+ //获取用户头像
1720
+ var headImg = "";
1721
+ var chatWindow = [];
1722
+ var isAiChatWindow;
1723
+ chatWindow = contactsList.filter(function(item) {
1724
+ return item.roomId == roomId;
1725
+ });
1726
+ if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
1727
+ headImg = chatWindow[0].headImg;
1795
1728
  }
1796
- return li;
1797
- })
1798
- });
1799
- } else {
1800
- return "";
1801
- }
1729
+ // console.log(chatWindow,'chatWindowchatWindow')
1730
+ //是否在智能客服窗口
1731
+ isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
1732
+ var header = 2; //代表是ai头像
1733
+ if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
1734
+ //使用AI头像
1735
+ header = 1;
1736
+ }
1737
+ li = /*#__PURE__*/ _jsxs(_Fragment, {
1738
+ children: [
1739
+ dataTime ? /*#__PURE__*/ _jsx("li", {
1740
+ className: styles.time,
1741
+ children: dataTime
1742
+ }) : "",
1743
+ /*#__PURE__*/ _jsxs("li", {
1744
+ className: styles.right,
1745
+ id: lastId == item.id ? "li_flag" : "",
1746
+ children: [
1747
+ (showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
1748
+ className: styles.head_sculpture,
1749
+ style: {
1750
+ marginRight: "12px"
1751
+ },
1752
+ children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
1753
+ src: knowledge_icon
1754
+ }) : /*#__PURE__*/ _jsx("img", {
1755
+ src: headImg
1756
+ })
1757
+ }),
1758
+ /*#__PURE__*/ _jsx("div", {
1759
+ className: styles.main,
1760
+ children: /*#__PURE__*/ _jsxs("div", {
1761
+ className: styles.main_content,
1762
+ children: [
1763
+ /*#__PURE__*/ _jsxs("div", {
1764
+ className: styles.main_content_flag,
1765
+ children: [
1766
+ /*#__PURE__*/ _jsx("div", {
1767
+ className: styles.operate_modal,
1768
+ children: // 不是最后一行,
1769
+ historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
1770
+ }),
1771
+ /*#__PURE__*/ _jsxs("div", {
1772
+ className: styles.content,
1773
+ children: [
1774
+ /*#__PURE__*/ _jsx("p", {
1775
+ dangerouslySetInnerHTML: {
1776
+ __html: message
1777
+ },
1778
+ className: styles.content_child
1779
+ }),
1780
+ item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ _jsx("ul", {
1781
+ className: styles.association_problem,
1782
+ children: JSON.parse(item.extraInfo).map(function(list, index) {
1783
+ return /*#__PURE__*/ _jsxs("li", {
1784
+ onClick: function() {
1785
+ sendMessage(list, 1);
1786
+ },
1787
+ children: [
1788
+ index + 1,
1789
+ ".",
1790
+ list.question
1791
+ ]
1792
+ }, i + "_" + index + "_" + list.value);
1793
+ })
1794
+ })
1795
+ ]
1796
+ })
1797
+ ]
1798
+ }),
1799
+ //引用消息
1800
+ item.quotedMessage && /*#__PURE__*/ _jsx("div", {
1801
+ className: styles.citation_content,
1802
+ children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
1803
+ overlayClassName: styles.popover_main_content,
1804
+ title: item.quotedMessage,
1805
+ placement: "rightTop",
1806
+ children: /*#__PURE__*/ _jsxs("p", {
1807
+ className: styles.text_exceed,
1808
+ children: [
1809
+ item.quotedMessage,
1810
+ /*#__PURE__*/ _jsx(RightOutlined, {})
1811
+ ]
1812
+ })
1813
+ }) : /*#__PURE__*/ _jsx("p", {
1814
+ children: item.quotedMessage
1815
+ })
1816
+ }),
1817
+ //findTeacher//是否在召唤老师过程中,是否是最后一条消息
1818
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
1819
+ //召唤老师回答按钮
1820
+ isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
1821
+ return item.short == "TeacherAnswer";
1822
+ }) ? /*#__PURE__*/ _jsx("div", {
1823
+ className: "".concat(styles.operate_modal_bottom, " "),
1824
+ children: /*#__PURE__*/ _jsx("p", {
1825
+ className: styles.stop_findTeacher,
1826
+ children: /*#__PURE__*/ _jsx("span", {
1827
+ onClick: function() {
1828
+ setAnswerMode(-1);
1829
+ setTeacherList([]);
1830
+ setHistoryMessageList(function(historyMessageList) {
1831
+ return historyMessageList.filter(function(item) {
1832
+ return item.id != "-1";
1833
+ });
1834
+ });
1835
+ },
1836
+ children: "停止召唤老师"
1837
+ })
1838
+ })
1839
+ }) : ""
1840
+ ]
1841
+ })
1842
+ })
1843
+ ]
1844
+ }, item.id)
1845
+ ]
1846
+ });
1847
+ }
1848
+ return li;
1849
+ })
1850
+ });
1851
+ // } else {
1852
+ // return "";
1853
+ // }
1802
1854
  };
1803
1855
  //渲染相关操作按钮 header == 1 ai ,== 2 知识库
1804
1856
  var renderOperateBtn = function(item, isAiChatWindow, i) {
@@ -2488,11 +2540,14 @@ var CustomerService = function(props) {
2488
2540
  }
2489
2541
  };
2490
2542
  //加载指定数据,点击历史记录
2491
- var loadSpecifiedData = function(renewRoomId, page, id, receiver) {
2543
+ var loadSpecifiedData = function(renewRoomId, page, id, receiver, keyWordProblem) {
2492
2544
  // let renewRoomId = '4a615d7126b343f78d10dcb06dbc29b0';
2493
2545
  // let page = 1;
2494
2546
  // let id = '0e459f0a3a62438698f170b42b94d150';
2495
2547
  // let receiver = mid;
2548
+ if (keyWordProblem != "") {
2549
+ setKeyWordProblem(keyWordProblem);
2550
+ }
2496
2551
  if (page != 1) {
2497
2552
  setPageNumHistory(page);
2498
2553
  }
@@ -2556,6 +2611,9 @@ var CustomerService = function(props) {
2556
2611
  style: {
2557
2612
  maxHeight: "calc(100vh-".concat(buttomHei + 48, "px)")
2558
2613
  },
2614
+ onClick: function() {
2615
+ setKeyWordProblem("");
2616
+ },
2559
2617
  children: [
2560
2618
  loading ? /*#__PURE__*/ _jsx("div", {
2561
2619
  className: styles.loading,
@@ -2564,7 +2622,7 @@ var CustomerService = function(props) {
2564
2622
  alt: ""
2565
2623
  })
2566
2624
  }) : "",
2567
- renderQuestion(),
2625
+ keyWordProblem ? renderQuestion() : renderQuestion(),
2568
2626
  bottomLoading ? /*#__PURE__*/ _jsx("div", {
2569
2627
  className: styles.loading,
2570
2628
  children: /*#__PURE__*/ _jsx("img", {
@@ -2620,6 +2678,9 @@ var CustomerService = function(props) {
2620
2678
  }),
2621
2679
  /*#__PURE__*/ _jsxs("div", {
2622
2680
  className: "".concat(styles.Drawer_wrap_main),
2681
+ onClick: function() {
2682
+ setKeyWordProblem("");
2683
+ },
2623
2684
  children: [
2624
2685
  /*#__PURE__*/ _jsxs("div", {
2625
2686
  className: "".concat(styles.Drawer_main, " ChatWindow_Modal_history_list"),
@@ -2652,7 +2713,7 @@ var CustomerService = function(props) {
2652
2713
  alt: ""
2653
2714
  })
2654
2715
  }) : "",
2655
- renderQuestion()
2716
+ keyWordProblem ? renderQuestion() : renderQuestion()
2656
2717
  ]
2657
2718
  })
2658
2719
  ]
@@ -2686,6 +2747,9 @@ var CustomerService = function(props) {
2686
2747
  showType == 3 ? /*#__PURE__*/ _jsxs("div", {
2687
2748
  className: "".concat(styles.ChatWindow_Drawer),
2688
2749
  id: "",
2750
+ onClick: function() {
2751
+ setKeyWordProblem("");
2752
+ },
2689
2753
  children: [
2690
2754
  /*#__PURE__*/ _jsx("div", {
2691
2755
  className: "".concat(styles.header_wrap, " ").concat(styles.header_wrap_newlabo),
@@ -2746,7 +2810,7 @@ var CustomerService = function(props) {
2746
2810
  alt: ""
2747
2811
  })
2748
2812
  }) : "",
2749
- renderQuestion()
2813
+ keyWordProblem ? renderQuestion() : renderQuestion()
2750
2814
  ]
2751
2815
  }),
2752
2816
  /*#__PURE__*/ _jsxs("div", {
@@ -2823,6 +2887,9 @@ var CustomerService = function(props) {
2823
2887
  style: {
2824
2888
  maxHeight: "".concat(window.innerHeight - 148 - buttomHei, "px")
2825
2889
  },
2890
+ onClick: function() {
2891
+ setKeyWordProblem("");
2892
+ },
2826
2893
  children: [
2827
2894
  /*#__PURE__*/ _jsx(ContactsList, {
2828
2895
  type: 4,
@@ -2848,7 +2915,7 @@ var CustomerService = function(props) {
2848
2915
  alt: ""
2849
2916
  })
2850
2917
  }) : "",
2851
- renderQuestion()
2918
+ keyWordProblem ? renderQuestion() : renderQuestion()
2852
2919
  ]
2853
2920
  })
2854
2921
  ]
@@ -2940,7 +3007,7 @@ var CustomerService = function(props) {
2940
3007
  alt: ""
2941
3008
  })
2942
3009
  }) : "",
2943
- renderQuestion()
3010
+ keyWordProblem ? renderQuestion() : renderQuestion()
2944
3011
  ]
2945
3012
  }),
2946
3013
  /*#__PURE__*/ _jsxs("div", {