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.
@@ -322,14 +322,14 @@ const HistoryFun = (props)=>{
322
322
  })
323
323
  ]
324
324
  }),
325
- /*#__PURE__*/ _jsx("div", {
326
- className: styles.main_list,
327
- id: "history_list",
328
- children: /*#__PURE__*/ _jsxs(Spin, {
329
- spinning: loading,
330
- tip: "加载中...",
325
+ /*#__PURE__*/ _jsx(Spin, {
326
+ spinning: loading,
327
+ tip: "加载中...",
328
+ children: /*#__PURE__*/ _jsxs("div", {
329
+ className: styles.main_list,
330
+ id: "history_list",
331
331
  children: [
332
- showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
332
+ !loading && showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
333
333
  className: styles.no_data,
334
334
  children: [
335
335
  /*#__PURE__*/ _jsx("img", {
@@ -340,7 +340,7 @@ const HistoryFun = (props)=>{
340
340
  })
341
341
  ]
342
342
  }),
343
- showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
343
+ !loading && showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
344
344
  className: styles.no_data,
345
345
  children: [
346
346
  /*#__PURE__*/ _jsx("img", {
@@ -351,7 +351,7 @@ const HistoryFun = (props)=>{
351
351
  })
352
352
  ]
353
353
  }),
354
- /*#__PURE__*/ _jsx("div", {
354
+ !loading && /*#__PURE__*/ _jsx("div", {
355
355
  className: styles.list_item,
356
356
  children: totalData.map((item)=>{
357
357
  let span = "";
@@ -2320,171 +2320,176 @@ 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);
2325
+ children: /*#__PURE__*/ _jsxs("div", {
2326
+ className: styles.main_content_flag,
2327
+ onMouseEnter: ()=>{
2328
+ const isSmall = showType == 1 || showType == 3;
2329
+ const container = document.getElementById(isSmall ? "chat_content" : "chat_content_modal");
2330
+ if (container) {
2331
+ const dom = container.querySelector(`[id="${item.id}"]`);
2330
2332
  if (dom) {
2331
- const con_h = document.getElementById('chat_content').clientHeight - 24; //滚动区域的高度
2333
+ // const con_h=document.getElementById('chat_content').clientHeight-24;//滚动区域的高度
2334
+ const con_h = container.clientHeight - (isSmall ? 24 : 0); //滚动区域的高度;
2332
2335
  const rectY = dom.getBoundingClientRect().y - 48;
2333
- const h = dom.clientHeight + 24; //当前元素高度
2336
+ const h = dom.clientHeight + (isSmall ? 24 : 0); //当前元素高度
2334
2337
  const topDom = dom.getElementsByClassName('operate_modal_showtop')[0];
2335
2338
  const bottomDom = dom.getElementsByClassName('operate_modal_showbottom')[0];
2339
+ // console.log({h,con_h,rectY,topDom,bottomDom})
2336
2340
  if (topDom && bottomDom) {
2337
- console.log(h, con_h, rectY);
2338
2341
  if (rectY > 0) {
2339
2342
  topDom.style.cssText = "";
2340
2343
  bottomDom.style.cssText = "visibility: hidden;";
2341
2344
  // 上下都能显示时,显示到下边
2342
2345
  if (h < con_h - rectY) {
2346
+ console.log('上下都能显示时,显示到下边');
2343
2347
  topDom.style.cssText = "visibility: hidden;";
2344
2348
  bottomDom.style.cssText = "";
2345
2349
  }
2346
2350
  } else {
2347
2351
  // 上下都不显示
2348
2352
  if (h > con_h && h - con_h > Math.abs(rectY)) {
2349
- console.log('rerererererer');
2353
+ console.log('上下都不显示');
2350
2354
  topDom.style.cssText = "visibility: hidden;";
2351
- bottomDom.style.cssText = `top:${-(h + rectY - 51)}px`;
2355
+ bottomDom.style.cssText = `top:${-(h + rectY - 51 - (isSmall ? 0 : 58))}px;`;
2352
2356
  } else {
2357
+ console.log('12312312');
2353
2358
  topDom.style.cssText = "visibility: hidden;";
2354
2359
  bottomDom.style.cssText = "";
2355
2360
  }
2356
2361
  }
2357
2362
  }
2358
2363
  }
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,
2364
+ }
2365
+ },
2366
+ children: [
2367
+ /*#__PURE__*/ _jsx("div", {
2368
+ className: `${styles.operate_modal} operate_modal_showtop`,
2369
+ children: // 不是最后一行,
2370
+ historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
2371
+ }),
2372
+ /*#__PURE__*/ _jsxs("div", {
2373
+ className: styles.content,
2374
+ children: [
2375
+ item.message != 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsx("p", {
2376
+ dangerouslySetInnerHTML: {
2377
+ __html: message
2378
+ },
2379
+ className: styles.content_child
2380
+ }),
2381
+ item.message == 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsxs("p", {
2382
+ children: [
2383
+ "AI助手繁忙,请稍后再提问或",
2384
+ /*#__PURE__*/ _jsx("span", {
2385
+ className: styles.find_teacher_con,
2386
+ onClick: ()=>{
2387
+ let extraInfo = historyMessageList[i - 1].extraInfo;
2388
+ let url = '';
2389
+ if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
2390
+ url = JSON.parse(extraInfo)[0].value;
2391
+ }
2392
+ setProblem({
2393
+ question: historyMessageList[i - 1].message,
2394
+ url
2395
+ });
2396
+ setShowTeacherList(true);
2397
+ },
2398
+ children: "召唤老师回答"
2399
+ })
2400
+ ]
2401
+ }),
2402
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2403
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2404
+ children: [
2405
+ /*#__PURE__*/ _jsx("img", {
2406
+ src: JSON.parse(item.extraInfo)[0].value
2407
+ }),
2408
+ /*#__PURE__*/ _jsx("div", {
2409
+ className: styles.mask_zoom,
2410
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2380
2411
  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: "召唤老师回答"
2412
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2413
+ setVisible(true);
2414
+ }
2393
2415
  })
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
- })
2416
+ })
2417
+ ]
2418
+ }),
2419
+ 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", {
2420
+ className: `${styles.association_problem} ${item.message == '抱歉,我暂时无法回答这样的问题。' ? styles.association_problem_flag : ''}`,
2421
+ children: [
2422
+ item.message == '抱歉,我暂时无法回答这样的问题。' && /*#__PURE__*/ _jsx("li", {
2423
+ className: styles.related_issues_flag,
2424
+ children: /*#__PURE__*/ _jsx("span", {
2425
+ children: "相关问题"
2410
2426
  })
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: "相关问题"
2427
+ }),
2428
+ JSON.parse(item.extraInfo).map((list, index)=>{
2429
+ return /*#__PURE__*/ _jsx("li", {
2430
+ onClick: ()=>{
2431
+ sendMessage(list, 1);
2432
+ setBottomRecommendationQuestions([]);
2433
+ resettingBottomHei();
2434
+ },
2435
+ children: item.message == '抱歉,我暂时无法回答这样的问题。' ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
2436
+ children: [
2437
+ JSON.parse(item.extraInfo).length > 1 ? index + 1 + '.' : '',
2438
+ list.question
2439
+ ]
2420
2440
  })
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
- })
2441
+ }, i + "_" + index + "_" + list.value);
2442
+ })
2443
+ ]
2444
+ }),
2445
+ //findTeacher//是否在召唤老师过程中,是否是最后一条消息
2446
+ !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != '123456_date' && renderLastOperateBtn(item, isAiChatWindow, i)
2447
+ ]
2448
+ }),
2449
+ //引用消息
2450
+ item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2451
+ className: styles.citation_content,
2452
+ children: [
2453
+ getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2454
+ overlayClassName: styles.popover_main_content,
2455
+ title: item.quotedMessage,
2456
+ placement: "rightTop",
2457
+ children: /*#__PURE__*/ _jsxs("p", {
2458
+ className: styles.text_exceed,
2459
+ children: [
2460
+ item.quotedMessage,
2461
+ /*#__PURE__*/ _jsx(RightOutlined, {})
2437
2462
  ]
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,
2463
+ })
2464
+ }) : /*#__PURE__*/ _jsx("p", {
2465
+ children: item.quotedMessage
2466
+ }),
2467
+ item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2468
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2460
2469
  children: [
2461
- item.quotedMessage,
2462
- /*#__PURE__*/ _jsx(RightOutlined, {})
2470
+ /*#__PURE__*/ _jsx("img", {
2471
+ src: JSON.parse(item.extraInfo)[0].value
2472
+ }),
2473
+ /*#__PURE__*/ _jsx("div", {
2474
+ className: styles.mask_zoom,
2475
+ children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
2476
+ onClick: ()=>{
2477
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
2478
+ setVisible(true);
2479
+ }
2480
+ })
2481
+ })
2463
2482
  ]
2464
2483
  })
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
- ]
2484
+ ]
2485
+ }),
2486
+ historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
2487
+ className: `${styles.operate_modal} ${styles.bottom} operate_modal_showbottom`,
2488
+ children: // 不是最后一行,
2489
+ renderOperateBtn(item, isAiChatWindow, i)
2490
+ })
2491
+ ]
2492
+ })
2488
2493
  })
2489
2494
  })
2490
2495
  ]
@@ -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
  //全屏下的历史记录
@@ -327,14 +327,14 @@ var HistoryFun = function(props) {
327
327
  })
328
328
  ]
329
329
  }),
330
- /*#__PURE__*/ _jsx("div", {
331
- className: styles.main_list,
332
- id: "history_list",
333
- children: /*#__PURE__*/ _jsxs(Spin, {
334
- spinning: loading,
335
- tip: "加载中...",
330
+ /*#__PURE__*/ _jsx(Spin, {
331
+ spinning: loading,
332
+ tip: "加载中...",
333
+ children: /*#__PURE__*/ _jsxs("div", {
334
+ className: styles.main_list,
335
+ id: "history_list",
336
336
  children: [
337
- showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
337
+ !loading && showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
338
338
  className: styles.no_data,
339
339
  children: [
340
340
  /*#__PURE__*/ _jsx("img", {
@@ -345,7 +345,7 @@ var HistoryFun = function(props) {
345
345
  })
346
346
  ]
347
347
  }),
348
- showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
348
+ !loading && showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
349
349
  className: styles.no_data,
350
350
  children: [
351
351
  /*#__PURE__*/ _jsx("img", {
@@ -356,7 +356,7 @@ var HistoryFun = function(props) {
356
356
  })
357
357
  ]
358
358
  }),
359
- /*#__PURE__*/ _jsx("div", {
359
+ !loading && /*#__PURE__*/ _jsx("div", {
360
360
  className: styles.list_item,
361
361
  children: totalData.map(function(item) {
362
362
  var span = "";