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.
@@ -1,5 +1,5 @@
1
- import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, y as Remarkable, D as Drawer, H as HighlightJS } from './769f0c13.esm.es5.development.js';
2
- export { A as Affix, B as Alert, F as Anchor, aA as App, G as AutoComplete, J as Avatar, N as BackTop, O as Badge, Q as Breadcrumb, U as Button, V as Calendar, W as Card, X as Carousel, Y as Cascader, Z as Checkbox, $ as Col, a0 as Collapse, a1 as DatePicker, a2 as Descriptions, a3 as Divider, D as Drawer, a4 as Dropdown, a5 as Empty, K as FloatButton, a6 as Form, a7 as Grid, a8 as Image, v as Input, a9 as InputNumber, aa as Layout, ab as List, ac as Mentions, ad as Menu, M as Modal, af as Popconfirm, ag as Popover, ah as Progress, aH as QRCode, ai as Radio, aj as Rate, ak as Result, al as Row, am as Segmented, g as Select, an as Skeleton, ao as Slider, ap as Space, aq as Spin, ar as Statistic, as as Steps, at as Switch, au as Tabs, av as Tag, ax as TimePicker, ay as Timeline, T as Tooltip, az as Tour, aB as Transfer, aC as Tree, aD as TreeSelect, aE as Typography, aF as Upload, aG as Watermark, aJ as en_US, ae as notification, aw as theme, aI as version, z as zh_CN } from './769f0c13.esm.es5.development.js';
1
+ import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, y as Remarkable, D as Drawer, H as HighlightJS } from './86a6ab15.esm.es5.development.js';
2
+ export { A as Affix, B as Alert, F as Anchor, aA as App, G as AutoComplete, J as Avatar, N as BackTop, O as Badge, Q as Breadcrumb, U as Button, V as Calendar, W as Card, X as Carousel, Y as Cascader, Z as Checkbox, $ as Col, a0 as Collapse, a1 as DatePicker, a2 as Descriptions, a3 as Divider, D as Drawer, a4 as Dropdown, a5 as Empty, K as FloatButton, a6 as Form, a7 as Grid, a8 as Image, v as Input, a9 as InputNumber, aa as Layout, ab as List, ac as Mentions, ad as Menu, M as Modal, af as Popconfirm, ag as Popover, ah as Progress, aH as QRCode, ai as Radio, aj as Rate, ak as Result, al as Row, am as Segmented, g as Select, an as Skeleton, ao as Slider, ap as Space, aq as Spin, ar as Statistic, as as Steps, at as Switch, au as Tabs, av as Tag, ax as TimePicker, ay as Timeline, T as Tooltip, az as Tour, aB as Transfer, aC as Tree, aD as TreeSelect, aE as Typography, aF as Upload, aG as Watermark, aJ as en_US, ae as notification, aw as theme, aI as version, z as zh_CN } from './86a6ab15.esm.es5.development.js';
3
3
  import * as React from 'react';
4
4
  import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
5
5
  import { Fragment } from 'react/jsx-runtime';
@@ -2332,7 +2332,7 @@ function BhdAppLayout(props) {
2332
2332
  });
2333
2333
  }
2334
2334
 
2335
- var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__c8b380c0","ChatWindow_Modal":"index_module_ChatWindow_Modal__c8b380c0","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__c8b380c0","header_wrap":"index_module_header_wrap__c8b380c0","top":"index_module_top__c8b380c0","user":"index_module_user__c8b380c0","count":"index_module_count__c8b380c0","operate":"index_module_operate__c8b380c0","line":"index_module_line__c8b380c0","header_wrap_newlabo":"index_module_header_wrap_newlabo__c8b380c0","Drawer_main":"index_module_Drawer_main__c8b380c0","loading":"index_module_loading__c8b380c0","message_con":"index_module_message_con__c8b380c0","left":"index_module_left__c8b380c0","head_sculpture":"index_module_head_sculpture__c8b380c0","main_content":"index_module_main_content__c8b380c0","right":"index_module_right__c8b380c0","main":"index_module_main__c8b380c0","main_content_flag":"index_module_main_content_flag__c8b380c0","operate_modal":"index_module_operate_modal__c8b380c0","content":"index_module_content__c8b380c0","content_child":"index_module_content_child__c8b380c0","active":"index_module_active__c8b380c0","ask_question":"index_module_ask_question__c8b380c0","operate_modal_bottom":"index_module_operate_modal_bottom__c8b380c0","stop_generate":"index_module_stop_generate__c8b380c0","icon":"index_module_icon__c8b380c0","find_teacher":"index_module_find_teacher__c8b380c0","stop_findTeacher":"index_module_stop_findTeacher__c8b380c0","association_problem":"index_module_association_problem__c8b380c0","time":"index_module_time__c8b380c0","citation_content":"index_module_citation_content__c8b380c0","text_exceed":"index_module_text_exceed__c8b380c0","popover_content":"index_module_popover_content__c8b380c0","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__c8b380c0","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__c8b380c0","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__c8b380c0","issues_list_teacherList":"index_module_issues_list_teacherList__c8b380c0","item":"index_module_item__c8b380c0","issues_list":"index_module_issues_list__c8b380c0","sign":"index_module_sign__c8b380c0","Drawer_buttom":"index_module_Drawer_buttom__c8b380c0","input_wrap":"index_module_input_wrap__c8b380c0","input":"index_module_input__c8b380c0","no_AI":"index_module_no_AI__c8b380c0","voice":"index_module_voice__c8b380c0","voice_btn":"index_module_voice_btn__c8b380c0","disabled":"index_module_disabled__c8b380c0","content_main":"index_module_content_main__c8b380c0","content_con":"index_module_content_con__c8b380c0","delete_quote":"index_module_delete_quote__c8b380c0","sending":"index_module_sending__c8b380c0","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__c8b380c0","main_list":"index_module_main_list__c8b380c0","chat_content":"index_module_chat_content__c8b380c0","popover_main_content":"index_module_popover_main_content__c8b380c0","popover_main_content_name":"index_module_popover_main_content_name__c8b380c0","teacher_layout":"index_module_teacher_layout__c8b380c0","bottom":"index_module_bottom__c8b380c0","delete":"index_module_delete__c8b380c0","num":"index_module_num__c8b380c0","shrink":"index_module_shrink__c8b380c0","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__c8b380c0","teacher_layout_modal":"index_module_teacher_layout_modal__c8b380c0","ai":"index_module_ai__c8b380c0","user_info":"index_module_user_info__c8b380c0","message":"index_module_message__c8b380c0","con":"index_module_con__c8b380c0","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__c8b380c0","history_list":"index_module_history_list__c8b380c0","search_layout":"index_module_search_layout__c8b380c0","mymove":"index_module_mymove__c8b380c0","title":"index_module_title__c8b380c0","search_top":"index_module_search_top__c8b380c0","list_item":"index_module_list_item__c8b380c0","list_summary":"index_module_list_summary__c8b380c0","head_img":"index_module_head_img__c8b380c0","list_desc":"index_module_list_desc__c8b380c0","name":"index_module_name__c8b380c0","decs":"index_module_decs__c8b380c0","open":"index_module_open__c8b380c0","list_detail":"index_module_list_detail__c8b380c0","list":"index_module_list__c8b380c0","list_more":"index_module_list_more__c8b380c0","no_data":"index_module_no_data__c8b380c0","history_list_broadside":"index_module_history_list_broadside__c8b380c0"};
2335
+ var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__1c3a52cb","ChatWindow_Modal":"index_module_ChatWindow_Modal__1c3a52cb","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__1c3a52cb","header_wrap":"index_module_header_wrap__1c3a52cb","top":"index_module_top__1c3a52cb","user":"index_module_user__1c3a52cb","count":"index_module_count__1c3a52cb","operate":"index_module_operate__1c3a52cb","line":"index_module_line__1c3a52cb","header_wrap_newlabo":"index_module_header_wrap_newlabo__1c3a52cb","Drawer_main":"index_module_Drawer_main__1c3a52cb","loading":"index_module_loading__1c3a52cb","message_con":"index_module_message_con__1c3a52cb","left":"index_module_left__1c3a52cb","head_sculpture":"index_module_head_sculpture__1c3a52cb","main_content":"index_module_main_content__1c3a52cb","right":"index_module_right__1c3a52cb","main":"index_module_main__1c3a52cb","main_content_flag":"index_module_main_content_flag__1c3a52cb","operate_modal":"index_module_operate_modal__1c3a52cb","content":"index_module_content__1c3a52cb","content_child":"index_module_content_child__1c3a52cb","sign":"index_module_sign__1c3a52cb","active":"index_module_active__1c3a52cb","ask_question":"index_module_ask_question__1c3a52cb","operate_modal_bottom":"index_module_operate_modal_bottom__1c3a52cb","stop_generate":"index_module_stop_generate__1c3a52cb","icon":"index_module_icon__1c3a52cb","find_teacher":"index_module_find_teacher__1c3a52cb","stop_findTeacher":"index_module_stop_findTeacher__1c3a52cb","association_problem":"index_module_association_problem__1c3a52cb","time":"index_module_time__1c3a52cb","citation_content":"index_module_citation_content__1c3a52cb","text_exceed":"index_module_text_exceed__1c3a52cb","popover_content":"index_module_popover_content__1c3a52cb","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__1c3a52cb","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__1c3a52cb","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__1c3a52cb","issues_list_teacherList":"index_module_issues_list_teacherList__1c3a52cb","item":"index_module_item__1c3a52cb","issues_list":"index_module_issues_list__1c3a52cb","Drawer_buttom":"index_module_Drawer_buttom__1c3a52cb","input_wrap":"index_module_input_wrap__1c3a52cb","input":"index_module_input__1c3a52cb","no_AI":"index_module_no_AI__1c3a52cb","voice":"index_module_voice__1c3a52cb","voice_btn":"index_module_voice_btn__1c3a52cb","disabled":"index_module_disabled__1c3a52cb","content_main":"index_module_content_main__1c3a52cb","content_con":"index_module_content_con__1c3a52cb","delete_quote":"index_module_delete_quote__1c3a52cb","sending":"index_module_sending__1c3a52cb","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__1c3a52cb","main_list":"index_module_main_list__1c3a52cb","chat_content":"index_module_chat_content__1c3a52cb","popover_main_content":"index_module_popover_main_content__1c3a52cb","popover_main_content_name":"index_module_popover_main_content_name__1c3a52cb","teacher_layout":"index_module_teacher_layout__1c3a52cb","bottom":"index_module_bottom__1c3a52cb","delete":"index_module_delete__1c3a52cb","num":"index_module_num__1c3a52cb","shrink":"index_module_shrink__1c3a52cb","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__1c3a52cb","teacher_layout_modal":"index_module_teacher_layout_modal__1c3a52cb","ai":"index_module_ai__1c3a52cb","user_info":"index_module_user_info__1c3a52cb","message":"index_module_message__1c3a52cb","con":"index_module_con__1c3a52cb","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__1c3a52cb","history_list":"index_module_history_list__1c3a52cb","search_layout":"index_module_search_layout__1c3a52cb","mymove":"index_module_mymove__1c3a52cb","title":"index_module_title__1c3a52cb","search_top":"index_module_search_top__1c3a52cb","list_item":"index_module_list_item__1c3a52cb","list_summary":"index_module_list_summary__1c3a52cb","head_img":"index_module_head_img__1c3a52cb","list_desc":"index_module_list_desc__1c3a52cb","name":"index_module_name__1c3a52cb","decs":"index_module_decs__1c3a52cb","open":"index_module_open__1c3a52cb","list_summary_active":"index_module_list_summary_active__1c3a52cb","list_detail":"index_module_list_detail__1c3a52cb","list":"index_module_list__1c3a52cb","list_more":"index_module_list_more__1c3a52cb","no_data":"index_module_no_data__1c3a52cb","history_list_broadside":"index_module_history_list_broadside__1c3a52cb"};
2336
2336
 
2337
2337
  //消息已读
2338
2338
  var readMessage = function(roomId, urllocation, userData, http) {
@@ -2526,7 +2526,7 @@ var HistoryFun = function(props) {
2526
2526
  pageNumber = 1;
2527
2527
  }
2528
2528
  console.log(roomId, pageNumber, id, receiver, "第几页第几页第几页第几页第几页第几页");
2529
- loadSpecifiedData(roomId, pageNumber, id, receiver);
2529
+ loadSpecifiedData(roomId, pageNumber, id, receiver, keyWordProblem);
2530
2530
  onClose();
2531
2531
  setKeyWordProblem("");
2532
2532
  setTotalData([]);
@@ -2793,7 +2793,7 @@ var HistoryFun = function(props) {
2793
2793
  return /*#__PURE__*/ jsxs(Fragment, {
2794
2794
  children: [
2795
2795
  /*#__PURE__*/ jsxs("div", {
2796
- className: modules_63b47c51.list_summary,
2796
+ className: "".concat(modules_63b47c51.list_summary, " ").concat(item.show ? modules_63b47c51.list_summary_active : ""),
2797
2797
  id: item.roomId,
2798
2798
  onClick: function() {
2799
2799
  if (item.count == 1) {
@@ -3288,9 +3288,9 @@ var CustomerService = function(props) {
3288
3288
  var _useState22 = _sliced_to_array(useState(-1), 2), answerMode = _useState22[0], setAnswerMode = _useState22[1]; //设置回答模式。1,召唤老师回答
3289
3289
  var _useState23 = _sliced_to_array(useState([]), 2), teacherList = _useState23[0], setTeacherList = _useState23[1]; //老师列表
3290
3290
  var _useState24 = _sliced_to_array(useState({}), 2), problem = _useState24[0], setProblem = _useState24[1]; //召唤老师回答的问题
3291
- // const [roomList,setRoomList] = useState([]);//聊天列表
3292
3291
  var _useState25 = _sliced_to_array(useState([]), 2), contactsList = _useState25[0], setContactsList = _useState25[1]; //老师列表
3293
3292
  var _useState26 = _sliced_to_array(useState([]), 2), chatObj = _useState26[0], setChatObj = _useState26[1]; //聊天记录id保存,用来在实验报告中记录
3293
+ var _useState27 = _sliced_to_array(useState(""), 2), keyWordProblem = _useState27[0], setKeyWordProblem = _useState27[1]; //历史记录搜索的内容
3294
3294
  var timer = useRef(null); //文本框输入时
3295
3295
  var receiveMessageTimer = useRef(null); //接收ai发回的消息
3296
3296
  var voiceCountdownTimer = useRef(null); //语音录制倒计时
@@ -3490,28 +3490,48 @@ var CustomerService = function(props) {
3490
3490
  var questionsList = [];
3491
3491
  var obj = {};
3492
3492
  if (type == 1) {
3493
- questionsList = hotQuestionsList.map(function(item, index) {
3494
- if (index < 3) {
3495
- return {
3496
- key: "messageSource",
3497
- value: item.id,
3498
- question: item.question,
3499
- answer: item.answer
3500
- };
3501
- } else {
3502
- return null;
3503
- }
3504
- });
3505
- questionsList = questionsList.filter(function(i) {
3506
- return i != null;
3507
- });
3493
+ // questionsList = hotQuestionsList.map((item, index) => {
3494
+ // if (index < 3) {
3495
+ // return {
3496
+ // key: "messageSource",
3497
+ // value: item.id,
3498
+ // question: item.question,
3499
+ // answer: item.answer,
3500
+ // };
3501
+ // } else {
3502
+ // return null;
3503
+ // }
3504
+ // });
3505
+ // questionsList = questionsList.filter((i) => i != null);
3508
3506
  obj = {
3509
3507
  roomId: roomId,
3510
3508
  sender: "AI",
3511
3509
  recevier: mid,
3512
- message: "Hi!我是有问必答的实训云智能客服,请问您遇到了什么问题?",
3513
- extraInfos: questionsList
3510
+ message: "Hi!我是有问必答的实训云智能客服,请问您遇到了什么问题?"
3514
3511
  };
3512
+ if (pageNumHistory <= 1) {
3513
+ setHistoryMessageList(function(historyMessageList) {
3514
+ var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
3515
+ id: new Date().getTime() + "dede",
3516
+ upvoted: false,
3517
+ downvoted: false,
3518
+ quotedMessage: "",
3519
+ createdAt: getDataTime(-1),
3520
+ // extraInfo: JSON.stringify(obj.extraInfos),
3521
+ extraInfo: JSON.stringify([
3522
+ {
3523
+ key: "messageSource",
3524
+ value: "knowledgebase"
3525
+ }
3526
+ ])
3527
+ }));
3528
+ return newHistoryMessageList;
3529
+ });
3530
+ setTimeout(function() {
3531
+ scrollToBottom();
3532
+ }, 100);
3533
+ }
3534
+ return;
3515
3535
  } else if (type == 2) {
3516
3536
  obj = {
3517
3537
  roomId: roomId,
@@ -3586,6 +3606,23 @@ var CustomerService = function(props) {
3586
3606
  message: "猜你想问:",
3587
3607
  extraInfos: questionsList
3588
3608
  };
3609
+ if (pageNumHistory <= 1) {
3610
+ setHistoryMessageList(function(historyMessageList) {
3611
+ var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
3612
+ id: "p" + new Date().getTime(),
3613
+ upvoted: false,
3614
+ downvoted: false,
3615
+ quotedMessage: "",
3616
+ createdAt: getDataTime(-1),
3617
+ extraInfo: JSON.stringify(obj.extraInfos)
3618
+ }));
3619
+ return newHistoryMessageList;
3620
+ });
3621
+ setTimeout(function() {
3622
+ scrollToBottom();
3623
+ }, 100);
3624
+ }
3625
+ return;
3589
3626
  }
3590
3627
  setKeyWord("");
3591
3628
  setQuestionsList([]);
@@ -4122,7 +4159,6 @@ var CustomerService = function(props) {
4122
4159
  last_id = historyMessageList[0].id;
4123
4160
  }
4124
4161
  if (flag != 1 && last_id != "") {
4125
- console.log(last_id, "dkfjvndfjvndfkvdflast_idlast_idlast_id");
4126
4162
  setLastId(last_id);
4127
4163
  }
4128
4164
  //取消搜索页码标记
@@ -4207,12 +4243,17 @@ var CustomerService = function(props) {
4207
4243
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
4208
4244
  sendToTeacher(1);
4209
4245
  }
4246
+ // if(flag == 1){
4247
+ setTimeout(function() {
4248
+ setKeyWordProblem("");
4249
+ }, 3100);
4250
+ // }
4210
4251
  } else {
4211
4252
  setPageCount(0);
4212
- setGreetingMessage(true);
4213
4253
  setBottomLoading(false);
4214
4254
  setLoading(false);
4215
4255
  setHistoryMessageList([]);
4256
+ setGreetingMessage(true);
4216
4257
  //召唤老师回答
4217
4258
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
4218
4259
  sendToTeacher(1);
@@ -4751,19 +4792,21 @@ var CustomerService = function(props) {
4751
4792
  // }
4752
4793
  //渲染问答
4753
4794
  var renderQuestion = function() {
4754
- if (historyMessageList.length > 0) {
4755
- return /*#__PURE__*/ jsx("ul", {
4756
- className: styles.message_con,
4757
- children: historyMessageList.map(function(item, i) {
4758
- var timeObj = parseDate(item.createdAt);
4759
- // console.log(item.message);
4760
- var message = item.message;
4761
- var li;
4762
- // 是否需要显示日期
4763
- var itemIndex = historyMessageList.findIndex(function(ite) {
4764
- return ite.id === item.id;
4765
- });
4766
- var time = "";
4795
+ // if (historyMessageList.length > 0) {
4796
+ return /*#__PURE__*/ jsx("ul", {
4797
+ className: styles.message_con,
4798
+ children: historyMessageList.map(function(item, i) {
4799
+ console.log(item, 444444888888);
4800
+ var timeObj = parseDate(item.createdAt);
4801
+ // console.log(item.message);
4802
+ var message = item.message;
4803
+ var li;
4804
+ // 是否需要显示日期
4805
+ var itemIndex = historyMessageList.findIndex(function(ite) {
4806
+ return ite.id === item.id;
4807
+ });
4808
+ var time = "";
4809
+ if (historyMessageList.length > 1) {
4767
4810
  if (itemIndex <= 0) {
4768
4811
  //第一项
4769
4812
  time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
@@ -4783,256 +4826,265 @@ var CustomerService = function(props) {
4783
4826
  }
4784
4827
  }
4785
4828
  }
4786
- var dataTime = time;
4787
- if (item.sender == mid) {
4788
- //只有引用和复制功能
4789
- li = /*#__PURE__*/ jsxs(Fragment, {
4790
- children: [
4791
- dataTime ? /*#__PURE__*/ jsx("li", {
4792
- className: styles.time,
4793
- children: dataTime
4794
- }) : "",
4795
- /*#__PURE__*/ jsxs("li", {
4796
- className: styles.left,
4797
- id: lastId == item.id ? "li_flag" : "",
4798
- children: [
4799
- /*#__PURE__*/ jsx("div", {
4800
- className: styles.main,
4801
- children: /*#__PURE__*/ jsxs("div", {
4802
- className: styles.main_content,
4803
- children: [
4804
- /*#__PURE__*/ jsxs("div", {
4805
- className: styles.main_content_flag,
4806
- children: [
4807
- /*#__PURE__*/ jsx("div", {
4808
- className: styles.operate_modal,
4809
- children: /*#__PURE__*/ jsxs("p", {
4810
- className: styles.operate,
4811
- children: [
4812
- /*#__PURE__*/ jsx("i", {
4813
- className: "yinyong_quote1",
4814
- onClick: function() {
4815
- setCitationContent({
4816
- content: item.message,
4817
- id: item.id
4818
- });
4819
- resettingBottomHei();
4820
- onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
4821
- },
4822
- children: /*#__PURE__*/ jsx(CustomQuote$1, {})
4823
- }),
4824
- copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
4825
- return list == item.id;
4826
- }) ? /*#__PURE__*/ jsx("i", {
4827
- className: "tongyong-xuanzhongdui",
4828
- children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
4829
- }) : /*#__PURE__*/ jsx("i", {
4830
- className: "fuzhi21",
4831
- onClick: function() {
4832
- copyText(item.message);
4833
- {
4834
- var obj = copyTextOBJ;
4835
- obj = obj.filter(function(list) {
4836
- return list != item.id;
4837
- });
4838
- obj.push(item.id);
4839
- setCopyTextObj(obj);
4840
- }
4841
- setTimeout(function() {
4842
- var obj = copyTextOBJ;
4843
- obj = obj.filter(function(list) {
4844
- return list != item.id;
4845
- });
4846
- setCopyTextObj(obj);
4847
- }, 3000);
4848
- onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
4849
- },
4850
- children: /*#__PURE__*/ jsx(CustomCopy$1, {})
4851
- })
4852
- ]
4853
- })
4854
- }),
4855
- /*#__PURE__*/ jsx("div", {
4856
- className: styles.content,
4857
- children: /*#__PURE__*/ jsx("p", {
4858
- dangerouslySetInnerHTML: {
4859
- __html: remarkable.render(message)
4860
- },
4861
- className: styles.content_child
4862
- })
4863
- })
4864
- ]
4865
- }),
4866
- //引用消息
4867
- item.quotedMessage && /*#__PURE__*/ jsx("div", {
4868
- className: styles.citation_content,
4869
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
4870
- overlayClassName: styles.popover_main_content,
4871
- title: item.quotedMessage,
4872
- placement: "leftTop",
4829
+ }
4830
+ var dataTime = time;
4831
+ if (lastId == item.id && keyWordProblem != "") {
4832
+ message = remarkable.render(message);
4833
+ message = message.replaceAll(keyWordProblem, function(e) {
4834
+ return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
4835
+ });
4836
+ } else {
4837
+ message = remarkable.render(message);
4838
+ }
4839
+ if (item.sender == mid) {
4840
+ //只有引用和复制功能
4841
+ li = /*#__PURE__*/ jsxs(Fragment, {
4842
+ children: [
4843
+ dataTime ? /*#__PURE__*/ jsx("li", {
4844
+ className: styles.time,
4845
+ children: dataTime
4846
+ }) : "",
4847
+ /*#__PURE__*/ jsxs("li", {
4848
+ className: styles.left,
4849
+ id: lastId == item.id ? "li_flag" : "",
4850
+ children: [
4851
+ /*#__PURE__*/ jsx("div", {
4852
+ className: styles.main,
4853
+ children: /*#__PURE__*/ jsxs("div", {
4854
+ className: styles.main_content,
4855
+ children: [
4856
+ /*#__PURE__*/ jsxs("div", {
4857
+ className: styles.main_content_flag,
4858
+ children: [
4859
+ /*#__PURE__*/ jsx("div", {
4860
+ className: styles.operate_modal,
4873
4861
  children: /*#__PURE__*/ jsxs("p", {
4874
- className: styles.text_exceed,
4875
- children: [
4876
- item.quotedMessage,
4877
- /*#__PURE__*/ jsx(RightOutlined, {})
4878
- ]
4879
- })
4880
- }) : /*#__PURE__*/ jsx("p", {
4881
- children: item.quotedMessage
4882
- })
4883
- })
4884
- ]
4885
- })
4886
- }),
4887
- showType == 2 || showType == 4 ? /*#__PURE__*/ jsx("div", {
4888
- className: styles.head_sculpture,
4889
- style: {
4890
- marginLeft: "12px"
4891
- },
4892
- children: /*#__PURE__*/ jsx("img", {
4893
- src: userData.avatar
4894
- })
4895
- }) : ""
4896
- ]
4897
- }, item.id)
4898
- ]
4899
- });
4900
- } else {
4901
- //获取用户头像
4902
- var headImg = "";
4903
- var chatWindow = [];
4904
- var isAiChatWindow;
4905
- chatWindow = contactsList.filter(function(item) {
4906
- return item.roomId == roomId;
4907
- });
4908
- if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
4909
- headImg = chatWindow[0].headImg;
4910
- }
4911
- // console.log(chatWindow,'chatWindowchatWindow')
4912
- //是否在智能客服窗口
4913
- isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
4914
- var header = 2; //代表是ai头像
4915
- if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
4916
- //使用AI头像
4917
- header = 1;
4918
- }
4919
- li = /*#__PURE__*/ jsxs(Fragment, {
4920
- children: [
4921
- dataTime ? /*#__PURE__*/ jsx("li", {
4922
- className: styles.time,
4923
- children: dataTime
4924
- }) : "",
4925
- /*#__PURE__*/ jsxs("li", {
4926
- className: styles.right,
4927
- id: lastId == item.id ? "li_flag" : "",
4928
- children: [
4929
- (showType == 2 || showType == 4) && /*#__PURE__*/ jsx("div", {
4930
- className: styles.head_sculpture,
4931
- style: {
4932
- marginRight: "12px"
4933
- },
4934
- children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
4935
- src: knowledge_icon
4936
- }) : /*#__PURE__*/ jsx("img", {
4937
- src: headImg
4938
- })
4939
- }),
4940
- /*#__PURE__*/ jsx("div", {
4941
- className: styles.main,
4942
- children: /*#__PURE__*/ jsxs("div", {
4943
- className: styles.main_content,
4944
- children: [
4945
- /*#__PURE__*/ jsxs("div", {
4946
- className: styles.main_content_flag,
4947
- children: [
4948
- /*#__PURE__*/ jsx("div", {
4949
- className: styles.operate_modal,
4950
- children: // 不是最后一行,
4951
- historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
4952
- }),
4953
- /*#__PURE__*/ jsxs("div", {
4954
- className: styles.content,
4862
+ className: styles.operate,
4955
4863
  children: [
4956
- /*#__PURE__*/ jsx("p", {
4957
- dangerouslySetInnerHTML: {
4958
- __html: remarkable.render(message)
4864
+ /*#__PURE__*/ jsx("i", {
4865
+ className: "yinyong_quote1",
4866
+ onClick: function() {
4867
+ setCitationContent({
4868
+ content: item.message,
4869
+ id: item.id
4870
+ });
4871
+ resettingBottomHei();
4872
+ onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
4959
4873
  },
4960
- className: styles.content_child
4874
+ children: /*#__PURE__*/ jsx(CustomQuote$1, {})
4961
4875
  }),
4962
- 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", {
4963
- className: styles.association_problem,
4964
- children: JSON.parse(item.extraInfo).map(function(list, index) {
4965
- return /*#__PURE__*/ jsxs("li", {
4966
- onClick: function() {
4967
- sendMessage(list, 1);
4968
- },
4969
- children: [
4970
- index + 1,
4971
- ".",
4972
- list.question
4973
- ]
4974
- }, i + "_" + index + "_" + list.value);
4975
- })
4876
+ copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
4877
+ return list == item.id;
4878
+ }) ? /*#__PURE__*/ jsx("i", {
4879
+ className: "tongyong-xuanzhongdui",
4880
+ children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
4881
+ }) : /*#__PURE__*/ jsx("i", {
4882
+ className: "fuzhi21",
4883
+ onClick: function() {
4884
+ copyText(item.message);
4885
+ {
4886
+ var obj = copyTextOBJ;
4887
+ obj = obj.filter(function(list) {
4888
+ return list != item.id;
4889
+ });
4890
+ obj.push(item.id);
4891
+ setCopyTextObj(obj);
4892
+ }
4893
+ setTimeout(function() {
4894
+ var obj = copyTextOBJ;
4895
+ obj = obj.filter(function(list) {
4896
+ return list != item.id;
4897
+ });
4898
+ setCopyTextObj(obj);
4899
+ }, 3000);
4900
+ onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
4901
+ },
4902
+ children: /*#__PURE__*/ jsx(CustomCopy$1, {})
4976
4903
  })
4977
4904
  ]
4978
4905
  })
4979
- ]
4980
- }),
4981
- //引用消息
4982
- item.quotedMessage && /*#__PURE__*/ jsx("div", {
4983
- className: styles.citation_content,
4984
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
4985
- overlayClassName: styles.popover_main_content,
4986
- title: item.quotedMessage,
4987
- placement: "rightTop",
4988
- children: /*#__PURE__*/ jsxs("p", {
4989
- className: styles.text_exceed,
4990
- children: [
4991
- item.quotedMessage,
4992
- /*#__PURE__*/ jsx(RightOutlined, {})
4993
- ]
4994
- })
4995
- }) : /*#__PURE__*/ jsx("p", {
4996
- children: item.quotedMessage
4997
- })
4998
- }),
4999
- //findTeacher//是否在召唤老师过程中,是否是最后一条消息
5000
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
5001
- //召唤老师回答按钮
5002
- isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
5003
- return item.short == "TeacherAnswer";
5004
- }) ? /*#__PURE__*/ jsx("div", {
5005
- className: "".concat(styles.operate_modal_bottom, " "),
5006
- children: /*#__PURE__*/ jsx("p", {
5007
- className: styles.stop_findTeacher,
5008
- children: /*#__PURE__*/ jsx("span", {
5009
- onClick: function() {
5010
- setAnswerMode(-1);
5011
- setTeacherList([]);
5012
- setHistoryMessageList(function(historyMessageList) {
5013
- return historyMessageList.filter(function(item) {
5014
- return item.id != "-1";
5015
- });
5016
- });
4906
+ }),
4907
+ /*#__PURE__*/ jsx("div", {
4908
+ className: styles.content,
4909
+ children: /*#__PURE__*/ jsx("p", {
4910
+ dangerouslySetInnerHTML: {
4911
+ __html: message
5017
4912
  },
5018
- children: "停止召唤老师"
4913
+ className: styles.content_child
5019
4914
  })
5020
4915
  })
5021
- }) : ""
5022
- ]
5023
- })
4916
+ ]
4917
+ }),
4918
+ //引用消息
4919
+ item.quotedMessage && /*#__PURE__*/ jsx("div", {
4920
+ className: styles.citation_content,
4921
+ children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
4922
+ overlayClassName: styles.popover_main_content,
4923
+ title: item.quotedMessage,
4924
+ placement: "leftTop",
4925
+ children: /*#__PURE__*/ jsxs("p", {
4926
+ className: styles.text_exceed,
4927
+ children: [
4928
+ item.quotedMessage,
4929
+ /*#__PURE__*/ jsx(RightOutlined, {})
4930
+ ]
4931
+ })
4932
+ }) : /*#__PURE__*/ jsx("p", {
4933
+ children: item.quotedMessage
4934
+ })
4935
+ })
4936
+ ]
5024
4937
  })
5025
- ]
5026
- }, item.id)
5027
- ]
5028
- });
4938
+ }),
4939
+ showType == 2 || showType == 4 ? /*#__PURE__*/ jsx("div", {
4940
+ className: styles.head_sculpture,
4941
+ style: {
4942
+ marginLeft: "12px"
4943
+ },
4944
+ children: /*#__PURE__*/ jsx("img", {
4945
+ src: userData.avatar
4946
+ })
4947
+ }) : ""
4948
+ ]
4949
+ }, item.id)
4950
+ ]
4951
+ });
4952
+ } else {
4953
+ //获取用户头像
4954
+ var headImg = "";
4955
+ var chatWindow = [];
4956
+ var isAiChatWindow;
4957
+ chatWindow = contactsList.filter(function(item) {
4958
+ return item.roomId == roomId;
4959
+ });
4960
+ if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
4961
+ headImg = chatWindow[0].headImg;
5029
4962
  }
5030
- return li;
5031
- })
5032
- });
5033
- } else {
5034
- return "";
5035
- }
4963
+ // console.log(chatWindow,'chatWindowchatWindow')
4964
+ //是否在智能客服窗口
4965
+ isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
4966
+ var header = 2; //代表是ai头像
4967
+ if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
4968
+ //使用AI头像
4969
+ header = 1;
4970
+ }
4971
+ li = /*#__PURE__*/ jsxs(Fragment, {
4972
+ children: [
4973
+ dataTime ? /*#__PURE__*/ jsx("li", {
4974
+ className: styles.time,
4975
+ children: dataTime
4976
+ }) : "",
4977
+ /*#__PURE__*/ jsxs("li", {
4978
+ className: styles.right,
4979
+ id: lastId == item.id ? "li_flag" : "",
4980
+ children: [
4981
+ (showType == 2 || showType == 4) && /*#__PURE__*/ jsx("div", {
4982
+ className: styles.head_sculpture,
4983
+ style: {
4984
+ marginRight: "12px"
4985
+ },
4986
+ children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
4987
+ src: knowledge_icon
4988
+ }) : /*#__PURE__*/ jsx("img", {
4989
+ src: headImg
4990
+ })
4991
+ }),
4992
+ /*#__PURE__*/ jsx("div", {
4993
+ className: styles.main,
4994
+ children: /*#__PURE__*/ jsxs("div", {
4995
+ className: styles.main_content,
4996
+ children: [
4997
+ /*#__PURE__*/ jsxs("div", {
4998
+ className: styles.main_content_flag,
4999
+ children: [
5000
+ /*#__PURE__*/ jsx("div", {
5001
+ className: styles.operate_modal,
5002
+ children: // 不是最后一行,
5003
+ historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
5004
+ }),
5005
+ /*#__PURE__*/ jsxs("div", {
5006
+ className: styles.content,
5007
+ children: [
5008
+ /*#__PURE__*/ jsx("p", {
5009
+ dangerouslySetInnerHTML: {
5010
+ __html: message
5011
+ },
5012
+ className: styles.content_child
5013
+ }),
5014
+ 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", {
5015
+ className: styles.association_problem,
5016
+ children: JSON.parse(item.extraInfo).map(function(list, index) {
5017
+ return /*#__PURE__*/ jsxs("li", {
5018
+ onClick: function() {
5019
+ sendMessage(list, 1);
5020
+ },
5021
+ children: [
5022
+ index + 1,
5023
+ ".",
5024
+ list.question
5025
+ ]
5026
+ }, i + "_" + index + "_" + list.value);
5027
+ })
5028
+ })
5029
+ ]
5030
+ })
5031
+ ]
5032
+ }),
5033
+ //引用消息
5034
+ item.quotedMessage && /*#__PURE__*/ jsx("div", {
5035
+ className: styles.citation_content,
5036
+ children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
5037
+ overlayClassName: styles.popover_main_content,
5038
+ title: item.quotedMessage,
5039
+ placement: "rightTop",
5040
+ children: /*#__PURE__*/ jsxs("p", {
5041
+ className: styles.text_exceed,
5042
+ children: [
5043
+ item.quotedMessage,
5044
+ /*#__PURE__*/ jsx(RightOutlined, {})
5045
+ ]
5046
+ })
5047
+ }) : /*#__PURE__*/ jsx("p", {
5048
+ children: item.quotedMessage
5049
+ })
5050
+ }),
5051
+ //findTeacher//是否在召唤老师过程中,是否是最后一条消息
5052
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
5053
+ //召唤老师回答按钮
5054
+ isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
5055
+ return item.short == "TeacherAnswer";
5056
+ }) ? /*#__PURE__*/ jsx("div", {
5057
+ className: "".concat(styles.operate_modal_bottom, " "),
5058
+ children: /*#__PURE__*/ jsx("p", {
5059
+ className: styles.stop_findTeacher,
5060
+ children: /*#__PURE__*/ jsx("span", {
5061
+ onClick: function() {
5062
+ setAnswerMode(-1);
5063
+ setTeacherList([]);
5064
+ setHistoryMessageList(function(historyMessageList) {
5065
+ return historyMessageList.filter(function(item) {
5066
+ return item.id != "-1";
5067
+ });
5068
+ });
5069
+ },
5070
+ children: "停止召唤老师"
5071
+ })
5072
+ })
5073
+ }) : ""
5074
+ ]
5075
+ })
5076
+ })
5077
+ ]
5078
+ }, item.id)
5079
+ ]
5080
+ });
5081
+ }
5082
+ return li;
5083
+ })
5084
+ });
5085
+ // } else {
5086
+ // return "";
5087
+ // }
5036
5088
  };
5037
5089
  //渲染相关操作按钮 header == 1 ai ,== 2 知识库
5038
5090
  var renderOperateBtn = function(item, isAiChatWindow, i) {
@@ -5720,11 +5772,14 @@ var CustomerService = function(props) {
5720
5772
  }
5721
5773
  };
5722
5774
  //加载指定数据,点击历史记录
5723
- var loadSpecifiedData = function(renewRoomId, page, id, receiver) {
5775
+ var loadSpecifiedData = function(renewRoomId, page, id, receiver, keyWordProblem) {
5724
5776
  // let renewRoomId = '4a615d7126b343f78d10dcb06dbc29b0';
5725
5777
  // let page = 1;
5726
5778
  // let id = '0e459f0a3a62438698f170b42b94d150';
5727
5779
  // let receiver = mid;
5780
+ if (keyWordProblem != "") {
5781
+ setKeyWordProblem(keyWordProblem);
5782
+ }
5728
5783
  if (page != 1) {
5729
5784
  setPageNumHistory(page);
5730
5785
  }
@@ -5788,6 +5843,9 @@ var CustomerService = function(props) {
5788
5843
  style: {
5789
5844
  maxHeight: "calc(100vh-".concat(buttomHei + 48, "px)")
5790
5845
  },
5846
+ onClick: function() {
5847
+ setKeyWordProblem("");
5848
+ },
5791
5849
  children: [
5792
5850
  loading ? /*#__PURE__*/ jsx("div", {
5793
5851
  className: styles.loading,
@@ -5796,7 +5854,7 @@ var CustomerService = function(props) {
5796
5854
  alt: ""
5797
5855
  })
5798
5856
  }) : "",
5799
- renderQuestion(),
5857
+ keyWordProblem ? renderQuestion() : renderQuestion(),
5800
5858
  bottomLoading ? /*#__PURE__*/ jsx("div", {
5801
5859
  className: styles.loading,
5802
5860
  children: /*#__PURE__*/ jsx("img", {
@@ -5852,6 +5910,9 @@ var CustomerService = function(props) {
5852
5910
  }),
5853
5911
  /*#__PURE__*/ jsxs("div", {
5854
5912
  className: "".concat(styles.Drawer_wrap_main),
5913
+ onClick: function() {
5914
+ setKeyWordProblem("");
5915
+ },
5855
5916
  children: [
5856
5917
  /*#__PURE__*/ jsxs("div", {
5857
5918
  className: "".concat(styles.Drawer_main, " ChatWindow_Modal_history_list"),
@@ -5884,7 +5945,7 @@ var CustomerService = function(props) {
5884
5945
  alt: ""
5885
5946
  })
5886
5947
  }) : "",
5887
- renderQuestion()
5948
+ keyWordProblem ? renderQuestion() : renderQuestion()
5888
5949
  ]
5889
5950
  })
5890
5951
  ]
@@ -5918,6 +5979,9 @@ var CustomerService = function(props) {
5918
5979
  showType == 3 ? /*#__PURE__*/ jsxs("div", {
5919
5980
  className: "".concat(styles.ChatWindow_Drawer),
5920
5981
  id: "",
5982
+ onClick: function() {
5983
+ setKeyWordProblem("");
5984
+ },
5921
5985
  children: [
5922
5986
  /*#__PURE__*/ jsx("div", {
5923
5987
  className: "".concat(styles.header_wrap, " ").concat(styles.header_wrap_newlabo),
@@ -5978,7 +6042,7 @@ var CustomerService = function(props) {
5978
6042
  alt: ""
5979
6043
  })
5980
6044
  }) : "",
5981
- renderQuestion()
6045
+ keyWordProblem ? renderQuestion() : renderQuestion()
5982
6046
  ]
5983
6047
  }),
5984
6048
  /*#__PURE__*/ jsxs("div", {
@@ -6055,6 +6119,9 @@ var CustomerService = function(props) {
6055
6119
  style: {
6056
6120
  maxHeight: "".concat(window.innerHeight - 148 - buttomHei, "px")
6057
6121
  },
6122
+ onClick: function() {
6123
+ setKeyWordProblem("");
6124
+ },
6058
6125
  children: [
6059
6126
  /*#__PURE__*/ jsx(ContactsList$1, {
6060
6127
  type: 4,
@@ -6080,7 +6147,7 @@ var CustomerService = function(props) {
6080
6147
  alt: ""
6081
6148
  })
6082
6149
  }) : "",
6083
- renderQuestion()
6150
+ keyWordProblem ? renderQuestion() : renderQuestion()
6084
6151
  ]
6085
6152
  })
6086
6153
  ]
@@ -6172,7 +6239,7 @@ var CustomerService = function(props) {
6172
6239
  alt: ""
6173
6240
  })
6174
6241
  }) : "",
6175
- renderQuestion()
6242
+ keyWordProblem ? renderQuestion() : renderQuestion()
6176
6243
  ]
6177
6244
  }),
6178
6245
  /*#__PURE__*/ jsxs("div", {