bhd-components 0.10.36 → 0.10.38

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,4 +1,4 @@
1
- import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as MinusOutlined, v as PlusOutlined, L as LeftOutlined, R as RightOutlined, w as __generator, x as Input, y as SearchOutlined, B as Spin, D as CloseOutlined, X, E as I, H, F as html2canvas$1, G as r, J as Remarkable, K as Drawer, N as HighlightJS, O as cn, Z as ZoomInOutlined, Q as DatePicker, U as Button, V as l, W as Upload, Y as Popover, $ as DoubleRightOutlined, a0 as CloseCircleFilled, a1 as Divider, a2 as fetchEventSource } from './vendor.esm.es5.development.js';
1
+ import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as __generator, v as MinusOutlined, w as PlusOutlined, L as LeftOutlined, R as RightOutlined, x as Input, y as SearchOutlined, B as Spin, D as CloseOutlined, X, E as I, H, F as html2canvas$1, G as r, J as Remarkable, K as Drawer, N as HighlightJS, O as cn, Z as ZoomInOutlined, Q as DatePicker, U as Button, V as l, W as Upload, Y as Popover, $ as DoubleRightOutlined, a0 as CloseCircleFilled, a1 as Divider, a2 as fetchEventSource } from './vendor.esm.es5.development.js';
2
2
  export { a3 as Affix, a4 as Alert, a5 as Anchor, a as AntdMessage, A as App, a6 as AutoComplete, a7 as Avatar, a9 as BackTop, aa as Badge, ab as Breadcrumb, U as Button, ac as Calendar, ad as Card, ae as Carousel, af as Cascader, ag as Checkbox, ah as Col, ai as Collapse, Q as DatePicker, aj as Descriptions, a1 as Divider, K as Drawer, ak as Dropdown, al as Empty, a8 as FloatButton, am as Form, an as Grid, ao as Image, x as Input, ap as InputNumber, aq as Layout, ar as List, as as Mentions, at as Menu, M as Modal, au as Popconfirm, Y as Popover, av as Progress, aS as QRCode, aw as Radio, ax as Rate, ay as Result, az as Row, aA as Segmented, k as Select, aB as Skeleton, aC as Slider, aD as Space, B as Spin, aE as Statistic, aF as Steps, aG as Switch, aH as Tabs, aI as Tag, aK as TimePicker, aL as Timeline, T as Tooltip, aM as Tour, aN as Transfer, aO as Tree, aP as TreeSelect, aQ as Typography, W as Upload, aR as Watermark, aU as en_US, b as notification, aJ as theme, aT as version, z as zh_CN } from './vendor.esm.es5.development.js';
3
3
  import * as React from 'react';
4
4
  import React__default, { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback, useMemo } from 'react';
@@ -2678,7 +2678,7 @@ function BhdAppLayout(props) {
2678
2678
  });
2679
2679
  }
2680
2680
 
2681
- var modules_63b47c51$f = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__6e43f92b","ChatWindow_Modal":"index_module_ChatWindow_Modal__6e43f92b","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__6e43f92b","header_wrap":"index_module_header_wrap__6e43f92b","top":"index_module_top__6e43f92b","user":"index_module_user__6e43f92b","count":"index_module_count__6e43f92b","operate":"index_module_operate__6e43f92b","line":"index_module_line__6e43f92b","popover_main":"index_module_popover_main__6e43f92b","popover":"index_module_popover__6e43f92b","header_wrap_newlabo":"index_module_header_wrap_newlabo__6e43f92b","Drawer_main":"index_module_Drawer_main__6e43f92b","loading":"index_module_loading__6e43f92b","message_con":"index_module_message_con__6e43f92b","left":"index_module_left__6e43f92b","head_sculpture":"index_module_head_sculpture__6e43f92b","main_content":"index_module_main_content__6e43f92b","right":"index_module_right__6e43f92b","itemcontent":"index_module_itemcontent__6e43f92b","main":"index_module_main__6e43f92b","main_content_flag":"index_module_main_content_flag__6e43f92b","operate_modal":"index_module_operate_modal__6e43f92b","operate_modal_showtop":"index_module_operate_modal_showtop__6e43f92b","operate_modal_bottom":"index_module_operate_modal_bottom__6e43f92b","active":"index_module_active__6e43f92b","stop_generate":"index_module_stop_generate__6e43f92b","icon":"index_module_icon__6e43f92b","find_teacher":"index_module_find_teacher__6e43f92b","stop_findTeacher":"index_module_stop_findTeacher__6e43f92b","content":"index_module_content__6e43f92b","content_child":"index_module_content_child__6e43f92b","mermaid":"index_module_mermaid__6e43f92b","maskZoomBox":"index_module_maskZoomBox__6e43f92b","zoomBox":"index_module_zoomBox__6e43f92b","find_teacher_con":"index_module_find_teacher_con__6e43f92b","sign":"index_module_sign__6e43f92b","ask_question":"index_module_ask_question__6e43f92b","bottom":"index_module_bottom__6e43f92b","association_problem":"index_module_association_problem__6e43f92b","association_problem_flag":"index_module_association_problem_flag__6e43f92b","related_issues_flag":"index_module_related_issues_flag__6e43f92b","img_con":"index_module_img_con__6e43f92b","mask_zoom":"index_module_mask_zoom__6e43f92b","img_con2":"index_module_img_con2__6e43f92b","copyCode":"index_module_copyCode__6e43f92b","time":"index_module_time__6e43f92b","citation_content":"index_module_citation_content__6e43f92b","text_exceed":"index_module_text_exceed__6e43f92b","popover_content":"index_module_popover_content__6e43f92b","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__6e43f92b","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__6e43f92b","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__6e43f92b","issues_list_teacherList":"index_module_issues_list_teacherList__6e43f92b","item":"index_module_item__6e43f92b","issues_list":"index_module_issues_list__6e43f92b","issues_list_flag":"index_module_issues_list_flag__6e43f92b","Drawer_buttom":"index_module_Drawer_buttom__6e43f92b","input_wrap":"index_module_input_wrap__6e43f92b","input":"index_module_input__6e43f92b","picture_layout":"index_module_picture_layout__6e43f92b","icon_close":"index_module_icon_close__6e43f92b","icon_zoom":"index_module_icon_zoom__6e43f92b","anticon":"index_module_anticon__6e43f92b","no_AI":"index_module_no_AI__6e43f92b","screenshot":"index_module_screenshot__6e43f92b","disabled":"index_module_disabled__6e43f92b","content_main":"index_module_content_main__6e43f92b","content_con":"index_module_content_con__6e43f92b","delete_quote":"index_module_delete_quote__6e43f92b","sending":"index_module_sending__6e43f92b","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__6e43f92b","main_list":"index_module_main_list__6e43f92b","chat_content":"index_module_chat_content__6e43f92b","popover_main_content":"index_module_popover_main_content__6e43f92b","popover_main_content_name":"index_module_popover_main_content_name__6e43f92b","teacher_layout":"index_module_teacher_layout__6e43f92b","delete":"index_module_delete__6e43f92b","num":"index_module_num__6e43f92b","shrink":"index_module_shrink__6e43f92b","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__6e43f92b","teacher_layout_modal":"index_module_teacher_layout_modal__6e43f92b","ai":"index_module_ai__6e43f92b","user_info":"index_module_user_info__6e43f92b","message":"index_module_message__6e43f92b","con":"index_module_con__6e43f92b","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__6e43f92b","history_list":"index_module_history_list__6e43f92b","search_layout":"index_module_search_layout__6e43f92b","mymove":"index_module_mymove__6e43f92b","title":"index_module_title__6e43f92b","search_top":"index_module_search_top__6e43f92b","list_item":"index_module_list_item__6e43f92b","list_summary":"index_module_list_summary__6e43f92b","head_img":"index_module_head_img__6e43f92b","list_desc":"index_module_list_desc__6e43f92b","name":"index_module_name__6e43f92b","decs":"index_module_decs__6e43f92b","open":"index_module_open__6e43f92b","list_summary_active":"index_module_list_summary_active__6e43f92b","list_detail":"index_module_list_detail__6e43f92b","list":"index_module_list__6e43f92b","list_more":"index_module_list_more__6e43f92b","no_data":"index_module_no_data__6e43f92b","history_list_broadside":"index_module_history_list_broadside__6e43f92b","teacher_list":"index_module_teacher_list__6e43f92b","screenshot_Modal":"index_module_screenshot_Modal__6e43f92b","ReactCrop":"index_module_ReactCrop__6e43f92b","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__6e43f92b","viewMedia_Modal":"index_module_viewMedia_Modal__6e43f92b","viewMemaid":"index_module_viewMemaid__6e43f92b"};
2681
+ var modules_63b47c51$f = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__e488bd5b","ChatWindow_Modal":"index_module_ChatWindow_Modal__e488bd5b","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__e488bd5b","header_wrap":"index_module_header_wrap__e488bd5b","top":"index_module_top__e488bd5b","user":"index_module_user__e488bd5b","count":"index_module_count__e488bd5b","operate":"index_module_operate__e488bd5b","line":"index_module_line__e488bd5b","popover_main":"index_module_popover_main__e488bd5b","popover":"index_module_popover__e488bd5b","header_wrap_newlabo":"index_module_header_wrap_newlabo__e488bd5b","Drawer_main":"index_module_Drawer_main__e488bd5b","loading":"index_module_loading__e488bd5b","message_con":"index_module_message_con__e488bd5b","left":"index_module_left__e488bd5b","head_sculpture":"index_module_head_sculpture__e488bd5b","main_content":"index_module_main_content__e488bd5b","right":"index_module_right__e488bd5b","itemcontent":"index_module_itemcontent__e488bd5b","main":"index_module_main__e488bd5b","main_content_flag":"index_module_main_content_flag__e488bd5b","operate_modal":"index_module_operate_modal__e488bd5b","operate_modal_showtop":"index_module_operate_modal_showtop__e488bd5b","operate_modal_bottom":"index_module_operate_modal_bottom__e488bd5b","active":"index_module_active__e488bd5b","stop_generate":"index_module_stop_generate__e488bd5b","icon":"index_module_icon__e488bd5b","find_teacher":"index_module_find_teacher__e488bd5b","stop_findTeacher":"index_module_stop_findTeacher__e488bd5b","content":"index_module_content__e488bd5b","content_child":"index_module_content_child__e488bd5b","mermaid":"index_module_mermaid__e488bd5b","maskZoomBox":"index_module_maskZoomBox__e488bd5b","zoomBox":"index_module_zoomBox__e488bd5b","find_teacher_con":"index_module_find_teacher_con__e488bd5b","sign":"index_module_sign__e488bd5b","ask_question":"index_module_ask_question__e488bd5b","bottom":"index_module_bottom__e488bd5b","association_problem":"index_module_association_problem__e488bd5b","association_problem_flag":"index_module_association_problem_flag__e488bd5b","related_issues_flag":"index_module_related_issues_flag__e488bd5b","img_con":"index_module_img_con__e488bd5b","mask_zoom":"index_module_mask_zoom__e488bd5b","img_con2":"index_module_img_con2__e488bd5b","copyCode":"index_module_copyCode__e488bd5b","time":"index_module_time__e488bd5b","citation_content":"index_module_citation_content__e488bd5b","text_exceed":"index_module_text_exceed__e488bd5b","popover_content":"index_module_popover_content__e488bd5b","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__e488bd5b","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__e488bd5b","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__e488bd5b","issues_list_teacherList":"index_module_issues_list_teacherList__e488bd5b","item":"index_module_item__e488bd5b","issues_list":"index_module_issues_list__e488bd5b","issues_list_flag":"index_module_issues_list_flag__e488bd5b","Drawer_buttom":"index_module_Drawer_buttom__e488bd5b","input_wrap":"index_module_input_wrap__e488bd5b","input":"index_module_input__e488bd5b","picture_layout":"index_module_picture_layout__e488bd5b","icon_close":"index_module_icon_close__e488bd5b","icon_zoom":"index_module_icon_zoom__e488bd5b","anticon":"index_module_anticon__e488bd5b","no_AI":"index_module_no_AI__e488bd5b","screenshot":"index_module_screenshot__e488bd5b","disabled":"index_module_disabled__e488bd5b","content_main":"index_module_content_main__e488bd5b","content_con":"index_module_content_con__e488bd5b","delete_quote":"index_module_delete_quote__e488bd5b","sending":"index_module_sending__e488bd5b","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__e488bd5b","main_list":"index_module_main_list__e488bd5b","chat_content":"index_module_chat_content__e488bd5b","popover_main_content":"index_module_popover_main_content__e488bd5b","popover_main_content_name":"index_module_popover_main_content_name__e488bd5b","teacher_layout":"index_module_teacher_layout__e488bd5b","delete":"index_module_delete__e488bd5b","num":"index_module_num__e488bd5b","shrink":"index_module_shrink__e488bd5b","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__e488bd5b","teacher_layout_modal":"index_module_teacher_layout_modal__e488bd5b","ai":"index_module_ai__e488bd5b","user_info":"index_module_user_info__e488bd5b","message":"index_module_message__e488bd5b","con":"index_module_con__e488bd5b","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__e488bd5b","history_list":"index_module_history_list__e488bd5b","search_layout":"index_module_search_layout__e488bd5b","mymove":"index_module_mymove__e488bd5b","title":"index_module_title__e488bd5b","search_top":"index_module_search_top__e488bd5b","list_item":"index_module_list_item__e488bd5b","list_summary":"index_module_list_summary__e488bd5b","head_img":"index_module_head_img__e488bd5b","list_desc":"index_module_list_desc__e488bd5b","name":"index_module_name__e488bd5b","decs":"index_module_decs__e488bd5b","open":"index_module_open__e488bd5b","list_summary_active":"index_module_list_summary_active__e488bd5b","list_detail":"index_module_list_detail__e488bd5b","list":"index_module_list__e488bd5b","list_more":"index_module_list_more__e488bd5b","no_data":"index_module_no_data__e488bd5b","history_list_broadside":"index_module_history_list_broadside__e488bd5b","teacher_list":"index_module_teacher_list__e488bd5b","screenshot_Modal":"index_module_screenshot_Modal__e488bd5b","ReactCrop":"index_module_ReactCrop__e488bd5b","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__e488bd5b","viewMedia_Modal":"index_module_viewMedia_Modal__e488bd5b","viewMemaid":"index_module_viewMemaid__e488bd5b","content_put":"index_module_content_put__e488bd5b"};
2682
2682
 
2683
2683
  function BaseHOC(key) {
2684
2684
  return function(props) {
@@ -2872,9 +2872,12 @@ var delegate = function(element, eventType, selector, callback) {
2872
2872
  };
2873
2873
  var formatDate = function(dateStr) {
2874
2874
  var today = new Date();
2875
+ today.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
2875
2876
  var date = new Date(dateStr);
2877
+ var cloneDate = new Date(dateStr);
2878
+ cloneDate.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
2876
2879
  var isSameDay = today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate();
2877
- var dayDiff = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); // 计算天数差
2880
+ var dayDiff = Math.ceil((today - cloneDate) / (1000 * 60 * 60 * 24)); // 计算天数差
2878
2881
  // 判断当前的日期 是否于传入的日期为同一天 同一天则显示时间 不是同一天则判断是否超过一周
2879
2882
  // console.log(dayDiff,'dayDiffdayDiff',today,'___',date);
2880
2883
  if (isSameDay) {
@@ -2882,7 +2885,7 @@ var formatDate = function(dateStr) {
2882
2885
  return date.toLocaleTimeString("zh-CN", {
2883
2886
  hour12: false
2884
2887
  }).substring(0, 5);
2885
- } else if (dayDiff <= 7) {
2888
+ } else if (dayDiff < 7) {
2886
2889
  // 一周内
2887
2890
  return date.toLocaleString("zh-CN", {
2888
2891
  weekday: "short"
@@ -4072,6 +4075,10 @@ var TeacherList$1 = TeacherList;
4072
4075
 
4073
4076
  var parseDate = function(dateStr) {
4074
4077
  var date = new Date(dateStr); // 创建一个日期对象,表示当前时间
4078
+ // @ts-ignore
4079
+ if (date == "Invalid Date") {
4080
+ date = new Date();
4081
+ }
4075
4082
  var year = date.getFullYear().toString(); // 获取年份
4076
4083
  var month = String(date.getMonth() + 1).padStart(2, "0"); // 获取月份,并补齐两位数
4077
4084
  var day = String(date.getDate()).padStart(2, "0"); // 获取日期,并补齐两位数
@@ -8198,6 +8205,12 @@ function escapeHtml(str) {
8198
8205
  }
8199
8206
  return str;
8200
8207
  }
8208
+ var exactRegex = /class\s*=\s*["']think-block["']/;
8209
+ // 去掉think
8210
+ var replaceThinkAndYaml = function() {
8211
+ var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
8212
+ return text.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "").replace(/<thinking>([\s\S]*?)<\/thinking>/g, "").replace(RegExp('<div\\s+class="think-block">.*?<\\/div>', "gs"), "");
8213
+ };
8201
8214
  r.initialize({
8202
8215
  startOnLoad: false,
8203
8216
  theme: "default",
@@ -8280,6 +8293,7 @@ var CustomerService = function(props) {
8280
8293
  var getLisyFlagRef = useRef(0);
8281
8294
  var _useState36 = _sliced_to_array(useState(false), 2); _useState36[0]; _useState36[1]; //是否显示mermaid弹窗
8282
8295
  var _useState37 = _sliced_to_array(useState(""), 2); _useState37[0]; _useState37[1]; //mermaid内容
8296
+ var shouqiTimer = useRef(null);
8283
8297
  var remarkable = new Remarkable({
8284
8298
  html: true,
8285
8299
  highlight: function highlight(str, lang) {
@@ -8366,6 +8380,7 @@ var CustomerService = function(props) {
8366
8380
  // //获取热门推荐
8367
8381
  // videoPageQuestiionsList(1);
8368
8382
  // }
8383
+ console.log("initShowType", initShowType);
8369
8384
  setShowType(initShowType);
8370
8385
  }, [
8371
8386
  initShowType
@@ -8959,100 +8974,176 @@ var CustomerService = function(props) {
8959
8974
  });
8960
8975
  };
8961
8976
  //AI窗口,type:1发送打招呼信息欢迎语 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
8962
- var sendGreetingMessage = function(type) {
8963
- var obj = {};
8964
- if (type == 1) {
8965
- sendWelcomMessage();
8966
- return;
8967
- } else if (type == 2) {
8968
- obj = {
8969
- roomId: roomId,
8970
- sender: "AI",
8971
- recevier: mid,
8972
- message: "您的点赞是我最大的鼓励!",
8973
- createdAt: getDataTime(-1),
8974
- extraInfos: [
8975
- {
8976
- key: "messageSource",
8977
- value: "knowledgebase"
8978
- }
8979
- ]
8980
- };
8981
- } else if (type == 3) {
8982
- obj = {
8983
- roomId: roomId,
8984
- sender: "AI",
8985
- recevier: mid,
8986
- message: "谢谢您的反馈,我会努力改进的!",
8987
- createdAt: getDataTime(-1),
8988
- extraInfos: [
8989
- {
8990
- key: "messageSource",
8991
- value: "knowledgebase"
8992
- }
8993
- ]
8994
- };
8995
- } else if (type == 4) {
8996
- obj = {
8997
- roomId: roomId,
8998
- sender: mid,
8999
- recevier: "AI",
9000
- message: keyWord,
9001
- createdAt: getDataTime(-1),
9002
- quotedMessage: citationContent.content,
9003
- extraInfos: [
9004
- {
9005
- key: "messageSource",
9006
- value: "knowledgebase"
9007
- }
9008
- ]
9009
- };
9010
- } else if (type == 5) {
9011
- obj = {
9012
- roomId: roomId,
9013
- sender: "AI",
9014
- recevier: mid,
9015
- message: "抱歉!您今日的提问量已经达到最大限额,请您明日再来提问。",
9016
- createdAt: getDataTime(-1),
9017
- quotedMessage: citationContent.content,
9018
- extraInfos: [
9019
- {
9020
- key: "messageSource",
9021
- value: "knowledgebase"
9022
- }
9023
- ]
9024
- };
9025
- } else if (type == 6) {
9026
- getAssociativeProblem();
9027
- return;
9028
- }
9029
- setKeyWord("");
9030
- setQuestionsList([]);
9031
- setCitationContent({});
9032
- http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
9033
- if (res.data.id) {
9034
- if (pageNumHistory <= 1) {
9035
- setHistoryMessageList(function(historyMessageList) {
9036
- var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
9037
- id: res.data.id,
9038
- upvoted: false,
9039
- downvoted: false,
9040
- quotedMessage: "",
8977
+ var sendGreetingMessage = function() {
8978
+ var _ref = _async_to_generator(function(type) {
8979
+ var message, obj, imageUrl, base64;
8980
+ var _arguments = arguments;
8981
+ return __generator(this, function(_state) {
8982
+ switch(_state.label){
8983
+ case 0:
8984
+ message = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : "";
8985
+ obj = {};
8986
+ if (!(type == 1)) return [
8987
+ 3,
8988
+ 1
8989
+ ];
8990
+ sendWelcomMessage();
8991
+ return [
8992
+ 2
8993
+ ];
8994
+ case 1:
8995
+ if (!(type == 2)) return [
8996
+ 3,
8997
+ 2
8998
+ ];
8999
+ obj = {
9000
+ roomId: roomId,
9001
+ sender: "AI",
9002
+ recevier: mid,
9003
+ message: "您的点赞是我最大的鼓励!",
9041
9004
  createdAt: getDataTime(-1),
9042
- extraInfo: JSON.stringify(obj.extraInfos)
9043
- }));
9044
- return newHistoryMessageList;
9045
- });
9046
- }
9047
- scrollToBottom();
9048
- if (type == 4) {
9049
- sendGreetingMessage(6);
9005
+ extraInfos: [
9006
+ {
9007
+ key: "messageSource",
9008
+ value: "knowledgebase"
9009
+ }
9010
+ ]
9011
+ };
9012
+ return [
9013
+ 3,
9014
+ 7
9015
+ ];
9016
+ case 2:
9017
+ if (!(type == 3)) return [
9018
+ 3,
9019
+ 3
9020
+ ];
9021
+ obj = {
9022
+ roomId: roomId,
9023
+ sender: "AI",
9024
+ recevier: mid,
9025
+ message: "谢谢您的反馈,我会努力改进的!",
9026
+ createdAt: getDataTime(-1),
9027
+ extraInfos: [
9028
+ {
9029
+ key: "messageSource",
9030
+ value: "knowledgebase"
9031
+ }
9032
+ ]
9033
+ };
9034
+ return [
9035
+ 3,
9036
+ 7
9037
+ ];
9038
+ case 3:
9039
+ if (!(type == 4)) return [
9040
+ 3,
9041
+ 6
9042
+ ];
9043
+ obj = {
9044
+ roomId: roomId,
9045
+ sender: mid,
9046
+ recevier: "AI",
9047
+ message: message ? message : keyWord,
9048
+ createdAt: getDataTime(-1),
9049
+ quotedMessage: citationContent.content,
9050
+ extraInfos: [
9051
+ {
9052
+ key: "messageSource",
9053
+ value: "knowledgebase"
9054
+ }
9055
+ ]
9056
+ };
9057
+ imageUrl = "";
9058
+ if (!citationContent.imageUrl) return [
9059
+ 3,
9060
+ 5
9061
+ ];
9062
+ return [
9063
+ 4,
9064
+ urlToBase64(citationContent.imageUrl)
9065
+ ];
9066
+ case 4:
9067
+ base64 = _state.sent();
9068
+ imageUrl = base64;
9069
+ _state.label = 5;
9070
+ case 5:
9071
+ if (screenshotBese64) {
9072
+ imageUrl = screenshotBese64;
9073
+ }
9074
+ console.log("imageUrl", imageUrl);
9075
+ if (imageUrl) {
9076
+ obj.image = imageUrl;
9077
+ obj.extraInfos.push({
9078
+ key: "imageUrl",
9079
+ value: imageUrl
9080
+ });
9081
+ }
9082
+ return [
9083
+ 3,
9084
+ 7
9085
+ ];
9086
+ case 6:
9087
+ if (type == 5) {
9088
+ obj = {
9089
+ roomId: roomId,
9090
+ sender: "AI",
9091
+ recevier: mid,
9092
+ message: "抱歉!您今日的提问量已经达到最大限额,请您明日再来提问。",
9093
+ createdAt: getDataTime(-1),
9094
+ quotedMessage: citationContent.content,
9095
+ extraInfos: [
9096
+ {
9097
+ key: "messageSource",
9098
+ value: "knowledgebase"
9099
+ }
9100
+ ]
9101
+ };
9102
+ } else if (type == 6) {
9103
+ getAssociativeProblem();
9104
+ return [
9105
+ 2
9106
+ ];
9107
+ }
9108
+ _state.label = 7;
9109
+ case 7:
9110
+ setKeyWord("");
9111
+ setQuestionsList([]);
9112
+ setCitationContent({});
9113
+ setScreenshotBese64("");
9114
+ http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
9115
+ if (res.data.id) {
9116
+ if (pageNumHistory <= 1) {
9117
+ setHistoryMessageList(function(historyMessageList) {
9118
+ var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
9119
+ id: res.data.id,
9120
+ upvoted: false,
9121
+ downvoted: false,
9122
+ quotedMessage: "",
9123
+ createdAt: getDataTime(-1),
9124
+ extraInfo: JSON.stringify(obj.extraInfos)
9125
+ }));
9126
+ return newHistoryMessageList;
9127
+ });
9128
+ }
9129
+ scrollToBottom();
9130
+ if (type == 4) {
9131
+ sendGreetingMessage(6);
9132
+ }
9133
+ }
9134
+ }).catch(function(err) {
9135
+ console.log(err);
9136
+ });
9137
+ return [
9138
+ 2
9139
+ ];
9050
9140
  }
9051
- }
9052
- }).catch(function(err) {
9053
- console.log(err);
9141
+ });
9054
9142
  });
9055
- };
9143
+ return function sendGreetingMessage(type) {
9144
+ return _ref.apply(this, arguments);
9145
+ };
9146
+ }();
9056
9147
  //消息发送给老师type == 1,召唤老师时发送,type == 2,在老师聊天窗口聊天
9057
9148
  var sendToTeacher = function() {
9058
9149
  var _ref = _async_to_generator(function(type) {
@@ -9432,7 +9523,7 @@ var CustomerService = function(props) {
9432
9523
  roomId: roomId,
9433
9524
  sender: "AI",
9434
9525
  recevier: mid,
9435
- message: "正在输入...",
9526
+ message: "正在思考...",
9436
9527
  id: "123456",
9437
9528
  createdAt: getDataTime(-1),
9438
9529
  extraInfo: null
@@ -9446,7 +9537,7 @@ var CustomerService = function(props) {
9446
9537
  roomId: roomId,
9447
9538
  sender: "AI",
9448
9539
  recevier: mid,
9449
- message: "正在输入...",
9540
+ message: "正在思考...",
9450
9541
  id: "123456",
9451
9542
  createdAt: getDataTime(-1),
9452
9543
  extraInfo: null
@@ -9459,6 +9550,7 @@ var CustomerService = function(props) {
9459
9550
  //先请求问题列表
9460
9551
  videoPageQuestiionsList(3);
9461
9552
  }
9553
+ var hasYamlStarted = false;
9462
9554
  //使用fetchEventSource接收数据
9463
9555
  fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
9464
9556
  method: "POST",
@@ -9566,7 +9658,12 @@ var CustomerService = function(props) {
9566
9658
  //识别的内容
9567
9659
  // console.log("eventSource msg: ", event.data);
9568
9660
  var msg = JSON.parse(event.data);
9569
- if (msg.message) ;
9661
+ if (msg.message) {
9662
+ if (!hasYamlStarted && msg.message && /```\s*yaml/.test(content)) {
9663
+ hasYamlStarted = true;
9664
+ }
9665
+ msg.message = msg.message.replace(/<thinking>/g, '<div class="think-block">').replace(/<\/thinking>/g, "</div>\n");
9666
+ }
9570
9667
  finishedRef.current = false;
9571
9668
  setFinished(false);
9572
9669
  msgStreamingCountRef.current = msgStreamingCountRef.current + 1;
@@ -9583,6 +9680,20 @@ var CustomerService = function(props) {
9583
9680
  videoPageQuestiionsList(2);
9584
9681
  }
9585
9682
  testLabQuestion(JSON.parse(data).message, content, "");
9683
+ if (shouqiTimer.current) {
9684
+ clearTimeout(shouqiTimer.current);
9685
+ }
9686
+ shouqiTimer.current = setTimeout(function() {
9687
+ if ($(".think-block").last().css("display") === "block") {
9688
+ clearTimeout(shouqiTimer.current);
9689
+ $(".think-block").last().parent().find(".think-block").css({
9690
+ display: "none"
9691
+ });
9692
+ $(".think-block").last().parent().parent().find("i").css({
9693
+ transform: "rotate(180deg)"
9694
+ });
9695
+ }
9696
+ }, 1000);
9586
9697
  }
9587
9698
  },
9588
9699
  onclose: function() {
@@ -9602,7 +9713,8 @@ var CustomerService = function(props) {
9602
9713
  // console.log(aiSendQuestions().abort(),'slkdsdsdsd')
9603
9714
  if (pageNumHistory > 1) return;
9604
9715
  var obj = msg;
9605
- var id = msg.messageId;
9716
+ var tempId = "ai thought process";
9717
+ var id = tempId; // 原:let id = msg.messageId; 备注:解决思考过程返回的messageId和下边回复的内容值不同问题,新:改成临时固定相同id,finished完成时替换为实际返回的messageId值
9606
9718
  setHistoryMessageList(function(prevHistoryMessageList) {
9607
9719
  var list1 = prevHistoryMessageList;
9608
9720
  //删除临时数据
@@ -9669,6 +9781,17 @@ var CustomerService = function(props) {
9669
9781
  console.log("isPosition", isPosition.current);
9670
9782
  scrollToBottom();
9671
9783
  if (msg.finished) {
9784
+ setHistoryMessageList(function(prevHistoryMessageList) {
9785
+ return prevHistoryMessageList.map(function(item) {
9786
+ if (item.id === tempId) {
9787
+ return _object_spread_props(_object_spread({}, item), {
9788
+ id: msg.messageId
9789
+ });
9790
+ } else {
9791
+ return item;
9792
+ }
9793
+ });
9794
+ });
9672
9795
  console.log("返回完成", msg, msgStreamingCountRef.current);
9673
9796
  //发送结束
9674
9797
  finishedRef.current = true;
@@ -9776,6 +9899,12 @@ var CustomerService = function(props) {
9776
9899
  // getHistoryMessage(page-1,5,'1',dataList);
9777
9900
  // return;
9778
9901
  // }
9902
+ dataList = dataList.map(function(ele, index) {
9903
+ if (ele.message.includes("<thinking>") && !ele.message.includes("</thinking>")) {
9904
+ ele.message = ele.message + "</thinking>";
9905
+ }
9906
+ return ele;
9907
+ });
9779
9908
  setPageCount(Math.ceil(total / maxPageSize));
9780
9909
  setFirstItemIndex(total - maxPageSize * (page - 1));
9781
9910
  var newHistoryMessageList = [];
@@ -10555,6 +10684,12 @@ var CustomerService = function(props) {
10555
10684
  var message = item.message;
10556
10685
  var li;
10557
10686
  // 是否需要显示日期
10687
+ // 判断是否第一项:
10688
+ // 如果是第一项显示日期+时间;
10689
+ //
10690
+ // 如果不是第一项:
10691
+ // 先判断是否跨天;如果跨天:就显示日期+时间;
10692
+ // 如果不跨天:判断是否超过10分钟,超过10分钟判断是否是当天,如果当天显示时间,不是当天就显示日期+时间;没超过10分钟不显示
10558
10693
  var itemIndex = historyMessageList.findIndex(function(ite) {
10559
10694
  return ite.id === item.id;
10560
10695
  });
@@ -10566,16 +10701,30 @@ var CustomerService = function(props) {
10566
10701
  } else {
10567
10702
  //非第一项 与上一项进行对比
10568
10703
  var beforeTime = historyMessageList[itemIndex - 1].createdAt;
10569
- //判断与上一条数据 是否跨天
10570
10704
  var beforeTimeObj = parseDate(beforeTime);
10705
+ // 上一条的日期
10571
10706
  var beforeTimeStr = "".concat(beforeTimeObj.year, "-").concat(beforeTimeObj.month, "-").concat(beforeTimeObj.day);
10707
+ // 当前这条的日期
10572
10708
  var curTimeStr = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day);
10709
+ var now = new Date();
10710
+ // 当天的日期
10711
+ var nowTimeStr = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, "0"), "-").concat(String(now.getDate()).padStart(2, "0"));
10712
+ //判断与上一条数据 是否跨天
10573
10713
  if (beforeTimeStr !== curTimeStr) {
10714
+ // 跨天
10715
+ // 显示日期+时间
10574
10716
  time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
10575
10717
  } else {
10576
10718
  //没有跨天 判断是否相隔超过10分钟
10577
10719
  if (new Date(item.createdAt).valueOf() - new Date(beforeTime).valueOf() > 10 * 60 * 1000) {
10578
- time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
10720
+ //判断是否当天
10721
+ if (curTimeStr === nowTimeStr) {
10722
+ // 当天,显示时间
10723
+ time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
10724
+ } else {
10725
+ // 非当天,显示日期+时间
10726
+ time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
10727
+ }
10579
10728
  }
10580
10729
  }
10581
10730
  }
@@ -10588,6 +10737,9 @@ var CustomerService = function(props) {
10588
10737
  message = removeMermaidBlockComments(message);
10589
10738
  }
10590
10739
  message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
10740
+ message = message.replace(/<thinking>([\s\S]*?)<\/thinking>/g, '<div class="think-block">$1</div>\n');
10741
+ message = message.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "");
10742
+ message = message.replace(/```\s*yaml[\s\S]*/, "");
10591
10743
  if (lastId == item.id && keyWordProblem != "") {
10592
10744
  //点击历史记录时,找到关键字,防止关键字和标签名重复
10593
10745
  // let key_sign = 'sign_'+new Date().getTime();+'sign';
@@ -10636,6 +10788,8 @@ var CustomerService = function(props) {
10636
10788
  /*#__PURE__*/ jsx("i", {
10637
10789
  className: "yinyong_quote1",
10638
10790
  onClick: function() {
10791
+ // 问题的引用
10792
+ item.message = replaceThinkAndYaml(item.message);
10639
10793
  setCitationContent({
10640
10794
  content: item.message,
10641
10795
  id: item.id,
@@ -10686,17 +10840,23 @@ var CustomerService = function(props) {
10686
10840
  },
10687
10841
  className: styles.content_child
10688
10842
  }),
10689
- !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
10843
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo).find(function(x) {
10844
+ return x.key == "imageUrl";
10845
+ }) && /*#__PURE__*/ jsxs("p", {
10690
10846
  className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
10691
10847
  children: [
10692
10848
  /*#__PURE__*/ jsx("img", {
10693
- src: JSON.parse(item.extraInfo)[0].value
10849
+ src: JSON.parse(item.extraInfo).find(function(x) {
10850
+ return x.key == "imageUrl";
10851
+ }).value
10694
10852
  }),
10695
10853
  /*#__PURE__*/ jsx("div", {
10696
10854
  className: styles.mask_zoom,
10697
10855
  children: /*#__PURE__*/ jsx(ZoomInOutlined, {
10698
10856
  onClick: function() {
10699
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
10857
+ setViewBase64(JSON.parse(item.extraInfo).find(function(x) {
10858
+ return x.key == "imageUrl";
10859
+ }).value);
10700
10860
  setVisible(true);
10701
10861
  }
10702
10862
  })
@@ -10711,14 +10871,14 @@ var CustomerService = function(props) {
10711
10871
  item.quotedMessage && /*#__PURE__*/ jsxs("div", {
10712
10872
  className: styles.citation_content,
10713
10873
  children: [
10714
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10874
+ getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10715
10875
  overlayClassName: styles.popover_main_content,
10716
- title: item.quotedMessage,
10876
+ title: replaceThinkAndYaml(item.quotedMessage),
10717
10877
  placement: "leftTop",
10718
10878
  children: /*#__PURE__*/ jsxs("p", {
10719
10879
  className: styles.text_exceed,
10720
10880
  children: [
10721
- item.quotedMessage,
10881
+ replaceThinkAndYaml(item.quotedMessage),
10722
10882
  /*#__PURE__*/ jsx(RightOutlined, {})
10723
10883
  ]
10724
10884
  })
@@ -10774,11 +10934,7 @@ var CustomerService = function(props) {
10774
10934
  // console.log(chatWindow,'chatWindowchatWindow')
10775
10935
  //是否在智能客服窗口
10776
10936
  isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
10777
- var header = 2; //代表是ai头像
10778
- if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
10779
- //使用AI头像
10780
- header = 1;
10781
- }
10937
+ if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") ;
10782
10938
  li = /*#__PURE__*/ jsxs(Fragment, {
10783
10939
  children: [
10784
10940
  dataTime ? /*#__PURE__*/ jsx("li", {
@@ -10794,7 +10950,10 @@ var CustomerService = function(props) {
10794
10950
  style: {
10795
10951
  marginRight: "12px"
10796
10952
  },
10797
- children: isAiChatWindow ? item.extraInfo == null || header == 1 ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
10953
+ children: isAiChatWindow ? // item.extraInfo == null || header == 1
10954
+ userData.modules.some(function(item) {
10955
+ return item.short == "AIservice";
10956
+ }) ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
10798
10957
  src: knowledge_icon
10799
10958
  }) : /*#__PURE__*/ jsx("img", {
10800
10959
  src: headImg
@@ -10873,6 +11032,35 @@ var CustomerService = function(props) {
10873
11032
  /*#__PURE__*/ jsxs("div", {
10874
11033
  className: styles.content,
10875
11034
  children: [
11035
+ !exactRegex.test(message) ? null : /*#__PURE__*/ jsxs("div", {
11036
+ id: "click_" + i,
11037
+ onClick: function() {
11038
+ if ($("#click_".concat(i, " + p .think-block")).css("display") === "inline-block" || $("#click_".concat(i, " + p .think-block")).css("display") === "block") {
11039
+ $("#click_".concat(i, " + p .think-block")).css({
11040
+ display: "none"
11041
+ });
11042
+ $("#click_".concat(i, " i")).css({
11043
+ transform: "rotate(180deg)"
11044
+ });
11045
+ } else {
11046
+ $("#click_".concat(i, " + p .think-block")).css({
11047
+ display: "block"
11048
+ });
11049
+ $("#click_".concat(i, " i")).css({
11050
+ transform: "rotate(0deg)"
11051
+ });
11052
+ }
11053
+ },
11054
+ className: styles.content_put,
11055
+ children: [
11056
+ /*#__PURE__*/ jsx("span", {
11057
+ children: "思考过程"
11058
+ }),
11059
+ /*#__PURE__*/ jsx("i", {
11060
+ className: "iconfont iconfangxiang-xiaxiao"
11061
+ })
11062
+ ]
11063
+ }),
10876
11064
  item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ jsx("p", {
10877
11065
  dangerouslySetInnerHTML: {
10878
11066
  __html: message
@@ -10900,17 +11088,23 @@ var CustomerService = function(props) {
10900
11088
  })
10901
11089
  ]
10902
11090
  }),
10903
- !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
11091
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo).find(function(x) {
11092
+ return x.key == "imageUrl";
11093
+ }) && /*#__PURE__*/ jsxs("p", {
10904
11094
  className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
10905
11095
  children: [
10906
11096
  /*#__PURE__*/ jsx("img", {
10907
- src: JSON.parse(item.extraInfo)[0].value
11097
+ src: JSON.parse(item.extraInfo).find(function(x) {
11098
+ return x.key == "imageUrl";
11099
+ }).value
10908
11100
  }),
10909
11101
  /*#__PURE__*/ jsx("div", {
10910
11102
  className: styles.mask_zoom,
10911
11103
  children: /*#__PURE__*/ jsx(ZoomInOutlined, {
10912
11104
  onClick: function() {
10913
- setViewBase64(JSON.parse(item.extraInfo)[0].value);
11105
+ setViewBase64(JSON.parse(item.extraInfo).find(function(x) {
11106
+ return x.key == "imageUrl";
11107
+ }).value);
10914
11108
  setVisible(true);
10915
11109
  }
10916
11110
  })
@@ -10951,14 +11145,14 @@ var CustomerService = function(props) {
10951
11145
  item.quotedMessage && /*#__PURE__*/ jsxs("div", {
10952
11146
  className: styles.citation_content,
10953
11147
  children: [
10954
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
11148
+ getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10955
11149
  overlayClassName: styles.popover_main_content,
10956
- title: item.quotedMessage,
11150
+ title: replaceThinkAndYaml(item.quotedMessage),
10957
11151
  placement: "rightTop",
10958
11152
  children: /*#__PURE__*/ jsxs("p", {
10959
11153
  className: styles.text_exceed,
10960
11154
  children: [
10961
- item.quotedMessage,
11155
+ replaceThinkAndYaml(item.quotedMessage),
10962
11156
  /*#__PURE__*/ jsx(RightOutlined, {})
10963
11157
  ]
10964
11158
  })
@@ -11186,6 +11380,8 @@ var CustomerService = function(props) {
11186
11380
  /*#__PURE__*/ jsx("i", {
11187
11381
  className: "yinyong_quote1",
11188
11382
  onClick: function() {
11383
+ // 答案的引用
11384
+ item.message = replaceThinkAndYaml(item.message);
11189
11385
  setCitationContent({
11190
11386
  content: item.message,
11191
11387
  imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
@@ -11392,6 +11588,7 @@ var CustomerService = function(props) {
11392
11588
  /*#__PURE__*/ jsx("i", {
11393
11589
  className: "yinyong_quote1",
11394
11590
  onClick: function() {
11591
+ item.message = replaceThinkAndYaml(item.message);
11395
11592
  setCitationContent({
11396
11593
  content: item.message,
11397
11594
  imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
@@ -11537,44 +11734,50 @@ var CustomerService = function(props) {
11537
11734
  };
11538
11735
  //发送截图信息
11539
11736
  var sendScreenshotData = function(message) {
11540
- if (contactsList.length > 0 && contactsList[0].roomId == roomId) {
11541
- setKeyWord("");
11542
- setCitationContent({});
11543
- setBottomRecommendationQuestions([]);
11544
- setHistoryMessageList(function(historyMessageList) {
11545
- var newHistoryMessageList = historyMessageList.concat({
11546
- id: "p" + new Date().getTime(),
11737
+ if (userData.modules.some(function(item) {
11738
+ return item.short == "AIservice";
11739
+ })) {
11740
+ if (contactsList.length > 0 && contactsList[0].roomId == roomId) {
11741
+ setKeyWord("");
11742
+ setCitationContent({});
11743
+ setBottomRecommendationQuestions([]);
11744
+ setHistoryMessageList(function(historyMessageList) {
11745
+ var newHistoryMessageList = historyMessageList.concat({
11746
+ id: "p" + new Date().getTime(),
11747
+ roomId: roomId,
11748
+ sender: mid,
11749
+ recevier: "AI",
11750
+ message: message,
11751
+ createdAt: getDataTime(-1),
11752
+ extraInfo: JSON.stringify([
11753
+ {
11754
+ key: "imageUrl",
11755
+ value: screenshotBese64
11756
+ }
11757
+ ])
11758
+ });
11759
+ return newHistoryMessageList;
11760
+ });
11761
+ //ai窗口
11762
+ aiSendQuestions(3, {
11763
+ //相关数据
11547
11764
  roomId: roomId,
11548
- sender: mid,
11549
- recevier: "AI",
11550
11765
  message: message,
11551
- createdAt: getDataTime(-1),
11552
- extraInfo: JSON.stringify([
11553
- {
11554
- key: "imageUrl",
11555
- value: screenshotBese64
11556
- }
11557
- ])
11558
- });
11559
- return newHistoryMessageList;
11560
- });
11561
- //ai窗口
11562
- aiSendQuestions(3, {
11563
- //相关数据
11564
- roomId: roomId,
11565
- message: message,
11566
- image: screenshotBese64,
11567
- quotedMessage: citationContent.content || "",
11568
- regenerate: citationContent.content != "" ? false : true,
11569
- generateUpvoteOrDownvoteMessage: false
11570
- }, 1);
11571
- setScreenshotBese64("");
11766
+ image: screenshotBese64,
11767
+ quotedMessage: citationContent.content || "",
11768
+ regenerate: citationContent.content != "" ? false : true,
11769
+ generateUpvoteOrDownvoteMessage: false
11770
+ }, 1);
11771
+ setScreenshotBese64("");
11772
+ } else {
11773
+ //老师窗口
11774
+ sendToTeacher(3, message);
11775
+ }
11776
+ scrollToBottom();
11777
+ resettingBottomHei();
11572
11778
  } else {
11573
- //老师窗口
11574
- sendToTeacher(3, message);
11779
+ sendGreetingMessage(4, message);
11575
11780
  }
11576
- scrollToBottom();
11577
- resettingBottomHei();
11578
11781
  };
11579
11782
  //渲染底部按钮
11580
11783
  var renderBottomAnt = function() {
@@ -15221,8 +15424,17 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
15221
15424
  } else {
15222
15425
  // 没有跨天 判断是否相隔超过10分钟
15223
15426
  if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
15224
- // 超过10分钟 显示 时分
15225
- time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
15427
+ // 超过10分钟 显示
15428
+ var now = new Date();
15429
+ // 当天的日期
15430
+ var nowTimeStr = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, "0"), "-").concat(String(now.getDate()).padStart(2, "0"));
15431
+ if (nowTimeStr === "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day)) {
15432
+ // 是当天 显示 时分
15433
+ time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
15434
+ } else {
15435
+ // 不是当天 显示 年月日 时分
15436
+ time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
15437
+ }
15226
15438
  }
15227
15439
  }
15228
15440
  }
@@ -16087,7 +16299,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
16087
16299
  apiRef.contentApi.addMsg({
16088
16300
  id: msgId,
16089
16301
  createTime: createTime,
16090
- content: "正在输入...",
16302
+ content: "正在思考...",
16091
16303
  location: "left",
16092
16304
  reference: recordObj.reference || null,
16093
16305
  source: null,
@@ -16097,7 +16309,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
16097
16309
  apiRef.contentApi.addMsg({
16098
16310
  id: msgId,
16099
16311
  createTime: createTime,
16100
- content: "正在输入...",
16312
+ content: "正在思考...",
16101
16313
  location: "left",
16102
16314
  reference: null,
16103
16315
  source: null,