bhd-components 0.7.8 → 0.7.10

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, B as html2canvas, D as Drawer, F as HighlightJS, Z as ZoomInOutlined, G as _to_consumable_array } from './bd8fe330.esm.es5.development.js';
2
- export { J as Affix, K as Alert, N as Anchor, aG as App, O as AutoComplete, Q as Avatar, V as BackTop, W as Badge, Y as Breadcrumb, $ as Button, a0 as Calendar, a1 as Card, a2 as Carousel, a3 as Cascader, a4 as Checkbox, a5 as Col, a6 as Collapse, a7 as DatePicker, a8 as Descriptions, a9 as Divider, D as Drawer, aa as Dropdown, ab as Empty, U as FloatButton, ac as Form, ad as Grid, ae as Image, v as Input, af as InputNumber, ag as Layout, ah as List, ai as Mentions, aj as Menu, M as Modal, al as Popconfirm, am as Popover, an as Progress, aN as QRCode, ao as Radio, ap as Rate, aq as Result, ar as Row, as as Segmented, g as Select, at as Skeleton, au as Slider, av as Space, aw as Spin, ax as Statistic, ay as Steps, az as Switch, aA as Tabs, aB as Tag, aD as TimePicker, aE as Timeline, T as Tooltip, aF as Tour, aH as Transfer, aI as Tree, aJ as TreeSelect, aK as Typography, aL as Upload, aM as Watermark, aP as en_US, ak as notification, aC as theme, aO as version, z as zh_CN } from './bd8fe330.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 './e7af2e4a.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 './e7af2e4a.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';
@@ -3166,7 +3166,7 @@ var AppViewImage = /*#__PURE__*/ forwardRef(function(props, ref) {
3166
3166
  });
3167
3167
  var ViewImage$1 = AppViewImage;
3168
3168
 
3169
- var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__061cabac","ChatWindow_Modal":"index_module_ChatWindow_Modal__061cabac","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__061cabac","header_wrap":"index_module_header_wrap__061cabac","top":"index_module_top__061cabac","user":"index_module_user__061cabac","count":"index_module_count__061cabac","operate":"index_module_operate__061cabac","line":"index_module_line__061cabac","popover_main":"index_module_popover_main__061cabac","popover":"index_module_popover__061cabac","header_wrap_newlabo":"index_module_header_wrap_newlabo__061cabac","Drawer_main":"index_module_Drawer_main__061cabac","loading":"index_module_loading__061cabac","message_con":"index_module_message_con__061cabac","left":"index_module_left__061cabac","head_sculpture":"index_module_head_sculpture__061cabac","main_content":"index_module_main_content__061cabac","right":"index_module_right__061cabac","main":"index_module_main__061cabac","main_content_flag":"index_module_main_content_flag__061cabac","operate_modal":"index_module_operate_modal__061cabac","operate_modal_bottom":"index_module_operate_modal_bottom__061cabac","active":"index_module_active__061cabac","stop_generate":"index_module_stop_generate__061cabac","icon":"index_module_icon__061cabac","find_teacher":"index_module_find_teacher__061cabac","stop_findTeacher":"index_module_stop_findTeacher__061cabac","content":"index_module_content__061cabac","content_child":"index_module_content_child__061cabac","sign":"index_module_sign__061cabac","ask_question":"index_module_ask_question__061cabac","association_problem":"index_module_association_problem__061cabac","img_con":"index_module_img_con__061cabac","mask_zoom":"index_module_mask_zoom__061cabac","copyCode":"index_module_copyCode__061cabac","time":"index_module_time__061cabac","citation_content":"index_module_citation_content__061cabac","text_exceed":"index_module_text_exceed__061cabac","popover_content":"index_module_popover_content__061cabac","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__061cabac","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__061cabac","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__061cabac","issues_list_teacherList":"index_module_issues_list_teacherList__061cabac","item":"index_module_item__061cabac","issues_list":"index_module_issues_list__061cabac","issues_list_flag":"index_module_issues_list_flag__061cabac","Drawer_buttom":"index_module_Drawer_buttom__061cabac","input_wrap":"index_module_input_wrap__061cabac","input":"index_module_input__061cabac","picture_layout":"index_module_picture_layout__061cabac","icon_close":"index_module_icon_close__061cabac","icon_zoom":"index_module_icon_zoom__061cabac","anticon":"index_module_anticon__061cabac","no_AI":"index_module_no_AI__061cabac","screenshot":"index_module_screenshot__061cabac","disabled":"index_module_disabled__061cabac","content_main":"index_module_content_main__061cabac","content_con":"index_module_content_con__061cabac","delete_quote":"index_module_delete_quote__061cabac","sending":"index_module_sending__061cabac","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__061cabac","main_list":"index_module_main_list__061cabac","chat_content":"index_module_chat_content__061cabac","popover_main_content":"index_module_popover_main_content__061cabac","popover_main_content_name":"index_module_popover_main_content_name__061cabac","teacher_layout":"index_module_teacher_layout__061cabac","bottom":"index_module_bottom__061cabac","delete":"index_module_delete__061cabac","num":"index_module_num__061cabac","shrink":"index_module_shrink__061cabac","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__061cabac","teacher_layout_modal":"index_module_teacher_layout_modal__061cabac","ai":"index_module_ai__061cabac","user_info":"index_module_user_info__061cabac","message":"index_module_message__061cabac","con":"index_module_con__061cabac","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__061cabac","history_list":"index_module_history_list__061cabac","search_layout":"index_module_search_layout__061cabac","mymove":"index_module_mymove__061cabac","title":"index_module_title__061cabac","search_top":"index_module_search_top__061cabac","list_item":"index_module_list_item__061cabac","list_summary":"index_module_list_summary__061cabac","head_img":"index_module_head_img__061cabac","list_desc":"index_module_list_desc__061cabac","name":"index_module_name__061cabac","decs":"index_module_decs__061cabac","open":"index_module_open__061cabac","list_summary_active":"index_module_list_summary_active__061cabac","list_detail":"index_module_list_detail__061cabac","list":"index_module_list__061cabac","list_more":"index_module_list_more__061cabac","no_data":"index_module_no_data__061cabac","history_list_broadside":"index_module_history_list_broadside__061cabac","screenshot_Modal":"index_module_screenshot_Modal__061cabac","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__061cabac"};
3169
+ var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__cb4626a6","ChatWindow_Modal":"index_module_ChatWindow_Modal__cb4626a6","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__cb4626a6","header_wrap":"index_module_header_wrap__cb4626a6","top":"index_module_top__cb4626a6","user":"index_module_user__cb4626a6","count":"index_module_count__cb4626a6","operate":"index_module_operate__cb4626a6","line":"index_module_line__cb4626a6","popover_main":"index_module_popover_main__cb4626a6","popover":"index_module_popover__cb4626a6","header_wrap_newlabo":"index_module_header_wrap_newlabo__cb4626a6","Drawer_main":"index_module_Drawer_main__cb4626a6","loading":"index_module_loading__cb4626a6","message_con":"index_module_message_con__cb4626a6","left":"index_module_left__cb4626a6","head_sculpture":"index_module_head_sculpture__cb4626a6","main_content":"index_module_main_content__cb4626a6","right":"index_module_right__cb4626a6","main":"index_module_main__cb4626a6","main_content_flag":"index_module_main_content_flag__cb4626a6","operate_modal":"index_module_operate_modal__cb4626a6","operate_modal_bottom":"index_module_operate_modal_bottom__cb4626a6","active":"index_module_active__cb4626a6","stop_generate":"index_module_stop_generate__cb4626a6","icon":"index_module_icon__cb4626a6","find_teacher":"index_module_find_teacher__cb4626a6","stop_findTeacher":"index_module_stop_findTeacher__cb4626a6","content":"index_module_content__cb4626a6","content_child":"index_module_content_child__cb4626a6","sign":"index_module_sign__cb4626a6","ask_question":"index_module_ask_question__cb4626a6","association_problem":"index_module_association_problem__cb4626a6","img_con":"index_module_img_con__cb4626a6","mask_zoom":"index_module_mask_zoom__cb4626a6","copyCode":"index_module_copyCode__cb4626a6","association_problem_flag":"index_module_association_problem_flag__cb4626a6","related_issues_flag":"index_module_related_issues_flag__cb4626a6","time":"index_module_time__cb4626a6","citation_content":"index_module_citation_content__cb4626a6","text_exceed":"index_module_text_exceed__cb4626a6","popover_content":"index_module_popover_content__cb4626a6","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__cb4626a6","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__cb4626a6","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__cb4626a6","issues_list_teacherList":"index_module_issues_list_teacherList__cb4626a6","item":"index_module_item__cb4626a6","issues_list":"index_module_issues_list__cb4626a6","issues_list_flag":"index_module_issues_list_flag__cb4626a6","Drawer_buttom":"index_module_Drawer_buttom__cb4626a6","input_wrap":"index_module_input_wrap__cb4626a6","input":"index_module_input__cb4626a6","picture_layout":"index_module_picture_layout__cb4626a6","icon_close":"index_module_icon_close__cb4626a6","icon_zoom":"index_module_icon_zoom__cb4626a6","anticon":"index_module_anticon__cb4626a6","no_AI":"index_module_no_AI__cb4626a6","screenshot":"index_module_screenshot__cb4626a6","disabled":"index_module_disabled__cb4626a6","content_main":"index_module_content_main__cb4626a6","content_con":"index_module_content_con__cb4626a6","delete_quote":"index_module_delete_quote__cb4626a6","sending":"index_module_sending__cb4626a6","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__cb4626a6","main_list":"index_module_main_list__cb4626a6","chat_content":"index_module_chat_content__cb4626a6","popover_main_content":"index_module_popover_main_content__cb4626a6","popover_main_content_name":"index_module_popover_main_content_name__cb4626a6","teacher_layout":"index_module_teacher_layout__cb4626a6","bottom":"index_module_bottom__cb4626a6","delete":"index_module_delete__cb4626a6","num":"index_module_num__cb4626a6","shrink":"index_module_shrink__cb4626a6","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__cb4626a6","teacher_layout_modal":"index_module_teacher_layout_modal__cb4626a6","ai":"index_module_ai__cb4626a6","user_info":"index_module_user_info__cb4626a6","message":"index_module_message__cb4626a6","con":"index_module_con__cb4626a6","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__cb4626a6","history_list":"index_module_history_list__cb4626a6","search_layout":"index_module_search_layout__cb4626a6","mymove":"index_module_mymove__cb4626a6","title":"index_module_title__cb4626a6","search_top":"index_module_search_top__cb4626a6","list_item":"index_module_list_item__cb4626a6","list_summary":"index_module_list_summary__cb4626a6","head_img":"index_module_head_img__cb4626a6","list_desc":"index_module_list_desc__cb4626a6","name":"index_module_name__cb4626a6","decs":"index_module_decs__cb4626a6","open":"index_module_open__cb4626a6","list_summary_active":"index_module_list_summary_active__cb4626a6","list_detail":"index_module_list_detail__cb4626a6","list":"index_module_list__cb4626a6","list_more":"index_module_list_more__cb4626a6","no_data":"index_module_no_data__cb4626a6","history_list_broadside":"index_module_history_list_broadside__cb4626a6","screenshot_Modal":"index_module_screenshot_Modal__cb4626a6","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__cb4626a6"};
3170
3170
 
3171
3171
  //消息已读
3172
3172
  var readMessage = function(roomId, urllocation, userData, http) {
@@ -4135,7 +4135,7 @@ var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAA
4135
4135
  var styles = modules_63b47c51;
4136
4136
  var TextArea = Input.TextArea;
4137
4137
  var CustomerService = function(props) {
4138
- var userData = props.userData, http = props.http, urllocation = props.urllocation, onCancel = props.onCancel, serverName = props.serverName, fetchEventSource = props.fetchEventSource, initShowType = props.initShowType, onEvent = props.onEvent, stepIds = props.stepIds, stepId = props.stepId; props.config;
4138
+ var userData = props.userData, http = props.http, urllocation = props.urllocation, onCancel = props.onCancel, serverName = props.serverName, fetchEventSource = props.fetchEventSource, initShowType = props.initShowType, onEvent = props.onEvent, stepIds = props.stepIds, stepId = props.stepId, screenshotAreaId = props.screenshotAreaId; props.config;
4139
4139
  // const { bese64String, startRecord, stopRecord } = useMediaRecorder(); //语音转文字
4140
4140
  // const [voiceRecordingStatus, setVoiceRecordingStatus] = useState(3); //语音录制状态 3,语音识别完成 2,录制中, 1,录制结束
4141
4141
  var _useState = _sliced_to_array(useState([]), 2), copyTextOBJ = _useState[0], setCopyTextObj = _useState[1]; //复制的消息id
@@ -4145,6 +4145,7 @@ var CustomerService = function(props) {
4145
4145
  var _useState4 = _sliced_to_array(useState(""), 2), keyWord = _useState4[0], setKeyWord = _useState4[1]; //搜索内容
4146
4146
  var _useState5 = _sliced_to_array(useState([]), 2), questionsList = _useState5[0], setQuestionsList = _useState5[1]; //问题列表
4147
4147
  var _useState6 = _sliced_to_array(useState([]), 2), hotQuestionsList = _useState6[0], setHotQuestionsList = _useState6[1]; //热门问题
4148
+ // const [videoHotQuestionsList, setVideoHotQuestionsList] = useState([]); //热门问题
4148
4149
  var _useState7 = _sliced_to_array(useState(false), 2), greetingMessage = _useState7[0], setGreetingMessage = _useState7[1]; //聊天记录列表是否请求完成
4149
4150
  var _useState8 = _sliced_to_array(useState(1), 2), pageNum = _useState8[0], setPageNum = _useState8[1]; //页码
4150
4151
  var _useState9 = _sliced_to_array(useState(0), 2), pageNumHistory = _useState9[0], setPageNumHistory = _useState9[1]; //用于搜索历史记录后的页码
@@ -4182,6 +4183,7 @@ var CustomerService = function(props) {
4182
4183
  var scrollTopHei = useRef(0);
4183
4184
  var isPosition = useRef(true);
4184
4185
  var recommendeQuestionID = useRef([]); //推荐问题id
4186
+ var videoHotQuestionsList = useRef([]); //视频热门问题
4185
4187
  var mid = props.userData.mid;
4186
4188
  var remarkable = new Remarkable({
4187
4189
  highlight: function highlight(str, lang) {
@@ -4196,30 +4198,51 @@ var CustomerService = function(props) {
4196
4198
  return ""; // use external default escaping
4197
4199
  }
4198
4200
  });
4201
+ useEffect(function() {
4202
+ // console.log(props,'lsdkcmsdlcksd')
4203
+ // getQuestiionsList("", 1);
4204
+ if (props.config && props.config.type == "video") {
4205
+ //获取热门推荐
4206
+ videoPageQuestiionsList(1);
4207
+ // getQuestiionsList("", 3)
4208
+ }
4209
+ setShowType(initShowType);
4210
+ //获取视频页面推荐问题
4211
+ // videoPageQuestiionsList();
4212
+ // scrollToBottom();
4213
+ }, [
4214
+ initShowType
4215
+ ]);
4199
4216
  useEffect(function() {
4200
4217
  if (showType == 5) {
4201
- setImgBese64("");
4202
- html2canvas(document.getElementsByTagName("html")[0]).then(function(canvas) {
4203
- console.log(canvas, 22222);
4204
- setTimeout(function() {
4205
- //let dom = document.getElementById("container_html5_api")
4206
- var dom = document.getElementById("rootWrapper");
4207
- html2canvas(dom, {
4208
- backgroundColor: null,
4209
- useCORS: true,
4210
- allowTaint: true,
4211
- scale: 1,
4212
- logging: false
4213
- }).then(function(canvas) {
4214
- // document.body.appendChild(canvas);
4215
- console.log(canvas, 4444444);
4216
- // var base64URL = canvas.toDataURL('image/jpeg')
4217
- // let base64URL=canvas.toDataURL("image/jpg", 1.0)
4218
- var base64URL = canvas.toDataURL("image/png");
4219
- setImgBese64(base64URL);
4220
- });
4221
- }, 100);
4222
- });
4218
+ try {
4219
+ setImgBese64("");
4220
+ // html2canvas(document.getElementsByTagName('html')[0],{
4221
+ // // ignoreElements:(element)=>{
4222
+ // // if(element.compareDocumentPosition(dom)===2)return true
4223
+ // // return false
4224
+ // // }
4225
+ // }).then((canvas)=>{
4226
+ // console.log(canvas,22222);
4227
+ // setTimeout(()=>{
4228
+ var dom = document.getElementById(screenshotAreaId);
4229
+ html2canvas(dom, {
4230
+ useCORS: true,
4231
+ // allowTaint: true, // 污染处理
4232
+ scale: 1
4233
+ }).then(function(canvas) {
4234
+ // document.body.appendChild(canvas);
4235
+ // document.body.appendChild(canvas);
4236
+ console.log(canvas, 99999);
4237
+ // var base64URL = canvas.toDataURL('image/jpeg')
4238
+ var base64URL = canvas.toDataURL("image/jpg", 1.0);
4239
+ setImgBese64(base64URL);
4240
+ });
4241
+ // },100)
4242
+ // })
4243
+ } catch (error) {
4244
+ console.log(error);
4245
+ }
4223
4246
  }
4224
4247
  if (showType != 1 && !firstLoad && pageCount > 0) {
4225
4248
  setFirstLoad(true);
@@ -4303,16 +4326,21 @@ var CustomerService = function(props) {
4303
4326
  buttomHei,
4304
4327
  showType
4305
4328
  ]);
4329
+ //创建聊天室并获取聊天室列表
4306
4330
  useEffect(function() {
4307
- // console.log(props,'lsdkcmsdlcksd')
4308
- // getQuestiionsList("", 1);
4309
- setShowType(initShowType);
4310
- //获取视频页面推荐问题
4311
- videoPageQuestiionsList();
4312
- scrollToBottom();
4313
- }, [
4314
- initShowType
4315
- ]);
4331
+ createRooms("AI").then(function(res) {
4332
+ setRoomId(res.data.id);
4333
+ });
4334
+ roomsListTimer();
4335
+ return function() {
4336
+ clearTimeout(receiveMessageTimer.current);
4337
+ // clearTimeout(voiceCountdownTimer.current);
4338
+ clearTimeout(listTimer.current);
4339
+ clearTimeout(timer.current);
4340
+ clearTimeout(roomMessage.current);
4341
+ clearTimeout(chatRoomList.current);
4342
+ };
4343
+ }, []);
4316
4344
  useEffect(function() {
4317
4345
  if (roomId != "") {
4318
4346
  if (lastId == "") {
@@ -4333,21 +4361,6 @@ var CustomerService = function(props) {
4333
4361
  }, [
4334
4362
  roomId
4335
4363
  ]);
4336
- //创建聊天室并获取聊天室列表
4337
- useEffect(function() {
4338
- createRooms("AI").then(function(res) {
4339
- setRoomId(res.data.id);
4340
- });
4341
- roomsListTimer();
4342
- return function() {
4343
- clearTimeout(receiveMessageTimer.current);
4344
- // clearTimeout(voiceCountdownTimer.current);
4345
- clearTimeout(listTimer.current);
4346
- clearTimeout(timer.current);
4347
- clearTimeout(roomMessage.current);
4348
- clearTimeout(chatRoomList.current);
4349
- };
4350
- }, []);
4351
4364
  //进入页面,发送打招呼信息
4352
4365
  useEffect(function() {
4353
4366
  //老师的聊天窗口不发送打招呼信息
@@ -4366,9 +4379,8 @@ var CustomerService = function(props) {
4366
4379
  scrollToBottom();
4367
4380
  }
4368
4381
  }, [
4369
- greetingMessage,
4370
- hotQuestionsList
4371
- ]);
4382
+ greetingMessage
4383
+ ]); //hotQuestionsList
4372
4384
  //查找需要复制的代码
4373
4385
  var findCopyContent = function(e) {
4374
4386
  var source = findParent(e.target, styles.copyCode);
@@ -4411,10 +4423,9 @@ var CustomerService = function(props) {
4411
4423
  var questionsList = [];
4412
4424
  var obj = {};
4413
4425
  if (type == 1) {
4414
- var questionsId = [];
4426
+ console.log(hotQuestionsList, "33322221111");
4415
4427
  questionsList = hotQuestionsList.map(function(item, index) {
4416
4428
  if (index < 3) {
4417
- questionsId.push(item.id);
4418
4429
  return {
4419
4430
  key: "messageSource",
4420
4431
  value: item.id,
@@ -4425,7 +4436,6 @@ var CustomerService = function(props) {
4425
4436
  return null;
4426
4437
  }
4427
4438
  });
4428
- recommendeQuestionID.current = questionsId; //保存推荐问题id
4429
4439
  questionsList = questionsList.filter(function(i) {
4430
4440
  return i != null;
4431
4441
  });
@@ -4438,8 +4448,11 @@ var CustomerService = function(props) {
4438
4448
  };
4439
4449
  if (pageNumHistory <= 1) {
4440
4450
  setHistoryMessageList(function(historyMessageList) {
4441
- var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
4442
- id: new Date().getTime() + "dede",
4451
+ var newHistoryMessageList = historyMessageList.filter(function(e) {
4452
+ return e.id != "123456_date";
4453
+ });
4454
+ newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
4455
+ id: "123456_date",
4443
4456
  upvoted: false,
4444
4457
  downvoted: false,
4445
4458
  quotedMessage: "",
@@ -4644,6 +4657,40 @@ var CustomerService = function(props) {
4644
4657
  //点击知识库的问题,或者是点击问候消息
4645
4658
  if (questions.length > 0) {
4646
4659
  questions = questions[0];
4660
+ //知识库联想的问题没有答案
4661
+ if (!questions.answer && userData.modules.some(function(item) {
4662
+ return item.short == "AIservice";
4663
+ })) {
4664
+ var sendData = {
4665
+ //相关数据
4666
+ roomId: roomId,
4667
+ message: questions.question,
4668
+ quotedMessage: "",
4669
+ regenerate: true,
4670
+ generateUpvoteOrDownvoteMessage: false
4671
+ };
4672
+ if (pageNumHistory <= 1) {
4673
+ setHistoryMessageList(function(historyMessageList) {
4674
+ var newHistoryMessageList = historyMessageList.concat({
4675
+ roomId: roomId,
4676
+ sender: mid,
4677
+ recevier: "AI",
4678
+ message: questions.question,
4679
+ quotedMessage: "",
4680
+ id: "654321",
4681
+ upvoted: false,
4682
+ downvoted: false,
4683
+ createdAt: getDataTime(-1),
4684
+ extraInfo: JSON.stringify([])
4685
+ });
4686
+ return newHistoryMessageList;
4687
+ });
4688
+ }
4689
+ setFinished(false);
4690
+ aiSendQuestions(3, sendData, 1);
4691
+ return;
4692
+ }
4693
+ console.log(questions, "知识库内容11111");
4647
4694
  //向知识库发送问题 type 1,发送问题 2 发送答案 obj 需要的参数
4648
4695
  var obj = {
4649
4696
  roomId: roomId,
@@ -4669,7 +4716,7 @@ var CustomerService = function(props) {
4669
4716
  } else if (userData.modules.some(function(item) {
4670
4717
  return item.short == "AIservice";
4671
4718
  })) {
4672
- var sendData = {
4719
+ var sendData1 = {
4673
4720
  //相关数据
4674
4721
  roomId: roomId,
4675
4722
  message: keyWord,
@@ -4678,16 +4725,8 @@ var CustomerService = function(props) {
4678
4725
  generateUpvoteOrDownvoteMessage: false
4679
4726
  };
4680
4727
  var imageUrl = "";
4681
- // if(citationContent.imageUrl){
4682
- // sendData.image = citationContent.imageUrl;
4683
- // imageUrl = citationContent.imageUrl;
4684
- // getBase64Image(citationContent.imageUrl).then((res)=>{
4685
- // console.log(res,33333);
4686
- // });
4687
- // console.log(imageUrl,'转换的bese64');
4688
- // }
4689
4728
  if (screenshotBese64) {
4690
- sendData.image = screenshotBese64;
4729
+ sendData1.image = screenshotBese64;
4691
4730
  imageUrl = screenshotBese64;
4692
4731
  }
4693
4732
  if (pageNumHistory <= 1) {
@@ -4713,7 +4752,7 @@ var CustomerService = function(props) {
4713
4752
  });
4714
4753
  }
4715
4754
  setFinished(false);
4716
- aiSendQuestions(3, sendData, 1);
4755
+ aiSendQuestions(3, sendData1, 1);
4717
4756
  setScreenshotBese64("");
4718
4757
  //存在AI客服
4719
4758
  } else {
@@ -4738,9 +4777,9 @@ var CustomerService = function(props) {
4738
4777
  }
4739
4778
  console.log(type, "接受答案77777");
4740
4779
  //获取下面的推荐问题
4741
- if (type == 2) {
4742
- videoPageQuestiionsList(2);
4743
- }
4780
+ // if(type == 2){
4781
+ // videoPageQuestiionsList(2);
4782
+ // }
4744
4783
  http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
4745
4784
  if (res.data.id) {
4746
4785
  if (pageNumHistory <= 1) {
@@ -4804,6 +4843,23 @@ var CustomerService = function(props) {
4804
4843
  });
4805
4844
  });
4806
4845
  }, 60 * 1000);
4846
+ if (props.config && props.config.type == "video" && props.config.params) {
4847
+ var params = props.config.params;
4848
+ var videoId = params.videoId;
4849
+ var watchTime = params.videoProgress;
4850
+ var courseId = getQuery("yc_id");
4851
+ var sectionId = params.VideoBriefSummaryId;
4852
+ obj.contexts = [
4853
+ {
4854
+ "type": "VIDEO",
4855
+ "courseId": courseId,
4856
+ "sectionId": sectionId,
4857
+ "videoId": videoId,
4858
+ "watchTime": watchTime
4859
+ }
4860
+ ];
4861
+ obj.regenerate = false;
4862
+ }
4807
4863
  var data = JSON.stringify(obj);
4808
4864
  setKeyWord("");
4809
4865
  setQuestionsList([]);
@@ -4843,6 +4899,10 @@ var CustomerService = function(props) {
4843
4899
  });
4844
4900
  scrollToBottom();
4845
4901
  }
4902
+ if (props.config && props.config.type == "video") {
4903
+ //先请求问题列表
4904
+ videoPageQuestiionsList(3);
4905
+ }
4846
4906
  //使用fetchEventSource接收数据
4847
4907
  fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
4848
4908
  method: "POST",
@@ -5013,9 +5073,23 @@ var CustomerService = function(props) {
5013
5073
  } else {
5014
5074
  var newHistoryMessageList2 = list1.map(function(item) {
5015
5075
  message = item.message + obj.message;
5076
+ var extraInfo = [];
5077
+ // message = '抱歉,我暂时无法回答这样的问题。'
5078
+ if (message == "抱歉,我暂时无法回答这样的问题。") {
5079
+ extraInfo = videoHotQuestionsList.current.map(function(str, index) {
5080
+ return {
5081
+ key: "messageSource",
5082
+ value: str.id,
5083
+ question: str.question,
5084
+ answer: str.answer,
5085
+ welcomeMessage: true
5086
+ };
5087
+ });
5088
+ }
5016
5089
  if (item.id == id) {
5017
5090
  return _object_spread_props(_object_spread({}, item), {
5018
- message: message
5091
+ message: message,
5092
+ extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
5019
5093
  });
5020
5094
  } else {
5021
5095
  return item;
@@ -5342,15 +5416,14 @@ var CustomerService = function(props) {
5342
5416
  } else if (flag == 3) {
5343
5417
  data = {
5344
5418
  page: 1,
5345
- maxPageSize: 4,
5419
+ maxPageSize: 5,
5346
5420
  question: value,
5347
5421
  sectionId: getQuery("s_id")
5348
5422
  };
5349
5423
  } else if (flag == 4) {
5350
5424
  data = {
5351
5425
  page: 1,
5352
- maxPageSize: 4,
5353
- question: value
5426
+ maxPageSize: 4
5354
5427
  };
5355
5428
  } else {
5356
5429
  data = {
@@ -5367,37 +5440,45 @@ var CustomerService = function(props) {
5367
5440
  if (flag == 1) {
5368
5441
  setHotQuestionsList(questionList);
5369
5442
  } else if (flag == 4) {
5370
- setQuestionsList(function(questionList) {
5443
+ setHotQuestionsList(function(questionList) {
5371
5444
  return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
5372
5445
  });
5373
5446
  } else {
5374
5447
  setQuestionsList(questionList);
5375
5448
  }
5376
- if (questionList.length < 4 && flag == 3) {
5449
+ if (questionList.length < 5 && flag == 3) {
5377
5450
  console.log("视频页面,联想问题小于4个");
5378
5451
  //视频页面,联想问题小于4个
5379
- getQuestiionsList(value, 4);
5452
+ http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
5453
+ params: {
5454
+ page: 1,
5455
+ maxPageSize: 5 - questionList.length
5456
+ }
5457
+ }).then(function(res) {
5458
+ if (res.data.questions) {
5459
+ setHotQuestionsList(function(questionList) {
5460
+ return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
5461
+ });
5462
+ }
5463
+ });
5380
5464
  }
5381
5465
  }
5382
5466
  });
5383
5467
  };
5384
- //获取视频页面热门问题 flag == 1,默认推荐问题 == 2,已经推荐过问题
5468
+ //获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
5385
5469
  var videoPageQuestiionsList = function() {
5386
5470
  var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
5387
- console.log(props, 3333333);
5471
+ console.log(flag, props, 3333333);
5388
5472
  var config = props.config;
5389
5473
  if (config && config.type == "video" && config.params) {
5390
5474
  var params = config.params;
5391
5475
  var videoId = params.videoId;
5392
5476
  var watchTime = params.videoProgress;
5393
5477
  var courseId = getQuery("yc_id");
5394
- var sectionId = getQuery("s_id");
5395
- if (videoId && watchTime && courseId && sectionId) {
5396
- console.log("请求接口2222", config);
5478
+ var sectionId = params.VideoBriefSummaryId;
5479
+ if (videoId && courseId && sectionId) {
5397
5480
  http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
5398
- "recommendedQuestions": flag == 2 ? recommendeQuestionID.current : [
5399
- ""
5400
- ],
5481
+ "recommendedQuestions": [],
5401
5482
  "contexts": [
5402
5483
  {
5403
5484
  "type": "VIDEO",
@@ -5407,19 +5488,32 @@ var CustomerService = function(props) {
5407
5488
  "watchTime": watchTime
5408
5489
  }
5409
5490
  ],
5410
- "maximum": 5
5491
+ "maximum": flag == 1 || flag == 2 ? 3 : 5
5411
5492
  }).then(function(res) {
5412
- console.log(res, 333333);
5413
5493
  if (res.data.total > 0) {
5414
5494
  var data = res.data.questions;
5495
+ if (flag == 3) {
5496
+ // setQuestionsList(data);
5497
+ // setVideoHotQuestionsList(data);
5498
+ videoHotQuestionsList.current = data;
5499
+ return;
5500
+ }
5415
5501
  if (flag == 2) {
5416
5502
  setBottomRecommendationQuestions(data);
5417
5503
  } else {
5418
5504
  setHotQuestionsList(data);
5419
5505
  }
5506
+ var ids = [];
5507
+ data.map(function(str) {
5508
+ ids.push(str.id);
5509
+ });
5510
+ recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
5420
5511
  resettingBottomHei();
5421
5512
  scrollToBottom();
5422
- console.log(data, 99999);
5513
+ // console.log(data,99999);
5514
+ // if(data.length < 4){
5515
+ // getQuestiionsList('',4)
5516
+ // }
5423
5517
  }
5424
5518
  }).catch(function() {});
5425
5519
  }
@@ -6063,23 +6157,37 @@ var CustomerService = function(props) {
6063
6157
  })
6064
6158
  ]
6065
6159
  }),
6066
- 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", {
6067
- className: styles.association_problem,
6068
- children: JSON.parse(item.extraInfo).map(function(list, index) {
6069
- return /*#__PURE__*/ jsxs("li", {
6070
- onClick: function() {
6071
- sendMessage(list, 1);
6072
- },
6073
- children: [
6074
- index + 1,
6075
- ".",
6076
- list.question
6077
- ]
6078
- }, i + "_" + index + "_" + list.value);
6079
- })
6160
+ item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ jsxs("ul", {
6161
+ className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? "association_problem_flag" : ""),
6162
+ children: [
6163
+ item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ jsx("li", {
6164
+ className: styles.related_issues_flag,
6165
+ children: /*#__PURE__*/ jsx("span", {
6166
+ children: "相关问题"
6167
+ })
6168
+ }),
6169
+ JSON.parse(item.extraInfo).map(function(list, index) {
6170
+ return /*#__PURE__*/ jsx("li", {
6171
+ onClick: function() {
6172
+ sendMessage(list, 1);
6173
+ if (props.config && props.config.type == "video") {
6174
+ //先请求问题列表
6175
+ videoPageQuestiionsList(2);
6176
+ }
6177
+ },
6178
+ children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ jsxs(Fragment, {
6179
+ children: [
6180
+ index + 1,
6181
+ ".",
6182
+ list.question
6183
+ ]
6184
+ })
6185
+ }, i + "_" + index + "_" + list.value);
6186
+ })
6187
+ ]
6080
6188
  }),
6081
6189
  //findTeacher//是否在召唤老师过程中,是否是最后一条消息
6082
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
6190
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i),
6083
6191
  //召唤老师回答按钮
6084
6192
  isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
6085
6193
  return item.short == "TeacherAnswer";
@@ -6303,11 +6411,9 @@ var CustomerService = function(props) {
6303
6411
  if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl") {
6304
6412
  findTeacherBtn = true;
6305
6413
  }
6414
+ /// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
6306
6415
  return /*#__PURE__*/ jsxs("div", {
6307
6416
  className: "".concat(styles.operate_modal_bottom),
6308
- style: {
6309
- position: showStopBtn && isPosition.current ? "sticky" : "relative"
6310
- },
6311
6417
  children: [
6312
6418
  /*#__PURE__*/ jsxs("p", {
6313
6419
  className: styles.stop_generate,
@@ -6577,6 +6683,7 @@ var CustomerService = function(props) {
6577
6683
  className: styles.icon_close,
6578
6684
  onClick: function() {
6579
6685
  setScreenshotBese64("");
6686
+ resettingBottomHei();
6580
6687
  },
6581
6688
  children: /*#__PURE__*/ jsx(CustomRoundClose$1, {})
6582
6689
  }),
@@ -6953,7 +7060,7 @@ var CustomerService = function(props) {
6953
7060
  return /*#__PURE__*/ jsx("div", {
6954
7061
  className: styles.issues_list_flag,
6955
7062
  style: {
6956
- bottom: "".concat(buttomHei, "px")
7063
+ bottom: "".concat(buttomHei - 60, "px")
6957
7064
  },
6958
7065
  id: "BottomAssociationProblem",
6959
7066
  children: bottomRecommendationQuestions.map(function(item) {