bhd-components 0.7.1 → 0.7.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/README.md +1 -1
- package/dist/{fd2fee4a.esm.es5.development.js → 0650d749.esm.es5.development.js} +1 -1
- package/dist/{f1d44d24.esm.es5.production.js → 24d37cb8.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.css +1352 -0
- package/dist/index.esm.es5.development.js +268 -269
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/historyFun.js +1 -1
- package/es2017/customerService/index.js +251 -252
- package/es2017/customerService/index2.module.less +1392 -0
- package/esm/customerService/historyFun.js +1 -1
- package/esm/customerService/index.js +265 -266
- package/esm/customerService/index2.module.less +1392 -0
- package/package.json +1 -1
|
@@ -52,7 +52,6 @@ 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保存,用来在实验报告中记录
|
|
58
57
|
var _useState27 = _sliced_to_array(useState(""), 2), keyWordProblem = _useState27[0], setKeyWordProblem = _useState27[1]; //历史记录搜索的内容
|
|
@@ -272,12 +271,12 @@ var CustomerService = function(props) {
|
|
|
272
271
|
roomId: roomId,
|
|
273
272
|
sender: "AI",
|
|
274
273
|
recevier: mid,
|
|
275
|
-
message: "Hi
|
|
274
|
+
message: "Hi,我是智能学习助手,你遇到了什么问题?"
|
|
276
275
|
};
|
|
277
276
|
if (pageNumHistory <= 1) {
|
|
278
277
|
setHistoryMessageList(function(historyMessageList) {
|
|
279
278
|
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
280
|
-
id:
|
|
279
|
+
id: new Date().getTime() + "dede",
|
|
281
280
|
upvoted: false,
|
|
282
281
|
downvoted: false,
|
|
283
282
|
quotedMessage: "",
|
|
@@ -387,7 +386,6 @@ var CustomerService = function(props) {
|
|
|
387
386
|
scrollToBottom();
|
|
388
387
|
}, 100);
|
|
389
388
|
}
|
|
390
|
-
console.log("不记录1111111");
|
|
391
389
|
return;
|
|
392
390
|
}
|
|
393
391
|
setKeyWord("");
|
|
@@ -1018,10 +1016,10 @@ var CustomerService = function(props) {
|
|
|
1018
1016
|
// }
|
|
1019
1017
|
} else {
|
|
1020
1018
|
setPageCount(0);
|
|
1021
|
-
setGreetingMessage(true);
|
|
1022
1019
|
setBottomLoading(false);
|
|
1023
1020
|
setLoading(false);
|
|
1024
1021
|
setHistoryMessageList([]);
|
|
1022
|
+
setGreetingMessage(true);
|
|
1025
1023
|
//召唤老师回答
|
|
1026
1024
|
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
1027
1025
|
sendToTeacher(1);
|
|
@@ -1560,19 +1558,21 @@ var CustomerService = function(props) {
|
|
|
1560
1558
|
// }
|
|
1561
1559
|
//渲染问答
|
|
1562
1560
|
var renderQuestion = function() {
|
|
1563
|
-
if (historyMessageList.length > 0) {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
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) {
|
|
1576
1576
|
if (itemIndex <= 0) {
|
|
1577
1577
|
//第一项
|
|
1578
1578
|
time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
@@ -1592,266 +1592,265 @@ var CustomerService = function(props) {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
className: styles.operate_modal,
|
|
1628
|
-
children: /*#__PURE__*/ _jsxs("p", {
|
|
1629
|
-
className: styles.operate,
|
|
1630
|
-
children: [
|
|
1631
|
-
/*#__PURE__*/ _jsx("i", {
|
|
1632
|
-
className: "yinyong_quote1",
|
|
1633
|
-
onClick: function() {
|
|
1634
|
-
setCitationContent({
|
|
1635
|
-
content: item.message,
|
|
1636
|
-
id: item.id
|
|
1637
|
-
});
|
|
1638
|
-
resettingBottomHei();
|
|
1639
|
-
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
1640
|
-
},
|
|
1641
|
-
children: /*#__PURE__*/ _jsx(CustomQuote, {})
|
|
1642
|
-
}),
|
|
1643
|
-
copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
|
|
1644
|
-
return list == item.id;
|
|
1645
|
-
}) ? /*#__PURE__*/ _jsx("i", {
|
|
1646
|
-
className: "tongyong-xuanzhongdui",
|
|
1647
|
-
children: /*#__PURE__*/ _jsx(CustomDuihao, {})
|
|
1648
|
-
}) : /*#__PURE__*/ _jsx("i", {
|
|
1649
|
-
className: "fuzhi21",
|
|
1650
|
-
onClick: function() {
|
|
1651
|
-
var bol = copyText(item.message);
|
|
1652
|
-
if (bol) {
|
|
1653
|
-
var obj = copyTextOBJ;
|
|
1654
|
-
obj = obj.filter(function(list) {
|
|
1655
|
-
return list != item.id;
|
|
1656
|
-
});
|
|
1657
|
-
obj.push(item.id);
|
|
1658
|
-
setCopyTextObj(obj);
|
|
1659
|
-
}
|
|
1660
|
-
setTimeout(function() {
|
|
1661
|
-
var obj = copyTextOBJ;
|
|
1662
|
-
obj = obj.filter(function(list) {
|
|
1663
|
-
return list != item.id;
|
|
1664
|
-
});
|
|
1665
|
-
setCopyTextObj(obj);
|
|
1666
|
-
}, 3000);
|
|
1667
|
-
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
1668
|
-
},
|
|
1669
|
-
children: /*#__PURE__*/ _jsx(CustomCopy, {})
|
|
1670
|
-
})
|
|
1671
|
-
]
|
|
1672
|
-
})
|
|
1673
|
-
}),
|
|
1674
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1675
|
-
className: styles.content,
|
|
1676
|
-
children: /*#__PURE__*/ _jsx("p", {
|
|
1677
|
-
dangerouslySetInnerHTML: {
|
|
1678
|
-
__html: message
|
|
1679
|
-
},
|
|
1680
|
-
className: styles.content_child
|
|
1681
|
-
})
|
|
1682
|
-
})
|
|
1683
|
-
]
|
|
1684
|
-
}),
|
|
1685
|
-
//引用消息
|
|
1686
|
-
item.quotedMessage && /*#__PURE__*/ _jsx("div", {
|
|
1687
|
-
className: styles.citation_content,
|
|
1688
|
-
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
1689
|
-
overlayClassName: styles.popover_main_content,
|
|
1690
|
-
title: item.quotedMessage,
|
|
1691
|
-
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,
|
|
1692
1627
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
1693
|
-
className: styles.
|
|
1694
|
-
children: [
|
|
1695
|
-
item.quotedMessage,
|
|
1696
|
-
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1697
|
-
]
|
|
1698
|
-
})
|
|
1699
|
-
}) : /*#__PURE__*/ _jsx("p", {
|
|
1700
|
-
children: item.quotedMessage
|
|
1701
|
-
})
|
|
1702
|
-
})
|
|
1703
|
-
]
|
|
1704
|
-
})
|
|
1705
|
-
}),
|
|
1706
|
-
showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
|
|
1707
|
-
className: styles.head_sculpture,
|
|
1708
|
-
style: {
|
|
1709
|
-
marginLeft: "12px"
|
|
1710
|
-
},
|
|
1711
|
-
children: /*#__PURE__*/ _jsx("img", {
|
|
1712
|
-
src: userData.avatar
|
|
1713
|
-
})
|
|
1714
|
-
}) : ""
|
|
1715
|
-
]
|
|
1716
|
-
}, item.id)
|
|
1717
|
-
]
|
|
1718
|
-
});
|
|
1719
|
-
} else {
|
|
1720
|
-
//获取用户头像
|
|
1721
|
-
var headImg = "";
|
|
1722
|
-
var chatWindow = [];
|
|
1723
|
-
var isAiChatWindow;
|
|
1724
|
-
chatWindow = contactsList.filter(function(item) {
|
|
1725
|
-
return item.roomId == roomId;
|
|
1726
|
-
});
|
|
1727
|
-
if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
|
|
1728
|
-
headImg = chatWindow[0].headImg;
|
|
1729
|
-
}
|
|
1730
|
-
// console.log(chatWindow,'chatWindowchatWindow')
|
|
1731
|
-
//是否在智能客服窗口
|
|
1732
|
-
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
1733
|
-
var header = 2; //代表是ai头像
|
|
1734
|
-
if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
1735
|
-
//使用AI头像
|
|
1736
|
-
header = 1;
|
|
1737
|
-
}
|
|
1738
|
-
li = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
1739
|
-
children: [
|
|
1740
|
-
dataTime ? /*#__PURE__*/ _jsx("li", {
|
|
1741
|
-
className: styles.time,
|
|
1742
|
-
children: dataTime
|
|
1743
|
-
}) : "",
|
|
1744
|
-
/*#__PURE__*/ _jsxs("li", {
|
|
1745
|
-
className: styles.right,
|
|
1746
|
-
id: lastId == item.id ? "li_flag" : "",
|
|
1747
|
-
children: [
|
|
1748
|
-
(showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
|
|
1749
|
-
className: styles.head_sculpture,
|
|
1750
|
-
style: {
|
|
1751
|
-
marginRight: "12px"
|
|
1752
|
-
},
|
|
1753
|
-
children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
|
|
1754
|
-
src: knowledge_icon
|
|
1755
|
-
}) : /*#__PURE__*/ _jsx("img", {
|
|
1756
|
-
src: headImg
|
|
1757
|
-
})
|
|
1758
|
-
}),
|
|
1759
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1760
|
-
className: styles.main,
|
|
1761
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
1762
|
-
className: styles.main_content,
|
|
1763
|
-
children: [
|
|
1764
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
1765
|
-
className: styles.main_content_flag,
|
|
1766
|
-
children: [
|
|
1767
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1768
|
-
className: styles.operate_modal,
|
|
1769
|
-
children: // 不是最后一行,
|
|
1770
|
-
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
1771
|
-
}),
|
|
1772
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
1773
|
-
className: styles.content,
|
|
1628
|
+
className: styles.operate,
|
|
1774
1629
|
children: [
|
|
1775
|
-
/*#__PURE__*/ _jsx("
|
|
1776
|
-
|
|
1777
|
-
|
|
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_智能问答_引用", "提交");
|
|
1778
1639
|
},
|
|
1779
|
-
|
|
1640
|
+
children: /*#__PURE__*/ _jsx(CustomQuote, {})
|
|
1780
1641
|
}),
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
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, {})
|
|
1795
1669
|
})
|
|
1796
1670
|
]
|
|
1797
1671
|
})
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
overlayClassName: styles.popover_main_content,
|
|
1805
|
-
title: item.quotedMessage,
|
|
1806
|
-
placement: "rightTop",
|
|
1807
|
-
children: /*#__PURE__*/ _jsxs("p", {
|
|
1808
|
-
className: styles.text_exceed,
|
|
1809
|
-
children: [
|
|
1810
|
-
item.quotedMessage,
|
|
1811
|
-
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1812
|
-
]
|
|
1813
|
-
})
|
|
1814
|
-
}) : /*#__PURE__*/ _jsx("p", {
|
|
1815
|
-
children: item.quotedMessage
|
|
1816
|
-
})
|
|
1817
|
-
}),
|
|
1818
|
-
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
1819
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
1820
|
-
//召唤老师回答按钮
|
|
1821
|
-
isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
|
|
1822
|
-
return item.short == "TeacherAnswer";
|
|
1823
|
-
}) ? /*#__PURE__*/ _jsx("div", {
|
|
1824
|
-
className: "".concat(styles.operate_modal_bottom, " "),
|
|
1825
|
-
children: /*#__PURE__*/ _jsx("p", {
|
|
1826
|
-
className: styles.stop_findTeacher,
|
|
1827
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
1828
|
-
onClick: function() {
|
|
1829
|
-
setAnswerMode(-1);
|
|
1830
|
-
setTeacherList([]);
|
|
1831
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1832
|
-
return historyMessageList.filter(function(item) {
|
|
1833
|
-
return item.id != "-1";
|
|
1834
|
-
});
|
|
1835
|
-
});
|
|
1672
|
+
}),
|
|
1673
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1674
|
+
className: styles.content,
|
|
1675
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
1676
|
+
dangerouslySetInnerHTML: {
|
|
1677
|
+
__html: message
|
|
1836
1678
|
},
|
|
1837
|
-
|
|
1679
|
+
className: styles.content_child
|
|
1838
1680
|
})
|
|
1839
1681
|
})
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
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
|
+
]
|
|
1843
1703
|
})
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
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;
|
|
1848
1728
|
}
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
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
|
+
// }
|
|
1855
1854
|
};
|
|
1856
1855
|
//渲染相关操作按钮 header == 1 ai ,== 2 知识库
|
|
1857
1856
|
var renderOperateBtn = function(item, isAiChatWindow, i) {
|