bhd-components 0.7.9 → 0.7.11

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, F as _to_consumable_array, Z as ZoomInOutlined } from './072bdcac.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 './072bdcac.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 './facd5ad8.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 './facd5ad8.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__a8c40776","ChatWindow_Modal":"index_module_ChatWindow_Modal__a8c40776","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__a8c40776","header_wrap":"index_module_header_wrap__a8c40776","top":"index_module_top__a8c40776","user":"index_module_user__a8c40776","count":"index_module_count__a8c40776","operate":"index_module_operate__a8c40776","line":"index_module_line__a8c40776","popover_main":"index_module_popover_main__a8c40776","popover":"index_module_popover__a8c40776","header_wrap_newlabo":"index_module_header_wrap_newlabo__a8c40776","Drawer_main":"index_module_Drawer_main__a8c40776","loading":"index_module_loading__a8c40776","message_con":"index_module_message_con__a8c40776","left":"index_module_left__a8c40776","head_sculpture":"index_module_head_sculpture__a8c40776","main_content":"index_module_main_content__a8c40776","right":"index_module_right__a8c40776","main":"index_module_main__a8c40776","main_content_flag":"index_module_main_content_flag__a8c40776","operate_modal":"index_module_operate_modal__a8c40776","operate_modal_bottom":"index_module_operate_modal_bottom__a8c40776","active":"index_module_active__a8c40776","stop_generate":"index_module_stop_generate__a8c40776","icon":"index_module_icon__a8c40776","find_teacher":"index_module_find_teacher__a8c40776","stop_findTeacher":"index_module_stop_findTeacher__a8c40776","content":"index_module_content__a8c40776","content_child":"index_module_content_child__a8c40776","sign":"index_module_sign__a8c40776","ask_question":"index_module_ask_question__a8c40776","association_problem":"index_module_association_problem__a8c40776","img_con":"index_module_img_con__a8c40776","mask_zoom":"index_module_mask_zoom__a8c40776","copyCode":"index_module_copyCode__a8c40776","time":"index_module_time__a8c40776","citation_content":"index_module_citation_content__a8c40776","text_exceed":"index_module_text_exceed__a8c40776","popover_content":"index_module_popover_content__a8c40776","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__a8c40776","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__a8c40776","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__a8c40776","issues_list_teacherList":"index_module_issues_list_teacherList__a8c40776","item":"index_module_item__a8c40776","issues_list":"index_module_issues_list__a8c40776","issues_list_flag":"index_module_issues_list_flag__a8c40776","Drawer_buttom":"index_module_Drawer_buttom__a8c40776","input_wrap":"index_module_input_wrap__a8c40776","input":"index_module_input__a8c40776","picture_layout":"index_module_picture_layout__a8c40776","icon_close":"index_module_icon_close__a8c40776","icon_zoom":"index_module_icon_zoom__a8c40776","anticon":"index_module_anticon__a8c40776","no_AI":"index_module_no_AI__a8c40776","screenshot":"index_module_screenshot__a8c40776","disabled":"index_module_disabled__a8c40776","content_main":"index_module_content_main__a8c40776","content_con":"index_module_content_con__a8c40776","delete_quote":"index_module_delete_quote__a8c40776","sending":"index_module_sending__a8c40776","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__a8c40776","main_list":"index_module_main_list__a8c40776","chat_content":"index_module_chat_content__a8c40776","popover_main_content":"index_module_popover_main_content__a8c40776","popover_main_content_name":"index_module_popover_main_content_name__a8c40776","teacher_layout":"index_module_teacher_layout__a8c40776","bottom":"index_module_bottom__a8c40776","delete":"index_module_delete__a8c40776","num":"index_module_num__a8c40776","shrink":"index_module_shrink__a8c40776","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__a8c40776","teacher_layout_modal":"index_module_teacher_layout_modal__a8c40776","ai":"index_module_ai__a8c40776","user_info":"index_module_user_info__a8c40776","message":"index_module_message__a8c40776","con":"index_module_con__a8c40776","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__a8c40776","history_list":"index_module_history_list__a8c40776","search_layout":"index_module_search_layout__a8c40776","mymove":"index_module_mymove__a8c40776","title":"index_module_title__a8c40776","search_top":"index_module_search_top__a8c40776","list_item":"index_module_list_item__a8c40776","list_summary":"index_module_list_summary__a8c40776","head_img":"index_module_head_img__a8c40776","list_desc":"index_module_list_desc__a8c40776","name":"index_module_name__a8c40776","decs":"index_module_decs__a8c40776","open":"index_module_open__a8c40776","list_summary_active":"index_module_list_summary_active__a8c40776","list_detail":"index_module_list_detail__a8c40776","list":"index_module_list__a8c40776","list_more":"index_module_list_more__a8c40776","no_data":"index_module_no_data__a8c40776","history_list_broadside":"index_module_history_list_broadside__a8c40776","screenshot_Modal":"index_module_screenshot_Modal__a8c40776","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__a8c40776"};
3169
+ var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__2a5f562d","ChatWindow_Modal":"index_module_ChatWindow_Modal__2a5f562d","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__2a5f562d","header_wrap":"index_module_header_wrap__2a5f562d","top":"index_module_top__2a5f562d","user":"index_module_user__2a5f562d","count":"index_module_count__2a5f562d","operate":"index_module_operate__2a5f562d","line":"index_module_line__2a5f562d","popover_main":"index_module_popover_main__2a5f562d","popover":"index_module_popover__2a5f562d","header_wrap_newlabo":"index_module_header_wrap_newlabo__2a5f562d","Drawer_main":"index_module_Drawer_main__2a5f562d","loading":"index_module_loading__2a5f562d","message_con":"index_module_message_con__2a5f562d","left":"index_module_left__2a5f562d","head_sculpture":"index_module_head_sculpture__2a5f562d","main_content":"index_module_main_content__2a5f562d","right":"index_module_right__2a5f562d","main":"index_module_main__2a5f562d","main_content_flag":"index_module_main_content_flag__2a5f562d","operate_modal":"index_module_operate_modal__2a5f562d","operate_modal_bottom":"index_module_operate_modal_bottom__2a5f562d","active":"index_module_active__2a5f562d","stop_generate":"index_module_stop_generate__2a5f562d","icon":"index_module_icon__2a5f562d","find_teacher":"index_module_find_teacher__2a5f562d","stop_findTeacher":"index_module_stop_findTeacher__2a5f562d","content":"index_module_content__2a5f562d","content_child":"index_module_content_child__2a5f562d","sign":"index_module_sign__2a5f562d","ask_question":"index_module_ask_question__2a5f562d","association_problem":"index_module_association_problem__2a5f562d","img_con":"index_module_img_con__2a5f562d","mask_zoom":"index_module_mask_zoom__2a5f562d","copyCode":"index_module_copyCode__2a5f562d","association_problem_flag":"index_module_association_problem_flag__2a5f562d","related_issues_flag":"index_module_related_issues_flag__2a5f562d","time":"index_module_time__2a5f562d","citation_content":"index_module_citation_content__2a5f562d","text_exceed":"index_module_text_exceed__2a5f562d","popover_content":"index_module_popover_content__2a5f562d","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__2a5f562d","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__2a5f562d","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__2a5f562d","issues_list_teacherList":"index_module_issues_list_teacherList__2a5f562d","item":"index_module_item__2a5f562d","issues_list":"index_module_issues_list__2a5f562d","issues_list_flag":"index_module_issues_list_flag__2a5f562d","Drawer_buttom":"index_module_Drawer_buttom__2a5f562d","input_wrap":"index_module_input_wrap__2a5f562d","input":"index_module_input__2a5f562d","picture_layout":"index_module_picture_layout__2a5f562d","icon_close":"index_module_icon_close__2a5f562d","icon_zoom":"index_module_icon_zoom__2a5f562d","anticon":"index_module_anticon__2a5f562d","no_AI":"index_module_no_AI__2a5f562d","screenshot":"index_module_screenshot__2a5f562d","disabled":"index_module_disabled__2a5f562d","content_main":"index_module_content_main__2a5f562d","content_con":"index_module_content_con__2a5f562d","delete_quote":"index_module_delete_quote__2a5f562d","sending":"index_module_sending__2a5f562d","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__2a5f562d","main_list":"index_module_main_list__2a5f562d","chat_content":"index_module_chat_content__2a5f562d","popover_main_content":"index_module_popover_main_content__2a5f562d","popover_main_content_name":"index_module_popover_main_content_name__2a5f562d","teacher_layout":"index_module_teacher_layout__2a5f562d","bottom":"index_module_bottom__2a5f562d","delete":"index_module_delete__2a5f562d","num":"index_module_num__2a5f562d","shrink":"index_module_shrink__2a5f562d","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__2a5f562d","teacher_layout_modal":"index_module_teacher_layout_modal__2a5f562d","ai":"index_module_ai__2a5f562d","user_info":"index_module_user_info__2a5f562d","message":"index_module_message__2a5f562d","con":"index_module_con__2a5f562d","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__2a5f562d","history_list":"index_module_history_list__2a5f562d","search_layout":"index_module_search_layout__2a5f562d","mymove":"index_module_mymove__2a5f562d","title":"index_module_title__2a5f562d","search_top":"index_module_search_top__2a5f562d","list_item":"index_module_list_item__2a5f562d","list_summary":"index_module_list_summary__2a5f562d","head_img":"index_module_head_img__2a5f562d","list_desc":"index_module_list_desc__2a5f562d","name":"index_module_name__2a5f562d","decs":"index_module_decs__2a5f562d","open":"index_module_open__2a5f562d","list_summary_active":"index_module_list_summary_active__2a5f562d","list_detail":"index_module_list_detail__2a5f562d","list":"index_module_list__2a5f562d","list_more":"index_module_list_more__2a5f562d","no_data":"index_module_no_data__2a5f562d","history_list_broadside":"index_module_history_list_broadside__2a5f562d","screenshot_Modal":"index_module_screenshot_Modal__2a5f562d","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__2a5f562d"};
3170
3170
 
3171
3171
  //消息已读
3172
3172
  var readMessage = function(roomId, urllocation, userData, http) {
@@ -3904,7 +3904,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
3904
3904
  }) : /*#__PURE__*/ jsxs("div", {
3905
3905
  className: "".concat(modules_63b47c51.teacher_layout, " ").concat(type == 3 ? modules_63b47c51.teacher_layout_newlabo : ""),
3906
3906
  style: {
3907
- left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
3907
+ left: type == 3 ? document.getElementById("box") && document.getElementById("box").offsetWidth + 10 + "px" : "auto"
3908
3908
  },
3909
3909
  children: [
3910
3910
  /*#__PURE__*/ jsxs("div", {
@@ -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, screenshotAreaId = props.screenshotAreaId; 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, config = 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]; //用于搜索历史记录后的页码
@@ -4170,7 +4171,8 @@ var CustomerService = function(props) {
4170
4171
  var _useState29 = _sliced_to_array(useState(""), 2), viewBase64 = _useState29[0], setViewBase64 = _useState29[1]; //图片预览
4171
4172
  var _useState30 = _sliced_to_array(useState(false), 2), visible = _useState30[0], setVisible = _useState30[1]; //是否显示图片预览
4172
4173
  var _useState31 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState31[0], setBottomRecommendationQuestions = _useState31[1]; //底部推荐问题
4173
- var _useState32 = _sliced_to_array(useState(-1), 2), saveShowType = _useState32[0], setSaveShowType = _useState32[1]; //保存截图时的状态
4174
+ var _useState32 = _sliced_to_array(useState(false), 2), showScreenshot = _useState32[0], setShowScreenshot = _useState32[1]; //是否显示截图 主要用于newlabo页面
4175
+ var _useState33 = _sliced_to_array(useState(-1), 2), saveShowType = _useState33[0], setSaveShowType = _useState33[1]; //保存截图时的状态
4174
4176
  var timer = useRef(null); //文本框输入时
4175
4177
  var receiveMessageTimer = useRef(null); //接收ai发回的消息
4176
4178
  // let voiceCountdownTimer = useRef(null); //语音录制倒计时
@@ -4182,6 +4184,7 @@ var CustomerService = function(props) {
4182
4184
  var scrollTopHei = useRef(0);
4183
4185
  var isPosition = useRef(true);
4184
4186
  var recommendeQuestionID = useRef([]); //推荐问题id
4187
+ var videoHotQuestionsList = useRef([]); //视频热门问题
4185
4188
  var mid = props.userData.mid;
4186
4189
  var remarkable = new Remarkable({
4187
4190
  highlight: function highlight(str, lang) {
@@ -4197,56 +4200,42 @@ var CustomerService = function(props) {
4197
4200
  }
4198
4201
  });
4199
4202
  useEffect(function() {
4200
- if (showType == 5) {
4201
- // 获取屏幕流
4202
- // 获取 video 元素和 canvas 元素
4203
- // var video = document.getElementById('container_html5_api');
4204
- // // const canvas = document.createElement('canvas');
4205
- // const canvas = document.getElementById('canvas_test');
4206
- // var context = canvas.getContext('2d');
4207
- // // 设置 canvas 尺寸
4208
- // canvas.width = video.videoWidth/4;
4209
- // canvas.height = video.videoHeight/4;
4210
- // // canvas 上绘制 video 的当前帧
4211
- // context.drawImage(video, 0, 0, canvas.width, canvas.height);
4212
- // // 使用 html2canvas 对 canvas 进行截图
4213
- // html2canvas(canvas,{
4214
- // scale: 1,
4215
- // useCORS: true,
4216
- // logging: true,
4217
- // }).then(function(screenshot) {
4218
- // // 将截图显示在页面上,或者进行其他操作
4219
- // document.body.appendChild(screenshot);
4220
- // setTimeout(()=>{
4221
- // let url = screenshot.toDataURL('image/png');
4222
- // console.log(url);
4223
- // },3000)
4224
- // // console.log("container_html5_apicontainer_html5_api",screenshot)
4225
- // // console.log(screenshot.toDataURL('image/jpeg'))
4226
- // });
4227
- // // 显示图片或者做其他操作
4203
+ if (config && config.type == "video") {
4204
+ //获取热门推荐
4205
+ videoPageQuestiionsList(1);
4206
+ }
4207
+ setShowType(initShowType);
4208
+ }, [
4209
+ initShowType
4210
+ ]);
4211
+ useEffect(function() {
4212
+ //|| showScreenshot
4213
+ if (showType == 5 || showScreenshot) {
4228
4214
  try {
4229
4215
  setImgBese64("");
4230
- html2canvas(document.getElementsByTagName("html")[0]).then(function(canvas) {
4231
- console.log(canvas, 22222);
4232
- setTimeout(function() {
4233
- var dom = document.getElementById(screenshotAreaId);
4234
- //let dom = document.getElementById("container_html5_api");
4235
- //let dom = document.getElementsByTagName('html')[0];
4236
- html2canvas(dom, {
4237
- useCORS: true,
4238
- // allowTaint: true, // 污染处理
4239
- scale: 1
4240
- }).then(function(canvas) {
4241
- // document.body.appendChild(canvas);
4242
- // document.body.appendChild(canvas);
4243
- console.log(canvas, 4444444);
4244
- // var base64URL = canvas.toDataURL('image/jpeg')
4245
- var base64URL = canvas.toDataURL("image/jpg", 1.0);
4246
- setImgBese64(base64URL);
4247
- });
4248
- }, 100);
4216
+ // html2canvas(document.getElementsByTagName('html')[0],{
4217
+ // // ignoreElements:(element)=>{
4218
+ // // if(element.compareDocumentPosition(dom)===2)return true
4219
+ // // return false
4220
+ // // }
4221
+ // }).then((canvas)=>{
4222
+ // console.log(canvas,22222);
4223
+ // setTimeout(()=>{
4224
+ var dom = document.getElementById(screenshotAreaId);
4225
+ html2canvas(dom, {
4226
+ useCORS: true,
4227
+ // allowTaint: true, // 污染处理
4228
+ scale: 1
4229
+ }).then(function(canvas) {
4230
+ // document.body.appendChild(canvas);
4231
+ // document.body.appendChild(canvas);
4232
+ console.log(canvas, 99999);
4233
+ // var base64URL = canvas.toDataURL('image/jpeg')
4234
+ var base64URL = canvas.toDataURL("image/jpg", 1.0);
4235
+ setImgBese64(base64URL);
4249
4236
  });
4237
+ // },100)
4238
+ // })
4250
4239
  } catch (error) {
4251
4240
  console.log(error);
4252
4241
  }
@@ -4314,7 +4303,8 @@ var CustomerService = function(props) {
4314
4303
  }, [
4315
4304
  historyMessageList,
4316
4305
  showType,
4317
- pageCount
4306
+ pageCount,
4307
+ showScreenshot
4318
4308
  ]);
4319
4309
  useEffect(function() {
4320
4310
  resettingBottomHei();
@@ -4333,16 +4323,21 @@ var CustomerService = function(props) {
4333
4323
  buttomHei,
4334
4324
  showType
4335
4325
  ]);
4326
+ //创建聊天室并获取聊天室列表
4336
4327
  useEffect(function() {
4337
- // console.log(props,'lsdkcmsdlcksd')
4338
- // getQuestiionsList("", 1);
4339
- setShowType(initShowType);
4340
- //获取视频页面推荐问题
4341
- videoPageQuestiionsList();
4342
- scrollToBottom();
4343
- }, [
4344
- initShowType
4345
- ]);
4328
+ createRooms("AI").then(function(res) {
4329
+ setRoomId(res.data.id);
4330
+ });
4331
+ roomsListTimer();
4332
+ return function() {
4333
+ clearTimeout(receiveMessageTimer.current);
4334
+ // clearTimeout(voiceCountdownTimer.current);
4335
+ clearTimeout(listTimer.current);
4336
+ clearTimeout(timer.current);
4337
+ clearTimeout(roomMessage.current);
4338
+ clearTimeout(chatRoomList.current);
4339
+ };
4340
+ }, []);
4346
4341
  useEffect(function() {
4347
4342
  if (roomId != "") {
4348
4343
  if (lastId == "") {
@@ -4363,21 +4358,6 @@ var CustomerService = function(props) {
4363
4358
  }, [
4364
4359
  roomId
4365
4360
  ]);
4366
- //创建聊天室并获取聊天室列表
4367
- useEffect(function() {
4368
- createRooms("AI").then(function(res) {
4369
- setRoomId(res.data.id);
4370
- });
4371
- roomsListTimer();
4372
- return function() {
4373
- clearTimeout(receiveMessageTimer.current);
4374
- // clearTimeout(voiceCountdownTimer.current);
4375
- clearTimeout(listTimer.current);
4376
- clearTimeout(timer.current);
4377
- clearTimeout(roomMessage.current);
4378
- clearTimeout(chatRoomList.current);
4379
- };
4380
- }, []);
4381
4361
  //进入页面,发送打招呼信息
4382
4362
  useEffect(function() {
4383
4363
  //老师的聊天窗口不发送打招呼信息
@@ -4396,9 +4376,8 @@ var CustomerService = function(props) {
4396
4376
  scrollToBottom();
4397
4377
  }
4398
4378
  }, [
4399
- greetingMessage,
4400
- hotQuestionsList
4401
- ]);
4379
+ greetingMessage
4380
+ ]); //hotQuestionsList
4402
4381
  //查找需要复制的代码
4403
4382
  var findCopyContent = function(e) {
4404
4383
  var source = findParent(e.target, styles.copyCode);
@@ -4441,10 +4420,9 @@ var CustomerService = function(props) {
4441
4420
  var questionsList = [];
4442
4421
  var obj = {};
4443
4422
  if (type == 1) {
4444
- var questionsId = [];
4423
+ console.log(hotQuestionsList, "33322221111");
4445
4424
  questionsList = hotQuestionsList.map(function(item, index) {
4446
4425
  if (index < 3) {
4447
- questionsId.push(item.id);
4448
4426
  return {
4449
4427
  key: "messageSource",
4450
4428
  value: item.id,
@@ -4455,7 +4433,6 @@ var CustomerService = function(props) {
4455
4433
  return null;
4456
4434
  }
4457
4435
  });
4458
- recommendeQuestionID.current = questionsId; //保存推荐问题id
4459
4436
  questionsList = questionsList.filter(function(i) {
4460
4437
  return i != null;
4461
4438
  });
@@ -4797,9 +4774,9 @@ var CustomerService = function(props) {
4797
4774
  }
4798
4775
  console.log(type, "接受答案77777");
4799
4776
  //获取下面的推荐问题
4800
- if (type == 2) {
4801
- videoPageQuestiionsList(2);
4802
- }
4777
+ // if(type == 2){
4778
+ // videoPageQuestiionsList(2);
4779
+ // }
4803
4780
  http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
4804
4781
  if (res.data.id) {
4805
4782
  if (pageNumHistory <= 1) {
@@ -4835,6 +4812,10 @@ var CustomerService = function(props) {
4835
4812
  sendingExistingIssues(2, dataObj, "");
4836
4813
  testLabQuestion(obj.message, questions.answer, "");
4837
4814
  }
4815
+ if (type == 2 && config && config.type == "video") {
4816
+ //先请求问题列表
4817
+ videoPageQuestiionsList(2);
4818
+ }
4838
4819
  });
4839
4820
  };
4840
4821
  //向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
@@ -4863,8 +4844,8 @@ var CustomerService = function(props) {
4863
4844
  });
4864
4845
  });
4865
4846
  }, 60 * 1000);
4866
- if (props.config && props.config.type == "video" && props.config.params) {
4867
- var params = props.config.params;
4847
+ if (config && config.type == "video" && config.params) {
4848
+ var params = config.params;
4868
4849
  var videoId = params.videoId;
4869
4850
  var watchTime = params.videoProgress;
4870
4851
  var courseId = getQuery("yc_id");
@@ -4878,6 +4859,7 @@ var CustomerService = function(props) {
4878
4859
  "watchTime": watchTime
4879
4860
  }
4880
4861
  ];
4862
+ obj.regenerate = false;
4881
4863
  }
4882
4864
  var data = JSON.stringify(obj);
4883
4865
  setKeyWord("");
@@ -4918,6 +4900,10 @@ var CustomerService = function(props) {
4918
4900
  });
4919
4901
  scrollToBottom();
4920
4902
  }
4903
+ if (config && config.type == "video") {
4904
+ //先请求问题列表
4905
+ videoPageQuestiionsList(3);
4906
+ }
4921
4907
  //使用fetchEventSource接收数据
4922
4908
  fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
4923
4909
  method: "POST",
@@ -5022,6 +5008,7 @@ var CustomerService = function(props) {
5022
5008
  }
5023
5009
  if (msg.finished) {
5024
5010
  setFinished(true); //发送结束
5011
+ videoPageQuestiionsList(2);
5025
5012
  // isPosition.current = true;
5026
5013
  setTimeout(function() {
5027
5014
  isPosition.current = true;
@@ -5088,9 +5075,23 @@ var CustomerService = function(props) {
5088
5075
  } else {
5089
5076
  var newHistoryMessageList2 = list1.map(function(item) {
5090
5077
  message = item.message + obj.message;
5078
+ var extraInfo = [];
5079
+ // message = '抱歉,我暂时无法回答这样的问题。'
5080
+ if (message == "抱歉,我暂时无法回答这样的问题。") {
5081
+ extraInfo = videoHotQuestionsList.current.map(function(str, index) {
5082
+ return {
5083
+ key: "messageSource",
5084
+ value: str.id,
5085
+ question: str.question,
5086
+ answer: str.answer,
5087
+ welcomeMessage: true
5088
+ };
5089
+ });
5090
+ }
5091
5091
  if (item.id == id) {
5092
5092
  return _object_spread_props(_object_spread({}, item), {
5093
- message: message
5093
+ message: message,
5094
+ extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
5094
5095
  });
5095
5096
  } else {
5096
5097
  return item;
@@ -5408,6 +5409,7 @@ var CustomerService = function(props) {
5408
5409
  };
5409
5410
  //获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
5410
5411
  var getQuestiionsList = function(value, flag) {
5412
+ // console.log(flag,'dlfkvdmflkvmdfklv');
5411
5413
  var data = {};
5412
5414
  if (flag == 1) {
5413
5415
  data = {
@@ -5417,7 +5419,7 @@ var CustomerService = function(props) {
5417
5419
  } else if (flag == 3) {
5418
5420
  data = {
5419
5421
  page: 1,
5420
- maxPageSize: 4,
5422
+ maxPageSize: 5,
5421
5423
  question: value,
5422
5424
  sectionId: getQuery("s_id")
5423
5425
  };
@@ -5447,30 +5449,43 @@ var CustomerService = function(props) {
5447
5449
  } else {
5448
5450
  setQuestionsList(questionList);
5449
5451
  }
5450
- if (questionList.length < 4 && flag == 3) {
5452
+ if (questionList.length < 5 && flag == 3) {
5451
5453
  console.log("视频页面,联想问题小于4个");
5452
5454
  //视频页面,联想问题小于4个
5453
- getQuestiionsList(value, 4);
5455
+ http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
5456
+ params: {
5457
+ page: 1,
5458
+ maxPageSize: 5 - questionList.length
5459
+ }
5460
+ }).then(function(res) {
5461
+ if (res.data.questions) {
5462
+ setQuestionsList(function(questionList) {
5463
+ return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
5464
+ });
5465
+ }
5466
+ });
5454
5467
  }
5455
5468
  }
5456
5469
  });
5457
5470
  };
5458
- //获取视频页面热门问题 flag == 1,默认推荐问题 == 2,已经推荐过问题
5471
+ //获取视频页面热门问题 flag == 1,默认推荐问题 == 2,底部渲染问题,flag == 3,ai回答后请求相关问题
5459
5472
  var videoPageQuestiionsList = function() {
5460
5473
  var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
5461
- console.log(props, 3333333);
5462
- var config = props.config;
5474
+ console.log(flag, props, 3333333);
5463
5475
  if (config && config.type == "video" && config.params) {
5464
5476
  var params = config.params;
5465
5477
  var videoId = params.videoId;
5466
5478
  var watchTime = params.videoProgress;
5467
5479
  var courseId = getQuery("yc_id");
5468
5480
  var sectionId = params.VideoBriefSummaryId;
5481
+ // let courseId="20899",
5482
+ // sectionId= "462347",
5483
+ // videoId= "29707",
5484
+ // watchTime= 262
5469
5485
  if (videoId && courseId && sectionId) {
5486
+ console.log(recommendeQuestionID.current, "recommendeQuestionID.current");
5470
5487
  http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
5471
- "recommendedQuestions": flag == 2 ? recommendeQuestionID.current : [
5472
- ""
5473
- ],
5488
+ "recommendedQuestions": recommendeQuestionID.current,
5474
5489
  "contexts": [
5475
5490
  {
5476
5491
  "type": "VIDEO",
@@ -5480,22 +5495,32 @@ var CustomerService = function(props) {
5480
5495
  "watchTime": watchTime
5481
5496
  }
5482
5497
  ],
5483
- "maximum": 5
5498
+ "maximum": flag == 1 || flag == 2 ? 3 : 5
5484
5499
  }).then(function(res) {
5485
- console.log(res, 333333);
5486
5500
  if (res.data.total > 0) {
5487
5501
  var data = res.data.questions;
5502
+ if (flag == 3) {
5503
+ // setQuestionsList(data);
5504
+ // setVideoHotQuestionsList(data);
5505
+ videoHotQuestionsList.current = data;
5506
+ return;
5507
+ }
5488
5508
  if (flag == 2) {
5489
5509
  setBottomRecommendationQuestions(data);
5490
5510
  } else {
5491
5511
  setHotQuestionsList(data);
5492
5512
  }
5513
+ // let ids:any[] = [];
5514
+ // data.map((str: { id: string; })=>{
5515
+ // ids.push(str.id);
5516
+ // })
5517
+ // recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
5493
5518
  resettingBottomHei();
5494
5519
  scrollToBottom();
5495
- console.log(data, 99999);
5496
- if (data.length < 4) {
5497
- getQuestiionsList("", 4);
5498
- }
5520
+ // console.log(data,99999);
5521
+ // if(data.length < 4){
5522
+ // getQuestiionsList('',4)
5523
+ // }
5499
5524
  }
5500
5525
  }).catch(function() {});
5501
5526
  }
@@ -5880,9 +5905,6 @@ var CustomerService = function(props) {
5880
5905
  var timeObj = parseDate(item.createdAt);
5881
5906
  // console.log(item.message);
5882
5907
  var message = item.message;
5883
- if (message == "抱歉,我暂时无法回答这样的问题。" && props.config && props.config.type == "video") {
5884
- videoPageQuestiionsList(2);
5885
- }
5886
5908
  var li;
5887
5909
  // 是否需要显示日期
5888
5910
  var itemIndex = historyMessageList.findIndex(function(ite) {
@@ -6142,23 +6164,36 @@ var CustomerService = function(props) {
6142
6164
  })
6143
6165
  ]
6144
6166
  }),
6145
- 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", {
6146
- className: styles.association_problem,
6147
- children: JSON.parse(item.extraInfo).map(function(list, index) {
6148
- return /*#__PURE__*/ jsxs("li", {
6149
- onClick: function() {
6150
- sendMessage(list, 1);
6151
- },
6152
- children: [
6153
- index + 1,
6154
- ".",
6155
- list.question
6156
- ]
6157
- }, i + "_" + index + "_" + list.value);
6158
- })
6167
+ 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", {
6168
+ className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? "association_problem_flag" : ""),
6169
+ children: [
6170
+ item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ jsx("li", {
6171
+ className: styles.related_issues_flag,
6172
+ children: /*#__PURE__*/ jsx("span", {
6173
+ children: "相关问题"
6174
+ })
6175
+ }),
6176
+ JSON.parse(item.extraInfo).map(function(list, index) {
6177
+ return /*#__PURE__*/ jsx("li", {
6178
+ onClick: function() {
6179
+ sendMessage(list, 1);
6180
+ recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
6181
+ setBottomRecommendationQuestions([]);
6182
+ resettingBottomHei();
6183
+ },
6184
+ children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ jsxs(Fragment, {
6185
+ children: [
6186
+ index + 1,
6187
+ ".",
6188
+ list.question
6189
+ ]
6190
+ })
6191
+ }, i + "_" + index + "_" + list.value);
6192
+ })
6193
+ ]
6159
6194
  }),
6160
6195
  //findTeacher//是否在召唤老师过程中,是否是最后一条消息
6161
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && renderLastOperateBtn(item, isAiChatWindow, i),
6196
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i),
6162
6197
  //召唤老师回答按钮
6163
6198
  isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
6164
6199
  return item.short == "TeacherAnswer";
@@ -6382,11 +6417,9 @@ var CustomerService = function(props) {
6382
6417
  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") {
6383
6418
  findTeacherBtn = true;
6384
6419
  }
6420
+ /// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
6385
6421
  return /*#__PURE__*/ jsxs("div", {
6386
6422
  className: "".concat(styles.operate_modal_bottom),
6387
- style: {
6388
- position: showStopBtn && isPosition.current ? "sticky" : "relative"
6389
- },
6390
6423
  children: [
6391
6424
  /*#__PURE__*/ jsxs("p", {
6392
6425
  className: styles.stop_generate,
@@ -6656,6 +6689,7 @@ var CustomerService = function(props) {
6656
6689
  className: styles.icon_close,
6657
6690
  onClick: function() {
6658
6691
  setScreenshotBese64("");
6692
+ resettingBottomHei();
6659
6693
  },
6660
6694
  children: /*#__PURE__*/ jsx(CustomRoundClose$1, {})
6661
6695
  }),
@@ -6708,6 +6742,7 @@ var CustomerService = function(props) {
6708
6742
  "讲解这张图片涉及到的知识内容"
6709
6743
  ]
6710
6744
  }),
6745
+ /*#__PURE__*/ jsx("br", {}),
6711
6746
  /*#__PURE__*/ jsxs("p", {
6712
6747
  onClick: function() {
6713
6748
  setHistoryMessageList(function(historyMessageList) {
@@ -6771,7 +6806,7 @@ var CustomerService = function(props) {
6771
6806
  var roomList = contactsList;
6772
6807
  if (roomList.length > 0 && roomList[0].roomId != roomId) return;
6773
6808
  console.log(props, 333333);
6774
- if (props.config && props.config.type == "video") {
6809
+ if (config && config.type == "video") {
6775
6810
  getQuestiionsList(String(e.target.value), 3);
6776
6811
  } else {
6777
6812
  getQuestiionsList(String(e.target.value), 2);
@@ -6868,7 +6903,11 @@ var CustomerService = function(props) {
6868
6903
  onClick: function() {
6869
6904
  if (!finished) return;
6870
6905
  setSaveShowType(showType);
6871
- setShowType(5);
6906
+ if (showType == 3) {
6907
+ setShowScreenshot(true);
6908
+ } else {
6909
+ setShowType(5);
6910
+ }
6872
6911
  },
6873
6912
  children: /*#__PURE__*/ jsx(CustomScreenshot$1, {})
6874
6913
  })
@@ -7028,17 +7067,20 @@ var CustomerService = function(props) {
7028
7067
  });
7029
7068
  }
7030
7069
  };
7070
+ //视频页面底部推荐问题
7031
7071
  var renderBottomAssociationProblem = function() {
7032
7072
  return /*#__PURE__*/ jsx("div", {
7033
7073
  className: styles.issues_list_flag,
7034
- style: {
7035
- bottom: "".concat(buttomHei, "px")
7036
- },
7037
7074
  id: "BottomAssociationProblem",
7038
7075
  children: bottomRecommendationQuestions.map(function(item) {
7039
7076
  return /*#__PURE__*/ jsx("p", {
7040
7077
  onClick: function() {
7041
7078
  sendMessage(item, 1);
7079
+ if (config && config.type == "video") {
7080
+ recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
7081
+ setBottomRecommendationQuestions([]);
7082
+ resettingBottomHei();
7083
+ }
7042
7084
  },
7043
7085
  children: item.question
7044
7086
  }, item.id);
@@ -7250,7 +7292,7 @@ var CustomerService = function(props) {
7250
7292
  })
7251
7293
  ]
7252
7294
  }),
7253
- showType == 3 ? /*#__PURE__*/ jsxs("div", {
7295
+ showType == 3 && /*#__PURE__*/ jsxs("div", {
7254
7296
  className: "".concat(styles.ChatWindow_Drawer),
7255
7297
  id: "",
7256
7298
  onClick: function() {
@@ -7361,12 +7403,12 @@ var CustomerService = function(props) {
7361
7403
  })
7362
7404
  })
7363
7405
  ]
7364
- }) : "",
7365
- showType == 4 && /*#__PURE__*/ jsxs(Fragment, {
7406
+ }),
7407
+ (showType == 4 || showType == 5) && /*#__PURE__*/ jsxs(Fragment, {
7366
7408
  children: [
7367
7409
  /*#__PURE__*/ jsxs(Modal, {
7368
7410
  title: "AI助手",
7369
- open: true,
7411
+ open: showType == 4 ? true : false,
7370
7412
  onCancel: function() {
7371
7413
  onCancel();
7372
7414
  onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
@@ -7452,7 +7494,7 @@ var CustomerService = function(props) {
7452
7494
  })
7453
7495
  ]
7454
7496
  }),
7455
- /*#__PURE__*/ jsxs("div", {
7497
+ (showType == 4 || showType == 5) && /*#__PURE__*/ jsxs("div", {
7456
7498
  className: "".concat(styles.ChatWindow_Drawer),
7457
7499
  id: "",
7458
7500
  children: [
@@ -7550,7 +7592,7 @@ var CustomerService = function(props) {
7550
7592
  })
7551
7593
  ]
7552
7594
  }),
7553
- showType == 5 && imgBese64 && /*#__PURE__*/ jsx(ScreenshotTool$1, {
7595
+ (showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ jsx(ScreenshotTool$1, {
7554
7596
  imgBese64: imgBese64,
7555
7597
  saveScreenshotBese64: function(base64) {
7556
7598
  setScreenshotBese64(base64);
@@ -7559,9 +7601,15 @@ var CustomerService = function(props) {
7559
7601
  } else {
7560
7602
  setShowType(1);
7561
7603
  }
7604
+ setShowScreenshot(false);
7562
7605
  },
7563
7606
  cancelScreenshot: function() {
7564
- setShowType(1);
7607
+ if (saveShowType != -1) {
7608
+ setShowType(saveShowType);
7609
+ } else {
7610
+ setShowType(1);
7611
+ }
7612
+ setShowScreenshot(false);
7565
7613
  }
7566
7614
  }),
7567
7615
  viewBase64 && visible && /*#__PURE__*/ jsx(ViewImage$1, {