bhd-components 0.7.14 → 0.7.16

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 './2a1e1288.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 './2a1e1288.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 './cb6a18bd.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 './cb6a18bd.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';
@@ -4424,7 +4424,7 @@ var CustomerService = function(props) {
4424
4424
  };
4425
4425
  //发送欢迎语,视频页面
4426
4426
  var sendWelcomMessage = function() {
4427
- if (config.type == "video") {
4427
+ if (config && config.type == "video") {
4428
4428
  var params = config.params;
4429
4429
  var videoId = params.videoId;
4430
4430
  var watchTime = params.videoProgress;
@@ -4448,44 +4448,48 @@ var CustomerService = function(props) {
4448
4448
  ],
4449
4449
  "maximum": 3
4450
4450
  }).then(function(res) {
4451
- var data = res.data.questions;
4452
- var questionsList = data.map(function(item, index) {
4453
- if (index < 3) {
4454
- return {
4455
- key: "messageSource",
4456
- value: item.id,
4457
- question: item.question,
4458
- answer: item.answer
4459
- };
4460
- } else {
4461
- return null;
4451
+ try {
4452
+ var data = res.data.questions;
4453
+ var questionsList = null;
4454
+ if (data.length > 0) {
4455
+ questionsList = data.map(function(item, index) {
4456
+ return {
4457
+ key: "messageSource",
4458
+ value: item.id,
4459
+ question: item.question,
4460
+ answer: item.answer
4461
+ };
4462
+ });
4462
4463
  }
4463
- });
4464
- var obj = {
4465
- roomId: roomId,
4466
- sender: "AI",
4467
- recevier: mid,
4468
- message: "Hi,我是智能学习助手,你遇到了什么问题?",
4469
- extraInfos: questionsList.length > 0 ? questionsList : null
4470
- };
4471
- if (pageNumHistory <= 1) {
4472
- setHistoryMessageList(function(historyMessageList) {
4473
- var newHistoryMessageList = historyMessageList.filter(function(e) {
4474
- return e.id != "123456_date";
4464
+ console.log("dflkvmdfklvdf欢迎语", data);
4465
+ var obj = {
4466
+ roomId: roomId,
4467
+ sender: "AI",
4468
+ recevier: mid,
4469
+ message: "Hi,我是智能学习助手,你遇到了什么问题?",
4470
+ extraInfos: questionsList == null ? null : questionsList
4471
+ };
4472
+ if (pageNumHistory <= 1) {
4473
+ console.log("欢迎语");
4474
+ setHistoryMessageList(function(historyMessageList) {
4475
+ var newHistoryMessageList = historyMessageList.filter(function(e) {
4476
+ return e.id != "123456_date";
4477
+ });
4478
+ newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
4479
+ id: "123456_date",
4480
+ upvoted: false,
4481
+ downvoted: false,
4482
+ quotedMessage: "",
4483
+ createdAt: getDataTime(-1),
4484
+ extraInfo: obj.extraInfos != null ? JSON.stringify(obj.extraInfos) : null
4485
+ }));
4486
+ console.log(newHistoryMessageList, 3333333333339999);
4487
+ return newHistoryMessageList;
4475
4488
  });
4476
- newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
4477
- id: "123456_date",
4478
- upvoted: false,
4479
- downvoted: false,
4480
- quotedMessage: "",
4481
- createdAt: getDataTime(-1),
4482
- extraInfo: JSON.stringify(obj.extraInfos)
4483
- }));
4484
- return newHistoryMessageList;
4485
- });
4486
- scrollToBottom();
4487
- }
4488
- return;
4489
+ scrollToBottom();
4490
+ }
4491
+ return;
4492
+ } catch (error) {}
4489
4493
  }).catch(function() {});
4490
4494
  }
4491
4495
  } else {
@@ -4525,6 +4529,7 @@ var CustomerService = function(props) {
4525
4529
  var questionsList = [];
4526
4530
  var obj = {};
4527
4531
  if (type == 1) {
4532
+ console.log("dflkvmdfklvdf欢迎语");
4528
4533
  sendWelcomMessage();
4529
4534
  // console.log(hotQuestionsList,newHotQuestionsList.current,'33322221111');
4530
4535
  // if(newHotQuestionsList.current.length > 0){
@@ -6229,7 +6234,7 @@ var CustomerService = function(props) {
6229
6234
  //是否在智能客服窗口
6230
6235
  isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
6231
6236
  var header = 2; //代表是ai头像
6232
- if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
6237
+ if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
6233
6238
  //使用AI头像
6234
6239
  header = 1;
6235
6240
  }
@@ -6293,7 +6298,7 @@ var CustomerService = function(props) {
6293
6298
  })
6294
6299
  ]
6295
6300
  }),
6296
- 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", {
6301
+ item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ jsxs("ul", {
6297
6302
  className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? styles.association_problem_flag : ""),
6298
6303
  children: [
6299
6304
  item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ jsx("li", {