bhd-components 0.7.21 → 0.7.23

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, X, y as I, H, A as Remarkable, D as Drawer, B as HighlightJS, Z as ZoomInOutlined, F as _to_consumable_array } from './49e31ffd.esm.es5.development.js';
2
- export { G as Affix, J as Alert, K as Anchor, aF as App, N as AutoComplete, O as Avatar, U as BackTop, V as Badge, W as Breadcrumb, Y as Button, $ as Calendar, a0 as Card, a1 as Carousel, a2 as Cascader, a3 as Checkbox, a4 as Col, a5 as Collapse, a6 as DatePicker, a7 as Descriptions, a8 as Divider, D as Drawer, a9 as Dropdown, aa as Empty, Q as FloatButton, ab as Form, ac as Grid, ad as Image, v as Input, ae as InputNumber, af as Layout, ag as List, ah as Mentions, ai as Menu, M as Modal, ak as Popconfirm, al as Popover, am as Progress, aM as QRCode, an as Radio, ao as Rate, ap as Result, aq as Row, ar as Segmented, g as Select, as as Skeleton, at as Slider, au as Space, av as Spin, aw as Statistic, ax as Steps, ay as Switch, az as Tabs, aA as Tag, aC as TimePicker, aD as Timeline, T as Tooltip, aE as Tour, aG as Transfer, aH as Tree, aI as TreeSelect, aJ as Typography, aK as Upload, aL as Watermark, aO as en_US, aj as notification, aB as theme, aN as version, z as zh_CN } from './49e31ffd.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, X, y as I, H, A as Remarkable, D as Drawer, B as HighlightJS, Z as ZoomInOutlined, F as _to_consumable_array } from './1188cc4c.esm.es5.development.js';
2
+ export { G as Affix, J as Alert, K as Anchor, aF as App, N as AutoComplete, O as Avatar, U as BackTop, V as Badge, W as Breadcrumb, Y as Button, $ as Calendar, a0 as Card, a1 as Carousel, a2 as Cascader, a3 as Checkbox, a4 as Col, a5 as Collapse, a6 as DatePicker, a7 as Descriptions, a8 as Divider, D as Drawer, a9 as Dropdown, aa as Empty, Q as FloatButton, ab as Form, ac as Grid, ad as Image, v as Input, ae as InputNumber, af as Layout, ag as List, ah as Mentions, ai as Menu, M as Modal, ak as Popconfirm, al as Popover, am as Progress, aM as QRCode, an as Radio, ao as Rate, ap as Result, aq as Row, ar as Segmented, g as Select, as as Skeleton, at as Slider, au as Space, av as Spin, aw as Statistic, ax as Steps, ay as Switch, az as Tabs, aA as Tag, aC as TimePicker, aD as Timeline, T as Tooltip, aE as Tour, aG as Transfer, aH as Tree, aI as TreeSelect, aJ as Typography, aK as Upload, aL as Watermark, aO as en_US, aj as notification, aB as theme, aN as version, z as zh_CN } from './1188cc4c.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';
@@ -2377,7 +2377,7 @@ function BhdAppLayout(props) {
2377
2377
  });
2378
2378
  }
2379
2379
 
2380
- var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__16db1945","ChatWindow_Modal":"index_module_ChatWindow_Modal__16db1945","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__16db1945","header_wrap":"index_module_header_wrap__16db1945","top":"index_module_top__16db1945","user":"index_module_user__16db1945","count":"index_module_count__16db1945","operate":"index_module_operate__16db1945","line":"index_module_line__16db1945","popover_main":"index_module_popover_main__16db1945","popover":"index_module_popover__16db1945","header_wrap_newlabo":"index_module_header_wrap_newlabo__16db1945","Drawer_main":"index_module_Drawer_main__16db1945","loading":"index_module_loading__16db1945","message_con":"index_module_message_con__16db1945","left":"index_module_left__16db1945","head_sculpture":"index_module_head_sculpture__16db1945","main_content":"index_module_main_content__16db1945","right":"index_module_right__16db1945","main":"index_module_main__16db1945","main_content_flag":"index_module_main_content_flag__16db1945","operate_modal":"index_module_operate_modal__16db1945","operate_modal_bottom":"index_module_operate_modal_bottom__16db1945","active":"index_module_active__16db1945","stop_generate":"index_module_stop_generate__16db1945","icon":"index_module_icon__16db1945","find_teacher":"index_module_find_teacher__16db1945","stop_findTeacher":"index_module_stop_findTeacher__16db1945","content":"index_module_content__16db1945","content_child":"index_module_content_child__16db1945","sign":"index_module_sign__16db1945","ask_question":"index_module_ask_question__16db1945","association_problem":"index_module_association_problem__16db1945","association_problem_flag":"index_module_association_problem_flag__16db1945","related_issues_flag":"index_module_related_issues_flag__16db1945","img_con":"index_module_img_con__16db1945","mask_zoom":"index_module_mask_zoom__16db1945","img_con2":"index_module_img_con2__16db1945","copyCode":"index_module_copyCode__16db1945","time":"index_module_time__16db1945","citation_content":"index_module_citation_content__16db1945","text_exceed":"index_module_text_exceed__16db1945","popover_content":"index_module_popover_content__16db1945","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__16db1945","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__16db1945","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__16db1945","issues_list_teacherList":"index_module_issues_list_teacherList__16db1945","item":"index_module_item__16db1945","issues_list":"index_module_issues_list__16db1945","issues_list_flag":"index_module_issues_list_flag__16db1945","Drawer_buttom":"index_module_Drawer_buttom__16db1945","input_wrap":"index_module_input_wrap__16db1945","input":"index_module_input__16db1945","picture_layout":"index_module_picture_layout__16db1945","icon_close":"index_module_icon_close__16db1945","icon_zoom":"index_module_icon_zoom__16db1945","anticon":"index_module_anticon__16db1945","no_AI":"index_module_no_AI__16db1945","screenshot":"index_module_screenshot__16db1945","disabled":"index_module_disabled__16db1945","content_main":"index_module_content_main__16db1945","content_con":"index_module_content_con__16db1945","delete_quote":"index_module_delete_quote__16db1945","sending":"index_module_sending__16db1945","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__16db1945","main_list":"index_module_main_list__16db1945","chat_content":"index_module_chat_content__16db1945","popover_main_content":"index_module_popover_main_content__16db1945","popover_main_content_name":"index_module_popover_main_content_name__16db1945","teacher_layout":"index_module_teacher_layout__16db1945","bottom":"index_module_bottom__16db1945","delete":"index_module_delete__16db1945","num":"index_module_num__16db1945","shrink":"index_module_shrink__16db1945","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__16db1945","teacher_layout_modal":"index_module_teacher_layout_modal__16db1945","ai":"index_module_ai__16db1945","user_info":"index_module_user_info__16db1945","message":"index_module_message__16db1945","con":"index_module_con__16db1945","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__16db1945","history_list":"index_module_history_list__16db1945","search_layout":"index_module_search_layout__16db1945","mymove":"index_module_mymove__16db1945","title":"index_module_title__16db1945","search_top":"index_module_search_top__16db1945","list_item":"index_module_list_item__16db1945","list_summary":"index_module_list_summary__16db1945","head_img":"index_module_head_img__16db1945","list_desc":"index_module_list_desc__16db1945","name":"index_module_name__16db1945","decs":"index_module_decs__16db1945","open":"index_module_open__16db1945","list_summary_active":"index_module_list_summary_active__16db1945","list_detail":"index_module_list_detail__16db1945","list":"index_module_list__16db1945","list_more":"index_module_list_more__16db1945","no_data":"index_module_no_data__16db1945","history_list_broadside":"index_module_history_list_broadside__16db1945","teacher_list":"index_module_teacher_list__16db1945","screenshot_Modal":"index_module_screenshot_Modal__16db1945","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__16db1945"};
2380
+ var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__db13568b","ChatWindow_Modal":"index_module_ChatWindow_Modal__db13568b","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__db13568b","header_wrap":"index_module_header_wrap__db13568b","top":"index_module_top__db13568b","user":"index_module_user__db13568b","count":"index_module_count__db13568b","operate":"index_module_operate__db13568b","line":"index_module_line__db13568b","popover_main":"index_module_popover_main__db13568b","popover":"index_module_popover__db13568b","header_wrap_newlabo":"index_module_header_wrap_newlabo__db13568b","Drawer_main":"index_module_Drawer_main__db13568b","loading":"index_module_loading__db13568b","message_con":"index_module_message_con__db13568b","left":"index_module_left__db13568b","head_sculpture":"index_module_head_sculpture__db13568b","main_content":"index_module_main_content__db13568b","right":"index_module_right__db13568b","main":"index_module_main__db13568b","main_content_flag":"index_module_main_content_flag__db13568b","operate_modal":"index_module_operate_modal__db13568b","operate_modal_bottom":"index_module_operate_modal_bottom__db13568b","active":"index_module_active__db13568b","stop_generate":"index_module_stop_generate__db13568b","icon":"index_module_icon__db13568b","find_teacher":"index_module_find_teacher__db13568b","stop_findTeacher":"index_module_stop_findTeacher__db13568b","content":"index_module_content__db13568b","content_child":"index_module_content_child__db13568b","find_teacher_con":"index_module_find_teacher_con__db13568b","sign":"index_module_sign__db13568b","ask_question":"index_module_ask_question__db13568b","association_problem":"index_module_association_problem__db13568b","association_problem_flag":"index_module_association_problem_flag__db13568b","related_issues_flag":"index_module_related_issues_flag__db13568b","img_con":"index_module_img_con__db13568b","mask_zoom":"index_module_mask_zoom__db13568b","img_con2":"index_module_img_con2__db13568b","copyCode":"index_module_copyCode__db13568b","time":"index_module_time__db13568b","citation_content":"index_module_citation_content__db13568b","text_exceed":"index_module_text_exceed__db13568b","popover_content":"index_module_popover_content__db13568b","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__db13568b","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__db13568b","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__db13568b","issues_list_teacherList":"index_module_issues_list_teacherList__db13568b","item":"index_module_item__db13568b","issues_list":"index_module_issues_list__db13568b","issues_list_flag":"index_module_issues_list_flag__db13568b","Drawer_buttom":"index_module_Drawer_buttom__db13568b","input_wrap":"index_module_input_wrap__db13568b","input":"index_module_input__db13568b","picture_layout":"index_module_picture_layout__db13568b","icon_close":"index_module_icon_close__db13568b","icon_zoom":"index_module_icon_zoom__db13568b","anticon":"index_module_anticon__db13568b","no_AI":"index_module_no_AI__db13568b","screenshot":"index_module_screenshot__db13568b","disabled":"index_module_disabled__db13568b","content_main":"index_module_content_main__db13568b","content_con":"index_module_content_con__db13568b","delete_quote":"index_module_delete_quote__db13568b","sending":"index_module_sending__db13568b","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__db13568b","main_list":"index_module_main_list__db13568b","chat_content":"index_module_chat_content__db13568b","popover_main_content":"index_module_popover_main_content__db13568b","popover_main_content_name":"index_module_popover_main_content_name__db13568b","teacher_layout":"index_module_teacher_layout__db13568b","bottom":"index_module_bottom__db13568b","delete":"index_module_delete__db13568b","num":"index_module_num__db13568b","shrink":"index_module_shrink__db13568b","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__db13568b","teacher_layout_modal":"index_module_teacher_layout_modal__db13568b","ai":"index_module_ai__db13568b","user_info":"index_module_user_info__db13568b","message":"index_module_message__db13568b","con":"index_module_con__db13568b","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__db13568b","history_list":"index_module_history_list__db13568b","search_layout":"index_module_search_layout__db13568b","mymove":"index_module_mymove__db13568b","title":"index_module_title__db13568b","search_top":"index_module_search_top__db13568b","list_item":"index_module_list_item__db13568b","list_summary":"index_module_list_summary__db13568b","head_img":"index_module_head_img__db13568b","list_desc":"index_module_list_desc__db13568b","name":"index_module_name__db13568b","decs":"index_module_decs__db13568b","open":"index_module_open__db13568b","list_summary_active":"index_module_list_summary_active__db13568b","list_detail":"index_module_list_detail__db13568b","list":"index_module_list__db13568b","list_more":"index_module_list_more__db13568b","no_data":"index_module_no_data__db13568b","history_list_broadside":"index_module_history_list_broadside__db13568b","teacher_list":"index_module_teacher_list__db13568b","screenshot_Modal":"index_module_screenshot_Modal__db13568b","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__db13568b"};
2381
2381
 
2382
2382
  //消息已读
2383
2383
  var readMessage = function(roomId, urllocation, userData, http) {
@@ -2865,15 +2865,19 @@ var HistoryFun = function(props) {
2865
2865
  var span = "";
2866
2866
  var time = "";
2867
2867
  if (item.count == 1) {
2868
+ var message = item.message;
2869
+ var position_i = message.indexOf(keyWordProblem);
2870
+ if (position_i > 30) {
2871
+ message = message.substring(position_i - 15);
2872
+ }
2868
2873
  var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
2869
2874
  //搜索内容是否有特殊字符
2870
2875
  if (reg.test(keyWordProblem)) {
2871
- span = item.message.replaceAll(keyWordProblem, function(e) {
2876
+ span = message.replaceAll(keyWordProblem, function(e) {
2872
2877
  return "<span class=".concat(modules_63b47c51.sign, ">").concat(e, "</span>");
2873
2878
  });
2874
2879
  } else {
2875
- span = item.message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
2876
- // console.log(i,'skdcnsdjk')
2880
+ span = message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
2877
2881
  return "<span class=".concat(modules_63b47c51.sign, ">").concat(i, "</span>");
2878
2882
  });
2879
2883
  }
@@ -2947,13 +2951,18 @@ var HistoryFun = function(props) {
2947
2951
  var time = formatDate(list.updatedAt);
2948
2952
  var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
2949
2953
  var span = "";
2954
+ var message = list.message;
2955
+ var position_i = message.indexOf(keyWordProblem);
2956
+ if (position_i > 30) {
2957
+ message = message.substring(position_i - 15);
2958
+ }
2950
2959
  //搜索内容是否有特殊字符
2951
2960
  if (reg.test(keyWordProblem)) {
2952
- span = list.message.replaceAll(keyWordProblem, function(e) {
2961
+ span = message.replaceAll(keyWordProblem, function(e) {
2953
2962
  return "<span class=".concat(modules_63b47c51.sign, ">").concat(e, "</span>");
2954
2963
  });
2955
2964
  } else {
2956
- span = list.message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
2965
+ span = message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
2957
2966
  // console.log(i,'skdcnsdjk')
2958
2967
  return "<span class=".concat(modules_63b47c51.sign, ">").concat(i, "</span>");
2959
2968
  });
@@ -3323,9 +3332,39 @@ var TeacherList = function(props) {
3323
3332
  var type = props.type, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, enterTeacherChat = props.enterTeacherChat;
3324
3333
  var _useState = _sliced_to_array(useState(""), 2), keyWordProblem = _useState[0], setKeyWordProblem = _useState[1]; //搜索内容
3325
3334
  var _useState1 = _sliced_to_array(useState(1), 2), showLoadingState = _useState1[0], setShowLoadingState = _useState1[1]; //1,初始状态,2、无数据 ,3、不显示图片
3326
- var _useState2 = _sliced_to_array(useState([]), 2), totalData = _useState2[0], setTotalData = _useState2[1]; //总数据
3327
- var _useState3 = _sliced_to_array(useState([]), 2), teacher_list = _useState3[0], setTeacher_list = _useState3[1]; //老师列表,有头像
3335
+ // const [totalData, setTotalData] = useState([]); //总数据
3336
+ var _useState2 = _sliced_to_array(useState([]), 2), showTotalData = _useState2[0], setShowTotalData = _useState2[1]; //总数据
3337
+ // const [teacher_list, setTeacher_list] = useState([]); //老师列表,有头像
3338
+ var totalData = useRef([]);
3339
+ var teacher_list = useRef([]); //老师列表,有头像
3328
3340
  var timer = useRef(null); //文本框输入时
3341
+ var page = useRef(1);
3342
+ var loading = useRef(true);
3343
+ var sliderRef = useRef(null);
3344
+ useEffect(function() {
3345
+ var handleScroll = function(e) {
3346
+ // 处理滚轮事件的逻辑
3347
+ var container = document.getElementById("teacher_list");
3348
+ var scrollTop = container.scrollTop;
3349
+ var clientHeight = container.clientHeight;
3350
+ var scrollHeight = container.scrollHeight;
3351
+ if (scrollTop + clientHeight + 60 >= scrollHeight && loading.current) {
3352
+ loading.current = false;
3353
+ // console.log('加载下一页');
3354
+ page.current = page.current + 1;
3355
+ getUserName();
3356
+ // getList(keyWordProblem);
3357
+ }
3358
+ };
3359
+ // 添加滚轮事件监听器
3360
+ sliderRef.current.addEventListener("wheel", handleScroll);
3361
+ // 清除滚轮事件监听器
3362
+ return function() {
3363
+ sliderRef.current.removeEventListener("wheel", handleScroll);
3364
+ };
3365
+ }, [
3366
+ keyWordProblem
3367
+ ]);
3329
3368
  useEffect(function() {
3330
3369
  getList("");
3331
3370
  return function() {
@@ -3333,26 +3372,41 @@ var TeacherList = function(props) {
3333
3372
  };
3334
3373
  }, []);
3335
3374
  var getList = function(val) {
3375
+ if (page.current == 1) {
3376
+ // setTotalData([]);
3377
+ totalData.current = [];
3378
+ setShowTotalData([]);
3379
+ }
3336
3380
  http.get("".concat(urllocation, "/chat-service/public/v1.0/teachers"), {
3337
3381
  params: {
3338
- name: val
3382
+ name: val,
3383
+ page: page.current,
3384
+ maxPageSize: 99
3339
3385
  }
3340
3386
  }).then(function(res) {
3341
3387
  console.log(res);
3342
- var data = res.data;
3343
- if (data.total > 0) {
3388
+ if (res.data.total > 0) {
3389
+ loading.current = true;
3344
3390
  setShowLoadingState(3);
3345
- setTotalData(res.data.teachers);
3346
- getUserName(res.data.teachers);
3391
+ totalData.current = res.data.teachers;
3392
+ getUserName();
3393
+ } else {
3394
+ loading.current = false;
3395
+ if (page.current == 1) {
3396
+ setShowLoadingState(2);
3397
+ }
3347
3398
  }
3348
3399
  });
3349
3400
  };
3350
- var getUserName = function(dataList) {
3401
+ var getUserName = function() {
3351
3402
  try {
3352
- var list = dataList;
3403
+ // let list = dataList;
3404
+ // console.log(totalData.current,4444444);
3405
+ var showTotalData = totalData.current.slice((page.current - 1) * 20, page.current * 20);
3406
+ var list = showTotalData;
3353
3407
  var ids = [];
3354
3408
  list = list.map(function(item) {
3355
- if (!item.headImg && teacher_list.filter(function(v) {
3409
+ if (!item.headImg && teacher_list.current.filter(function(v) {
3356
3410
  return v.uid == item.uid;
3357
3411
  }).length <= 0) {
3358
3412
  ids.push(item.uid);
@@ -3362,8 +3416,8 @@ var TeacherList = function(props) {
3362
3416
  userName(ids.join(",")).then(function(res) {
3363
3417
  if (res.data) {
3364
3418
  var nameList = res.data;
3365
- setTotalData(function(list1) {
3366
- var list = list1;
3419
+ setShowTotalData(function(list1) {
3420
+ var list = showTotalData;
3367
3421
  list = list.map(function(item) {
3368
3422
  var name = nameList.filter(function(v) {
3369
3423
  return v.uid == item.uid;
@@ -3371,18 +3425,34 @@ var TeacherList = function(props) {
3371
3425
  if (name.length > 0) {
3372
3426
  return _object_spread({}, item, name[0]);
3373
3427
  } else {
3374
- return item;
3428
+ var nameList1 = teacher_list.current;
3429
+ var name1 = nameList1.filter(function(v) {
3430
+ return v.uid == item.uid;
3431
+ });
3432
+ if (name1.length > 0) {
3433
+ return _object_spread({}, item, name1[0]);
3434
+ } else {
3435
+ return item;
3436
+ }
3375
3437
  }
3376
3438
  });
3377
- setTeacher_list(list);
3378
- return list;
3439
+ var data = new Map();
3440
+ teacher_list.current = teacher_list.current.concat(list).filter(function(a) {
3441
+ return !data.has(a.uid) && data.set(a.uid, 1);
3442
+ });
3443
+ if (showTotalData.length == 0) {
3444
+ loading.current = false;
3445
+ } else {
3446
+ loading.current = true;
3447
+ }
3448
+ return list1.concat(list);
3379
3449
  });
3380
3450
  }
3381
3451
  });
3382
3452
  } else {
3383
- var nameList = teacher_list;
3384
- setTotalData(function(list1) {
3385
- var list = list1;
3453
+ var nameList = teacher_list.current;
3454
+ setShowTotalData(function(list1) {
3455
+ var list = showTotalData;
3386
3456
  list = list.map(function(item) {
3387
3457
  var name = nameList.filter(function(v) {
3388
3458
  return v.uid == item.uid;
@@ -3393,8 +3463,12 @@ var TeacherList = function(props) {
3393
3463
  return item;
3394
3464
  }
3395
3465
  });
3396
- setTeacher_list(list);
3397
- return list;
3466
+ if (showTotalData.length == 0) {
3467
+ loading.current = false;
3468
+ } else {
3469
+ loading.current = true;
3470
+ }
3471
+ return list1.concat(list);
3398
3472
  });
3399
3473
  }
3400
3474
  } catch (error) {}
@@ -3444,13 +3518,10 @@ var TeacherList = function(props) {
3444
3518
  setKeyWordProblem(val);
3445
3519
  clearTimeout(timer.current);
3446
3520
  timer.current = setTimeout(function() {
3447
- if (val != "") {
3448
- setTotalData([]);
3449
- getList(val);
3450
- } else {
3451
- setShowLoadingState(1);
3452
- setTotalData([]);
3453
- }
3521
+ page.current = 1;
3522
+ // setTotalData([]);
3523
+ totalData.current = [];
3524
+ getList(val);
3454
3525
  }, 1000);
3455
3526
  }
3456
3527
  }),
@@ -3459,7 +3530,10 @@ var TeacherList = function(props) {
3459
3530
  onClick: function() {
3460
3531
  setShowLoadingState(1);
3461
3532
  setKeyWordProblem("");
3462
- setTotalData([]);
3533
+ // setTotalData([]);
3534
+ totalData.current = [];
3535
+ page.current = 1;
3536
+ getList("");
3463
3537
  },
3464
3538
  children: /*#__PURE__*/ jsx(CustomClose$1, {})
3465
3539
  })
@@ -3467,7 +3541,7 @@ var TeacherList = function(props) {
3467
3541
  }),
3468
3542
  /*#__PURE__*/ jsxs("div", {
3469
3543
  className: modules_63b47c51.main_list,
3470
- id: "history_list",
3544
+ id: "teacher_list",
3471
3545
  children: [
3472
3546
  showLoadingState == 1 && /*#__PURE__*/ jsxs("div", {
3473
3547
  className: modules_63b47c51.no_data,
@@ -3487,13 +3561,14 @@ var TeacherList = function(props) {
3487
3561
  src: "/new_yun/images/aiService/no_data.png"
3488
3562
  }),
3489
3563
  /*#__PURE__*/ jsx("p", {
3490
- children: "暂无记录"
3564
+ children: "未搜索到老师"
3491
3565
  })
3492
3566
  ]
3493
3567
  }),
3494
3568
  /*#__PURE__*/ jsx("div", {
3495
3569
  className: modules_63b47c51.list_item,
3496
- children: totalData.map(function(item) {
3570
+ ref: sliderRef,
3571
+ children: showTotalData.map(function(item) {
3497
3572
  var span = item.name.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
3498
3573
  return "<span class=".concat(modules_63b47c51.sign, ">").concat(i, "</span>");
3499
3574
  });
@@ -3657,6 +3732,7 @@ var CustomerService = function(props) {
3657
3732
  console.log(canvas, 99999);
3658
3733
  // var base64URL = canvas.toDataURL('image/jpeg')
3659
3734
  var base64URL = canvas.toDataURL("image/jpg", 1.0);
3735
+ console.log(base64URL);
3660
3736
  setImgBese64(base64URL);
3661
3737
  });
3662
3738
  } catch (error) {
@@ -4348,11 +4424,11 @@ var CustomerService = function(props) {
4348
4424
  ctrl.current = new AbortController();
4349
4425
  clearTimeout(receiveMessageTimer.current);
4350
4426
  receiveMessageTimer.current = setTimeout(function() {
4351
- // setHistoryMessageList((historyMessageList) => {
4352
- // return historyMessageList.filter(
4353
- // (item) => item.id != "123456" && item.id != "654321"
4354
- // );
4355
- // });
4427
+ setHistoryMessageList(function(historyMessageList) {
4428
+ return historyMessageList.filter(function(item) {
4429
+ return item.id != "123456";
4430
+ });
4431
+ });
4356
4432
  setFinished(true);
4357
4433
  ctrl.current.abort();
4358
4434
  setHistoryMessageList(function(historyMessageList) {
@@ -4360,7 +4436,7 @@ var CustomerService = function(props) {
4360
4436
  roomId: roomId,
4361
4437
  sender: "AI",
4362
4438
  recevier: mid,
4363
- message: "网络异常,请稍后重试!",
4439
+ message: "AI助手繁忙,请稍后再提问或",
4364
4440
  id: "123456",
4365
4441
  createdAt: getDataTime(-1),
4366
4442
  extraInfo: null
@@ -4756,11 +4832,9 @@ var CustomerService = function(props) {
4756
4832
  if (problem != undefined && problem.user != undefined && problem.question != undefined) {
4757
4833
  sendToTeacher(1);
4758
4834
  }
4759
- // if(flag == 1){
4760
4835
  setTimeout(function() {
4761
4836
  setKeyWordProblem("");
4762
4837
  }, 3100);
4763
- // }
4764
4838
  } else {
4765
4839
  setPageCount(0);
4766
4840
  setBottomLoading(false);
@@ -5449,18 +5523,21 @@ var CustomerService = function(props) {
5449
5523
  // code = code[1];
5450
5524
  // console.log(code,888888888);
5451
5525
  if (lastId == item.id && keyWordProblem != "") {
5452
- message = remarkable.render(message);
5526
+ //点击历史记录时,找到关键字,防止关键字和标签名重复
5527
+ var key_sign = "sign_" + new Date().getTime();
5453
5528
  message = message.replaceAll(keyWordProblem, function(e) {
5454
- return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
5529
+ return key_sign;
5530
+ });
5531
+ message = remarkable.render(message);
5532
+ message = message.replaceAll(key_sign, function(e) {
5533
+ return "<span class=".concat(styles.sign, ">").concat(keyWordProblem, "</span>");
5455
5534
  });
5456
5535
  } else {
5457
5536
  message = remarkable.render(message);
5458
5537
  }
5459
5538
  var position = 0;
5460
5539
  message = message.replaceAll(new RegExp("<pre", "ig"), function(i, index) {
5461
- //copyText(${item.message,2,position})
5462
5540
  position++;
5463
- // console.log(i,index,onClick={copyText} ,'skdcnsdjk')
5464
5541
  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');
5465
5542
  return text;
5466
5543
  });
@@ -5653,12 +5730,33 @@ var CustomerService = function(props) {
5653
5730
  /*#__PURE__*/ jsxs("div", {
5654
5731
  className: styles.content,
5655
5732
  children: [
5656
- /*#__PURE__*/ jsx("p", {
5733
+ item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ jsx("p", {
5657
5734
  dangerouslySetInnerHTML: {
5658
5735
  __html: message
5659
5736
  },
5660
5737
  className: styles.content_child
5661
5738
  }),
5739
+ item.message == "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ jsxs("p", {
5740
+ children: [
5741
+ "AI助手繁忙,请稍后再提问或",
5742
+ /*#__PURE__*/ jsx("span", {
5743
+ className: styles.find_teacher_con,
5744
+ onClick: function() {
5745
+ var extraInfo = historyMessageList[i - 1].extraInfo;
5746
+ var url = "";
5747
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
5748
+ url = JSON.parse(extraInfo)[0].value;
5749
+ }
5750
+ setProblem({
5751
+ question: historyMessageList[i - 1].message,
5752
+ url: url
5753
+ });
5754
+ setShowTeacherList(true);
5755
+ },
5756
+ children: "召唤老师回答"
5757
+ })
5758
+ ]
5759
+ }),
5662
5760
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
5663
5761
  className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
5664
5762
  children: [
@@ -6525,7 +6623,7 @@ var CustomerService = function(props) {
6525
6623
  mask: false,
6526
6624
  rootClassName: styles.service_ChatWindow_Drawer,
6527
6625
  children: [
6528
- showType == 1 && /*#__PURE__*/ jsx("div", {
6626
+ showType == 1 && !showScreenshot && /*#__PURE__*/ jsx("div", {
6529
6627
  style: {
6530
6628
  display: "".concat(showContacts && roomId != "" ? "block" : "none")
6531
6629
  },