bhd-components 0.9.11 → 0.9.13

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.
@@ -81,7 +81,7 @@
81
81
  }
82
82
  }
83
83
  .bhd_app_layout_footer {
84
- width: calc(100% - 60px);
84
+ width: 100%;
85
85
  height: 56px;
86
86
  position: absolute;
87
87
  z-index: 10;
@@ -5,12 +5,13 @@ import React, { useEffect, useState, useRef } from "react";
5
5
  import styles from "./index.module.less";
6
6
  //import "highlight.js/styles/default.css";
7
7
  import "highlight.js/styles/github.css";
8
- import { Input } from "antd";
8
+ import { Input, Spin } from "antd";
9
9
  import { CustomClose, CustomExpand, CustomAiIcon } from "../icons";
10
10
  import { SearchOutlined } from "@ant-design/icons";
11
11
  import { formatDate } from "./function"; //录音使用文件
12
12
  const HistoryFun = (props)=>{
13
13
  let { type, roomId, userData, http, urllocation, onClose, loadSpecifiedData } = props;
14
+ const [loading, setLoading] = useState(false);
14
15
  const [keyWordProblem, setKeyWordProblem] = useState(""); //搜索内容
15
16
  const [showLoadingState, setShowLoadingState] = useState(1); //1,初始状态,2、无数据 ,3、不显示图片
16
17
  const [pageNum, setPageNum] = useState(1);
@@ -49,6 +50,7 @@ const HistoryFun = (props)=>{
49
50
  pageNum
50
51
  ]);
51
52
  const getList = (val, pageNum)=>{
53
+ setLoading(true);
52
54
  return http.get(`${urllocation}/chat-service/public/v1.0/history-messages-total`, {
53
55
  params: {
54
56
  message: val,
@@ -56,6 +58,7 @@ const HistoryFun = (props)=>{
56
58
  maxPageSize: maxPageSize
57
59
  }
58
60
  }).then((res)=>{
61
+ setLoading(false);
59
62
  let data = res.data;
60
63
  if (data.total > 0) {
61
64
  setShowLoadingState(3);
@@ -70,7 +73,9 @@ const HistoryFun = (props)=>{
70
73
  } else {
71
74
  setShowLoadingState(2);
72
75
  }
73
- }).catch((res)=>{});
76
+ }).catch((res)=>{
77
+ setLoading(false);
78
+ });
74
79
  };
75
80
  //获取全部数据
76
81
  const allData = (roomId)=>{
@@ -317,181 +322,185 @@ const HistoryFun = (props)=>{
317
322
  })
318
323
  ]
319
324
  }),
320
- /*#__PURE__*/ _jsxs("div", {
325
+ /*#__PURE__*/ _jsx("div", {
321
326
  className: styles.main_list,
322
327
  id: "history_list",
323
- children: [
324
- showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
325
- className: styles.no_data,
326
- children: [
327
- /*#__PURE__*/ _jsx("img", {
328
- src: "/new_yun/images/aiService/search_for_icon.png"
329
- }),
330
- /*#__PURE__*/ _jsx("p", {
331
- children: "输入关键词,搜索聊天记录"
332
- })
333
- ]
334
- }),
335
- showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
336
- className: styles.no_data,
337
- children: [
338
- /*#__PURE__*/ _jsx("img", {
339
- src: "/new_yun/images/aiService/no_data.png"
340
- }),
341
- /*#__PURE__*/ _jsx("p", {
342
- children: "暂无记录"
343
- })
344
- ]
345
- }),
346
- /*#__PURE__*/ _jsx("div", {
347
- className: styles.list_item,
348
- children: totalData.map((item)=>{
349
- let span = "";
350
- let time = "";
351
- if (item.count == 1) {
352
- let message = item.message;
353
- let position_i = message.indexOf(keyWordProblem);
354
- if (position_i > 30) {
355
- message = message.substring(position_i - 15);
356
- }
357
- let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
358
- //搜索内容是否有特殊字符
359
- if (reg.test(keyWordProblem)) {
360
- span = message.replaceAll(keyWordProblem, (e)=>{
361
- return `<span class=${styles.sign}>${e}</span>`;
362
- });
363
- } else {
364
- span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
365
- return `<span class=${styles.sign}>${i}</span>`;
366
- });
328
+ children: /*#__PURE__*/ _jsxs(Spin, {
329
+ spinning: loading,
330
+ tip: "加载中...",
331
+ children: [
332
+ showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
333
+ className: styles.no_data,
334
+ children: [
335
+ /*#__PURE__*/ _jsx("img", {
336
+ src: "/new_yun/images/aiService/search_for_icon.png"
337
+ }),
338
+ /*#__PURE__*/ _jsx("p", {
339
+ children: "输入关键词,搜索聊天记录"
340
+ })
341
+ ]
342
+ }),
343
+ showLoadingState == 2 && /*#__PURE__*/ _jsxs("div", {
344
+ className: styles.no_data,
345
+ children: [
346
+ /*#__PURE__*/ _jsx("img", {
347
+ src: "/new_yun/images/aiService/no_data.png"
348
+ }),
349
+ /*#__PURE__*/ _jsx("p", {
350
+ children: "暂无记录"
351
+ })
352
+ ]
353
+ }),
354
+ /*#__PURE__*/ _jsx("div", {
355
+ className: styles.list_item,
356
+ children: totalData.map((item)=>{
357
+ let span = "";
358
+ let time = "";
359
+ if (item.count == 1) {
360
+ let message = item.message;
361
+ let position_i = message.indexOf(keyWordProblem);
362
+ if (position_i > 30) {
363
+ message = message.substring(position_i - 15);
364
+ }
365
+ let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
366
+ //搜索内容是否有特殊字符
367
+ if (reg.test(keyWordProblem)) {
368
+ span = message.replaceAll(keyWordProblem, (e)=>{
369
+ return `<span class=${styles.sign}>${e}</span>`;
370
+ });
371
+ } else {
372
+ span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
373
+ return `<span class=${styles.sign}>${i}</span>`;
374
+ });
375
+ }
376
+ time = formatDate(item.createdAt);
367
377
  }
368
- time = formatDate(item.createdAt);
369
- }
370
- return /*#__PURE__*/ _jsxs(_Fragment, {
371
- children: [
372
- /*#__PURE__*/ _jsxs("div", {
373
- className: `${styles.list_summary} ${item.show ? styles.list_summary_active : ""}`,
374
- id: item.roomId,
375
- onClick: ()=>{
376
- if (item.count == 1) {
377
- calculationData(item.roomId, item.id, item.member);
378
- } else {
379
- showDetails(item.roomId, item.show);
380
- }
381
- },
382
- children: [
383
- /*#__PURE__*/ _jsx("div", {
384
- className: styles.head_img,
385
- children: item.member == "AI" ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
386
- src: item.headImg
387
- })
388
- }),
389
- /*#__PURE__*/ _jsxs("div", {
390
- className: styles.list_desc,
391
- children: [
392
- /*#__PURE__*/ _jsxs("p", {
393
- className: styles.name,
394
- children: [
395
- item.member == "AI" ? "AI助手" : item.name,
396
- item.count == 1 ? /*#__PURE__*/ _jsx("span", {
397
- className: styles.time,
398
- children: time
399
- }) : ""
400
- ]
401
- }),
402
- item.count == 1 ? /*#__PURE__*/ _jsx("p", {
403
- className: styles.decs,
404
- style: {
405
- width: "calc(100% - 36px)"
406
- },
407
- dangerouslySetInnerHTML: {
408
- __html: span
409
- }
410
- }) : /*#__PURE__*/ _jsx("p", {
411
- className: styles.decs,
412
- children: `${item.count}条相关聊天记录`
413
- })
414
- ]
415
- }),
416
- item.count != 1 ? /*#__PURE__*/ _jsx("div", {
417
- className: `${styles.open} ${item.show ? styles.active : ''}`,
418
- children: /*#__PURE__*/ _jsx(CustomExpand, {})
419
- }) : ""
420
- ]
421
- }),
422
- /*#__PURE__*/ _jsxs("div", {
423
- className: styles.list_detail,
424
- children: [
425
- item.show && item.detailsList && item.detailsList.map((list)=>{
426
- // console.log(list,item,'dklfvmdflkvmdfklv')
427
- let name = "";
428
- if (list.sender == 'AI') {
429
- name = 'AI助手';
430
- } else if (list.sender == item.member) {
431
- name = item.name;
378
+ return /*#__PURE__*/ _jsxs(_Fragment, {
379
+ children: [
380
+ /*#__PURE__*/ _jsxs("div", {
381
+ className: `${styles.list_summary} ${item.show ? styles.list_summary_active : ""}`,
382
+ id: item.roomId,
383
+ onClick: ()=>{
384
+ if (item.count == 1) {
385
+ calculationData(item.roomId, item.id, item.member);
432
386
  } else {
433
- name = userData.real_name;
434
- }
435
- let time = formatDate(list.updatedAt);
436
- let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
437
- let span = '';
438
- let message = list.message;
439
- let position_i = message.indexOf(keyWordProblem);
440
- if (position_i > 30) {
441
- message = message.substring(position_i - 15);
387
+ showDetails(item.roomId, item.show);
442
388
  }
443
- //搜索内容是否有特殊字符
444
- if (reg.test(keyWordProblem)) {
445
- span = message.replaceAll(keyWordProblem, (e)=>{
446
- return `<span class=${styles.sign}>${e}</span>`;
447
- });
448
- } else {
449
- span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
450
- // console.log(i,'skdcnsdjk')
451
- return `<span class=${styles.sign}>${i}</span>`;
452
- });
453
- }
454
- return /*#__PURE__*/ _jsxs("div", {
455
- className: styles.list,
456
- onClick: ()=>{
457
- calculationData(item.roomId, list.id, list.receiver);
458
- },
389
+ },
390
+ children: [
391
+ /*#__PURE__*/ _jsx("div", {
392
+ className: styles.head_img,
393
+ children: item.member == "AI" ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
394
+ src: item.headImg
395
+ })
396
+ }),
397
+ /*#__PURE__*/ _jsxs("div", {
398
+ className: styles.list_desc,
459
399
  children: [
460
- /*#__PURE__*/ _jsxs("div", {
400
+ /*#__PURE__*/ _jsxs("p", {
461
401
  className: styles.name,
462
402
  children: [
463
- /*#__PURE__*/ _jsx("p", {
464
- children: name
465
- }),
466
- /*#__PURE__*/ _jsx("span", {
403
+ item.member == "AI" ? "AI助手" : item.name,
404
+ item.count == 1 ? /*#__PURE__*/ _jsx("span", {
467
405
  className: styles.time,
468
406
  children: time
469
- })
407
+ }) : ""
470
408
  ]
471
409
  }),
472
- /*#__PURE__*/ _jsx("div", {
473
- className: styles.con,
410
+ item.count == 1 ? /*#__PURE__*/ _jsx("p", {
411
+ className: styles.decs,
412
+ style: {
413
+ width: "calc(100% - 36px)"
414
+ },
474
415
  dangerouslySetInnerHTML: {
475
416
  __html: span
476
417
  }
418
+ }) : /*#__PURE__*/ _jsx("p", {
419
+ className: styles.decs,
420
+ children: `${item.count}条相关聊天记录`
477
421
  })
478
422
  ]
479
- }, list.id);
480
- }),
481
- item.show && item.pageCount > 1 && item.pageCount > item.pageNum && /*#__PURE__*/ _jsx("div", {
482
- className: `${styles.list} ${styles.list_more}`,
483
- onClick: ()=>{
484
- loadMore(item.pageNum + 1, item.roomId);
485
- },
486
- children: "点击加载更多"
487
- })
488
- ]
489
- })
490
- ]
491
- });
423
+ }),
424
+ item.count != 1 ? /*#__PURE__*/ _jsx("div", {
425
+ className: `${styles.open} ${item.show ? styles.active : ''}`,
426
+ children: /*#__PURE__*/ _jsx(CustomExpand, {})
427
+ }) : ""
428
+ ]
429
+ }),
430
+ /*#__PURE__*/ _jsxs("div", {
431
+ className: styles.list_detail,
432
+ children: [
433
+ item.show && item.detailsList && item.detailsList.map((list)=>{
434
+ // console.log(list,item,'dklfvmdflkvmdfklv')
435
+ let name = "";
436
+ if (list.sender == 'AI') {
437
+ name = 'AI助手';
438
+ } else if (list.sender == item.member) {
439
+ name = item.name;
440
+ } else {
441
+ name = userData.real_name;
442
+ }
443
+ let time = formatDate(list.updatedAt);
444
+ let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
445
+ let span = '';
446
+ let message = list.message;
447
+ let position_i = message.indexOf(keyWordProblem);
448
+ if (position_i > 30) {
449
+ message = message.substring(position_i - 15);
450
+ }
451
+ //搜索内容是否有特殊字符
452
+ if (reg.test(keyWordProblem)) {
453
+ span = message.replaceAll(keyWordProblem, (e)=>{
454
+ return `<span class=${styles.sign}>${e}</span>`;
455
+ });
456
+ } else {
457
+ span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
458
+ // console.log(i,'skdcnsdjk')
459
+ return `<span class=${styles.sign}>${i}</span>`;
460
+ });
461
+ }
462
+ return /*#__PURE__*/ _jsxs("div", {
463
+ className: styles.list,
464
+ onClick: ()=>{
465
+ calculationData(item.roomId, list.id, list.receiver);
466
+ },
467
+ children: [
468
+ /*#__PURE__*/ _jsxs("div", {
469
+ className: styles.name,
470
+ children: [
471
+ /*#__PURE__*/ _jsx("p", {
472
+ children: name
473
+ }),
474
+ /*#__PURE__*/ _jsx("span", {
475
+ className: styles.time,
476
+ children: time
477
+ })
478
+ ]
479
+ }),
480
+ /*#__PURE__*/ _jsx("div", {
481
+ className: styles.con,
482
+ dangerouslySetInnerHTML: {
483
+ __html: span
484
+ }
485
+ })
486
+ ]
487
+ }, list.id);
488
+ }),
489
+ item.show && item.pageCount > 1 && item.pageCount > item.pageNum && /*#__PURE__*/ _jsx("div", {
490
+ className: `${styles.list} ${styles.list_more}`,
491
+ onClick: ()=>{
492
+ loadMore(item.pageNum + 1, item.roomId);
493
+ },
494
+ children: "点击加载更多"
495
+ })
496
+ ]
497
+ })
498
+ ]
499
+ });
500
+ })
492
501
  })
493
- })
494
- ]
502
+ ]
503
+ })
495
504
  })
496
505
  ]
497
506
  })
@@ -27,11 +27,11 @@ const { TextArea } = Input;
27
27
  // import './html2canvas.test.js';
28
28
  import knowledge_icon from "./images/knowledge_icon.png";
29
29
  // import { useMediaRecorder } from "./useMediaRecorder"; //录音使用文件
30
- import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, resetStyles, findParent, delegate } from "./function"; //一些方法
30
+ import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, resetStyles, findParent, delegate, urlToBase64 } from "./function"; //一些方法
31
31
  // import html2canvas from "html2canvas";
32
- // const screenShot = require('./screenShotPlugin.esm')
32
+ // const screenShot = require('./screenShotPlugin.esm')
33
33
  import ScreenShot from "./js-screen-shot/main";
34
- /*
34
+ /*
35
35
  自定义remarkable的text解析规则
36
36
  */ const HTML_ESCAPE_TEST_RE = /[&<>"]/;
37
37
  const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
@@ -69,6 +69,7 @@ const CustomerService = (props)=>{
69
69
  const [loading, setLoading] = useState(false); //上拉显示加载图标
70
70
  const [bottomLoading, setBottomLoading] = useState(false); //下拉显示加载图标
71
71
  const [finished, setFinished] = useState(true); //是否结束生成
72
+ const finishedRef = useRef(true); //是否结束生成
72
73
  const [lastId, setLastId] = useState(""); //最后一条数据的id,可用于定位当前位置
73
74
  const [chatWith, setChatWith] = useState({}); //聊天的老师id或ai
74
75
  const [firstLoad, setFirstLoad] = useState(false); //第一次切换全屏时滚动到页面底部
@@ -327,12 +328,13 @@ const CustomerService = (props)=>{
327
328
  }, 1000);
328
329
  }
329
330
  //生成答案过程中
330
- if (!finished && scrollTopHei.current > scrollTop) {
331
+ if (!finished && scrollHeight > scrollTop) {
332
+ console.log('生成答案过程中', scrollTopHei.current, scrollTop);
331
333
  // setIsPosition(false);
332
334
  isPosition.current = false;
333
335
  }
334
336
  if (!finished && clientHeight + scrollTop >= scrollHeight) {
335
- // console.log('到顶了111');
337
+ console.log('到顶了111', clientHeight, scrollTop, scrollHeight);
336
338
  isPosition.current = true;
337
339
  }
338
340
  scrollTopHei.current = scrollTop;
@@ -521,7 +523,7 @@ const CustomerService = (props)=>{
521
523
  roomId: roomId,
522
524
  sender: "AI",
523
525
  recevier: mid,
524
- message: `Hi,我是智能学习助手,你遇到了什么问题?`,
526
+ message: `Hi,我是智能学习助手,你遇到了什么问题?111`,
525
527
  extraInfos: questionsList == null ? null : questionsList
526
528
  };
527
529
  if (pageNumHistory <= 1) {
@@ -549,7 +551,7 @@ const CustomerService = (props)=>{
549
551
  roomId: roomId,
550
552
  sender: "AI",
551
553
  recevier: mid,
552
- message: `Hi,我是智能学习助手,你遇到了什么问题?`
554
+ message: `Hi,我是智能学习助手,你遇到了什么问题?222哈哈`
553
555
  };
554
556
  if (pageNumHistory <= 1) {
555
557
  setHistoryMessageList((historyMessageList)=>{
@@ -713,7 +715,7 @@ const CustomerService = (props)=>{
713
715
  });
714
716
  };
715
717
  //消息发送给老师type == 1,召唤老师时发送,type == 2,在老师聊天窗口聊天
716
- const sendToTeacher = (type, message = '')=>{
718
+ const sendToTeacher = async (type, message = '')=>{
717
719
  console.log("消息发送给老师111");
718
720
  let obj = {};
719
721
  if (type == 1) {
@@ -741,7 +743,12 @@ const CustomerService = (props)=>{
741
743
  quotedMessage: citationContent.content || ""
742
744
  };
743
745
  if (citationContent.imageUrl) {
744
- obj.image = citationContent.imageUrl;
746
+ // obj.image = citationContent.imageUrl;
747
+ // obj.image = urlToBase64(citationContent.imageUrl);
748
+ let base64 = await urlToBase64(citationContent.imageUrl);
749
+ console.log('citationContent.imageUrl', citationContent.imageUrl);
750
+ //imageUrl = citationContent.imageUrl;
751
+ obj.image = base64;
745
752
  }
746
753
  if (screenshotBese64) {
747
754
  obj.image = screenshotBese64;
@@ -866,10 +873,11 @@ const CustomerService = (props)=>{
866
873
  };
867
874
  let imageUrl = '';
868
875
  if (citationContent.imageUrl) {
869
- // let base64:string=await urlToBase64(citationContent.imageUrl) as string
876
+ let base64 = await urlToBase64(citationContent.imageUrl);
870
877
  console.log('citationContent.imageUrl', citationContent.imageUrl);
871
878
  sendData.image = citationContent.imageUrl;
872
- imageUrl = citationContent.imageUrl;
879
+ //imageUrl = citationContent.imageUrl;
880
+ imageUrl = base64;
873
881
  }
874
882
  if (screenshotBese64) {
875
883
  console.log('screenshotBese64', screenshotBese64);
@@ -1064,7 +1072,7 @@ const CustomerService = (props)=>{
1064
1072
  body: data,
1065
1073
  signal: ctrl.current.signal,
1066
1074
  openWhenHidden: true,
1067
- onopen (res) {
1075
+ async onopen (res) {
1068
1076
  console.info("eventSource open: ", res);
1069
1077
  clearTimeout(receiveMessageTimer.current);
1070
1078
  if (res.status >= 300) {
@@ -1144,31 +1152,39 @@ const CustomerService = (props)=>{
1144
1152
  //识别的内容
1145
1153
  // console.log("eventSource msg: ", event.data);
1146
1154
  let msg = JSON.parse(event.data);
1147
- if (msg.message) {
1148
- content = content + msg.message;
1149
- // isPosition.current = true;
1150
- renderAiAnswerTimer.current = setTimeout(()=>{
1155
+ if (msg.message) {}
1156
+ setFinished((prevData)=>{
1157
+ finishedRef.current = false;
1158
+ return finishedRef.current;
1159
+ });
1160
+ console.log('返回中', msg);
1161
+ content = content + msg.message;
1162
+ // isPosition.current = true;
1163
+ renderAiAnswerTimer.current = setTimeout(()=>{
1164
+ if (!finishedRef.current) {
1151
1165
  renderAiAnswer(msg, id, type);
1152
- }, 100);
1153
- }
1166
+ }
1167
+ }, 100);
1154
1168
  if (msg.finished) {
1155
- setFinished(true); //发送结束
1169
+ // console.log('返回完成',msg)
1170
+ // setFinished(true); //发送结束
1156
1171
  if (!flagKeyWord) {
1157
1172
  videoPageQuestiionsList(2);
1158
1173
  }
1159
1174
  // isPosition.current = true;
1160
- setTimeout(()=>{
1161
- isPosition.current = true;
1162
- }, 100);
1175
+ // setTimeout(()=>{
1176
+ // isPosition.current = true;
1177
+ // },100)
1163
1178
  testLabQuestion(JSON.parse(data).message, content, "");
1164
- }
1179
+ } else {}
1165
1180
  },
1166
1181
  onclose () {
1167
- setFinished(true); //发送结束
1168
- // isPosition.current = true;
1169
- setTimeout(()=>{
1170
- isPosition.current = true;
1171
- }, 100);
1182
+ console.log("eventSource close");
1183
+ // setFinished(true); //发送结束
1184
+ // // isPosition.current = true;
1185
+ // setTimeout(()=>{
1186
+ // isPosition.current = true;
1187
+ // },100)
1172
1188
  setHistoryMessageList((historyMessageList)=>{
1173
1189
  return historyMessageList.filter((item)=>item.id != "123456");
1174
1190
  });
@@ -1247,9 +1263,20 @@ const CustomerService = (props)=>{
1247
1263
  return newHistoryMessageList2;
1248
1264
  }
1249
1265
  });
1250
- const container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
1251
- if (container) {
1252
- container.scrollTop = container.scrollHeight;
1266
+ console.log('isPosition', isPosition.current);
1267
+ if (isPosition.current) {
1268
+ const container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
1269
+ if (container) {
1270
+ container.scrollTop = container.scrollHeight;
1271
+ }
1272
+ }
1273
+ if (msg.finished) {
1274
+ console.log('返回完成', msg);
1275
+ //发送结束
1276
+ setFinished((prevData)=>{
1277
+ finishedRef.current = true;
1278
+ return finishedRef.current;
1279
+ });
1253
1280
  }
1254
1281
  // console.log('historyMessageList',historyMessageList)
1255
1282
  // if(isPosition.current){
@@ -2640,7 +2667,11 @@ const CustomerService = (props)=>{
2640
2667
  setHistoryMessageList((historyMessageList)=>{
2641
2668
  return historyMessageList.filter((item)=>item.id != "123456");
2642
2669
  });
2643
- setFinished(true);
2670
+ // setFinished(true);
2671
+ setFinished((prevData)=>{
2672
+ finishedRef.current = true;
2673
+ return finishedRef.current;
2674
+ });
2644
2675
  onEvent(serverName + serverUrl(), "click_智能问答_停止生成", "提交");
2645
2676
  }
2646
2677
  }),
@@ -2656,7 +2687,11 @@ const CustomerService = (props)=>{
2656
2687
  setHistoryMessageList((historyMessageList)=>{
2657
2688
  return historyMessageList.filter((item)=>item.id != "123456");
2658
2689
  });
2659
- setFinished(true);
2690
+ // setFinished(true);
2691
+ setFinished((prevData)=>{
2692
+ finishedRef.current = true;
2693
+ return finishedRef.current;
2694
+ });
2660
2695
  onEvent(serverName + serverUrl(), "click_智能问答_停止生成", "提交");
2661
2696
  },
2662
2697
  children: "停止生成"
@@ -81,7 +81,7 @@
81
81
  }
82
82
  }
83
83
  .bhd_app_layout_footer {
84
- width: calc(100% - 60px);
84
+ width: 100%;
85
85
  height: 56px;
86
86
  position: absolute;
87
87
  z-index: 10;