bhd-components 0.7.1 → 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.
- package/README.md +1 -1
- package/dist/{f1d44d24.esm.es5.production.js → 03434506.esm.es5.production.js} +1 -1
- package/dist/{fd2fee4a.esm.es5.development.js → 86a6ab15.esm.es5.development.js} +1 -1
- package/dist/index.esm.es5.development.css +1352 -0
- package/dist/index.esm.es5.development.js +266 -267
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/index.js +250 -251
- package/es2017/customerService/index2.module.less +1392 -0
- package/esm/customerService/index.js +264 -265
- package/esm/customerService/index2.module.less +1392 -0
- package/package.json +1 -1
|
@@ -51,7 +51,6 @@ const CustomerService = (props)=>{
|
|
|
51
51
|
const [answerMode, setAnswerMode] = useState(-1); //设置回答模式。1,召唤老师回答
|
|
52
52
|
const [teacherList, setTeacherList] = useState([]); //老师列表
|
|
53
53
|
const [problem, setProblem] = useState({}); //召唤老师回答的问题
|
|
54
|
-
// const [roomList,setRoomList] = useState([]);//聊天列表
|
|
55
54
|
const [contactsList, setContactsList] = useState([]); //老师列表
|
|
56
55
|
const [chatObj, setChatObj] = useState([]); //聊天记录id保存,用来在实验报告中记录
|
|
57
56
|
const [keyWordProblem, setKeyWordProblem] = useState(""); //历史记录搜索的内容
|
|
@@ -276,7 +275,7 @@ const CustomerService = (props)=>{
|
|
|
276
275
|
if (pageNumHistory <= 1) {
|
|
277
276
|
setHistoryMessageList((historyMessageList)=>{
|
|
278
277
|
let newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
279
|
-
id:
|
|
278
|
+
id: new Date().getTime() + 'dede',
|
|
280
279
|
upvoted: false,
|
|
281
280
|
downvoted: false,
|
|
282
281
|
quotedMessage: "",
|
|
@@ -386,7 +385,6 @@ const CustomerService = (props)=>{
|
|
|
386
385
|
scrollToBottom();
|
|
387
386
|
}, 100);
|
|
388
387
|
}
|
|
389
|
-
console.log('不记录1111111');
|
|
390
388
|
return;
|
|
391
389
|
}
|
|
392
390
|
setKeyWord("");
|
|
@@ -996,10 +994,10 @@ const CustomerService = (props)=>{
|
|
|
996
994
|
// }
|
|
997
995
|
} else {
|
|
998
996
|
setPageCount(0);
|
|
999
|
-
setGreetingMessage(true);
|
|
1000
997
|
setBottomLoading(false);
|
|
1001
998
|
setLoading(false);
|
|
1002
999
|
setHistoryMessageList([]);
|
|
1000
|
+
setGreetingMessage(true);
|
|
1003
1001
|
//召唤老师回答
|
|
1004
1002
|
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
1005
1003
|
sendToTeacher(1);
|
|
@@ -1520,17 +1518,19 @@ const CustomerService = (props)=>{
|
|
|
1520
1518
|
// }
|
|
1521
1519
|
//渲染问答
|
|
1522
1520
|
const renderQuestion = ()=>{
|
|
1523
|
-
if (historyMessageList.length > 0) {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1521
|
+
// if (historyMessageList.length > 0) {
|
|
1522
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
1523
|
+
className: styles.message_con,
|
|
1524
|
+
children: historyMessageList.map((item, i)=>{
|
|
1525
|
+
console.log(item, 444444888888);
|
|
1526
|
+
let timeObj = parseDate(item.createdAt);
|
|
1527
|
+
// console.log(item.message);
|
|
1528
|
+
let message = item.message;
|
|
1529
|
+
let li;
|
|
1530
|
+
// 是否需要显示日期
|
|
1531
|
+
let itemIndex = historyMessageList.findIndex((ite)=>ite.id === item.id);
|
|
1532
|
+
let time = "";
|
|
1533
|
+
if (historyMessageList.length > 1) {
|
|
1534
1534
|
if (itemIndex <= 0) {
|
|
1535
1535
|
//第一项
|
|
1536
1536
|
time = `${timeObj.year}-${timeObj.month}-${timeObj.day} ${timeObj.hours}:${timeObj.minutes}`;
|
|
@@ -1550,254 +1550,253 @@ const CustomerService = (props)=>{
|
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
className: styles.operate_modal,
|
|
1586
|
-
children: /*#__PURE__*/ _jsxs("p", {
|
|
1587
|
-
className: styles.operate,
|
|
1588
|
-
children: [
|
|
1589
|
-
/*#__PURE__*/ _jsx("i", {
|
|
1590
|
-
className: "yinyong_quote1",
|
|
1591
|
-
onClick: ()=>{
|
|
1592
|
-
setCitationContent({
|
|
1593
|
-
content: item.message,
|
|
1594
|
-
id: item.id
|
|
1595
|
-
});
|
|
1596
|
-
resettingBottomHei();
|
|
1597
|
-
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
1598
|
-
},
|
|
1599
|
-
children: /*#__PURE__*/ _jsx(CustomQuote, {})
|
|
1600
|
-
}),
|
|
1601
|
-
copyTextOBJ.length > 0 && copyTextOBJ.some((list)=>list == item.id) ? /*#__PURE__*/ _jsx("i", {
|
|
1602
|
-
className: `tongyong-xuanzhongdui`,
|
|
1603
|
-
children: /*#__PURE__*/ _jsx(CustomDuihao, {})
|
|
1604
|
-
}) : /*#__PURE__*/ _jsx("i", {
|
|
1605
|
-
className: "fuzhi21",
|
|
1606
|
-
onClick: ()=>{
|
|
1607
|
-
let bol = copyText(item.message);
|
|
1608
|
-
if (bol) {
|
|
1609
|
-
let obj = copyTextOBJ;
|
|
1610
|
-
obj = obj.filter((list)=>list != item.id);
|
|
1611
|
-
obj.push(item.id);
|
|
1612
|
-
setCopyTextObj(obj);
|
|
1613
|
-
}
|
|
1614
|
-
setTimeout(()=>{
|
|
1615
|
-
let obj = copyTextOBJ;
|
|
1616
|
-
obj = obj.filter((list)=>list != item.id);
|
|
1617
|
-
setCopyTextObj(obj);
|
|
1618
|
-
}, 3000);
|
|
1619
|
-
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
1620
|
-
},
|
|
1621
|
-
children: /*#__PURE__*/ _jsx(CustomCopy, {})
|
|
1622
|
-
})
|
|
1623
|
-
]
|
|
1624
|
-
})
|
|
1625
|
-
}),
|
|
1626
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1627
|
-
className: styles.content,
|
|
1628
|
-
children: /*#__PURE__*/ _jsx("p", {
|
|
1629
|
-
dangerouslySetInnerHTML: {
|
|
1630
|
-
__html: message
|
|
1631
|
-
},
|
|
1632
|
-
className: styles.content_child
|
|
1633
|
-
})
|
|
1634
|
-
})
|
|
1635
|
-
]
|
|
1636
|
-
}),
|
|
1637
|
-
//引用消息
|
|
1638
|
-
item.quotedMessage && /*#__PURE__*/ _jsx("div", {
|
|
1639
|
-
className: styles.citation_content,
|
|
1640
|
-
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
1641
|
-
overlayClassName: styles.popover_main_content,
|
|
1642
|
-
title: item.quotedMessage,
|
|
1643
|
-
placement: "leftTop",
|
|
1553
|
+
}
|
|
1554
|
+
let dataTime = time;
|
|
1555
|
+
if (lastId == item.id && keyWordProblem != '') {
|
|
1556
|
+
message = remarkable.render(message);
|
|
1557
|
+
message = message.replaceAll(keyWordProblem, (e)=>{
|
|
1558
|
+
return `<span class=${styles.sign}>${e}</span>`;
|
|
1559
|
+
});
|
|
1560
|
+
} else {
|
|
1561
|
+
message = remarkable.render(message);
|
|
1562
|
+
}
|
|
1563
|
+
if (item.sender == mid) {
|
|
1564
|
+
//只有引用和复制功能
|
|
1565
|
+
li = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
1566
|
+
children: [
|
|
1567
|
+
dataTime ? /*#__PURE__*/ _jsx("li", {
|
|
1568
|
+
className: styles.time,
|
|
1569
|
+
children: dataTime
|
|
1570
|
+
}) : "",
|
|
1571
|
+
/*#__PURE__*/ _jsxs("li", {
|
|
1572
|
+
className: styles.left,
|
|
1573
|
+
id: lastId == item.id ? "li_flag" : "",
|
|
1574
|
+
children: [
|
|
1575
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1576
|
+
className: styles.main,
|
|
1577
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
1578
|
+
className: styles.main_content,
|
|
1579
|
+
children: [
|
|
1580
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1581
|
+
className: styles.main_content_flag,
|
|
1582
|
+
children: [
|
|
1583
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1584
|
+
className: styles.operate_modal,
|
|
1644
1585
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
1645
|
-
className: styles.
|
|
1646
|
-
children: [
|
|
1647
|
-
item.quotedMessage,
|
|
1648
|
-
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1649
|
-
]
|
|
1650
|
-
})
|
|
1651
|
-
}) : /*#__PURE__*/ _jsx("p", {
|
|
1652
|
-
children: item.quotedMessage
|
|
1653
|
-
})
|
|
1654
|
-
})
|
|
1655
|
-
]
|
|
1656
|
-
})
|
|
1657
|
-
}),
|
|
1658
|
-
showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
|
|
1659
|
-
className: styles.head_sculpture,
|
|
1660
|
-
style: {
|
|
1661
|
-
marginLeft: "12px"
|
|
1662
|
-
},
|
|
1663
|
-
children: /*#__PURE__*/ _jsx("img", {
|
|
1664
|
-
src: userData.avatar
|
|
1665
|
-
})
|
|
1666
|
-
}) : ""
|
|
1667
|
-
]
|
|
1668
|
-
}, item.id)
|
|
1669
|
-
]
|
|
1670
|
-
});
|
|
1671
|
-
} else {
|
|
1672
|
-
//获取用户头像
|
|
1673
|
-
let headImg = "";
|
|
1674
|
-
let chatWindow = [];
|
|
1675
|
-
let isAiChatWindow;
|
|
1676
|
-
chatWindow = contactsList.filter((item)=>item.roomId == roomId);
|
|
1677
|
-
if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
|
|
1678
|
-
headImg = chatWindow[0].headImg;
|
|
1679
|
-
}
|
|
1680
|
-
// console.log(chatWindow,'chatWindowchatWindow')
|
|
1681
|
-
//是否在智能客服窗口
|
|
1682
|
-
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
1683
|
-
let header = 2; //代表是ai头像
|
|
1684
|
-
if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
1685
|
-
//使用AI头像
|
|
1686
|
-
header = 1;
|
|
1687
|
-
}
|
|
1688
|
-
li = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
1689
|
-
children: [
|
|
1690
|
-
dataTime ? /*#__PURE__*/ _jsx("li", {
|
|
1691
|
-
className: styles.time,
|
|
1692
|
-
children: dataTime
|
|
1693
|
-
}) : "",
|
|
1694
|
-
/*#__PURE__*/ _jsxs("li", {
|
|
1695
|
-
className: styles.right,
|
|
1696
|
-
id: lastId == item.id ? "li_flag" : "",
|
|
1697
|
-
children: [
|
|
1698
|
-
(showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
|
|
1699
|
-
className: styles.head_sculpture,
|
|
1700
|
-
style: {
|
|
1701
|
-
marginRight: "12px"
|
|
1702
|
-
},
|
|
1703
|
-
children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
|
|
1704
|
-
src: knowledge_icon
|
|
1705
|
-
}) : /*#__PURE__*/ _jsx("img", {
|
|
1706
|
-
src: headImg
|
|
1707
|
-
})
|
|
1708
|
-
}),
|
|
1709
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1710
|
-
className: styles.main,
|
|
1711
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
1712
|
-
className: styles.main_content,
|
|
1713
|
-
children: [
|
|
1714
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
1715
|
-
className: styles.main_content_flag,
|
|
1716
|
-
children: [
|
|
1717
|
-
/*#__PURE__*/ _jsx("div", {
|
|
1718
|
-
className: styles.operate_modal,
|
|
1719
|
-
children: // 不是最后一行,
|
|
1720
|
-
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
1721
|
-
}),
|
|
1722
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
1723
|
-
className: styles.content,
|
|
1586
|
+
className: styles.operate,
|
|
1724
1587
|
children: [
|
|
1725
|
-
/*#__PURE__*/ _jsx("
|
|
1726
|
-
|
|
1727
|
-
|
|
1588
|
+
/*#__PURE__*/ _jsx("i", {
|
|
1589
|
+
className: "yinyong_quote1",
|
|
1590
|
+
onClick: ()=>{
|
|
1591
|
+
setCitationContent({
|
|
1592
|
+
content: item.message,
|
|
1593
|
+
id: item.id
|
|
1594
|
+
});
|
|
1595
|
+
resettingBottomHei();
|
|
1596
|
+
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
1728
1597
|
},
|
|
1729
|
-
|
|
1598
|
+
children: /*#__PURE__*/ _jsx(CustomQuote, {})
|
|
1730
1599
|
}),
|
|
1731
|
-
|
|
1732
|
-
className:
|
|
1733
|
-
children:
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1600
|
+
copyTextOBJ.length > 0 && copyTextOBJ.some((list)=>list == item.id) ? /*#__PURE__*/ _jsx("i", {
|
|
1601
|
+
className: `tongyong-xuanzhongdui`,
|
|
1602
|
+
children: /*#__PURE__*/ _jsx(CustomDuihao, {})
|
|
1603
|
+
}) : /*#__PURE__*/ _jsx("i", {
|
|
1604
|
+
className: "fuzhi21",
|
|
1605
|
+
onClick: ()=>{
|
|
1606
|
+
let bol = copyText(item.message);
|
|
1607
|
+
if (bol) {
|
|
1608
|
+
let obj = copyTextOBJ;
|
|
1609
|
+
obj = obj.filter((list)=>list != item.id);
|
|
1610
|
+
obj.push(item.id);
|
|
1611
|
+
setCopyTextObj(obj);
|
|
1612
|
+
}
|
|
1613
|
+
setTimeout(()=>{
|
|
1614
|
+
let obj = copyTextOBJ;
|
|
1615
|
+
obj = obj.filter((list)=>list != item.id);
|
|
1616
|
+
setCopyTextObj(obj);
|
|
1617
|
+
}, 3000);
|
|
1618
|
+
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
1619
|
+
},
|
|
1620
|
+
children: /*#__PURE__*/ _jsx(CustomCopy, {})
|
|
1745
1621
|
})
|
|
1746
1622
|
]
|
|
1747
1623
|
})
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
overlayClassName: styles.popover_main_content,
|
|
1755
|
-
title: item.quotedMessage,
|
|
1756
|
-
placement: "rightTop",
|
|
1757
|
-
children: /*#__PURE__*/ _jsxs("p", {
|
|
1758
|
-
className: styles.text_exceed,
|
|
1759
|
-
children: [
|
|
1760
|
-
item.quotedMessage,
|
|
1761
|
-
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1762
|
-
]
|
|
1763
|
-
})
|
|
1764
|
-
}) : /*#__PURE__*/ _jsx("p", {
|
|
1765
|
-
children: item.quotedMessage
|
|
1766
|
-
})
|
|
1767
|
-
}),
|
|
1768
|
-
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
1769
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
1770
|
-
//召唤老师回答按钮
|
|
1771
|
-
isAiChatWindow && item.findTeacher && userData.modules.some((item)=>item.short == "TeacherAnswer") ? /*#__PURE__*/ _jsx("div", {
|
|
1772
|
-
className: `${styles.operate_modal_bottom} `,
|
|
1773
|
-
children: /*#__PURE__*/ _jsx("p", {
|
|
1774
|
-
className: styles.stop_findTeacher,
|
|
1775
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
1776
|
-
onClick: ()=>{
|
|
1777
|
-
setAnswerMode(-1);
|
|
1778
|
-
setTeacherList([]);
|
|
1779
|
-
setHistoryMessageList((historyMessageList)=>{
|
|
1780
|
-
return historyMessageList.filter((item)=>item.id != "-1");
|
|
1781
|
-
});
|
|
1624
|
+
}),
|
|
1625
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1626
|
+
className: styles.content,
|
|
1627
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
1628
|
+
dangerouslySetInnerHTML: {
|
|
1629
|
+
__html: message
|
|
1782
1630
|
},
|
|
1783
|
-
|
|
1631
|
+
className: styles.content_child
|
|
1784
1632
|
})
|
|
1785
1633
|
})
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1634
|
+
]
|
|
1635
|
+
}),
|
|
1636
|
+
//引用消息
|
|
1637
|
+
item.quotedMessage && /*#__PURE__*/ _jsx("div", {
|
|
1638
|
+
className: styles.citation_content,
|
|
1639
|
+
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
1640
|
+
overlayClassName: styles.popover_main_content,
|
|
1641
|
+
title: item.quotedMessage,
|
|
1642
|
+
placement: "leftTop",
|
|
1643
|
+
children: /*#__PURE__*/ _jsxs("p", {
|
|
1644
|
+
className: styles.text_exceed,
|
|
1645
|
+
children: [
|
|
1646
|
+
item.quotedMessage,
|
|
1647
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1648
|
+
]
|
|
1649
|
+
})
|
|
1650
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
1651
|
+
children: item.quotedMessage
|
|
1652
|
+
})
|
|
1653
|
+
})
|
|
1654
|
+
]
|
|
1789
1655
|
})
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1656
|
+
}),
|
|
1657
|
+
showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
|
|
1658
|
+
className: styles.head_sculpture,
|
|
1659
|
+
style: {
|
|
1660
|
+
marginLeft: "12px"
|
|
1661
|
+
},
|
|
1662
|
+
children: /*#__PURE__*/ _jsx("img", {
|
|
1663
|
+
src: userData.avatar
|
|
1664
|
+
})
|
|
1665
|
+
}) : ""
|
|
1666
|
+
]
|
|
1667
|
+
}, item.id)
|
|
1668
|
+
]
|
|
1669
|
+
});
|
|
1670
|
+
} else {
|
|
1671
|
+
//获取用户头像
|
|
1672
|
+
let headImg = "";
|
|
1673
|
+
let chatWindow = [];
|
|
1674
|
+
let isAiChatWindow;
|
|
1675
|
+
chatWindow = contactsList.filter((item)=>item.roomId == roomId);
|
|
1676
|
+
if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
|
|
1677
|
+
headImg = chatWindow[0].headImg;
|
|
1794
1678
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1679
|
+
// console.log(chatWindow,'chatWindowchatWindow')
|
|
1680
|
+
//是否在智能客服窗口
|
|
1681
|
+
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
1682
|
+
let header = 2; //代表是ai头像
|
|
1683
|
+
if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
1684
|
+
//使用AI头像
|
|
1685
|
+
header = 1;
|
|
1686
|
+
}
|
|
1687
|
+
li = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
1688
|
+
children: [
|
|
1689
|
+
dataTime ? /*#__PURE__*/ _jsx("li", {
|
|
1690
|
+
className: styles.time,
|
|
1691
|
+
children: dataTime
|
|
1692
|
+
}) : "",
|
|
1693
|
+
/*#__PURE__*/ _jsxs("li", {
|
|
1694
|
+
className: styles.right,
|
|
1695
|
+
id: lastId == item.id ? "li_flag" : "",
|
|
1696
|
+
children: [
|
|
1697
|
+
(showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
|
|
1698
|
+
className: styles.head_sculpture,
|
|
1699
|
+
style: {
|
|
1700
|
+
marginRight: "12px"
|
|
1701
|
+
},
|
|
1702
|
+
children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
|
|
1703
|
+
src: knowledge_icon
|
|
1704
|
+
}) : /*#__PURE__*/ _jsx("img", {
|
|
1705
|
+
src: headImg
|
|
1706
|
+
})
|
|
1707
|
+
}),
|
|
1708
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1709
|
+
className: styles.main,
|
|
1710
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
1711
|
+
className: styles.main_content,
|
|
1712
|
+
children: [
|
|
1713
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1714
|
+
className: styles.main_content_flag,
|
|
1715
|
+
children: [
|
|
1716
|
+
/*#__PURE__*/ _jsx("div", {
|
|
1717
|
+
className: styles.operate_modal,
|
|
1718
|
+
children: // 不是最后一行,
|
|
1719
|
+
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
1720
|
+
}),
|
|
1721
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
1722
|
+
className: styles.content,
|
|
1723
|
+
children: [
|
|
1724
|
+
/*#__PURE__*/ _jsx("p", {
|
|
1725
|
+
dangerouslySetInnerHTML: {
|
|
1726
|
+
__html: message
|
|
1727
|
+
},
|
|
1728
|
+
className: styles.content_child
|
|
1729
|
+
}),
|
|
1730
|
+
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", {
|
|
1731
|
+
className: styles.association_problem,
|
|
1732
|
+
children: JSON.parse(item.extraInfo).map((list, index)=>{
|
|
1733
|
+
return /*#__PURE__*/ _jsxs("li", {
|
|
1734
|
+
onClick: ()=>{
|
|
1735
|
+
sendMessage(list, 1);
|
|
1736
|
+
},
|
|
1737
|
+
children: [
|
|
1738
|
+
index + 1,
|
|
1739
|
+
".",
|
|
1740
|
+
list.question
|
|
1741
|
+
]
|
|
1742
|
+
}, i + "_" + index + "_" + list.value);
|
|
1743
|
+
})
|
|
1744
|
+
})
|
|
1745
|
+
]
|
|
1746
|
+
})
|
|
1747
|
+
]
|
|
1748
|
+
}),
|
|
1749
|
+
//引用消息
|
|
1750
|
+
item.quotedMessage && /*#__PURE__*/ _jsx("div", {
|
|
1751
|
+
className: styles.citation_content,
|
|
1752
|
+
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
1753
|
+
overlayClassName: styles.popover_main_content,
|
|
1754
|
+
title: item.quotedMessage,
|
|
1755
|
+
placement: "rightTop",
|
|
1756
|
+
children: /*#__PURE__*/ _jsxs("p", {
|
|
1757
|
+
className: styles.text_exceed,
|
|
1758
|
+
children: [
|
|
1759
|
+
item.quotedMessage,
|
|
1760
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
1761
|
+
]
|
|
1762
|
+
})
|
|
1763
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
1764
|
+
children: item.quotedMessage
|
|
1765
|
+
})
|
|
1766
|
+
}),
|
|
1767
|
+
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
1768
|
+
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
|
|
1769
|
+
//召唤老师回答按钮
|
|
1770
|
+
isAiChatWindow && item.findTeacher && userData.modules.some((item)=>item.short == "TeacherAnswer") ? /*#__PURE__*/ _jsx("div", {
|
|
1771
|
+
className: `${styles.operate_modal_bottom} `,
|
|
1772
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
1773
|
+
className: styles.stop_findTeacher,
|
|
1774
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
1775
|
+
onClick: ()=>{
|
|
1776
|
+
setAnswerMode(-1);
|
|
1777
|
+
setTeacherList([]);
|
|
1778
|
+
setHistoryMessageList((historyMessageList)=>{
|
|
1779
|
+
return historyMessageList.filter((item)=>item.id != "-1");
|
|
1780
|
+
});
|
|
1781
|
+
},
|
|
1782
|
+
children: "停止召唤老师"
|
|
1783
|
+
})
|
|
1784
|
+
})
|
|
1785
|
+
}) : ""
|
|
1786
|
+
]
|
|
1787
|
+
})
|
|
1788
|
+
})
|
|
1789
|
+
]
|
|
1790
|
+
}, item.id)
|
|
1791
|
+
]
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
return li;
|
|
1795
|
+
})
|
|
1796
|
+
});
|
|
1797
|
+
// } else {
|
|
1798
|
+
// return "";
|
|
1799
|
+
// }
|
|
1801
1800
|
};
|
|
1802
1801
|
//渲染相关操作按钮 header == 1 ai ,== 2 知识库
|
|
1803
1802
|
const renderOperateBtn = (item, isAiChatWindow, i)=>{
|