bhd-components 0.9.14 → 0.9.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.
@@ -2414,171 +2414,176 @@ var CustomerService = function(props) {
2414
2414
  }),
2415
2415
  /*#__PURE__*/ _jsx("div", {
2416
2416
  className: styles.main,
2417
- children: /*#__PURE__*/ _jsxs("div", {
2417
+ children: /*#__PURE__*/ _jsx("div", {
2418
2418
  className: styles.main_content,
2419
- children: [
2420
- /*#__PURE__*/ _jsxs("div", {
2421
- className: styles.main_content_flag,
2422
- onMouseEnter: function() {
2423
- var dom = document.getElementById(item.id);
2419
+ children: /*#__PURE__*/ _jsxs("div", {
2420
+ className: styles.main_content_flag,
2421
+ onMouseEnter: function() {
2422
+ var isSmall = showType == 1 || showType == 3;
2423
+ var container = document.getElementById(isSmall ? "chat_content" : "chat_content_modal");
2424
+ if (container) {
2425
+ var dom = container.querySelector('[id="'.concat(item.id, '"]'));
2424
2426
  if (dom) {
2425
- var con_h = document.getElementById("chat_content").clientHeight - 24; //滚动区域的高度
2427
+ // const con_h=document.getElementById('chat_content').clientHeight-24;//滚动区域的高度
2428
+ var con_h = container.clientHeight - (isSmall ? 24 : 0); //滚动区域的高度;
2426
2429
  var rectY = dom.getBoundingClientRect().y - 48;
2427
- var h = dom.clientHeight + 24; //当前元素高度
2430
+ var h = dom.clientHeight + (isSmall ? 24 : 0); //当前元素高度
2428
2431
  var topDom = dom.getElementsByClassName("operate_modal_showtop")[0];
2429
2432
  var bottomDom = dom.getElementsByClassName("operate_modal_showbottom")[0];
2433
+ // console.log({h,con_h,rectY,topDom,bottomDom})
2430
2434
  if (topDom && bottomDom) {
2431
- console.log(h, con_h, rectY);
2432
2435
  if (rectY > 0) {
2433
2436
  topDom.style.cssText = "";
2434
2437
  bottomDom.style.cssText = "visibility: hidden;";
2435
2438
  // 上下都能显示时,显示到下边
2436
2439
  if (h < con_h - rectY) {
2440
+ console.log("上下都能显示时,显示到下边");
2437
2441
  topDom.style.cssText = "visibility: hidden;";
2438
2442
  bottomDom.style.cssText = "";
2439
2443
  }
2440
2444
  } else {
2441
2445
  // 上下都不显示
2442
2446
  if (h > con_h && h - con_h > Math.abs(rectY)) {
2443
- console.log("rerererererer");
2447
+ console.log("上下都不显示");
2444
2448
  topDom.style.cssText = "visibility: hidden;";
2445
- bottomDom.style.cssText = "top:".concat(-(h + rectY - 51), "px");
2449
+ bottomDom.style.cssText = "top:".concat(-(h + rectY - 51 - (isSmall ? 0 : 58)), "px;");
2446
2450
  } else {
2451
+ console.log("12312312");
2447
2452
  topDom.style.cssText = "visibility: hidden;";
2448
2453
  bottomDom.style.cssText = "";
2449
2454
  }
2450
2455
  }
2451
2456
  }
2452
2457
  }
2453
- },
2454
- children: [
2455
- /*#__PURE__*/ _jsx("div", {
2456
- className: "".concat(styles.operate_modal, " operate_modal_showtop"),
2457
- children: // 不是最后一行,
2458
- historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
2459
- }),
2460
- /*#__PURE__*/ _jsxs("div", {
2461
- className: styles.content,
2462
- children: [
2463
- item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
2464
- dangerouslySetInnerHTML: {
2465
- __html: message
2466
- },
2467
- className: styles.content_child
2468
- }),
2469
- item.message == "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsxs("p", {
2470
- children: [
2471
- "AI助手繁忙,请稍后再提问或",
2472
- /*#__PURE__*/ _jsx("span", {
2473
- className: styles.find_teacher_con,
2458
+ }
2459
+ },
2460
+ children: [
2461
+ /*#__PURE__*/ _jsx("div", {
2462
+ className: "".concat(styles.operate_modal, " operate_modal_showtop"),
2463
+ children: // 不是最后一行,
2464
+ historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
2465
+ }),
2466
+ /*#__PURE__*/ _jsxs("div", {
2467
+ className: styles.content,
2468
+ children: [
2469
+ item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
2470
+ dangerouslySetInnerHTML: {
2471
+ __html: message
2472
+ },
2473
+ className: styles.content_child
2474
+ }),
2475
+ item.message == "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsxs("p", {
2476
+ children: [
2477
+ "AI助手繁忙,请稍后再提问或",
2478
+ /*#__PURE__*/ _jsx("span", {
2479
+ className: styles.find_teacher_con,
2480
+ onClick: function() {
2481
+ var extraInfo = historyMessageList[i - 1].extraInfo;
2482
+ var url = "";
2483
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2484
+ url = JSON.parse(extraInfo)[0].value;
2485
+ }
2486
+ setProblem({
2487
+ question: historyMessageList[i - 1].message,
2488
+ url: url
2489
+ });
2490
+ setShowTeacherList(true);
2491
+ },
2492
+ children: "召唤老师回答"
2493
+ })
2494
+ ]
2495
+ }),
2496
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2497
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2498
+ children: [
2499
+ /*#__PURE__*/ _jsx("img", {
2500
+ src: JSON.parse(item.extraInfo)[0].value
2501
+ }),
2502
+ /*#__PURE__*/ _jsx("div", {
2503
+ className: styles.mask_zoom,
2504
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2474
2505
  onClick: function() {
2475
- var extraInfo = historyMessageList[i - 1].extraInfo;
2476
- var url = "";
2477
- if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2478
- url = JSON.parse(extraInfo)[0].value;
2479
- }
2480
- setProblem({
2481
- question: historyMessageList[i - 1].message,
2482
- url: url
2483
- });
2484
- setShowTeacherList(true);
2485
- },
2486
- children: "召唤老师回答"
2506
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2507
+ setVisible(true);
2508
+ }
2487
2509
  })
2488
- ]
2489
- }),
2490
- item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2491
- className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2492
- children: [
2493
- /*#__PURE__*/ _jsx("img", {
2494
- src: JSON.parse(item.extraInfo)[0].value
2495
- }),
2496
- /*#__PURE__*/ _jsx("div", {
2497
- className: styles.mask_zoom,
2498
- children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2499
- onClick: function() {
2500
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
2501
- setVisible(true);
2502
- }
2503
- })
2510
+ })
2511
+ ]
2512
+ }),
2513
+ 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", {
2514
+ className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? styles.association_problem_flag : ""),
2515
+ children: [
2516
+ item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ _jsx("li", {
2517
+ className: styles.related_issues_flag,
2518
+ children: /*#__PURE__*/ _jsx("span", {
2519
+ children: "相关问题"
2504
2520
  })
2505
- ]
2506
- }),
2507
- 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", {
2508
- className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? styles.association_problem_flag : ""),
2509
- children: [
2510
- item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ _jsx("li", {
2511
- className: styles.related_issues_flag,
2512
- children: /*#__PURE__*/ _jsx("span", {
2513
- children: "相关问题"
2521
+ }),
2522
+ JSON.parse(item.extraInfo).map(function(list, index) {
2523
+ return /*#__PURE__*/ _jsx("li", {
2524
+ onClick: function() {
2525
+ sendMessage(list, 1);
2526
+ setBottomRecommendationQuestions([]);
2527
+ resettingBottomHei();
2528
+ },
2529
+ children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
2530
+ children: [
2531
+ JSON.parse(item.extraInfo).length > 1 ? index + 1 + "." : "",
2532
+ list.question
2533
+ ]
2514
2534
  })
2515
- }),
2516
- JSON.parse(item.extraInfo).map(function(list, index) {
2517
- return /*#__PURE__*/ _jsx("li", {
2518
- onClick: function() {
2519
- sendMessage(list, 1);
2520
- setBottomRecommendationQuestions([]);
2521
- resettingBottomHei();
2522
- },
2523
- children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
2524
- children: [
2525
- JSON.parse(item.extraInfo).length > 1 ? index + 1 + "." : "",
2526
- list.question
2527
- ]
2528
- })
2529
- }, i + "_" + index + "_" + list.value);
2530
- })
2535
+ }, i + "_" + index + "_" + list.value);
2536
+ })
2537
+ ]
2538
+ }),
2539
+ //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2540
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i)
2541
+ ]
2542
+ }),
2543
+ //引用消息
2544
+ item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2545
+ className: styles.citation_content,
2546
+ children: [
2547
+ getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2548
+ overlayClassName: styles.popover_main_content,
2549
+ title: item.quotedMessage,
2550
+ placement: "rightTop",
2551
+ children: /*#__PURE__*/ _jsxs("p", {
2552
+ className: styles.text_exceed,
2553
+ children: [
2554
+ item.quotedMessage,
2555
+ /*#__PURE__*/ _jsx(RightOutlined, {})
2531
2556
  ]
2532
- }),
2533
- //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2534
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i)
2535
- ]
2536
- }),
2537
- historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
2538
- className: "".concat(styles.operate_modal, " ").concat(styles.bottom, " operate_modal_showbottom"),
2539
- children: // 不是最后一行,
2540
- renderOperateBtn(item, isAiChatWindow, i)
2541
- })
2542
- ]
2543
- }),
2544
- //引用消息
2545
- item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2546
- className: styles.citation_content,
2547
- children: [
2548
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2549
- overlayClassName: styles.popover_main_content,
2550
- title: item.quotedMessage,
2551
- placement: "rightTop",
2552
- children: /*#__PURE__*/ _jsxs("p", {
2553
- className: styles.text_exceed,
2557
+ })
2558
+ }) : /*#__PURE__*/ _jsx("p", {
2559
+ children: item.quotedMessage
2560
+ }),
2561
+ item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2562
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2554
2563
  children: [
2555
- item.quotedMessage,
2556
- /*#__PURE__*/ _jsx(RightOutlined, {})
2564
+ /*#__PURE__*/ _jsx("img", {
2565
+ src: JSON.parse(item.extraInfo)[0].value
2566
+ }),
2567
+ /*#__PURE__*/ _jsx("div", {
2568
+ className: styles.mask_zoom,
2569
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2570
+ onClick: function() {
2571
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2572
+ setVisible(true);
2573
+ }
2574
+ })
2575
+ })
2557
2576
  ]
2558
2577
  })
2559
- }) : /*#__PURE__*/ _jsx("p", {
2560
- children: item.quotedMessage
2561
- }),
2562
- item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2563
- className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2564
- children: [
2565
- /*#__PURE__*/ _jsx("img", {
2566
- src: JSON.parse(item.extraInfo)[0].value
2567
- }),
2568
- /*#__PURE__*/ _jsx("div", {
2569
- className: styles.mask_zoom,
2570
- children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2571
- onClick: function() {
2572
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
2573
- setVisible(true);
2574
- }
2575
- })
2576
- })
2577
- ]
2578
- })
2579
- ]
2580
- })
2581
- ]
2578
+ ]
2579
+ }),
2580
+ historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
2581
+ className: "".concat(styles.operate_modal, " ").concat(styles.bottom, " operate_modal_showbottom"),
2582
+ children: // 不是最后一行,
2583
+ renderOperateBtn(item, isAiChatWindow, i)
2584
+ })
2585
+ ]
2586
+ })
2582
2587
  })
2583
2588
  })
2584
2589
  ]
@@ -1980,6 +1980,12 @@
1980
1980
  .anticon {
1981
1981
  vertical-align: 0;
1982
1982
  }
1983
+ .bhd-spin-nested-loading {
1984
+ height: calc(100% - 72px - 57px);
1985
+ & >div>.bhd-spin{
1986
+ max-height:436px;
1987
+ }
1988
+ }
1983
1989
  }
1984
1990
  }
1985
1991
  //全屏下的历史记录
@@ -1970,6 +1970,12 @@
1970
1970
  .anticon {
1971
1971
  vertical-align: 0;
1972
1972
  }
1973
+ .bhd-spin-nested-loading {
1974
+ height: calc(100% - 72px - 57px);
1975
+ & >div>.bhd-spin{
1976
+ max-height:436px;
1977
+ }
1978
+ }
1973
1979
  }
1974
1980
  }
1975
1981
  //全屏下的历史记录
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {