bhd-components 0.7.20 → 0.7.22

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.
@@ -5,7 +5,7 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
5
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
6
6
  import React, { useEffect, useState, useRef } from "react";
7
7
  import { Modal, Drawer, Input, Tooltip } from "antd";
8
- import { ViewImage } from "bhd-components";
8
+ import ViewImage from "../viewImage";
9
9
  // import html2canvas from "html2canvas";
10
10
  import cssStyle from "./index.module.less";
11
11
  import cssStyleOnline from "./index2.module.less";
@@ -18,6 +18,7 @@ import { CloseOutlined, RightOutlined, ZoomInOutlined } from "@ant-design/icons"
18
18
  import HistoryFun from "./historyFun";
19
19
  import ContactsList from "./contactsList";
20
20
  import ScreenshotTool from "./screenshotTool";
21
+ import TeacherList from "./teacherList";
21
22
  import { parseDate } from "../utils/Date";
22
23
  import { Remarkable } from "remarkable";
23
24
  import hljs from "highlight.js";
@@ -54,20 +55,21 @@ var CustomerService = function(props) {
54
55
  var _useState17 = _sliced_to_array(useState(45), 2), buttomHei = _useState17[0], setButtomHei = _useState17[1]; //底部输入框的高度
55
56
  var _useState18 = _sliced_to_array(useState(false), 2), showHistory = _useState18[0], setShowHistory = _useState18[1]; //是否显示历史记录
56
57
  var _useState19 = _sliced_to_array(useState(false), 2), showContacts = _useState19[0], setShowContacts = _useState19[1]; //是否显示老师列表
57
- var _useState20 = _sliced_to_array(useState(-1), 2), showType = _useState20[0], setShowType = _useState20[1]; //显示聊天框类型 1、侧边栏 2 modal 3 相应的div中 newlabo中使用
58
- var _useState21 = _sliced_to_array(useState(-1), 2), answerMode = _useState21[0], setAnswerMode = _useState21[1]; //设置回答模式。1,召唤老师回答
59
- var _useState22 = _sliced_to_array(useState([]), 2), teacherList = _useState22[0], setTeacherList = _useState22[1]; //老师列表
60
- var _useState23 = _sliced_to_array(useState({}), 2), problem = _useState23[0], setProblem = _useState23[1]; //召唤老师回答的问题
61
- var _useState24 = _sliced_to_array(useState([]), 2), contactsList = _useState24[0], setContactsList = _useState24[1]; //老师列表
62
- var _useState25 = _sliced_to_array(useState([]), 2), chatObj = _useState25[0], setChatObj = _useState25[1]; //聊天记录id保存,用来在实验报告中记录
63
- var _useState26 = _sliced_to_array(useState(""), 2), keyWordProblem = _useState26[0], setKeyWordProblem = _useState26[1]; //历史记录搜索的内容
64
- var _useState27 = _sliced_to_array(useState(""), 2), imgBese64 = _useState27[0], setImgBese64 = _useState27[1]; //屏幕截图
65
- var _useState28 = _sliced_to_array(useState(""), 2), screenshotBese64 = _useState28[0], setScreenshotBese64 = _useState28[1]; //bese64图片
66
- var _useState29 = _sliced_to_array(useState(""), 2), viewBase64 = _useState29[0], setViewBase64 = _useState29[1]; //图片预览
67
- var _useState30 = _sliced_to_array(useState(false), 2), visible = _useState30[0], setVisible = _useState30[1]; //是否显示图片预览
68
- var _useState31 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState31[0], setBottomRecommendationQuestions = _useState31[1]; //底部推荐问题
69
- var _useState32 = _sliced_to_array(useState(false), 2), showScreenshot = _useState32[0], setShowScreenshot = _useState32[1]; //是否显示截图 主要用于newlabo页面
70
- var _useState33 = _sliced_to_array(useState(-1), 2), saveShowType = _useState33[0], setSaveShowType = _useState33[1]; //保存截图时的状态
58
+ var _useState20 = _sliced_to_array(useState([]), 2), contactsList = _useState20[0], setContactsList = _useState20[1]; //老师列表
59
+ var _useState21 = _sliced_to_array(useState(-1), 2), showType = _useState21[0], setShowType = _useState21[1]; //显示聊天框类型 1、侧边栏 2 modal 3 相应的div中 newlabo中使用
60
+ // const [answerMode, setAnswerMode] = useState(-1); //设置回答模式。1,召唤老师回答
61
+ // const [teacherList, setTeacherList] = useState([]); //老师列表
62
+ var _useState22 = _sliced_to_array(useState({}), 2), problem = _useState22[0], setProblem = _useState22[1]; //召唤老师回答的问题
63
+ var _useState23 = _sliced_to_array(useState([]), 2), chatObj = _useState23[0], setChatObj = _useState23[1]; //聊天记录id保存,用来在实验报告中记录
64
+ var _useState24 = _sliced_to_array(useState(""), 2), keyWordProblem = _useState24[0], setKeyWordProblem = _useState24[1]; //历史记录搜索的内容
65
+ var _useState25 = _sliced_to_array(useState(""), 2), imgBese64 = _useState25[0], setImgBese64 = _useState25[1]; //屏幕截图
66
+ var _useState26 = _sliced_to_array(useState(""), 2), screenshotBese64 = _useState26[0], setScreenshotBese64 = _useState26[1]; //bese64图片
67
+ var _useState27 = _sliced_to_array(useState(""), 2), viewBase64 = _useState27[0], setViewBase64 = _useState27[1]; //图片预览
68
+ var _useState28 = _sliced_to_array(useState(false), 2), visible = _useState28[0], setVisible = _useState28[1]; //是否显示图片预览
69
+ var _useState29 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState29[0], setBottomRecommendationQuestions = _useState29[1]; //底部推荐问题
70
+ var _useState30 = _sliced_to_array(useState(false), 2), showScreenshot = _useState30[0], setShowScreenshot = _useState30[1]; //是否显示截图 主要用于newlabo页面
71
+ var _useState31 = _sliced_to_array(useState(-1), 2), saveShowType = _useState31[0], setSaveShowType = _useState31[1]; //保存截图时的状态
72
+ var _useState32 = _sliced_to_array(useState(false), 2), showTeacherList = _useState32[0], setShowTeacherList = _useState32[1]; //是否显示召唤老师列表
71
73
  var timer = useRef(null); //文本框输入时
72
74
  var receiveMessageTimer = useRef(null); //接收ai发回的消息
73
75
  // let voiceCountdownTimer = useRef(null); //语音录制倒计时
@@ -81,6 +83,7 @@ var CustomerService = function(props) {
81
83
  var recommendeQuestionID = useRef([]); //推荐问题id
82
84
  var videoHotQuestionsList = useRef([]); //视频热门问题
83
85
  var newHotQuestionsList = useRef([]); //视频热门问题
86
+ var newShowType = useRef(false);
84
87
  var mid = props.userData.mid;
85
88
  var remarkable = new Remarkable({
86
89
  highlight: function highlight(str, lang) {
@@ -154,6 +157,7 @@ var CustomerService = function(props) {
154
157
  //|| showScreenshot
155
158
  if (showType == 5 || showScreenshot) {
156
159
  try {
160
+ newShowType.current = true;
157
161
  setImgBese64("");
158
162
  // let dom = document.getElementById(screenshotAreaId);
159
163
  html2canvas(screenshotAreaId, {
@@ -170,6 +174,7 @@ var CustomerService = function(props) {
170
174
  console.log(canvas, 99999);
171
175
  // var base64URL = canvas.toDataURL('image/jpeg')
172
176
  var base64URL = canvas.toDataURL("image/jpg", 1.0);
177
+ console.log(base64URL);
173
178
  setImgBese64(base64URL);
174
179
  });
175
180
  } catch (error) {
@@ -559,6 +564,7 @@ var CustomerService = function(props) {
559
564
  };
560
565
  //消息发送给老师type == 1,召唤老师时发送,type == 2,在老师聊天窗口聊天
561
566
  var sendToTeacher = function(type) {
567
+ var message = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
562
568
  console.log("消息发送给老师111");
563
569
  var obj = {};
564
570
  if (type == 1) {
@@ -568,8 +574,11 @@ var CustomerService = function(props) {
568
574
  recevier: chatWith.uid,
569
575
  message: problem.question
570
576
  };
577
+ if (problem.url) {
578
+ obj.image = problem.url;
579
+ }
571
580
  setProblem({});
572
- } else if (type == 2) {
581
+ } else if (type == 2 || type == 3) {
573
582
  var list = contactsList.filter(function(item) {
574
583
  return item.roomId == roomId;
575
584
  });
@@ -581,9 +590,13 @@ var CustomerService = function(props) {
581
590
  roomId: roomId,
582
591
  sender: mid,
583
592
  recevier: recevier,
584
- message: keyWord,
593
+ message: type == 2 ? keyWord : message,
585
594
  quotedMessage: citationContent.content || ""
586
595
  };
596
+ if (screenshotBese64) {
597
+ obj.image = screenshotBese64;
598
+ setScreenshotBese64("");
599
+ }
587
600
  }
588
601
  http.post("".concat(urllocation, "/chat-service/public/v1.0/chat-with-user/messages"), obj).then(function(res) {
589
602
  if (res.data.id) {
@@ -594,7 +607,13 @@ var CustomerService = function(props) {
594
607
  id: res.data.id,
595
608
  upvoted: false,
596
609
  downvoted: false,
597
- createdAt: getDataTime(-1)
610
+ createdAt: getDataTime(-1),
611
+ extraInfo: obj.image ? JSON.stringify([
612
+ {
613
+ key: "imageUrl",
614
+ value: obj.image
615
+ }
616
+ ]) : null
598
617
  }));
599
618
  return newHistoryMessageList;
600
619
  });
@@ -801,11 +820,11 @@ var CustomerService = function(props) {
801
820
  ctrl.current = new AbortController();
802
821
  clearTimeout(receiveMessageTimer.current);
803
822
  receiveMessageTimer.current = setTimeout(function() {
804
- // setHistoryMessageList((historyMessageList) => {
805
- // return historyMessageList.filter(
806
- // (item) => item.id != "123456" && item.id != "654321"
807
- // );
808
- // });
823
+ setHistoryMessageList(function(historyMessageList) {
824
+ return historyMessageList.filter(function(item) {
825
+ return item.id != "123456";
826
+ });
827
+ });
809
828
  setFinished(true);
810
829
  ctrl.current.abort();
811
830
  setHistoryMessageList(function(historyMessageList) {
@@ -813,7 +832,7 @@ var CustomerService = function(props) {
813
832
  roomId: roomId,
814
833
  sender: "AI",
815
834
  recevier: mid,
816
- message: "网络异常,请稍后重试!",
835
+ message: "AI助手繁忙,请稍后再提问或",
817
836
  id: "123456",
818
837
  createdAt: getDataTime(-1),
819
838
  extraInfo: null
@@ -1211,11 +1230,9 @@ var CustomerService = function(props) {
1211
1230
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
1212
1231
  sendToTeacher(1);
1213
1232
  }
1214
- // if(flag == 1){
1215
1233
  setTimeout(function() {
1216
1234
  setKeyWordProblem("");
1217
1235
  }, 3100);
1218
- // }
1219
1236
  } else {
1220
1237
  setPageCount(0);
1221
1238
  setBottomLoading(false);
@@ -1247,8 +1264,9 @@ var CustomerService = function(props) {
1247
1264
  roomMessage.current = setTimeout(function() {
1248
1265
  getRoomidHistoryMessage(totalNumber, rid);
1249
1266
  }, 5000);
1250
- if (rid == "") return;
1251
- // console.log(roomList,2222222);
1267
+ // console.log(showType, imgBese64,showScreenshot,newShowType.current,9999999);
1268
+ //newShowType.current 截图中,不循环
1269
+ if (rid == "" || newShowType.current) return;
1252
1270
  return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
1253
1271
  params: {
1254
1272
  roomId: rid,
@@ -1505,19 +1523,6 @@ var CustomerService = function(props) {
1505
1523
  }
1506
1524
  }
1507
1525
  };
1508
- //获取老师列表
1509
- var getTeacherList = function(keyWord) {
1510
- http.get("".concat(urllocation, "/chat-service/public/v1.0/teachers"), {
1511
- params: {
1512
- name: keyWord
1513
- }
1514
- }).then(function(res) {
1515
- console.log(res);
1516
- if (res.data) {
1517
- setTeacherList(res.data.teachers);
1518
- }
1519
- });
1520
- };
1521
1526
  //获取聊天室列表
1522
1527
  var roomsListTimer = function() {
1523
1528
  if (chatRoomList != null) clearTimeout(chatRoomList.current);
@@ -1916,18 +1921,22 @@ var CustomerService = function(props) {
1916
1921
  // code = code[1];
1917
1922
  // console.log(code,888888888);
1918
1923
  if (lastId == item.id && keyWordProblem != "") {
1919
- message = remarkable.render(message);
1924
+ //点击历史记录时,找到关键字,防止关键字和标签名重复
1925
+ var key_sign = "sign_" + new Date().getTime();
1926
+ +"sign";
1920
1927
  message = message.replaceAll(keyWordProblem, function(e) {
1921
- return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
1928
+ return key_sign;
1929
+ });
1930
+ message = remarkable.render(message);
1931
+ message = message.replaceAll(key_sign, function(e) {
1932
+ return "<span class=".concat(styles.sign, ">").concat(keyWordProblem, "</span>");
1922
1933
  });
1923
1934
  } else {
1924
1935
  message = remarkable.render(message);
1925
1936
  }
1926
1937
  var position = 0;
1927
1938
  message = message.replaceAll(new RegExp("<pre", "ig"), function(i, index) {
1928
- //copyText(${item.message,2,position})
1929
1939
  position++;
1930
- // console.log(i,index,onClick={copyText} ,'skdcnsdjk')
1931
1940
  var text = "<p class='".concat(styles.copyCode, " copyCodeFun' data-id=").concat(item.id, " data-position=").concat(position, ">\n <span class='").concat(styles.icon, ' copy\' >\n <svg\n width="1em"\n height="1em"\n viewBox="0 0 14 14"\n shape-rendering="geometricPrecision"\n fill="currentColor"\n xmlns="http://www.w3.org/2000/svg"\n >\n <g clip-path="url(#clip0_518_8403)">\n <path\n d="M6.16666 1.66666H13.1667C13.4761 1.66666 13.7728 1.78957 13.9916 2.00837C14.2104 2.22716 14.3333 2.5239 14.3333 2.83332V9.83332C14.3333 10.1427 14.2104 10.4395 13.9916 10.6583C13.7728 10.8771 13.4761 11 13.1667 11H6.16666C5.85724 11 5.5605 10.8771 5.34171 10.6583C5.12291 10.4395 5 10.1427 5 9.83332V2.83332C5 2.5239 5.12291 2.22716 5.34171 2.00837C5.5605 1.78957 5.85724 1.66666 6.16666 1.66666ZM6.16666 2.66666C6.12246 2.66666 6.08007 2.68422 6.04881 2.71547C6.01756 2.74673 6 2.78912 6 2.83332V9.83332C6 9.85521 6.00431 9.87688 6.01268 9.8971C6.02106 9.91732 6.03334 9.9357 6.04881 9.95117C6.06429 9.96665 6.08266 9.97893 6.10288 9.9873C6.1231 9.99568 6.14478 9.99999 6.16666 9.99999H13.1667C13.2109 9.99999 13.2533 9.98243 13.2845 9.95117C13.3158 9.91992 13.3333 9.87753 13.3333 9.83332V2.83332C13.3333 2.78912 13.3158 2.74673 13.2845 2.71547C13.2533 2.68422 13.2109 2.66666 13.1667 2.66666H6.16666ZM10 12C10 11.8674 10.0527 11.7402 10.1464 11.6464C10.2402 11.5527 10.3674 11.5 10.5 11.5C10.6326 11.5 10.7598 11.5527 10.8536 11.6464C10.9473 11.7402 11 11.8674 11 12V13.1667C11 13.4761 10.8771 13.7728 10.6583 13.9916C10.4395 14.2104 10.1427 14.3333 9.83333 14.3333H2.83333C2.52391 14.3333 2.22717 14.2104 2.00837 13.9916C1.78958 13.7728 1.66666 13.4761 1.66666 13.1667V6.16666C1.66666 5.85724 1.78958 5.56049 2.00837 5.3417C2.22717 5.12291 2.52391 4.99999 2.83333 4.99999H4C4.13261 4.99999 4.25978 5.05267 4.35355 5.14644C4.44732 5.2402 4.5 5.36738 4.5 5.49999C4.5 5.6326 4.44732 5.75978 4.35355 5.85354C4.25978 5.94731 4.13261 5.99999 4 5.99999H2.83333C2.78913 5.99999 2.74674 6.01755 2.71548 6.04881C2.68422 6.08006 2.66666 6.12245 2.66666 6.16666V13.1667C2.66666 13.2109 2.68422 13.2533 2.71548 13.2845C2.74674 13.3158 2.78913 13.3333 2.83333 13.3333H9.83333C9.87753 13.3333 9.91993 13.3158 9.95118 13.2845C9.98244 13.2533 10 13.2109 10 13.1667V12Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_518_8403">\n <rect width="16" height="16" />\n </clipPath>\n </defs>\n </svg>\n </span>\n <span class=\'').concat(styles.icon, ' copy_success_flag\'>\n <svg\n width="1em"\n height="1em"\n shape-rendering="geometricPrecision"\n fill="currentColor"\n viewBox="0 0 12 7"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M11.2242 0.375687C11.4586 0.610002 11.4586 0.989901 11.2242 1.22422L4.82424 7.62422C4.58992 7.85853 4.21003 7.85853 3.97571 7.62422L0.775712 4.42422C0.541397 4.1899 0.541397 3.81 0.775712 3.57569C1.01003 3.34137 1.38993 3.34137 1.62424 3.57569L4.39998 6.35142L10.3757 0.375687C10.61 0.141373 10.9899 0.141373 11.2242 0.375687Z" />\n </svg>\n </span><span class="copyCode">复制代码</span></p><pre');
1932
1941
  return text;
1933
1942
  });
@@ -2051,7 +2060,7 @@ var CustomerService = function(props) {
2051
2060
  ]
2052
2061
  })
2053
2062
  }),
2054
- showType == 2 || showType == 4 ? /*#__PURE__*/ _jsx("div", {
2063
+ (showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
2055
2064
  className: styles.head_sculpture,
2056
2065
  style: {
2057
2066
  marginLeft: "12px"
@@ -2059,7 +2068,7 @@ var CustomerService = function(props) {
2059
2068
  children: /*#__PURE__*/ _jsx("img", {
2060
2069
  src: userData.avatar
2061
2070
  })
2062
- }) : ""
2071
+ })
2063
2072
  ]
2064
2073
  }, item.id)
2065
2074
  ]
@@ -2120,12 +2129,33 @@ var CustomerService = function(props) {
2120
2129
  /*#__PURE__*/ _jsxs("div", {
2121
2130
  className: styles.content,
2122
2131
  children: [
2123
- /*#__PURE__*/ _jsx("p", {
2132
+ item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
2124
2133
  dangerouslySetInnerHTML: {
2125
2134
  __html: message
2126
2135
  },
2127
2136
  className: styles.content_child
2128
2137
  }),
2138
+ item.message == "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsxs("p", {
2139
+ children: [
2140
+ "AI助手繁忙,请稍后再提问或",
2141
+ /*#__PURE__*/ _jsx("span", {
2142
+ className: styles.find_teacher_con,
2143
+ onClick: function() {
2144
+ var extraInfo = historyMessageList[i - 1].extraInfo;
2145
+ var url = "";
2146
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2147
+ url = JSON.parse(extraInfo)[0].value;
2148
+ }
2149
+ setProblem({
2150
+ question: historyMessageList[i - 1].message,
2151
+ url: url
2152
+ });
2153
+ setShowTeacherList(true);
2154
+ },
2155
+ children: "召唤老师回答"
2156
+ })
2157
+ ]
2158
+ }),
2129
2159
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2130
2160
  className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2131
2161
  children: [
@@ -2171,28 +2201,7 @@ var CustomerService = function(props) {
2171
2201
  ]
2172
2202
  }),
2173
2203
  //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2174
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i),
2175
- //召唤老师回答按钮
2176
- isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
2177
- return item.short == "TeacherAnswer";
2178
- }) && /*#__PURE__*/ _jsx("div", {
2179
- className: "".concat(styles.operate_modal_bottom, " "),
2180
- children: /*#__PURE__*/ _jsx("p", {
2181
- className: styles.stop_findTeacher,
2182
- children: /*#__PURE__*/ _jsx("span", {
2183
- onClick: function() {
2184
- setAnswerMode(-1);
2185
- setTeacherList([]);
2186
- setHistoryMessageList(function(historyMessageList) {
2187
- return historyMessageList.filter(function(item) {
2188
- return item.id != "-1";
2189
- });
2190
- });
2191
- },
2192
- children: "停止召唤老师"
2193
- })
2194
- })
2195
- })
2204
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i)
2196
2205
  ]
2197
2206
  })
2198
2207
  ]
@@ -2238,52 +2247,26 @@ var CustomerService = function(props) {
2238
2247
  if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "messageSource" || extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "isVoteMessage") {
2239
2248
  return "";
2240
2249
  }
2241
- // console.log(historyMessageList,i,'sdcsd;sldcscsdsd')
2242
- //根据上一行数据,判断是否显示招唤老师按钮
2243
- var showTeacherBtn = true;
2244
- var previousLineData = historyMessageList[i - 1];
2245
- if (!previousLineData) {
2246
- showTeacherBtn = true;
2247
- } else if (!previousLineData.extraInfo) {
2248
- showTeacherBtn = true;
2249
- } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2250
- showTeacherBtn = false;
2251
- }
2252
2250
  return /*#__PURE__*/ _jsxs("p", {
2253
2251
  className: styles.operate,
2254
2252
  children: [
2255
2253
  // 不在智能客服窗口,并已经点击了召唤老师,并有召唤老师权限
2256
- isAiChatWindow && answerMode != 1 && userData.modules.some(function(item) {
2254
+ isAiChatWindow && userData.modules.some(function(item) {
2257
2255
  return item.short == "TeacherAnswer";
2258
- }) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2256
+ }) && /*#__PURE__*/ _jsx("span", {
2259
2257
  className: styles.ask_question,
2260
2258
  onClick: function() {
2261
- setAnswerMode(1);
2259
+ console.log(historyMessageList[i - 1], 4444444);
2260
+ var extraInfo = historyMessageList[i - 1].extraInfo;
2261
+ var url = "";
2262
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2263
+ url = JSON.parse(extraInfo)[0].value;
2264
+ }
2262
2265
  setProblem({
2263
2266
  question: historyMessageList[i - 1].message,
2264
- user: problem.user
2267
+ url: url
2265
2268
  });
2266
- setHistoryMessageList(function(historyMessageList) {
2267
- var newHistoryMessageList = historyMessageList.concat({
2268
- id: -1,
2269
- roomId: roomId,
2270
- sender: "AI",
2271
- recevier: mid,
2272
- message: "请告诉我您要召唤的老师名字",
2273
- createdAt: getDataTime(-1),
2274
- findTeacher: true,
2275
- extraInfo: item.extraInfo == null ? null : JSON.stringify([
2276
- {
2277
- key: "questionId",
2278
- value: "questionId"
2279
- }
2280
- ])
2281
- });
2282
- return newHistoryMessageList;
2283
- });
2284
- setTimeout(function() {
2285
- scrollToBottom();
2286
- }, 200);
2269
+ setShowTeacherList(true);
2287
2270
  },
2288
2271
  children: "召唤老师回答"
2289
2272
  }),
@@ -2296,7 +2279,6 @@ var CustomerService = function(props) {
2296
2279
  });
2297
2280
  resettingBottomHei();
2298
2281
  onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
2299
- console.log("引用222222");
2300
2282
  },
2301
2283
  children: /*#__PURE__*/ _jsx(CustomQuote, {})
2302
2284
  }),
@@ -2339,7 +2321,6 @@ var CustomerService = function(props) {
2339
2321
  if (!isAiChatWindow) return;
2340
2322
  //只有最后一条回答,支持发送点赞或踩
2341
2323
  if (!item.upvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
2342
- console.log("判断是AI还是智能问答", item);
2343
2324
  if (!item.extraInfo && item.sender == "AI") {
2344
2325
  aiSendQuestions(1, {
2345
2326
  roomId: roomId,
@@ -2349,7 +2330,6 @@ var CustomerService = function(props) {
2349
2330
  generateUpvoteOrDownvoteMessage: true
2350
2331
  }, 1);
2351
2332
  } else {
2352
- console.log("AI回答2255555");
2353
2333
  sendGreetingMessage(2);
2354
2334
  }
2355
2335
  }
@@ -2407,17 +2387,6 @@ var CustomerService = function(props) {
2407
2387
  if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null)) {
2408
2388
  findTeacherBtn = true;
2409
2389
  }
2410
- //根据上一行数据,判断是否显示招唤老师按钮
2411
- var showTeacherBtn = true;
2412
- var previousLineData = historyMessageList[i - 1];
2413
- if (!previousLineData) {
2414
- showTeacherBtn = true;
2415
- } else if (!previousLineData.extraInfo) {
2416
- showTeacherBtn = true;
2417
- } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2418
- showTeacherBtn = false;
2419
- }
2420
- /// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
2421
2390
  return /*#__PURE__*/ _jsxs("div", {
2422
2391
  className: "".concat(styles.operate_modal_bottom),
2423
2392
  children: [
@@ -2468,35 +2437,19 @@ var CustomerService = function(props) {
2468
2437
  //在ai窗口并ai已经生成完答案
2469
2438
  findTeacherBtn && userData.modules.some(function(item) {
2470
2439
  return item.short == "TeacherAnswer";
2471
- }) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2440
+ }) && /*#__PURE__*/ _jsx("span", {
2472
2441
  className: styles.find_teacher,
2473
2442
  onClick: function() {
2474
- setAnswerMode(1);
2443
+ var extraInfo = historyMessageList[i - 1].extraInfo;
2444
+ var url = "";
2445
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2446
+ url = JSON.parse(extraInfo)[0].value;
2447
+ }
2475
2448
  setProblem({
2476
2449
  question: historyMessageList[i - 1].message,
2477
- user: problem.user
2450
+ url: url
2478
2451
  });
2479
- setHistoryMessageList(function(historyMessageList) {
2480
- var newHistoryMessageList = historyMessageList.concat({
2481
- id: -1,
2482
- roomId: roomId,
2483
- sender: "AI",
2484
- recevier: mid,
2485
- message: "请告诉我您要召唤的老师名字",
2486
- createdAt: getDataTime(-1),
2487
- findTeacher: true,
2488
- extraInfo: item.extraInfo == null ? null : JSON.stringify([
2489
- {
2490
- key: "questionId",
2491
- value: "questionId"
2492
- }
2493
- ])
2494
- });
2495
- return newHistoryMessageList;
2496
- });
2497
- setTimeout(function() {
2498
- scrollToBottom();
2499
- }, 200);
2452
+ setShowTeacherList(true);
2500
2453
  },
2501
2454
  children: "召唤老师回答"
2502
2455
  })
@@ -2648,6 +2601,44 @@ var CustomerService = function(props) {
2648
2601
  }
2649
2602
  }
2650
2603
  };
2604
+ //发送截图信息
2605
+ var sendScreenshotData = function(message) {
2606
+ if (contactsList.length > 0 && contactsList[0].roomId == roomId) {
2607
+ setHistoryMessageList(function(historyMessageList) {
2608
+ var newHistoryMessageList = historyMessageList.concat({
2609
+ id: "p" + new Date().getTime(),
2610
+ roomId: roomId,
2611
+ sender: mid,
2612
+ recevier: "AI",
2613
+ message: message,
2614
+ createdAt: getDataTime(-1),
2615
+ extraInfo: JSON.stringify([
2616
+ {
2617
+ key: "imageUrl",
2618
+ value: screenshotBese64
2619
+ }
2620
+ ])
2621
+ });
2622
+ return newHistoryMessageList;
2623
+ });
2624
+ //ai窗口
2625
+ aiSendQuestions(3, {
2626
+ //相关数据
2627
+ roomId: roomId,
2628
+ message: message,
2629
+ image: screenshotBese64,
2630
+ quotedMessage: citationContent.content || "",
2631
+ regenerate: citationContent.content != "" ? false : true,
2632
+ generateUpvoteOrDownvoteMessage: false
2633
+ }, 1);
2634
+ setScreenshotBese64("");
2635
+ } else {
2636
+ //老师窗口
2637
+ sendToTeacher(3, message);
2638
+ }
2639
+ scrollToBottom();
2640
+ resettingBottomHei();
2641
+ };
2651
2642
  //渲染底部按钮
2652
2643
  var renderBottomAnt = function() {
2653
2644
  var placeholder = "";
@@ -2707,35 +2698,7 @@ var CustomerService = function(props) {
2707
2698
  children: [
2708
2699
  /*#__PURE__*/ _jsxs("p", {
2709
2700
  onClick: function() {
2710
- setHistoryMessageList(function(historyMessageList) {
2711
- var newHistoryMessageList = historyMessageList.concat({
2712
- id: "p" + new Date().getTime(),
2713
- roomId: roomId,
2714
- sender: mid,
2715
- recevier: "AI",
2716
- message: "讲解这张图片涉及到的知识内容",
2717
- createdAt: getDataTime(-1),
2718
- extraInfo: JSON.stringify([
2719
- {
2720
- key: "imageUrl",
2721
- value: screenshotBese64
2722
- }
2723
- ])
2724
- });
2725
- return newHistoryMessageList;
2726
- });
2727
- scrollToBottom();
2728
- aiSendQuestions(3, {
2729
- //相关数据
2730
- roomId: roomId,
2731
- message: "讲解这张图片涉及到的知识内容",
2732
- image: screenshotBese64,
2733
- quotedMessage: citationContent.content || "",
2734
- regenerate: citationContent.content != "" ? false : true,
2735
- generateUpvoteOrDownvoteMessage: false
2736
- }, 1);
2737
- setScreenshotBese64("");
2738
- resettingBottomHei();
2701
+ sendScreenshotData("讲解这张图片涉及到的知识内容");
2739
2702
  },
2740
2703
  children: [
2741
2704
  /*#__PURE__*/ _jsx(CustomKnowledgeContent, {}),
@@ -2745,35 +2708,7 @@ var CustomerService = function(props) {
2745
2708
  /*#__PURE__*/ _jsx("br", {}),
2746
2709
  /*#__PURE__*/ _jsxs("p", {
2747
2710
  onClick: function() {
2748
- setHistoryMessageList(function(historyMessageList) {
2749
- var newHistoryMessageList = historyMessageList.concat({
2750
- id: "p" + new Date().getTime(),
2751
- roomId: roomId,
2752
- sender: mid,
2753
- recevier: "AI",
2754
- message: "帮助我更深入地理解图片中的概念",
2755
- createdAt: getDataTime(-1),
2756
- extraInfo: JSON.stringify([
2757
- {
2758
- key: "imageUrl",
2759
- value: screenshotBese64
2760
- }
2761
- ])
2762
- });
2763
- return newHistoryMessageList;
2764
- });
2765
- scrollToBottom();
2766
- aiSendQuestions(3, {
2767
- //相关数据
2768
- roomId: roomId,
2769
- message: "帮助我更深入地理解图片中的概念",
2770
- image: screenshotBese64,
2771
- quotedMessage: citationContent.content || "",
2772
- regenerate: citationContent.content != "" ? false : true,
2773
- generateUpvoteOrDownvoteMessage: false
2774
- }, 1);
2775
- setScreenshotBese64("");
2776
- resettingBottomHei();
2711
+ sendScreenshotData("帮助我更深入地理解图片中的概念");
2777
2712
  },
2778
2713
  children: [
2779
2714
  /*#__PURE__*/ _jsx(CustomWenhaoRound, {}),
@@ -2795,22 +2730,14 @@ var CustomerService = function(props) {
2795
2730
  setKeyWord(e.target.value);
2796
2731
  if (e.target.value == "") {
2797
2732
  setQuestionsList([]);
2798
- setTeacherList([]);
2799
2733
  clearTimeout(timer.current);
2800
2734
  } else {
2801
2735
  clearTimeout(timer.current);
2802
2736
  timer.current = setTimeout(function() {
2803
- if (answerMode == 1) {
2804
- getTeacherList(String(e.target.value));
2737
+ if (config && config.type == "video") {
2738
+ getQuestiionsList(String(e.target.value), 3);
2805
2739
  } else {
2806
- var roomList = contactsList;
2807
- if (roomList.length > 0 && roomList[0].roomId != roomId) return;
2808
- console.log(props, 333333);
2809
- if (config && config.type == "video") {
2810
- getQuestiionsList(String(e.target.value), 3);
2811
- } else {
2812
- getQuestiionsList(String(e.target.value), 2);
2813
- }
2740
+ getQuestiionsList(String(e.target.value), 2);
2814
2741
  }
2815
2742
  }, 1000);
2816
2743
  }
@@ -2827,44 +2754,21 @@ var CustomerService = function(props) {
2827
2754
  setKeyWord("");
2828
2755
  setCitationContent({});
2829
2756
  setBottomRecommendationQuestions([]);
2830
- resettingBottomHei();
2831
- //查找是否是召唤老师回答并有相应的老师名称
2832
- if (answerMode == 1 && teacherList.length > 0) {
2833
- var list = teacherList.filter(function(v) {
2834
- return v.name == keyWord.trim();
2835
- });
2836
- if (list.length > 0) {
2837
- //直接进入召唤老师回答模式
2838
- enterTeacherChat(list[0]);
2839
- setButtomHei(45);
2840
- return;
2841
- }
2842
- }
2843
2757
  //跟老师对话
2844
- var roomList = contactsList;
2845
- if (roomList.length > 0 && roomList[0].roomId != roomId) {
2758
+ if (contactsList.length > 0 && contactsList[0].roomId != roomId) {
2846
2759
  sendToTeacher(2);
2847
2760
  } else {
2848
2761
  setFinished(false);
2849
- clearTimeout(timer.current);
2850
2762
  setQuestionsList([]);
2851
- setAnswerMode(-1);
2852
- setTeacherList([]);
2853
- setTimeout(function() {
2854
- setQuestionsList([]);
2855
- setTeacherList([]);
2856
- clearTimeout(timer.current);
2857
- }, 200);
2858
- setHistoryMessageList(function(historyMessageList) {
2859
- return historyMessageList.filter(function(item) {
2860
- return item.id != "-1";
2861
- });
2862
- });
2863
2763
  sendMessage("", 0);
2864
2764
  }
2765
+ setTimeout(function() {
2766
+ setQuestionsList([]);
2767
+ clearTimeout(timer.current);
2768
+ }, 200);
2769
+ resettingBottomHei();
2865
2770
  setButtomHei(45);
2866
2771
  } else {
2867
- console.log("回车事件");
2868
2772
  resettingBottomHei();
2869
2773
  }
2870
2774
  },
@@ -2898,9 +2802,9 @@ var CustomerService = function(props) {
2898
2802
  })
2899
2803
  ]
2900
2804
  }),
2901
- userData.modules.some(function(item) {
2805
+ (userData.modules.some(function(item) {
2902
2806
  return item.short == "AIservice";
2903
- }) && contactsList.length > 0 && contactsList[0].roomId == roomId && /*#__PURE__*/ _jsx("p", {
2807
+ }) || contactsList.length > 0 && contactsList[0].roomId !== roomId) && /*#__PURE__*/ _jsx("p", {
2904
2808
  className: styles.screenshot,
2905
2809
  children: /*#__PURE__*/ _jsx("i", {
2906
2810
  className: "".concat(!finished ? styles.disabled : ""),
@@ -2927,40 +2831,20 @@ var CustomerService = function(props) {
2927
2831
  setCitationContent({});
2928
2832
  setButtomHei(45);
2929
2833
  if (keyWord.trim() != "") {
2930
- //查找是否是召唤老师回答并有相应的老师名称
2931
- if (answerMode == 1 && teacherList.length > 0) {
2932
- var list = teacherList.filter(function(v) {
2933
- return v.name == keyWord.trim();
2934
- });
2935
- if (list.length > 0) {
2936
- //直接进入召唤老师回答模式
2937
- enterTeacherChat(list[0]);
2938
- setButtomHei(45);
2939
- return;
2940
- }
2941
- }
2942
2834
  setKeyWord("");
2943
2835
  //跟老师对话
2944
- var roomList = contactsList;
2945
- if (roomList.length > 0 && roomList[0].roomId != roomId) {
2836
+ if (contactsList.length > 0 && contactsList[0].roomId != roomId) {
2946
2837
  sendToTeacher(2);
2947
2838
  } else {
2948
2839
  clearTimeout(timer.current);
2949
2840
  setQuestionsList([]);
2950
- setAnswerMode(-1);
2951
- setTeacherList([]);
2952
- setTimeout(function() {
2953
- setQuestionsList([]);
2954
- setTeacherList([]);
2955
- clearTimeout(timer.current);
2956
- }, 200);
2957
- setHistoryMessageList(function(historyMessageList) {
2958
- return historyMessageList.filter(function(item) {
2959
- return item.id != "-1";
2960
- });
2961
- });
2962
2841
  sendMessage("", 0);
2963
2842
  }
2843
+ resettingBottomHei();
2844
+ setTimeout(function() {
2845
+ setQuestionsList([]);
2846
+ clearTimeout(timer.current);
2847
+ }, 200);
2964
2848
  onEvent(serverName + serverUrl(), "click_智能问答_ Enter", "提交");
2965
2849
  }
2966
2850
  },
@@ -2972,15 +2856,12 @@ var CustomerService = function(props) {
2972
2856
  };
2973
2857
  //进入与老师的聊天
2974
2858
  var enterTeacherChat = function(item) {
2975
- setTeacherList([]);
2859
+ setShowTeacherList(false);
2976
2860
  //提问的问题
2977
- setProblem({
2861
+ setProblem(_object_spread_props(_object_spread({}, problem), {
2978
2862
  question: problem.question,
2979
2863
  user: item.uid
2980
- });
2981
- setKeyWord("");
2982
- //setUpdateRecords(true);
2983
- setAnswerMode(-1);
2864
+ }));
2984
2865
  setChatWith(item);
2985
2866
  var roomList = contactsList;
2986
2867
  var list = roomList.filter(function(e) {
@@ -2991,7 +2872,6 @@ var CustomerService = function(props) {
2991
2872
  setRoomId(list[0].roomId); //已有聊天室
2992
2873
  } else {
2993
2874
  createRooms(item.uid).then(function(res) {
2994
- // childRef.current.roomsListTimer();
2995
2875
  roomsListTimer();
2996
2876
  var id = res.data.id;
2997
2877
  setRoomId(id); //新的聊天室id
@@ -3000,82 +2880,47 @@ var CustomerService = function(props) {
3000
2880
  };
3001
2881
  //渲染联想问题及联想的老师名称
3002
2882
  var renderAssociationProblem = function() {
3003
- if (answerMode == 1) {
3004
- return /*#__PURE__*/ _jsx("div", {
3005
- className: "".concat(styles.issues_list, " ").concat(styles.issues_list_teacherList),
3006
- style: {
3007
- bottom: "".concat(buttomHei + 14, "px")
3008
- },
3009
- children: teacherList.map(function(item) {
3010
- var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
3011
- var span = "";
3012
- //搜索内容是否有特殊字符
3013
- if (reg.test(keyWord)) {
3014
- span = item.name.replaceAll(keyWord, function(e) {
3015
- return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
3016
- });
3017
- } else {
3018
- span = item.name.replaceAll(new RegExp(keyWord, "ig"), function(i) {
3019
- // console.log(i,'skdcnsdjk')
3020
- return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
3021
- });
3022
- }
2883
+ return /*#__PURE__*/ _jsx("div", {
2884
+ className: styles.issues_list,
2885
+ style: {
2886
+ bottom: "".concat(buttomHei + 6, "px")
2887
+ },
2888
+ children: questionsList.map(function(item, i) {
2889
+ if (i > 4) return "";
2890
+ var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
2891
+ var span = "";
2892
+ //搜索内容是否有特殊字符
2893
+ if (reg.test(keyWord)) {
2894
+ span = item.question.replaceAll(keyWord, function(e) {
2895
+ return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
2896
+ });
2897
+ } else {
2898
+ span = item.question.replaceAll(new RegExp(keyWord, "ig"), function(i) {
2899
+ // console.log(i,'skdcnsdjk')
2900
+ return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
2901
+ });
2902
+ }
2903
+ if (userData.modules.some(function(item) {
2904
+ return item.short == "AIservice";
2905
+ }) || item.answer) {
3023
2906
  return /*#__PURE__*/ _jsx("p", {
3024
2907
  className: styles.item,
3025
2908
  children: /*#__PURE__*/ _jsx("span", {
3026
2909
  onClick: function() {
3027
- enterTeacherChat(item);
2910
+ sendMessage(item, 2, "AssociativeProblem");
2911
+ setKeyWord("");
2912
+ onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
3028
2913
  },
3029
2914
  dangerouslySetInnerHTML: {
3030
2915
  __html: span
3031
2916
  }
3032
2917
  })
3033
2918
  });
3034
- })
3035
- });
3036
- } else {
3037
- return /*#__PURE__*/ _jsx("div", {
3038
- className: styles.issues_list,
3039
- style: {
3040
- bottom: "".concat(buttomHei + 6, "px")
3041
- },
3042
- children: questionsList.map(function(item, i) {
3043
- if (i > 4) return "";
3044
- var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
3045
- var span = "";
3046
- //搜索内容是否有特殊字符
3047
- if (reg.test(keyWord)) {
3048
- span = item.question.replaceAll(keyWord, function(e) {
3049
- return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
3050
- });
3051
- } else {
3052
- span = item.question.replaceAll(new RegExp(keyWord, "ig"), function(i) {
3053
- // console.log(i,'skdcnsdjk')
3054
- return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
3055
- });
3056
- }
3057
- if (userData.modules.some(function(item) {
3058
- return item.short == "AIservice";
3059
- }) || item.answer) {
3060
- return /*#__PURE__*/ _jsx("p", {
3061
- className: styles.item,
3062
- children: /*#__PURE__*/ _jsx("span", {
3063
- onClick: function() {
3064
- sendMessage(item, 2, "AssociativeProblem");
3065
- setKeyWord("");
3066
- onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
3067
- },
3068
- dangerouslySetInnerHTML: {
3069
- __html: span
3070
- }
3071
- })
3072
- });
3073
- } else {
3074
- return null;
3075
- }
3076
- })
3077
- });
3078
- }
2919
+ } else {
2920
+ return null;
2921
+ }
2922
+ })
2923
+ });
3079
2924
  };
3080
2925
  //视频页面底部推荐问题
3081
2926
  var renderBottomAssociationProblem = function() {
@@ -3179,7 +3024,7 @@ var CustomerService = function(props) {
3179
3024
  mask: false,
3180
3025
  rootClassName: styles.service_ChatWindow_Drawer,
3181
3026
  children: [
3182
- showType == 1 && /*#__PURE__*/ _jsx("div", {
3027
+ showType == 1 && !showScreenshot && /*#__PURE__*/ _jsx("div", {
3183
3028
  style: {
3184
3029
  display: "".concat(showContacts && roomId != "" ? "block" : "none")
3185
3030
  },
@@ -3251,6 +3096,16 @@ var CustomerService = function(props) {
3251
3096
  setShowHistory(false);
3252
3097
  },
3253
3098
  loadSpecifiedData: loadSpecifiedData
3099
+ }),
3100
+ showType == 1 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
3101
+ type: showType,
3102
+ userData: userData,
3103
+ http: http,
3104
+ urllocation: urllocation,
3105
+ onClose: function() {
3106
+ setShowTeacherList(false);
3107
+ },
3108
+ enterTeacherChat: enterTeacherChat
3254
3109
  })
3255
3110
  ]
3256
3111
  }),
@@ -3338,6 +3193,16 @@ var CustomerService = function(props) {
3338
3193
  setShowHistory(false);
3339
3194
  },
3340
3195
  loadSpecifiedData: loadSpecifiedData
3196
+ }),
3197
+ showType == 2 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
3198
+ type: showType,
3199
+ userData: userData,
3200
+ http: http,
3201
+ urllocation: urllocation,
3202
+ onClose: function() {
3203
+ setShowTeacherList(false);
3204
+ },
3205
+ enterTeacherChat: enterTeacherChat
3341
3206
  })
3342
3207
  ]
3343
3208
  })
@@ -3435,6 +3300,16 @@ var CustomerService = function(props) {
3435
3300
  },
3436
3301
  loadSpecifiedData: loadSpecifiedData
3437
3302
  }),
3303
+ showType == 3 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
3304
+ type: showType,
3305
+ userData: userData,
3306
+ http: http,
3307
+ urllocation: urllocation,
3308
+ onClose: function() {
3309
+ setShowTeacherList(false);
3310
+ },
3311
+ enterTeacherChat: enterTeacherChat
3312
+ }),
3438
3313
  showType == 3 && /*#__PURE__*/ _jsx("div", {
3439
3314
  style: {
3440
3315
  display: "".concat(showType == 3 && showContacts && roomId != "" ? "block" : "none")
@@ -3542,6 +3417,16 @@ var CustomerService = function(props) {
3542
3417
  setShowHistory(false);
3543
3418
  },
3544
3419
  loadSpecifiedData: loadSpecifiedData
3420
+ }),
3421
+ showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
3422
+ type: showType,
3423
+ userData: userData,
3424
+ http: http,
3425
+ urllocation: urllocation,
3426
+ onClose: function() {
3427
+ setShowTeacherList(false);
3428
+ },
3429
+ enterTeacherChat: enterTeacherChat
3545
3430
  })
3546
3431
  ]
3547
3432
  })
@@ -3649,6 +3534,7 @@ var CustomerService = function(props) {
3649
3534
  (showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
3650
3535
  imgBese64: imgBese64,
3651
3536
  saveScreenshotBese64: function(base64) {
3537
+ newShowType.current = false;
3652
3538
  setScreenshotBese64(base64);
3653
3539
  if (saveShowType != -1) {
3654
3540
  setShowType(saveShowType);
@@ -3658,6 +3544,7 @@ var CustomerService = function(props) {
3658
3544
  setShowScreenshot(false);
3659
3545
  },
3660
3546
  cancelScreenshot: function() {
3547
+ newShowType.current = false;
3661
3548
  if (saveShowType != -1) {
3662
3549
  setShowType(saveShowType);
3663
3550
  } else {