bhd-components 0.9.14 → 0.9.15

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.
@@ -2320,171 +2320,169 @@ const CustomerService = (props)=>{
2320
2320
  }),
2321
2321
  /*#__PURE__*/ _jsx("div", {
2322
2322
  className: styles.main,
2323
- children: /*#__PURE__*/ _jsxs("div", {
2323
+ children: /*#__PURE__*/ _jsx("div", {
2324
2324
  className: styles.main_content,
2325
- children: [
2326
- /*#__PURE__*/ _jsxs("div", {
2327
- className: styles.main_content_flag,
2328
- onMouseEnter: ()=>{
2329
- const dom = document.getElementById(item.id);
2330
- if (dom) {
2331
- const con_h = document.getElementById('chat_content').clientHeight - 24; //滚动区域的高度
2332
- const rectY = dom.getBoundingClientRect().y - 48;
2333
- const h = dom.clientHeight + 24; //当前元素高度
2334
- const topDom = dom.getElementsByClassName('operate_modal_showtop')[0];
2335
- const bottomDom = dom.getElementsByClassName('operate_modal_showbottom')[0];
2336
- if (topDom && bottomDom) {
2337
- console.log(h, con_h, rectY);
2338
- if (rectY > 0) {
2339
- topDom.style.cssText = "";
2340
- bottomDom.style.cssText = "visibility: hidden;";
2341
- // 上下都能显示时,显示到下边
2342
- if (h < con_h - rectY) {
2343
- topDom.style.cssText = "visibility: hidden;";
2344
- bottomDom.style.cssText = "";
2345
- }
2325
+ children: /*#__PURE__*/ _jsxs("div", {
2326
+ className: styles.main_content_flag,
2327
+ onMouseEnter: ()=>{
2328
+ const dom = document.getElementById(item.id);
2329
+ if (dom) {
2330
+ const con_h = document.getElementById('chat_content').clientHeight - 24; //滚动区域的高度
2331
+ const rectY = dom.getBoundingClientRect().y - 48;
2332
+ const h = dom.clientHeight + 24; //当前元素高度
2333
+ const topDom = dom.getElementsByClassName('operate_modal_showtop')[0];
2334
+ const bottomDom = dom.getElementsByClassName('operate_modal_showbottom')[0];
2335
+ if (topDom && bottomDom) {
2336
+ console.log(h, con_h, rectY);
2337
+ if (rectY > 0) {
2338
+ topDom.style.cssText = "";
2339
+ bottomDom.style.cssText = "visibility: hidden;";
2340
+ // 上下都能显示时,显示到下边
2341
+ if (h < con_h - rectY) {
2342
+ topDom.style.cssText = "visibility: hidden;";
2343
+ bottomDom.style.cssText = "";
2344
+ }
2345
+ } else {
2346
+ // 上下都不显示
2347
+ if (h > con_h && h - con_h > Math.abs(rectY)) {
2348
+ console.log('rerererererer');
2349
+ topDom.style.cssText = "visibility: hidden;";
2350
+ bottomDom.style.cssText = `top:${-(h + rectY - 51)}px`;
2346
2351
  } else {
2347
- // 上下都不显示
2348
- if (h > con_h && h - con_h > Math.abs(rectY)) {
2349
- console.log('rerererererer');
2350
- topDom.style.cssText = "visibility: hidden;";
2351
- bottomDom.style.cssText = `top:${-(h + rectY - 51)}px`;
2352
- } else {
2353
- topDom.style.cssText = "visibility: hidden;";
2354
- bottomDom.style.cssText = "";
2355
- }
2352
+ topDom.style.cssText = "visibility: hidden;";
2353
+ bottomDom.style.cssText = "";
2356
2354
  }
2357
2355
  }
2358
2356
  }
2359
- },
2360
- children: [
2361
- /*#__PURE__*/ _jsx("div", {
2362
- className: `${styles.operate_modal} operate_modal_showtop`,
2363
- children: // 不是最后一行,
2364
- historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
2365
- }),
2366
- /*#__PURE__*/ _jsxs("div", {
2367
- className: styles.content,
2368
- children: [
2369
- item.message != 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsx("p", {
2370
- dangerouslySetInnerHTML: {
2371
- __html: message
2372
- },
2373
- className: styles.content_child
2374
- }),
2375
- item.message == 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsxs("p", {
2376
- children: [
2377
- "AI助手繁忙,请稍后再提问或",
2378
- /*#__PURE__*/ _jsx("span", {
2379
- className: styles.find_teacher_con,
2357
+ }
2358
+ },
2359
+ children: [
2360
+ /*#__PURE__*/ _jsx("div", {
2361
+ className: `${styles.operate_modal} operate_modal_showtop`,
2362
+ children: // 不是最后一行,
2363
+ historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
2364
+ }),
2365
+ /*#__PURE__*/ _jsxs("div", {
2366
+ className: styles.content,
2367
+ children: [
2368
+ item.message != 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsx("p", {
2369
+ dangerouslySetInnerHTML: {
2370
+ __html: message
2371
+ },
2372
+ className: styles.content_child
2373
+ }),
2374
+ item.message == 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsxs("p", {
2375
+ children: [
2376
+ "AI助手繁忙,请稍后再提问或",
2377
+ /*#__PURE__*/ _jsx("span", {
2378
+ className: styles.find_teacher_con,
2379
+ onClick: ()=>{
2380
+ let extraInfo = historyMessageList[i - 1].extraInfo;
2381
+ let url = '';
2382
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2383
+ url = JSON.parse(extraInfo)[0].value;
2384
+ }
2385
+ setProblem({
2386
+ question: historyMessageList[i - 1].message,
2387
+ url
2388
+ });
2389
+ setShowTeacherList(true);
2390
+ },
2391
+ children: "召唤老师回答"
2392
+ })
2393
+ ]
2394
+ }),
2395
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2396
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2397
+ children: [
2398
+ /*#__PURE__*/ _jsx("img", {
2399
+ src: JSON.parse(item.extraInfo)[0].value
2400
+ }),
2401
+ /*#__PURE__*/ _jsx("div", {
2402
+ className: styles.mask_zoom,
2403
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2380
2404
  onClick: ()=>{
2381
- let extraInfo = historyMessageList[i - 1].extraInfo;
2382
- let url = '';
2383
- if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2384
- url = JSON.parse(extraInfo)[0].value;
2385
- }
2386
- setProblem({
2387
- question: historyMessageList[i - 1].message,
2388
- url
2389
- });
2390
- setShowTeacherList(true);
2391
- },
2392
- children: "召唤老师回答"
2405
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2406
+ setVisible(true);
2407
+ }
2393
2408
  })
2394
- ]
2395
- }),
2396
- item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2397
- className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2398
- children: [
2399
- /*#__PURE__*/ _jsx("img", {
2400
- src: JSON.parse(item.extraInfo)[0].value
2401
- }),
2402
- /*#__PURE__*/ _jsx("div", {
2403
- className: styles.mask_zoom,
2404
- children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2405
- onClick: ()=>{
2406
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
2407
- setVisible(true);
2408
- }
2409
- })
2409
+ })
2410
+ ]
2411
+ }),
2412
+ 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", {
2413
+ className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? styles.association_problem_flag : ''}`,
2414
+ children: [
2415
+ item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
2416
+ className: styles.related_issues_flag,
2417
+ children: /*#__PURE__*/ _jsx("span", {
2418
+ children: "相关问题"
2410
2419
  })
2411
- ]
2412
- }),
2413
- 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", {
2414
- className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? styles.association_problem_flag : ''}`,
2415
- children: [
2416
- item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
2417
- className: styles.related_issues_flag,
2418
- children: /*#__PURE__*/ _jsx("span", {
2419
- children: "相关问题"
2420
+ }),
2421
+ JSON.parse(item.extraInfo).map((list, index)=>{
2422
+ return /*#__PURE__*/ _jsx("li", {
2423
+ onClick: ()=>{
2424
+ sendMessage(list, 1);
2425
+ setBottomRecommendationQuestions([]);
2426
+ resettingBottomHei();
2427
+ },
2428
+ children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
2429
+ children: [
2430
+ JSON.parse(item.extraInfo).length > 1 ? index + 1 + '.' : '',
2431
+ list.question
2432
+ ]
2420
2433
  })
2421
- }),
2422
- JSON.parse(item.extraInfo).map((list, index)=>{
2423
- return /*#__PURE__*/ _jsx("li", {
2424
- onClick: ()=>{
2425
- sendMessage(list, 1);
2426
- setBottomRecommendationQuestions([]);
2427
- resettingBottomHei();
2428
- },
2429
- children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
2430
- children: [
2431
- JSON.parse(item.extraInfo).length > 1 ? index + 1 + '.' : '',
2432
- list.question
2433
- ]
2434
- })
2435
- }, i + "_" + index + "_" + list.value);
2436
- })
2434
+ }, i + "_" + index + "_" + list.value);
2435
+ })
2436
+ ]
2437
+ }),
2438
+ //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2439
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != '123456_date' && renderLastOperateBtn(item, isAiChatWindow, i)
2440
+ ]
2441
+ }),
2442
+ //引用消息
2443
+ item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2444
+ className: styles.citation_content,
2445
+ children: [
2446
+ getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2447
+ overlayClassName: styles.popover_main_content,
2448
+ title: item.quotedMessage,
2449
+ placement: "rightTop",
2450
+ children: /*#__PURE__*/ _jsxs("p", {
2451
+ className: styles.text_exceed,
2452
+ children: [
2453
+ item.quotedMessage,
2454
+ /*#__PURE__*/ _jsx(RightOutlined, {})
2437
2455
  ]
2438
- }),
2439
- //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2440
- !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != '123456_date' && renderLastOperateBtn(item, isAiChatWindow, i)
2441
- ]
2442
- }),
2443
- historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
2444
- className: `${styles.operate_modal} ${styles.bottom} operate_modal_showbottom`,
2445
- children: // 不是最后一行,
2446
- renderOperateBtn(item, isAiChatWindow, i)
2447
- })
2448
- ]
2449
- }),
2450
- //引用消息
2451
- item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2452
- className: styles.citation_content,
2453
- children: [
2454
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2455
- overlayClassName: styles.popover_main_content,
2456
- title: item.quotedMessage,
2457
- placement: "rightTop",
2458
- children: /*#__PURE__*/ _jsxs("p", {
2459
- className: styles.text_exceed,
2456
+ })
2457
+ }) : /*#__PURE__*/ _jsx("p", {
2458
+ children: item.quotedMessage
2459
+ }),
2460
+ item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2461
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2460
2462
  children: [
2461
- item.quotedMessage,
2462
- /*#__PURE__*/ _jsx(RightOutlined, {})
2463
+ /*#__PURE__*/ _jsx("img", {
2464
+ src: JSON.parse(item.extraInfo)[0].value
2465
+ }),
2466
+ /*#__PURE__*/ _jsx("div", {
2467
+ className: styles.mask_zoom,
2468
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2469
+ onClick: ()=>{
2470
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2471
+ setVisible(true);
2472
+ }
2473
+ })
2474
+ })
2463
2475
  ]
2464
2476
  })
2465
- }) : /*#__PURE__*/ _jsx("p", {
2466
- children: item.quotedMessage
2467
- }),
2468
- item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2469
- className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2470
- children: [
2471
- /*#__PURE__*/ _jsx("img", {
2472
- src: JSON.parse(item.extraInfo)[0].value
2473
- }),
2474
- /*#__PURE__*/ _jsx("div", {
2475
- className: styles.mask_zoom,
2476
- children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2477
- onClick: ()=>{
2478
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
2479
- setVisible(true);
2480
- }
2481
- })
2482
- })
2483
- ]
2484
- })
2485
- ]
2486
- })
2487
- ]
2477
+ ]
2478
+ }),
2479
+ historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
2480
+ className: `${styles.operate_modal} ${styles.bottom} operate_modal_showbottom`,
2481
+ children: // 不是最后一行,
2482
+ renderOperateBtn(item, isAiChatWindow, i)
2483
+ })
2484
+ ]
2485
+ })
2488
2486
  })
2489
2487
  })
2490
2488
  ]
@@ -1956,6 +1956,11 @@
1956
1956
  line-height: 100%; /* 14px */
1957
1957
  }
1958
1958
  }
1959
+ :global{
1960
+ .bhd-spin-nested-loading{
1961
+ height:calc(100% - 130px)
1962
+ }
1963
+ }
1959
1964
  }
1960
1965
  }
1961
1966
  @keyframes mymove {
@@ -1946,6 +1946,11 @@
1946
1946
  line-height: 100%; /* 14px */
1947
1947
  }
1948
1948
  }
1949
+ :global{
1950
+ .bhd-spin-nested-loading{
1951
+ height:calc(100% - 130px)
1952
+ }
1953
+ }
1949
1954
  }
1950
1955
  }
1951
1956
  @keyframes mymove {