bhd-components 0.6.4 → 0.6.6
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.
- package/README.md +1 -1
- package/dist/{9674e68c.esm.es5.development.js → 869a16fb.esm.es5.development.js} +1402 -1140
- package/dist/{a57a24b2.esm.es5.production.js → c220442c.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.css +888 -753
- package/dist/index.esm.es5.development.js +786 -686
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/bhdSelect/index.d.ts +3 -0
- package/es2017/bhdSelect/index.js +30 -14
- package/es2017/bhdSelect/index.module.less +4 -5
- package/es2017/customerService/contactsList.d.ts +1 -1
- package/es2017/customerService/contactsList.js +11 -145
- package/es2017/customerService/function.js +1 -1
- package/es2017/customerService/historyFun.js +325 -154
- package/es2017/customerService/index.js +412 -341
- package/es2017/customerService/index.module.less +169 -65
- package/es2017/customerService/index2.module.less +170 -65
- package/es2017/icons/components/custom-expand.d.ts +4 -0
- package/es2017/icons/components/custom-expand.js +22 -0
- package/es2017/icons/components/index.d.ts +1 -0
- package/es2017/icons/components/index.js +1 -0
- package/esm/bhdSelect/index.d.ts +3 -0
- package/esm/bhdSelect/index.js +30 -14
- package/esm/bhdSelect/index.module.less +4 -5
- package/esm/customerService/contactsList.d.ts +1 -1
- package/esm/customerService/contactsList.js +11 -158
- package/esm/customerService/function.js +1 -1
- package/esm/customerService/historyFun.js +329 -167
- package/esm/customerService/index.js +397 -348
- package/esm/customerService/index.module.less +169 -65
- package/esm/customerService/index2.module.less +170 -65
- package/esm/icons/components/custom-expand.d.ts +4 -0
- package/esm/icons/components/custom-expand.js +24 -0
- package/esm/icons/components/index.d.ts +1 -0
- package/esm/icons/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, y as Remarkable, D as Drawer, H as HighlightJS } from './
|
|
2
|
-
export { A as Affix, B as Alert, F as Anchor, aA as App, G as AutoComplete, J as Avatar, N as BackTop, O as Badge, Q as Breadcrumb, U as Button, V as Calendar, W as Card, X as Carousel, Y as Cascader, Z as Checkbox, $ as Col, a0 as Collapse, a1 as DatePicker, a2 as Descriptions, a3 as Divider, D as Drawer, a4 as Dropdown, a5 as Empty, K as FloatButton, a6 as Form, a7 as Grid, a8 as Image, v as Input, a9 as InputNumber, aa as Layout, ab as List, ac as Mentions, ad as Menu, M as Modal, af as Popconfirm, ag as Popover, ah as Progress, aH as QRCode, ai as Radio, aj as Rate, ak as Result, al as Row, am as Segmented, g as Select, an as Skeleton, ao as Slider, ap as Space, aq as Spin, ar as Statistic, as as Steps, at as Switch, au as Tabs, av as Tag, ax as TimePicker, ay as Timeline, T as Tooltip, az as Tour, aB as Transfer, aC as Tree, aD as TreeSelect, aE as Typography, aF as Upload, aG as Watermark, aJ as en_US, ae as notification, aw as theme, aI as version, z as zh_CN } from './
|
|
1
|
+
import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, y as Remarkable, D as Drawer, H as HighlightJS } from './869a16fb.esm.es5.development.js';
|
|
2
|
+
export { A as Affix, B as Alert, F as Anchor, aA as App, G as AutoComplete, J as Avatar, N as BackTop, O as Badge, Q as Breadcrumb, U as Button, V as Calendar, W as Card, X as Carousel, Y as Cascader, Z as Checkbox, $ as Col, a0 as Collapse, a1 as DatePicker, a2 as Descriptions, a3 as Divider, D as Drawer, a4 as Dropdown, a5 as Empty, K as FloatButton, a6 as Form, a7 as Grid, a8 as Image, v as Input, a9 as InputNumber, aa as Layout, ab as List, ac as Mentions, ad as Menu, M as Modal, af as Popconfirm, ag as Popover, ah as Progress, aH as QRCode, ai as Radio, aj as Rate, ak as Result, al as Row, am as Segmented, g as Select, an as Skeleton, ao as Slider, ap as Space, aq as Spin, ar as Statistic, as as Steps, at as Switch, au as Tabs, av as Tag, ax as TimePicker, ay as Timeline, T as Tooltip, az as Tour, aB as Transfer, aC as Tree, aD as TreeSelect, aE as Typography, aF as Upload, aG as Watermark, aJ as en_US, ae as notification, aw as theme, aI as version, z as zh_CN } from './869a16fb.esm.es5.development.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
5
5
|
import { Fragment } from 'react/jsx-runtime';
|
|
@@ -865,6 +865,26 @@ var CustomAiIcon = function(props) {
|
|
|
865
865
|
};
|
|
866
866
|
var CustomAiIcon$1 = CustomAiIcon;
|
|
867
867
|
|
|
868
|
+
var CustomExpandSvg = function() {
|
|
869
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
870
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
871
|
+
width: "1em",
|
|
872
|
+
height: "1em",
|
|
873
|
+
viewBox: "0 0 24 25",
|
|
874
|
+
"shape-rendering": "geometricPrecision",
|
|
875
|
+
fill: "currentColor",
|
|
876
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
877
|
+
d: "M8.36358 5.86364C8.01211 6.21511 8.01211 6.78496 8.36358 7.13643L13.7272 12.5L8.36358 17.8636C8.01211 18.2151 8.01211 18.785 8.36358 19.1364C8.71505 19.4879 9.2849 19.4879 9.63637 19.1364L15.6364 13.1364C15.9878 12.785 15.9878 12.2151 15.6364 11.8636L9.63637 5.86364C9.2849 5.51217 8.71505 5.51217 8.36358 5.86364Z"
|
|
878
|
+
})
|
|
879
|
+
});
|
|
880
|
+
};
|
|
881
|
+
var CustomExpand = function(props) {
|
|
882
|
+
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
883
|
+
component: CustomExpandSvg
|
|
884
|
+
}));
|
|
885
|
+
};
|
|
886
|
+
var CustomExpand$1 = CustomExpand;
|
|
887
|
+
|
|
868
888
|
var BhdMessage = _object_spread_props(_object_spread({}, message), {
|
|
869
889
|
customSuccess: function(config) {
|
|
870
890
|
var className = modules_63b47c51$8.customSuccess;
|
|
@@ -1789,7 +1809,7 @@ var AppViewImage = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
1789
1809
|
});
|
|
1790
1810
|
var AppViewImage$1 = AppViewImage;
|
|
1791
1811
|
|
|
1792
|
-
var modules_63b47c51$2 = {"BhdSelect":"
|
|
1812
|
+
var modules_63b47c51$2 = {"BhdSelect":"index_module_BhdSelect__0982ff78","bhdSelect_option":"index_module_bhdSelect_option__0982ff78","bhdSelectDrop":"index_module_bhdSelectDrop__0982ff78","selectTitle":"index_module_selectTitle__0982ff78","bhdSelectSearch":"index_module_bhdSelectSearch__0982ff78","search":"index_module_search__0982ff78"};
|
|
1793
1813
|
|
|
1794
1814
|
var Search = Input.Search;
|
|
1795
1815
|
var RenderDrop = function(param) {
|
|
@@ -1812,7 +1832,7 @@ var BhdSelect = function(props) {
|
|
|
1812
1832
|
var _useState1 = _sliced_to_array(useState(0), 2), optionHei = _useState1[0], setOptionHei = _useState1[1]; //option的宽度
|
|
1813
1833
|
var _useState2 = _sliced_to_array(useState(""), 2), filterValue = _useState2[0], setFilterValue = _useState2[1]; //下拉搜索的内容
|
|
1814
1834
|
var _useState3 = _sliced_to_array(useState([]), 2), filterChildren = _useState3[0], setfilterChildren = _useState3[1];
|
|
1815
|
-
|
|
1835
|
+
var _useState4 = _sliced_to_array(useState(0), 2), selectWidth = _useState4[0], setSelectWidth = _useState4[1]; //下拉框的宽度
|
|
1816
1836
|
var renderSuffixIcon = function() {
|
|
1817
1837
|
switch(arrowType){
|
|
1818
1838
|
case "table":
|
|
@@ -1978,11 +1998,9 @@ var BhdSelect = function(props) {
|
|
|
1978
1998
|
};
|
|
1979
1999
|
useEffect(function() {
|
|
1980
2000
|
// console.log(34343434,props);
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
// // console.log(bhdSelectRef.current.getBoundingClientRect(),555555555);
|
|
1985
|
-
// }
|
|
2001
|
+
if (props.popupMatchSelectWidth) {
|
|
2002
|
+
setSelectWidth(props.popupMatchSelectWidth);
|
|
2003
|
+
}
|
|
1986
2004
|
filterOption();
|
|
1987
2005
|
window.addEventListener("resize", initHeight);
|
|
1988
2006
|
return function() {
|
|
@@ -1998,7 +2016,11 @@ var BhdSelect = function(props) {
|
|
|
1998
2016
|
var config = _object_spread_props(_object_spread({}, props), {
|
|
1999
2017
|
listHeight: optionHei,
|
|
2000
2018
|
popupClassName: "".concat(modules_63b47c51$2.bhdSelect_option, " ").concat(popupClassName || "", " "),
|
|
2001
|
-
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon()
|
|
2019
|
+
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon(),
|
|
2020
|
+
popupMatchSelectWidth: selectWidth,
|
|
2021
|
+
dropdownStyle: _object_spread_props(_object_spread({}, props.dropdownStyle), {
|
|
2022
|
+
width: selectWidth
|
|
2023
|
+
})
|
|
2002
2024
|
});
|
|
2003
2025
|
delete config.mask;
|
|
2004
2026
|
delete config.className;
|
|
@@ -2042,13 +2064,25 @@ var BhdSelect = function(props) {
|
|
|
2042
2064
|
}
|
|
2043
2065
|
}
|
|
2044
2066
|
//表格中使用下拉列表,定义下拉列表宽度
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2067
|
+
//表格中使用下拉列表,定义下拉列表宽度
|
|
2068
|
+
if (props.dropdownStyle != undefined && props.dropdownStyle.width != undefined) {
|
|
2069
|
+
setSelectWidth(props.dropdownStyle.width);
|
|
2070
|
+
} else if (useType === "table") {
|
|
2071
|
+
try {
|
|
2072
|
+
var width = bhdSelectRef.current.parentNode.getBoundingClientRect().width + 14;
|
|
2073
|
+
var minWidth = props.popupMatchSelectWidth;
|
|
2074
|
+
//设置了最小宽度
|
|
2075
|
+
if (minWidth != undefined && minWidth >= width) {
|
|
2076
|
+
setSelectWidth(minWidth);
|
|
2077
|
+
} else if (minWidth != undefined && minWidth < width) {
|
|
2078
|
+
setSelectWidth(width);
|
|
2079
|
+
} else if (minWidth == undefined && width < 60) {
|
|
2080
|
+
setSelectWidth(60);
|
|
2081
|
+
} else {
|
|
2082
|
+
setSelectWidth(width);
|
|
2083
|
+
}
|
|
2084
|
+
} catch (error) {}
|
|
2085
|
+
}
|
|
2052
2086
|
props.onMouseEnter && props.onMouseEnter(e);
|
|
2053
2087
|
},
|
|
2054
2088
|
children: filterChildren
|
|
@@ -2298,7 +2332,7 @@ function BhdAppLayout(props) {
|
|
|
2298
2332
|
});
|
|
2299
2333
|
}
|
|
2300
2334
|
|
|
2301
|
-
var modules_63b47c51 = {"service_ChatWindow_Drawer":"
|
|
2335
|
+
var modules_63b47c51 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__9cd6a734","ChatWindow_Modal":"index_module_ChatWindow_Modal__9cd6a734","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__9cd6a734","header_wrap":"index_module_header_wrap__9cd6a734","top":"index_module_top__9cd6a734","user":"index_module_user__9cd6a734","count":"index_module_count__9cd6a734","operate":"index_module_operate__9cd6a734","line":"index_module_line__9cd6a734","header_wrap_newlabo":"index_module_header_wrap_newlabo__9cd6a734","Drawer_main":"index_module_Drawer_main__9cd6a734","loading":"index_module_loading__9cd6a734","message_con":"index_module_message_con__9cd6a734","left":"index_module_left__9cd6a734","head_sculpture":"index_module_head_sculpture__9cd6a734","main_content":"index_module_main_content__9cd6a734","right":"index_module_right__9cd6a734","main":"index_module_main__9cd6a734","main_content_flag":"index_module_main_content_flag__9cd6a734","operate_modal":"index_module_operate_modal__9cd6a734","content":"index_module_content__9cd6a734","content_child":"index_module_content_child__9cd6a734","active":"index_module_active__9cd6a734","ask_question":"index_module_ask_question__9cd6a734","operate_modal_bottom":"index_module_operate_modal_bottom__9cd6a734","stop_generate":"index_module_stop_generate__9cd6a734","icon":"index_module_icon__9cd6a734","find_teacher":"index_module_find_teacher__9cd6a734","stop_findTeacher":"index_module_stop_findTeacher__9cd6a734","association_problem":"index_module_association_problem__9cd6a734","time":"index_module_time__9cd6a734","citation_content":"index_module_citation_content__9cd6a734","text_exceed":"index_module_text_exceed__9cd6a734","popover_content":"index_module_popover_content__9cd6a734","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__9cd6a734","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__9cd6a734","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__9cd6a734","issues_list_teacherList":"index_module_issues_list_teacherList__9cd6a734","item":"index_module_item__9cd6a734","issues_list":"index_module_issues_list__9cd6a734","sign":"index_module_sign__9cd6a734","Drawer_buttom":"index_module_Drawer_buttom__9cd6a734","input_wrap":"index_module_input_wrap__9cd6a734","input":"index_module_input__9cd6a734","no_AI":"index_module_no_AI__9cd6a734","voice":"index_module_voice__9cd6a734","voice_btn":"index_module_voice_btn__9cd6a734","disabled":"index_module_disabled__9cd6a734","content_main":"index_module_content_main__9cd6a734","content_con":"index_module_content_con__9cd6a734","delete_quote":"index_module_delete_quote__9cd6a734","sending":"index_module_sending__9cd6a734","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__9cd6a734","main_list":"index_module_main_list__9cd6a734","chat_content":"index_module_chat_content__9cd6a734","popover_main_content":"index_module_popover_main_content__9cd6a734","popover_main_content_name":"index_module_popover_main_content_name__9cd6a734","teacher_layout":"index_module_teacher_layout__9cd6a734","bottom":"index_module_bottom__9cd6a734","delete":"index_module_delete__9cd6a734","num":"index_module_num__9cd6a734","shrink":"index_module_shrink__9cd6a734","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__9cd6a734","teacher_layout_modal":"index_module_teacher_layout_modal__9cd6a734","ai":"index_module_ai__9cd6a734","user_info":"index_module_user_info__9cd6a734","message":"index_module_message__9cd6a734","con":"index_module_con__9cd6a734","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__9cd6a734","history_list":"index_module_history_list__9cd6a734","search_layout":"index_module_search_layout__9cd6a734","mymove":"index_module_mymove__9cd6a734","title":"index_module_title__9cd6a734","search_top":"index_module_search_top__9cd6a734","list_item":"index_module_list_item__9cd6a734","list_summary":"index_module_list_summary__9cd6a734","head_img":"index_module_head_img__9cd6a734","list_desc":"index_module_list_desc__9cd6a734","name":"index_module_name__9cd6a734","decs":"index_module_decs__9cd6a734","open":"index_module_open__9cd6a734","list_detail":"index_module_list_detail__9cd6a734","list":"index_module_list__9cd6a734","list_more":"index_module_list_more__9cd6a734","no_data":"index_module_no_data__9cd6a734","history_list_broadside":"index_module_history_list_broadside__9cd6a734"};
|
|
2302
2336
|
|
|
2303
2337
|
//消息已读
|
|
2304
2338
|
var readMessage = function(roomId, urllocation, userData, http) {
|
|
@@ -2370,7 +2404,7 @@ var getDataTime = function(time) {
|
|
|
2370
2404
|
var hours = String(now.getHours()).padStart(2, "0");
|
|
2371
2405
|
var minutes = String(now.getMinutes()).padStart(2, "0");
|
|
2372
2406
|
var seconds = String(now.getSeconds()).padStart(2, "0");
|
|
2373
|
-
var currentDateTime = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes
|
|
2407
|
+
var currentDateTime = "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes);
|
|
2374
2408
|
if (type == 1) {
|
|
2375
2409
|
return "".concat(year, "-").concat(month, "-").concat(day);
|
|
2376
2410
|
} else if (type == 2) {
|
|
@@ -2384,96 +2418,66 @@ var getDataTime = function(time) {
|
|
|
2384
2418
|
};
|
|
2385
2419
|
|
|
2386
2420
|
var HistoryFun = function(props) {
|
|
2387
|
-
var type = props.type
|
|
2421
|
+
var type = props.type; props.roomId; var userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, loadSpecifiedData = props.loadSpecifiedData;
|
|
2388
2422
|
var _useState = _sliced_to_array(useState(""), 2), keyWordProblem = _useState[0], setKeyWordProblem = _useState[1]; //搜索内容
|
|
2389
|
-
var _useState1 = _sliced_to_array(useState(
|
|
2390
|
-
var _useState2 = _sliced_to_array(useState(1), 2),
|
|
2391
|
-
var _useState3 = _sliced_to_array(useState(
|
|
2392
|
-
var _useState4 = _sliced_to_array(useState(
|
|
2393
|
-
var _useState5 = _sliced_to_array(useState(
|
|
2423
|
+
var _useState1 = _sliced_to_array(useState(1), 2), showLoadingState = _useState1[0], setShowLoadingState = _useState1[1]; //1,初始状态,2、无数据 ,3、不显示图片
|
|
2424
|
+
var _useState2 = _sliced_to_array(useState(1), 2), pageNum = _useState2[0], setPageNum = _useState2[1];
|
|
2425
|
+
var _useState3 = _sliced_to_array(useState(0), 2), pageCount = _useState3[0], setPageCount = _useState3[1];
|
|
2426
|
+
var _useState4 = _sliced_to_array(useState(10), 2), maxPageSize = _useState4[0]; _useState4[1];
|
|
2427
|
+
var _useState5 = _sliced_to_array(useState([]), 2), totalData = _useState5[0], setTotalData = _useState5[1]; //总数据
|
|
2394
2428
|
var timer = useRef(null); //文本框输入时
|
|
2395
|
-
var objName = useRef([]);
|
|
2396
|
-
// useEffect(() => {
|
|
2397
|
-
// function handleScroll() {
|
|
2398
|
-
// const container = document.getElementById('history_list');
|
|
2399
|
-
// const scrollTop = container.scrollTop;
|
|
2400
|
-
// const clientHeight = container.clientHeight;
|
|
2401
|
-
// const scrollHeight = container.scrollHeight;
|
|
2402
|
-
// // console.log(scrollTop,clientHeight,scrollHeight,'333dfkvmdfv')
|
|
2403
|
-
// // if((clientHeight + scrollTop + 10) >= scrollHeight && pageCount > pageNum && pageCount > 0){
|
|
2404
|
-
// // // console.log(11111111,pageNumHistory)
|
|
2405
|
-
// // let number = pageNum + 1;
|
|
2406
|
-
// // console.log('到底部了22222',number)
|
|
2407
|
-
// // setPageNum((pageNum) => {
|
|
2408
|
-
// // return pageNum + 1;
|
|
2409
|
-
// // });
|
|
2410
|
-
// // getKeyHistoryMessage(keyWordProblem,number);
|
|
2411
|
-
// // }
|
|
2412
|
-
// }
|
|
2413
|
-
// const content = document.getElementById('history_list');
|
|
2414
|
-
// if (content) {
|
|
2415
|
-
// content.addEventListener("scroll", handleScroll);
|
|
2416
|
-
// }
|
|
2417
|
-
// return () => {
|
|
2418
|
-
// const content = document.getElementById('history_list');
|
|
2419
|
-
// if (content) {
|
|
2420
|
-
// content.removeEventListener("scroll", handleScroll);
|
|
2421
|
-
// }
|
|
2422
|
-
// };
|
|
2423
|
-
// }, [keyHistoryMessageList]);
|
|
2424
2429
|
useEffect(function() {
|
|
2425
|
-
|
|
2426
|
-
var
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
name: name
|
|
2430
|
+
function handleScroll() {
|
|
2431
|
+
var container = document.getElementById("history_list");
|
|
2432
|
+
var scrollTop = container.scrollTop;
|
|
2433
|
+
var clientHeight = container.clientHeight;
|
|
2434
|
+
var scrollHeight = container.scrollHeight;
|
|
2435
|
+
// console.log(pageCount, pageNum, "333dfkvmdfv");
|
|
2436
|
+
if (clientHeight + scrollTop + 10 >= scrollHeight && pageCount > pageNum && pageCount > 0) {
|
|
2437
|
+
// console.log("到底部了22222", number);
|
|
2438
|
+
setPageNum(function(page) {
|
|
2439
|
+
return page + 1;
|
|
2436
2440
|
});
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2441
|
+
// console.log(pageNum,444455556666)
|
|
2442
|
+
getList(keyWordProblem, pageNum + 1);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
var content = document.getElementById("history_list");
|
|
2446
|
+
if (content) {
|
|
2447
|
+
content.addEventListener("scroll", handleScroll);
|
|
2448
|
+
}
|
|
2449
|
+
return function() {
|
|
2450
|
+
var content = document.getElementById("history_list");
|
|
2451
|
+
if (content) {
|
|
2452
|
+
content.removeEventListener("scroll", handleScroll);
|
|
2453
|
+
}
|
|
2454
|
+
};
|
|
2440
2455
|
}, [
|
|
2441
|
-
|
|
2456
|
+
pageCount,
|
|
2457
|
+
pageNum
|
|
2442
2458
|
]);
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
var page = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
|
|
2446
|
-
if (roomId == "") return;
|
|
2447
|
-
setLoad(false);
|
|
2448
|
-
setKeyHistoryMessageList([]);
|
|
2449
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
2459
|
+
var getList = function(val, pageNum) {
|
|
2460
|
+
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages-total"), {
|
|
2450
2461
|
params: {
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
maxPageSize: 1000,
|
|
2455
|
-
direction: "desc"
|
|
2456
|
-
},
|
|
2457
|
-
headers: {
|
|
2458
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2459
|
-
return ele.short == "IntelligentCustomerService";
|
|
2460
|
-
}).id,
|
|
2461
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2462
|
+
message: val,
|
|
2463
|
+
page: pageNum,
|
|
2464
|
+
maxPageSize: maxPageSize
|
|
2462
2465
|
}
|
|
2463
2466
|
}).then(function(res) {
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
setPageCount(Math.ceil(total / maxPageSize));
|
|
2467
|
+
console.log(res, 7777779999);
|
|
2468
|
+
var data = res.data;
|
|
2469
|
+
if (data.total > 0) {
|
|
2468
2470
|
setShowLoadingState(3);
|
|
2469
|
-
var
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2471
|
+
var list = data.messageHistories;
|
|
2472
|
+
setPageCount(Math.ceil(data.total / maxPageSize));
|
|
2473
|
+
// setTotalData(totalData.concat(list));
|
|
2474
|
+
setTotalData(function(list1) {
|
|
2475
|
+
var new_list = list1;
|
|
2476
|
+
new_list = new_list.concat(list);
|
|
2477
|
+
return new_list;
|
|
2473
2478
|
});
|
|
2474
|
-
getUserName(
|
|
2479
|
+
getUserName(list);
|
|
2475
2480
|
} else {
|
|
2476
|
-
// setKeyHistoryMessageList([]);
|
|
2477
2481
|
setShowLoadingState(2);
|
|
2478
2482
|
}
|
|
2479
2483
|
}).catch(function(res) {});
|
|
@@ -2485,13 +2489,7 @@ var HistoryFun = function(props) {
|
|
|
2485
2489
|
params: {
|
|
2486
2490
|
roomId: roomId,
|
|
2487
2491
|
page: 1,
|
|
2488
|
-
maxPageSize:
|
|
2489
|
-
},
|
|
2490
|
-
headers: {
|
|
2491
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2492
|
-
return ele.short == "IntelligentCustomerService";
|
|
2493
|
-
}).id,
|
|
2494
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2492
|
+
maxPageSize: 99999999
|
|
2495
2493
|
}
|
|
2496
2494
|
});
|
|
2497
2495
|
};
|
|
@@ -2517,47 +2515,153 @@ var HistoryFun = function(props) {
|
|
|
2517
2515
|
}
|
|
2518
2516
|
});
|
|
2519
2517
|
var pageNumber = findPageNumber(30, Math.ceil(total / 30), number);
|
|
2520
|
-
|
|
2521
|
-
// roomId, pageNumber, id,
|
|
2522
|
-
// "第几页第几页第几页第几页第几页第几页"
|
|
2523
|
-
// );
|
|
2518
|
+
console.log(roomId, pageNumber, id, receiver, "第几页第几页第几页第几页第几页第几页");
|
|
2524
2519
|
loadSpecifiedData(roomId, pageNumber, id, receiver);
|
|
2525
2520
|
onClose();
|
|
2526
2521
|
setKeyWordProblem("");
|
|
2527
|
-
|
|
2522
|
+
setTotalData([]);
|
|
2523
|
+
// setKeyHistoryMessageList([]);
|
|
2528
2524
|
}
|
|
2529
2525
|
});
|
|
2530
2526
|
};
|
|
2531
2527
|
var getUserName = function(dataList) {
|
|
2532
2528
|
try {
|
|
2533
|
-
|
|
2534
|
-
var
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
});
|
|
2540
|
-
filterList = filterList.filter(function(item) {
|
|
2541
|
-
return item.receiver != userData.mid && item.receiver != "AI";
|
|
2529
|
+
var list = dataList;
|
|
2530
|
+
var ids = [];
|
|
2531
|
+
list = list.map(function(item) {
|
|
2532
|
+
if (item.member != "AI") {
|
|
2533
|
+
ids.push(item.member);
|
|
2534
|
+
}
|
|
2542
2535
|
});
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
userName(item.receiver).then(function(res) {
|
|
2536
|
+
if (ids.length > 0) {
|
|
2537
|
+
userName(ids.join(",")).then(function(res) {
|
|
2546
2538
|
if (res.data) {
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2539
|
+
var nameList = res.data;
|
|
2540
|
+
setTotalData(function(list1) {
|
|
2541
|
+
var list = list1;
|
|
2542
|
+
list = list.map(function(item) {
|
|
2543
|
+
var name = nameList.filter(function(v) {
|
|
2544
|
+
return v.uid == item.member;
|
|
2545
|
+
});
|
|
2546
|
+
if (name.length > 0) {
|
|
2547
|
+
return _object_spread({}, item, name[0]);
|
|
2548
|
+
} else {
|
|
2549
|
+
return item;
|
|
2550
|
+
}
|
|
2551
|
+
});
|
|
2552
|
+
return list;
|
|
2550
2553
|
});
|
|
2551
|
-
console.log(objName, "kdfvdfdfvjkdfnv");
|
|
2552
|
-
if (obj.length == filterList.length) {
|
|
2553
|
-
objName.current = obj;
|
|
2554
|
-
setLoad(true);
|
|
2555
|
-
}
|
|
2556
2554
|
}
|
|
2557
2555
|
});
|
|
2558
|
-
}
|
|
2556
|
+
}
|
|
2557
|
+
// let objName: { id: string; name: String; }[] = [];//[{id:'用户id',name:'用户名字‘}]
|
|
2558
|
+
// let obj: any[] = [];
|
|
2559
|
+
// //去重
|
|
2560
|
+
// let res = new Map();
|
|
2561
|
+
// let filterList = dataList.filter(
|
|
2562
|
+
// (a: { receiver: string }) =>
|
|
2563
|
+
// !res.has(a.receiver) && res.set(a.receiver, 1)
|
|
2564
|
+
// );
|
|
2565
|
+
// filterList = filterList.filter(
|
|
2566
|
+
// (item) => item.receiver != userData.mid && item.receiver != "AI"
|
|
2567
|
+
// );
|
|
2568
|
+
// console.log(filterList, "wefwekfjwef");
|
|
2569
|
+
// filterList.map((item)=>{
|
|
2570
|
+
// userName(item.receiver).then((res: { data: { name: String } }) => {
|
|
2571
|
+
// if (res.data) {
|
|
2572
|
+
// obj.push({id:item.receiver,name:res.data.name,});
|
|
2573
|
+
// console.log(objName,'kdfvdfdfvjkdfnv');
|
|
2574
|
+
// if(obj.length == filterList.length){
|
|
2575
|
+
// objName.current = obj;
|
|
2576
|
+
// setLoad(true)
|
|
2577
|
+
// }
|
|
2578
|
+
// }
|
|
2579
|
+
// });
|
|
2580
|
+
// })
|
|
2559
2581
|
} catch (error) {}
|
|
2560
2582
|
};
|
|
2583
|
+
//显示详情
|
|
2584
|
+
var showDetails = function(roomId, show) {
|
|
2585
|
+
//展开
|
|
2586
|
+
if (show === true || show === false) {
|
|
2587
|
+
setTotalData(function(list) {
|
|
2588
|
+
console.log(list, 33333);
|
|
2589
|
+
var new_list = list;
|
|
2590
|
+
new_list = new_list.map(function(item) {
|
|
2591
|
+
if (roomId == item.roomId) {
|
|
2592
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
2593
|
+
show: !show
|
|
2594
|
+
});
|
|
2595
|
+
} else {
|
|
2596
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
2597
|
+
show: item.show == undefined ? undefined : false
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
});
|
|
2601
|
+
return new_list;
|
|
2602
|
+
});
|
|
2603
|
+
} else {
|
|
2604
|
+
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
2605
|
+
params: {
|
|
2606
|
+
roomId: roomId,
|
|
2607
|
+
message: keyWordProblem,
|
|
2608
|
+
page: 1,
|
|
2609
|
+
maxPageSize: 20,
|
|
2610
|
+
direction: "desc"
|
|
2611
|
+
}
|
|
2612
|
+
}).then(function(res) {
|
|
2613
|
+
if (res.data.messages.length > 0) {
|
|
2614
|
+
setTotalData(function(list) {
|
|
2615
|
+
var new_list = list;
|
|
2616
|
+
new_list = new_list.map(function(item) {
|
|
2617
|
+
if (item.roomId == roomId) {
|
|
2618
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
2619
|
+
detailsList: res.data.messages,
|
|
2620
|
+
pageCount: Math.ceil(res.data.total / 20),
|
|
2621
|
+
show: true,
|
|
2622
|
+
pageNum: 1
|
|
2623
|
+
});
|
|
2624
|
+
} else {
|
|
2625
|
+
return item;
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
return new_list;
|
|
2629
|
+
});
|
|
2630
|
+
}
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
//加载更多
|
|
2635
|
+
var loadMore = function(pageNum, roomId) {
|
|
2636
|
+
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
2637
|
+
params: {
|
|
2638
|
+
roomId: roomId,
|
|
2639
|
+
message: keyWordProblem,
|
|
2640
|
+
page: pageNum,
|
|
2641
|
+
maxPageSize: 20,
|
|
2642
|
+
direction: "desc"
|
|
2643
|
+
}
|
|
2644
|
+
}).then(function(res) {
|
|
2645
|
+
if (res.data.messages.length > 0) {
|
|
2646
|
+
setTotalData(function(list) {
|
|
2647
|
+
var new_list = list;
|
|
2648
|
+
new_list = new_list.map(function(item) {
|
|
2649
|
+
if (item.roomId == roomId) {
|
|
2650
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
2651
|
+
detailsList: item.detailsList.concat(res.data.messages),
|
|
2652
|
+
pageCount: Math.ceil(res.data.total / 20),
|
|
2653
|
+
show: true,
|
|
2654
|
+
pageNum: pageNum
|
|
2655
|
+
});
|
|
2656
|
+
} else {
|
|
2657
|
+
return item;
|
|
2658
|
+
}
|
|
2659
|
+
});
|
|
2660
|
+
return new_list;
|
|
2661
|
+
});
|
|
2662
|
+
}
|
|
2663
|
+
});
|
|
2664
|
+
};
|
|
2561
2665
|
var userName = function(uid) {
|
|
2562
2666
|
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
2563
2667
|
params: {
|
|
@@ -2565,7 +2669,7 @@ var HistoryFun = function(props) {
|
|
|
2565
2669
|
},
|
|
2566
2670
|
headers: {
|
|
2567
2671
|
"x-module-id": userData.modules.find(function(ele) {
|
|
2568
|
-
return ele.short == "
|
|
2672
|
+
return ele.short == "IntelligentCustomerService";
|
|
2569
2673
|
}).id,
|
|
2570
2674
|
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2571
2675
|
}
|
|
@@ -2603,11 +2707,11 @@ var HistoryFun = function(props) {
|
|
|
2603
2707
|
clearTimeout(timer.current);
|
|
2604
2708
|
timer.current = setTimeout(function() {
|
|
2605
2709
|
if (val != "") {
|
|
2606
|
-
|
|
2710
|
+
setTotalData([]);
|
|
2711
|
+
getList(val, 1);
|
|
2607
2712
|
} else {
|
|
2608
2713
|
setShowLoadingState(1);
|
|
2609
|
-
|
|
2610
|
-
setLoad(false);
|
|
2714
|
+
setTotalData([]);
|
|
2611
2715
|
}
|
|
2612
2716
|
}, 1000);
|
|
2613
2717
|
}
|
|
@@ -2617,8 +2721,7 @@ var HistoryFun = function(props) {
|
|
|
2617
2721
|
onClick: function() {
|
|
2618
2722
|
setShowLoadingState(1);
|
|
2619
2723
|
setKeyWordProblem("");
|
|
2620
|
-
|
|
2621
|
-
setLoad(false);
|
|
2724
|
+
setTotalData([]);
|
|
2622
2725
|
},
|
|
2623
2726
|
children: /*#__PURE__*/ jsx(CustomClose$1, {})
|
|
2624
2727
|
})
|
|
@@ -2650,56 +2753,149 @@ var HistoryFun = function(props) {
|
|
|
2650
2753
|
})
|
|
2651
2754
|
]
|
|
2652
2755
|
}),
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2756
|
+
/*#__PURE__*/ jsx("div", {
|
|
2757
|
+
className: modules_63b47c51.list_item,
|
|
2758
|
+
children: totalData.map(function(item) {
|
|
2759
|
+
var span = "";
|
|
2760
|
+
var time = "";
|
|
2761
|
+
if (item.count == 1) {
|
|
2762
|
+
// span = item.message.replaceAll(keyWordProblem, () => {
|
|
2763
|
+
// return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
2764
|
+
// });
|
|
2765
|
+
span = item.message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
|
|
2766
|
+
// console.log(i,'skdcnsdjk')
|
|
2767
|
+
return "<span class=".concat(modules_63b47c51.sign, ">").concat(i, "</span>");
|
|
2768
|
+
});
|
|
2769
|
+
var currentTime = getDataTime(-1, 1); //当前时间
|
|
2770
|
+
var createdAt = getDataTime(item.createdAt, 1);
|
|
2771
|
+
if (currentTime == createdAt) {
|
|
2772
|
+
time = getDataTime(item.createdAt, 2);
|
|
2773
|
+
} else {
|
|
2774
|
+
time = getDataTime(item.createdAt);
|
|
2775
|
+
}
|
|
2664
2776
|
}
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2777
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
2778
|
+
children: [
|
|
2779
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2780
|
+
className: modules_63b47c51.list_summary,
|
|
2781
|
+
id: item.roomId,
|
|
2782
|
+
onClick: function() {
|
|
2783
|
+
if (item.count == 1) {
|
|
2784
|
+
calculationData(item.roomId, item.id, item.member);
|
|
2785
|
+
} else {
|
|
2786
|
+
showDetails(item.roomId, item.show);
|
|
2787
|
+
}
|
|
2788
|
+
},
|
|
2789
|
+
children: [
|
|
2790
|
+
/*#__PURE__*/ jsx("div", {
|
|
2791
|
+
className: modules_63b47c51.head_img,
|
|
2792
|
+
children: item.member == "AI" ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
|
|
2793
|
+
src: item.headImg
|
|
2794
|
+
})
|
|
2795
|
+
}),
|
|
2796
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2797
|
+
className: modules_63b47c51.list_desc,
|
|
2798
|
+
children: [
|
|
2799
|
+
/*#__PURE__*/ jsxs("p", {
|
|
2800
|
+
className: modules_63b47c51.name,
|
|
2801
|
+
children: [
|
|
2802
|
+
item.member == "AI" ? "AI助手" : item.name,
|
|
2803
|
+
item.count == 1 ? /*#__PURE__*/ jsx("span", {
|
|
2804
|
+
className: modules_63b47c51.time,
|
|
2805
|
+
children: time
|
|
2806
|
+
}) : ""
|
|
2807
|
+
]
|
|
2808
|
+
}),
|
|
2809
|
+
item.count == 1 ? /*#__PURE__*/ jsx("p", {
|
|
2810
|
+
className: modules_63b47c51.decs,
|
|
2811
|
+
style: {
|
|
2812
|
+
width: "calc(100% - 36px)"
|
|
2813
|
+
},
|
|
2814
|
+
dangerouslySetInnerHTML: {
|
|
2815
|
+
__html: span
|
|
2816
|
+
}
|
|
2817
|
+
}) : /*#__PURE__*/ jsx("p", {
|
|
2818
|
+
className: modules_63b47c51.decs,
|
|
2819
|
+
children: "".concat(item.count, "条相关聊天记录")
|
|
2820
|
+
})
|
|
2821
|
+
]
|
|
2822
|
+
}),
|
|
2823
|
+
item.count != 1 ? /*#__PURE__*/ jsx("div", {
|
|
2824
|
+
className: "".concat(modules_63b47c51.open, " ").concat(item.show ? modules_63b47c51.active : ""),
|
|
2825
|
+
children: /*#__PURE__*/ jsx(CustomExpand$1, {})
|
|
2826
|
+
}) : ""
|
|
2827
|
+
]
|
|
2828
|
+
}),
|
|
2829
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2830
|
+
className: modules_63b47c51.list_detail,
|
|
2831
|
+
children: [
|
|
2832
|
+
item.show && item.detailsList && item.detailsList.map(function(list) {
|
|
2833
|
+
// console.log(list,item,'dklfvmdflkvmdfklv')
|
|
2834
|
+
var name = "";
|
|
2835
|
+
if (list.sender == "AI") {
|
|
2836
|
+
name = "AI助手";
|
|
2837
|
+
} else if (list.sender == item.member) {
|
|
2838
|
+
name = item.name;
|
|
2839
|
+
} else {
|
|
2840
|
+
name = userData.real_name;
|
|
2841
|
+
}
|
|
2842
|
+
var time = "";
|
|
2843
|
+
var currentTime = getDataTime(-1, 1); //当前时间
|
|
2844
|
+
var updatedAt = getDataTime(list.updatedAt, 1);
|
|
2845
|
+
if (currentTime == updatedAt) {
|
|
2846
|
+
time = getDataTime(list.updatedAt, 2);
|
|
2847
|
+
} else {
|
|
2848
|
+
time = getDataTime(list.updatedAt);
|
|
2849
|
+
}
|
|
2850
|
+
// let span = list.message.replace(
|
|
2851
|
+
// /keyWordProblem/gi,
|
|
2852
|
+
// () => {
|
|
2853
|
+
// return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
2854
|
+
// }
|
|
2855
|
+
// );
|
|
2856
|
+
var span = list.message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
|
|
2857
|
+
// console.log(i,'skdcnsdjk')
|
|
2858
|
+
return "<span class=".concat(modules_63b47c51.sign, ">").concat(i, "</span>");
|
|
2859
|
+
});
|
|
2860
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
2861
|
+
className: modules_63b47c51.list,
|
|
2862
|
+
onClick: function() {
|
|
2863
|
+
calculationData(item.roomId, list.id, list.receiver);
|
|
2864
|
+
},
|
|
2865
|
+
children: [
|
|
2866
|
+
/*#__PURE__*/ jsxs("div", {
|
|
2867
|
+
className: modules_63b47c51.name,
|
|
2868
|
+
children: [
|
|
2869
|
+
/*#__PURE__*/ jsx("p", {
|
|
2870
|
+
children: name
|
|
2871
|
+
}),
|
|
2872
|
+
/*#__PURE__*/ jsx("span", {
|
|
2873
|
+
className: modules_63b47c51.time,
|
|
2874
|
+
children: time
|
|
2875
|
+
})
|
|
2876
|
+
]
|
|
2877
|
+
}),
|
|
2878
|
+
/*#__PURE__*/ jsx("div", {
|
|
2879
|
+
className: modules_63b47c51.con,
|
|
2880
|
+
dangerouslySetInnerHTML: {
|
|
2881
|
+
__html: span
|
|
2882
|
+
}
|
|
2883
|
+
})
|
|
2884
|
+
]
|
|
2885
|
+
}, list.id);
|
|
2886
|
+
}),
|
|
2887
|
+
item.show && item.pageCount > 1 && item.pageCount > item.pageNum && /*#__PURE__*/ jsx("div", {
|
|
2888
|
+
className: "".concat(modules_63b47c51.list, " ").concat(modules_63b47c51.list_more),
|
|
2889
|
+
onClick: function() {
|
|
2890
|
+
loadMore(item.pageNum + 1, item.roomId);
|
|
2891
|
+
},
|
|
2892
|
+
children: "点击加载更多"
|
|
2893
|
+
})
|
|
2894
|
+
]
|
|
2895
|
+
})
|
|
2896
|
+
]
|
|
2897
|
+
});
|
|
2898
|
+
})
|
|
2703
2899
|
})
|
|
2704
2900
|
]
|
|
2705
2901
|
})
|
|
@@ -2710,123 +2906,19 @@ var HistoryFun = function(props) {
|
|
|
2710
2906
|
var HistoryFun$1 = HistoryFun;
|
|
2711
2907
|
|
|
2712
2908
|
var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
2713
|
-
var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, switchChatRoom = props.switchChatRoom,
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
clearTimeout(timer.current);
|
|
2721
|
-
};
|
|
2722
|
-
}, []);
|
|
2723
|
-
// //获取聊天室列表
|
|
2724
|
-
// useEffect(() => {
|
|
2725
|
-
// roomsListTimer();
|
|
2726
|
-
// }, [contactsList]);
|
|
2727
|
-
useImperativeHandle(ref, function() {
|
|
2728
|
-
return {
|
|
2729
|
-
roomsListTimer: function() {
|
|
2730
|
-
return roomsListTimer();
|
|
2731
|
-
}
|
|
2732
|
-
};
|
|
2733
|
-
});
|
|
2734
|
-
var roomsListTimer = function() {
|
|
2735
|
-
if (timer != null) clearTimeout(timer.current);
|
|
2736
|
-
timer.current = setTimeout(function() {
|
|
2737
|
-
return roomsListTimer();
|
|
2738
|
-
}, 60000);
|
|
2739
|
-
http.get("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
2740
|
-
params: {
|
|
2741
|
-
page: 1,
|
|
2742
|
-
maxPageSize: 100002
|
|
2743
|
-
},
|
|
2744
|
-
headers: {
|
|
2745
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2746
|
-
return ele.short == "IntelligentCustomerService";
|
|
2747
|
-
}).id,
|
|
2748
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2749
|
-
}
|
|
2750
|
-
}).then(function(res) {
|
|
2751
|
-
if (res.data) {
|
|
2752
|
-
var list = res.data.contacts;
|
|
2753
|
-
setContactsList(function(contactsList) {
|
|
2754
|
-
list = list.map(function(item, index) {
|
|
2755
|
-
var c_list = contactsList.filter(function(e) {
|
|
2756
|
-
return e.sender == item.sender;
|
|
2757
|
-
});
|
|
2758
|
-
var obj = {};
|
|
2759
|
-
if (c_list.length > 0) {
|
|
2760
|
-
obj = c_list[0];
|
|
2761
|
-
}
|
|
2762
|
-
return _object_spread({}, obj, item);
|
|
2763
|
-
});
|
|
2764
|
-
return list;
|
|
2765
|
-
});
|
|
2766
|
-
getUserInfo(list);
|
|
2767
|
-
saveContactsList(list);
|
|
2768
|
-
}
|
|
2769
|
-
});
|
|
2770
|
-
};
|
|
2909
|
+
var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, switchChatRoom = props.switchChatRoom, contactsList = props.contactsList;
|
|
2910
|
+
// useImperativeHandle(ref, () => ({
|
|
2911
|
+
// roomsListTimer: () => {
|
|
2912
|
+
// return roomsListTimer();
|
|
2913
|
+
// },
|
|
2914
|
+
// roomsList:contactsList,
|
|
2915
|
+
// }),[contactsList]);
|
|
2771
2916
|
//删除聊天室
|
|
2772
2917
|
var deleteRoom = function(roomId) {
|
|
2773
|
-
var contactsList;
|
|
2774
|
-
setContactsList(function(list) {
|
|
2775
|
-
contactsList = list.filter(function(e) {
|
|
2776
|
-
return e.roomId != roomId;
|
|
2777
|
-
});
|
|
2778
|
-
//切换到AI聊天窗口
|
|
2779
|
-
if (roomId == props.roomId) {
|
|
2780
|
-
switchChatRoom(contactsList[0].roomId, "");
|
|
2781
|
-
}
|
|
2782
|
-
saveContactsList(contactsList);
|
|
2783
|
-
return contactsList;
|
|
2784
|
-
});
|
|
2785
2918
|
http.delete("".concat(urllocation, "/chat-service/public/v1.0/rooms/").concat(roomId), {
|
|
2786
|
-
headers: {
|
|
2787
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2788
|
-
return ele.short == "IntelligentCustomerService";
|
|
2789
|
-
}).id,
|
|
2790
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2791
|
-
}
|
|
2792
2919
|
}).then(function(res) {
|
|
2793
|
-
roomsListTimer();
|
|
2794
|
-
|
|
2795
|
-
};
|
|
2796
|
-
//获取老师的信息等
|
|
2797
|
-
var getUserInfo = function(list) {
|
|
2798
|
-
list.map(function(item, i) {
|
|
2799
|
-
if (!item.name && !item.headImg && item.sender != "AI") {
|
|
2800
|
-
getUserName(item.sender).then(function(res) {
|
|
2801
|
-
if (res.data) {
|
|
2802
|
-
var _$list;
|
|
2803
|
-
setContactsList(function(contactsList) {
|
|
2804
|
-
_$list = contactsList.map(function(item, index) {
|
|
2805
|
-
if (item.sender == res.data.uid) {
|
|
2806
|
-
return _object_spread({}, item, res.data);
|
|
2807
|
-
} else {
|
|
2808
|
-
return item;
|
|
2809
|
-
}
|
|
2810
|
-
});
|
|
2811
|
-
return _$list;
|
|
2812
|
-
});
|
|
2813
|
-
saveContactsList(_$list);
|
|
2814
|
-
}
|
|
2815
|
-
});
|
|
2816
|
-
}
|
|
2817
|
-
});
|
|
2818
|
-
};
|
|
2819
|
-
var getUserName = function(uid) {
|
|
2820
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
2821
|
-
params: {
|
|
2822
|
-
uid: uid
|
|
2823
|
-
},
|
|
2824
|
-
headers: {
|
|
2825
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2826
|
-
return ele.short == "TeacherAnswer";
|
|
2827
|
-
}).id,
|
|
2828
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2829
|
-
}
|
|
2920
|
+
// roomsListTimer();
|
|
2921
|
+
switchChatRoom(roomId, "1");
|
|
2830
2922
|
});
|
|
2831
2923
|
};
|
|
2832
2924
|
return type == 2 || type == 4 ? //联系人展开
|
|
@@ -2838,8 +2930,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
2838
2930
|
children: /*#__PURE__*/ jsxs("div", {
|
|
2839
2931
|
className: "".concat(modules_63b47c51.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId || contactsList.length == 0 ? modules_63b47c51.active : ""),
|
|
2840
2932
|
onClick: function() {
|
|
2841
|
-
switchChatRoom(contactsList[0].roomId, "");
|
|
2842
|
-
// roomsListTimer();
|
|
2933
|
+
return switchChatRoom(contactsList[0].roomId, "");
|
|
2843
2934
|
},
|
|
2844
2935
|
children: [
|
|
2845
2936
|
/*#__PURE__*/ jsx(CustomAiIcon$1, {}),
|
|
@@ -2882,25 +2973,6 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
2882
2973
|
className: "".concat(modules_63b47c51.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? modules_63b47c51.active : ""),
|
|
2883
2974
|
onClick: function() {
|
|
2884
2975
|
switchChatRoom(item.roomId, "");
|
|
2885
|
-
// roomsListTimer();
|
|
2886
|
-
var newList = [];
|
|
2887
|
-
setContactsList(function(list) {
|
|
2888
|
-
newList = list;
|
|
2889
|
-
newList = newList.map(function(v) {
|
|
2890
|
-
if (v.roomId == item.roomId) {
|
|
2891
|
-
return _object_spread_props(_object_spread({}, v), {
|
|
2892
|
-
unreadCount: 0
|
|
2893
|
-
});
|
|
2894
|
-
} else {
|
|
2895
|
-
return v;
|
|
2896
|
-
}
|
|
2897
|
-
});
|
|
2898
|
-
return newList;
|
|
2899
|
-
});
|
|
2900
|
-
// console.log(newList,9999999999)
|
|
2901
|
-
setTimeout(function() {
|
|
2902
|
-
saveContactsList(newList);
|
|
2903
|
-
}, 100);
|
|
2904
2976
|
},
|
|
2905
2977
|
children: [
|
|
2906
2978
|
/*#__PURE__*/ jsx("img", {
|
|
@@ -2991,26 +3063,6 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
2991
3063
|
className: "".concat(modules_63b47c51.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? modules_63b47c51.active : ""),
|
|
2992
3064
|
onClick: function() {
|
|
2993
3065
|
switchChatRoom(item.roomId, "");
|
|
2994
|
-
// roomsListTimer();
|
|
2995
|
-
//消息更改为已读
|
|
2996
|
-
var newList = [];
|
|
2997
|
-
setContactsList(function(list) {
|
|
2998
|
-
newList = list;
|
|
2999
|
-
newList = newList.map(function(v) {
|
|
3000
|
-
if (v.roomId == item.roomId) {
|
|
3001
|
-
return _object_spread_props(_object_spread({}, v), {
|
|
3002
|
-
unreadCount: 0
|
|
3003
|
-
});
|
|
3004
|
-
} else {
|
|
3005
|
-
return v;
|
|
3006
|
-
}
|
|
3007
|
-
});
|
|
3008
|
-
return newList;
|
|
3009
|
-
});
|
|
3010
|
-
// console.log(newList,9999999999)
|
|
3011
|
-
setTimeout(function() {
|
|
3012
|
-
saveContactsList(newList);
|
|
3013
|
-
}, 100);
|
|
3014
3066
|
},
|
|
3015
3067
|
children: [
|
|
3016
3068
|
/*#__PURE__*/ jsx("img", {
|
|
@@ -3212,21 +3264,22 @@ var CustomerService = function(props) {
|
|
|
3212
3264
|
var _useState17 = _sliced_to_array(useState(false), 2), firstLoad = _useState17[0], setFirstLoad = _useState17[1]; //第一次切换全屏时滚动到页面底部
|
|
3213
3265
|
var _useState18 = _sliced_to_array(useState(45), 2), buttomHei = _useState18[0], setButtomHei = _useState18[1]; //底部输入框的高度
|
|
3214
3266
|
var _useState19 = _sliced_to_array(useState(false), 2), showHistory = _useState19[0], setShowHistory = _useState19[1]; //是否显示历史记录
|
|
3215
|
-
var _useState20 = _sliced_to_array(useState(false), 2), showContacts = _useState20[0], setShowContacts = _useState20[1];
|
|
3267
|
+
var _useState20 = _sliced_to_array(useState(false), 2), showContacts = _useState20[0], setShowContacts = _useState20[1]; //是否显示老师列表
|
|
3216
3268
|
var _useState21 = _sliced_to_array(useState(-1), 2), showType = _useState21[0], setShowType = _useState21[1]; //显示聊天框类型 1、侧边栏 2 modal 3 相应的div中 newlabo中使用
|
|
3217
3269
|
var _useState22 = _sliced_to_array(useState(-1), 2), answerMode = _useState22[0], setAnswerMode = _useState22[1]; //设置回答模式。1,召唤老师回答
|
|
3218
3270
|
var _useState23 = _sliced_to_array(useState([]), 2), teacherList = _useState23[0], setTeacherList = _useState23[1]; //老师列表
|
|
3219
3271
|
var _useState24 = _sliced_to_array(useState({}), 2), problem = _useState24[0], setProblem = _useState24[1]; //召唤老师回答的问题
|
|
3220
|
-
|
|
3272
|
+
// const [roomList,setRoomList] = useState([]);//聊天列表
|
|
3273
|
+
var _useState25 = _sliced_to_array(useState([]), 2), contactsList = _useState25[0], setContactsList = _useState25[1]; //老师列表
|
|
3221
3274
|
var _useState26 = _sliced_to_array(useState([]), 2), chatObj = _useState26[0], setChatObj = _useState26[1]; //聊天记录id保存,用来在实验报告中记录
|
|
3222
3275
|
var timer = useRef(null); //文本框输入时
|
|
3223
3276
|
var receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
3224
3277
|
var voiceCountdownTimer = useRef(null); //语音录制倒计时
|
|
3225
3278
|
var listTimer = useRef(null); // 请求列表倒计时
|
|
3226
3279
|
var roomMessage = useRef(null); //循环当前页面的新消息
|
|
3280
|
+
var chatRoomList = useRef(null); //获取聊天室列表
|
|
3227
3281
|
var ctrl = useRef(); //停止生成ai回答时使用
|
|
3228
3282
|
var childRef = useRef(null); //获取子组件方法
|
|
3229
|
-
// const [mid, setmid] = useState(props.userData.mid); //当前用户id
|
|
3230
3283
|
var mid = props.userData.mid;
|
|
3231
3284
|
var remarkable = new Remarkable({
|
|
3232
3285
|
highlight: function highlight(str, lang) {
|
|
@@ -3248,6 +3301,7 @@ var CustomerService = function(props) {
|
|
|
3248
3301
|
clearTimeout(listTimer.current);
|
|
3249
3302
|
clearTimeout(timer.current);
|
|
3250
3303
|
clearTimeout(roomMessage.current);
|
|
3304
|
+
clearTimeout(chatRoomList.current);
|
|
3251
3305
|
};
|
|
3252
3306
|
}, []);
|
|
3253
3307
|
useEffect(function() {
|
|
@@ -3260,7 +3314,6 @@ var CustomerService = function(props) {
|
|
|
3260
3314
|
function handleScroll() {
|
|
3261
3315
|
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
3262
3316
|
var scrollTop = container.scrollTop;
|
|
3263
|
-
// const scrollBottom = container.scroll;
|
|
3264
3317
|
var clientHeight = container.clientHeight;
|
|
3265
3318
|
var scrollHeight = container.scrollHeight;
|
|
3266
3319
|
// console.log(scrollTop,clientHeight,scrollHeight,'333dfkvmdfv')
|
|
@@ -3274,7 +3327,6 @@ var CustomerService = function(props) {
|
|
|
3274
3327
|
clearTimeout(listTimer.current);
|
|
3275
3328
|
setBottomLoading(true);
|
|
3276
3329
|
listTimer.current = setTimeout(function() {
|
|
3277
|
-
// console.log("加载下一页", number);
|
|
3278
3330
|
getHistoryMessage(number, 4);
|
|
3279
3331
|
}, 1000);
|
|
3280
3332
|
} else {
|
|
@@ -3332,13 +3384,11 @@ var CustomerService = function(props) {
|
|
|
3332
3384
|
// console.log(props,'lsdkcmsdlcksd')
|
|
3333
3385
|
getQuestiionsList("", 1);
|
|
3334
3386
|
scrollToBottom();
|
|
3335
|
-
// less.modifyVars({ "@color-border-Tr": "#f4523b" });
|
|
3336
3387
|
setShowType(initShowType);
|
|
3337
3388
|
}, [
|
|
3338
3389
|
initShowType
|
|
3339
3390
|
]);
|
|
3340
3391
|
useEffect(function() {
|
|
3341
|
-
// console.log(roomId,1111111)
|
|
3342
3392
|
if (roomId != "") {
|
|
3343
3393
|
if (lastId == "") {
|
|
3344
3394
|
getHistoryMessage(pageNum, 2);
|
|
@@ -3350,30 +3400,28 @@ var CustomerService = function(props) {
|
|
|
3350
3400
|
}, [
|
|
3351
3401
|
roomId
|
|
3352
3402
|
]);
|
|
3403
|
+
//创建聊天室并获取聊天室列表
|
|
3353
3404
|
useEffect(function() {
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
sender: "AI"
|
|
3363
|
-
}
|
|
3364
|
-
]);
|
|
3365
|
-
});
|
|
3366
|
-
} else {
|
|
3367
|
-
setRoomList(roomList);
|
|
3368
|
-
}
|
|
3369
|
-
// recordRef.current.roomList=JSON.parse(JSON.stringify(roomList))
|
|
3370
|
-
}, [
|
|
3371
|
-
roomList
|
|
3372
|
-
]);
|
|
3405
|
+
createRooms("AI").then(function(res) {
|
|
3406
|
+
setRoomId(res.data.id);
|
|
3407
|
+
});
|
|
3408
|
+
roomsListTimer();
|
|
3409
|
+
return function() {
|
|
3410
|
+
clearTimeout(chatRoomList.current);
|
|
3411
|
+
};
|
|
3412
|
+
}, []);
|
|
3373
3413
|
//进入页面,发送打招呼信息
|
|
3374
3414
|
useEffect(function() {
|
|
3375
|
-
// console.log(historyMessageList, "dkjvndfkjvd33333f");
|
|
3376
3415
|
//老师的聊天窗口不发送打招呼信息
|
|
3416
|
+
var roomList = contactsList;
|
|
3417
|
+
// console.log(roomList,'dkfvdfkjvndfkjvdfv')
|
|
3418
|
+
var count = 0;
|
|
3419
|
+
roomList.map(function(item) {
|
|
3420
|
+
count += item.unreadCount;
|
|
3421
|
+
});
|
|
3422
|
+
if (count > 0) {
|
|
3423
|
+
setShowContacts(true);
|
|
3424
|
+
}
|
|
3377
3425
|
if (!(roomList.length > 0 && roomList[0].roomId != roomId)) {
|
|
3378
3426
|
//是否发送打招呼信息
|
|
3379
3427
|
if (greetingMessage && historyMessageList.length == 0) {
|
|
@@ -3408,7 +3456,7 @@ var CustomerService = function(props) {
|
|
|
3408
3456
|
}, [
|
|
3409
3457
|
bese64String
|
|
3410
3458
|
]);
|
|
3411
|
-
//AI窗口,type:1发送打招呼信息 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
3459
|
+
//AI窗口,type:1发送打招呼信息 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
3412
3460
|
var sendGreetingMessage = function(type) {
|
|
3413
3461
|
var questionsList = [];
|
|
3414
3462
|
var obj = {};
|
|
@@ -3513,14 +3561,7 @@ var CustomerService = function(props) {
|
|
|
3513
3561
|
setKeyWord("");
|
|
3514
3562
|
setQuestionsList([]);
|
|
3515
3563
|
setCitationContent({});
|
|
3516
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj
|
|
3517
|
-
headers: {
|
|
3518
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
3519
|
-
return ele.short == "IntelligentCustomerService";
|
|
3520
|
-
}).id,
|
|
3521
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
3522
|
-
}
|
|
3523
|
-
}).then(function(res) {
|
|
3564
|
+
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
3524
3565
|
if (res.data.id) {
|
|
3525
3566
|
setHistoryMessageList(function(historyMessageList) {
|
|
3526
3567
|
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
@@ -3555,7 +3596,7 @@ var CustomerService = function(props) {
|
|
|
3555
3596
|
};
|
|
3556
3597
|
setProblem({});
|
|
3557
3598
|
} else if (type == 2) {
|
|
3558
|
-
var list =
|
|
3599
|
+
var list = contactsList.filter(function(item) {
|
|
3559
3600
|
return item.roomId == roomId;
|
|
3560
3601
|
});
|
|
3561
3602
|
var recevier = "";
|
|
@@ -3570,16 +3611,9 @@ var CustomerService = function(props) {
|
|
|
3570
3611
|
quotedMessage: citationContent.content || ""
|
|
3571
3612
|
};
|
|
3572
3613
|
}
|
|
3573
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/chat-with-user/messages"), obj
|
|
3574
|
-
headers: {
|
|
3575
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
3576
|
-
return ele.short == "TeacherAnswer";
|
|
3577
|
-
}).id,
|
|
3578
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
3579
|
-
}
|
|
3580
|
-
}).then(function(res) {
|
|
3614
|
+
http.post("".concat(urllocation, "/chat-service/public/v1.0/chat-with-user/messages"), obj).then(function(res) {
|
|
3581
3615
|
if (res.data.id) {
|
|
3582
|
-
console.log(pageNum, pageNumHistory, lastId, "dlskskdsd4444");
|
|
3616
|
+
// console.log(pageNum, pageNumHistory, lastId, "dlskskdsd4444");
|
|
3583
3617
|
if (pageNum == 1 || pageNumHistory == 1 || pageNumHistory == 0) {
|
|
3584
3618
|
setHistoryMessageList(function(historyMessageList) {
|
|
3585
3619
|
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
@@ -3600,8 +3634,8 @@ var CustomerService = function(props) {
|
|
|
3600
3634
|
if (type == 1) {
|
|
3601
3635
|
var roomList = [
|
|
3602
3636
|
{
|
|
3603
|
-
|
|
3604
|
-
|
|
3637
|
+
roomId: roomId,
|
|
3638
|
+
id: res.data.id
|
|
3605
3639
|
}
|
|
3606
3640
|
];
|
|
3607
3641
|
setChatObj(function(list) {
|
|
@@ -3695,14 +3729,7 @@ var CustomerService = function(props) {
|
|
|
3695
3729
|
return newHistoryMessageList;
|
|
3696
3730
|
});
|
|
3697
3731
|
scrollToBottom();
|
|
3698
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj
|
|
3699
|
-
headers: {
|
|
3700
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
3701
|
-
return ele.short == "IntelligentCustomerService";
|
|
3702
|
-
}).id,
|
|
3703
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
3704
|
-
}
|
|
3705
|
-
}).then(function(res) {
|
|
3732
|
+
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
3706
3733
|
if (res.data.id) {
|
|
3707
3734
|
//更新聊天记录id
|
|
3708
3735
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -3735,31 +3762,15 @@ var CustomerService = function(props) {
|
|
|
3735
3762
|
sendingExistingIssues(2, dataObj, "");
|
|
3736
3763
|
testLabQuestion(obj.message, questions.answer, "");
|
|
3737
3764
|
}
|
|
3738
|
-
}).then(function(res) {
|
|
3739
|
-
console.log(res);
|
|
3740
3765
|
});
|
|
3741
3766
|
};
|
|
3742
3767
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
3743
3768
|
var content = ""; //用于实验报告的问题记录
|
|
3744
3769
|
var aiSendQuestions = function(type, obj, id) {
|
|
3745
3770
|
content = "";
|
|
3746
|
-
// if (type == 3) {
|
|
3747
|
-
// try {
|
|
3748
|
-
// if (ctrl && ctrl.current) {
|
|
3749
|
-
// ctrl.current.abort();
|
|
3750
|
-
// }
|
|
3751
|
-
// } catch (error) {}
|
|
3752
|
-
// clearTimeout(receiveMessageTimer.current);
|
|
3753
|
-
// setHistoryMessageList((historyMessageList) => {
|
|
3754
|
-
// return historyMessageList.filter((item) => item.id != "123456");
|
|
3755
|
-
// });
|
|
3756
|
-
// setFinished(true);
|
|
3757
|
-
// return;
|
|
3758
|
-
// }
|
|
3759
3771
|
ctrl.current = new AbortController();
|
|
3760
3772
|
clearTimeout(receiveMessageTimer.current);
|
|
3761
3773
|
receiveMessageTimer.current = setTimeout(function() {
|
|
3762
|
-
// console.log('超时终止1111')
|
|
3763
3774
|
setHistoryMessageList(function(historyMessageList) {
|
|
3764
3775
|
return historyMessageList.filter(function(item) {
|
|
3765
3776
|
return item.id != "123456" && item.id != "654321";
|
|
@@ -3839,7 +3850,7 @@ var CustomerService = function(props) {
|
|
|
3839
3850
|
"X-Auth-Jwt": window.localStorage.getItem("usertoken") || "",
|
|
3840
3851
|
"Auth-Token": userData.token,
|
|
3841
3852
|
"X-Module-Id": userData.modules.find(function(ele) {
|
|
3842
|
-
return ele.short == "
|
|
3853
|
+
return ele.short == "IntelligentCustomerService";
|
|
3843
3854
|
}).id
|
|
3844
3855
|
},
|
|
3845
3856
|
body: data,
|
|
@@ -4000,9 +4011,9 @@ var CustomerService = function(props) {
|
|
|
4000
4011
|
return newHistoryMessageList2;
|
|
4001
4012
|
}
|
|
4002
4013
|
});
|
|
4003
|
-
setTimeout(
|
|
4004
|
-
|
|
4005
|
-
|
|
4014
|
+
// setTimeout(() => {
|
|
4015
|
+
scrollToBottom();
|
|
4016
|
+
// }, 10);
|
|
4006
4017
|
};
|
|
4007
4018
|
//问题记录到实验报告中
|
|
4008
4019
|
var testLabQuestion = function(title, content, teachId) {
|
|
@@ -4014,13 +4025,6 @@ var CustomerService = function(props) {
|
|
|
4014
4025
|
teachId: teachId != undefined ? teachId : chatWith.uid | mid,
|
|
4015
4026
|
stepId: stepId,
|
|
4016
4027
|
stepIds: stepIds
|
|
4017
|
-
}, {
|
|
4018
|
-
headers: {
|
|
4019
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4020
|
-
return ele.short == "IntelligentCustomerService";
|
|
4021
|
-
}).id,
|
|
4022
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4023
|
-
}
|
|
4024
4028
|
}).then(function() {
|
|
4025
4029
|
console.log(roomId, chatObj, "roomIdroomIdroomIdroomId");
|
|
4026
4030
|
setChatObj(function(list1) {
|
|
@@ -4036,13 +4040,6 @@ var CustomerService = function(props) {
|
|
|
4036
4040
|
var speechToText = function() {
|
|
4037
4041
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/speech:recognize"), {
|
|
4038
4042
|
audio: bese64String
|
|
4039
|
-
}, {
|
|
4040
|
-
headers: {
|
|
4041
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4042
|
-
return ele.short == "AIservice";
|
|
4043
|
-
}).id,
|
|
4044
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4045
|
-
}
|
|
4046
4043
|
}).then(function(res) {
|
|
4047
4044
|
setVoiceRecordingStatus(3);
|
|
4048
4045
|
if (res.data) {
|
|
@@ -4058,20 +4055,13 @@ var CustomerService = function(props) {
|
|
|
4058
4055
|
var createRooms = function(uid) {
|
|
4059
4056
|
return http.post("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
4060
4057
|
chatWith: uid
|
|
4061
|
-
}, {
|
|
4062
|
-
headers: {
|
|
4063
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4064
|
-
return ele.short == "IntelligentCustomerService";
|
|
4065
|
-
}).id,
|
|
4066
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4067
|
-
}
|
|
4068
4058
|
});
|
|
4069
4059
|
};
|
|
4070
4060
|
//获取历史消息 flag:1,历史记录点击定位,2,代表是上拉加载,3,存在新的消息-->老师回答等,4,下拉加载,滚动到底部时,主要用于查看历史记录
|
|
4071
4061
|
var getHistoryMessage = function(pageNum, flag) {
|
|
4072
4062
|
var id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "1";
|
|
4073
4063
|
clearTimeout(roomMessage.current);
|
|
4074
|
-
console.log(pageNum,
|
|
4064
|
+
// console.log(pageNum,flag,'dkfjvndfjvndfkvdf')
|
|
4075
4065
|
// flag == 1 时已经设置好了位置标记
|
|
4076
4066
|
var last_id = "";
|
|
4077
4067
|
if (flag == 2 && historyMessageList.length > 0) {
|
|
@@ -4092,20 +4082,10 @@ var CustomerService = function(props) {
|
|
|
4092
4082
|
page: pageNum ? pageNum : 1,
|
|
4093
4083
|
maxPageSize: 30,
|
|
4094
4084
|
direction: "desc"
|
|
4095
|
-
},
|
|
4096
|
-
headers: {
|
|
4097
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4098
|
-
return ele.short == "IntelligentCustomerService";
|
|
4099
|
-
}).id,
|
|
4100
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4101
4085
|
}
|
|
4102
4086
|
}).then(function(res) {
|
|
4103
4087
|
var totalNumber = 0;
|
|
4104
|
-
var roomList =
|
|
4105
|
-
setRoomList(function(list) {
|
|
4106
|
-
roomList = list;
|
|
4107
|
-
return list;
|
|
4108
|
-
});
|
|
4088
|
+
var roomList = contactsList;
|
|
4109
4089
|
if (res.data.messages.length > 0) {
|
|
4110
4090
|
clearTimeout(listTimer.current);
|
|
4111
4091
|
var total = res.data.total;
|
|
@@ -4178,6 +4158,7 @@ var CustomerService = function(props) {
|
|
|
4178
4158
|
});
|
|
4179
4159
|
var isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
4180
4160
|
if (!isAiChatWindow && roomList.length > 0 && (pageNum == 1 || pageNumHistory == 0)) {
|
|
4161
|
+
//&& pageNum == 1
|
|
4181
4162
|
getRoomidHistoryMessage(totalNumber, rid);
|
|
4182
4163
|
}
|
|
4183
4164
|
}).catch(function(res) {
|
|
@@ -4196,14 +4177,8 @@ var CustomerService = function(props) {
|
|
|
4196
4177
|
params: {
|
|
4197
4178
|
roomId: rid,
|
|
4198
4179
|
page: 1,
|
|
4199
|
-
maxPageSize: totalNumber,
|
|
4180
|
+
maxPageSize: totalNumber == 0 ? 30 : totalNumber,
|
|
4200
4181
|
direction: "desc"
|
|
4201
|
-
},
|
|
4202
|
-
headers: {
|
|
4203
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4204
|
-
return ele.short == "IntelligentCustomerService";
|
|
4205
|
-
}).id,
|
|
4206
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4207
4182
|
}
|
|
4208
4183
|
}).then(function(res) {
|
|
4209
4184
|
var newHistoryMessageList = [];
|
|
@@ -4222,7 +4197,7 @@ var CustomerService = function(props) {
|
|
|
4222
4197
|
newList = newHistoryMessageList.length;
|
|
4223
4198
|
return newHistoryMessageList;
|
|
4224
4199
|
});
|
|
4225
|
-
console.log(dataList.length, originList,
|
|
4200
|
+
// console.log(dataList.length , originList,lastId,'dfkvdnfkvdfj44444');
|
|
4226
4201
|
if (!lastId && originList != newList) {
|
|
4227
4202
|
setTimeout(function() {
|
|
4228
4203
|
scrollToBottom();
|
|
@@ -4270,8 +4245,7 @@ var CustomerService = function(props) {
|
|
|
4270
4245
|
console.log(newMessage, "newMessagenewMessage");
|
|
4271
4246
|
var result = [];
|
|
4272
4247
|
newMessage.forEach(function(item, index) {
|
|
4273
|
-
var isQuestion = item.receiver !== mid //是否为问题
|
|
4274
|
-
;
|
|
4248
|
+
var isQuestion = item.receiver !== mid; //是否为问题
|
|
4275
4249
|
if (isQuestion) {
|
|
4276
4250
|
//问题
|
|
4277
4251
|
if (newMessage[index + 1] && newMessage[index + 1].receiver === mid) {
|
|
@@ -4303,13 +4277,6 @@ var CustomerService = function(props) {
|
|
|
4303
4277
|
}
|
|
4304
4278
|
http.post(url, {
|
|
4305
4279
|
messageId: id
|
|
4306
|
-
}, {
|
|
4307
|
-
headers: {
|
|
4308
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4309
|
-
return ele.short == "IntelligentCustomerService";
|
|
4310
|
-
}).id,
|
|
4311
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4312
|
-
}
|
|
4313
4280
|
}).then(function(res) {
|
|
4314
4281
|
setHistoryMessageList(function(historyMessageList) {
|
|
4315
4282
|
var list = historyMessageList;
|
|
@@ -4334,13 +4301,6 @@ var CustomerService = function(props) {
|
|
|
4334
4301
|
}
|
|
4335
4302
|
http.post(url, {
|
|
4336
4303
|
messageId: id
|
|
4337
|
-
}, {
|
|
4338
|
-
headers: {
|
|
4339
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4340
|
-
return ele.short == "IntelligentCustomerService";
|
|
4341
|
-
}).id,
|
|
4342
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4343
|
-
}
|
|
4344
4304
|
}).then(function(res) {
|
|
4345
4305
|
setHistoryMessageList(function(historyMessageList) {
|
|
4346
4306
|
var list = historyMessageList;
|
|
@@ -4370,13 +4330,7 @@ var CustomerService = function(props) {
|
|
|
4370
4330
|
};
|
|
4371
4331
|
}
|
|
4372
4332
|
http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
|
|
4373
|
-
params: data
|
|
4374
|
-
headers: {
|
|
4375
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4376
|
-
return ele.short == "IntelligentCustomerService";
|
|
4377
|
-
}).id,
|
|
4378
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4379
|
-
}
|
|
4333
|
+
params: data
|
|
4380
4334
|
}).then(function(res) {
|
|
4381
4335
|
if (res.data.questions) {
|
|
4382
4336
|
if (flag == 1) {
|
|
@@ -4392,12 +4346,6 @@ var CustomerService = function(props) {
|
|
|
4392
4346
|
http.get("".concat(urllocation, "/chat-service/public/v1.0/teachers"), {
|
|
4393
4347
|
params: {
|
|
4394
4348
|
name: keyWord
|
|
4395
|
-
},
|
|
4396
|
-
headers: {
|
|
4397
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
4398
|
-
return ele.short == "TeacherAnswer";
|
|
4399
|
-
}).id,
|
|
4400
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
4401
4349
|
}
|
|
4402
4350
|
}).then(function(res) {
|
|
4403
4351
|
console.log(res);
|
|
@@ -4406,6 +4354,90 @@ var CustomerService = function(props) {
|
|
|
4406
4354
|
}
|
|
4407
4355
|
});
|
|
4408
4356
|
};
|
|
4357
|
+
//获取聊天室列表
|
|
4358
|
+
var roomsListTimer = function() {
|
|
4359
|
+
if (chatRoomList != null) clearTimeout(chatRoomList.current);
|
|
4360
|
+
chatRoomList.current = setTimeout(function() {
|
|
4361
|
+
return roomsListTimer();
|
|
4362
|
+
}, 60000);
|
|
4363
|
+
http.get("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
4364
|
+
params: {
|
|
4365
|
+
page: 1,
|
|
4366
|
+
maxPageSize: 100002
|
|
4367
|
+
}
|
|
4368
|
+
}).then(function(res) {
|
|
4369
|
+
if (res.data) {
|
|
4370
|
+
var list = res.data.contacts;
|
|
4371
|
+
setContactsList(function(list1) {
|
|
4372
|
+
list = list.map(function(item, index) {
|
|
4373
|
+
var c_list = list1.filter(function(e) {
|
|
4374
|
+
return e.sender == item.sender;
|
|
4375
|
+
});
|
|
4376
|
+
var obj = {};
|
|
4377
|
+
if (c_list.length > 0) {
|
|
4378
|
+
obj = c_list[0];
|
|
4379
|
+
}
|
|
4380
|
+
return _object_spread({}, obj, item);
|
|
4381
|
+
});
|
|
4382
|
+
return list;
|
|
4383
|
+
});
|
|
4384
|
+
getUserInfo(list);
|
|
4385
|
+
}
|
|
4386
|
+
});
|
|
4387
|
+
};
|
|
4388
|
+
//获取老师的信息等
|
|
4389
|
+
var getUserInfo = function(list) {
|
|
4390
|
+
var getUserid = [];
|
|
4391
|
+
//查找需要用户名和头像的
|
|
4392
|
+
list.map(function(item, i) {
|
|
4393
|
+
if (!item.name && !item.headImg && item.sender != "AI") {
|
|
4394
|
+
getUserid.push(item.sender);
|
|
4395
|
+
}
|
|
4396
|
+
});
|
|
4397
|
+
if (getUserid.length > 0) {
|
|
4398
|
+
getUserName(getUserid.join(",")).then(function(res) {
|
|
4399
|
+
if (res.data) {
|
|
4400
|
+
var nameList = res.data;
|
|
4401
|
+
// console.log(nameList,contactsList,'kdsjnvjdkvdfj')
|
|
4402
|
+
setContactsList(function(contactsList) {
|
|
4403
|
+
list = list.map(function(item, index) {
|
|
4404
|
+
var name = nameList.filter(function(v) {
|
|
4405
|
+
return v.uid == item.sender;
|
|
4406
|
+
});
|
|
4407
|
+
if (name.length > 0) {
|
|
4408
|
+
return _object_spread({}, item, name[0]);
|
|
4409
|
+
} else {
|
|
4410
|
+
return item;
|
|
4411
|
+
}
|
|
4412
|
+
});
|
|
4413
|
+
return list;
|
|
4414
|
+
});
|
|
4415
|
+
}
|
|
4416
|
+
});
|
|
4417
|
+
} else {
|
|
4418
|
+
setContactsList(function(contactsList) {
|
|
4419
|
+
list = list.map(function(item, index) {
|
|
4420
|
+
var c_list = contactsList.filter(function(e) {
|
|
4421
|
+
return e.sender == item.sender;
|
|
4422
|
+
});
|
|
4423
|
+
var obj = {};
|
|
4424
|
+
if (c_list.length > 0) {
|
|
4425
|
+
obj = c_list[0];
|
|
4426
|
+
}
|
|
4427
|
+
return _object_spread({}, obj, item);
|
|
4428
|
+
});
|
|
4429
|
+
return list;
|
|
4430
|
+
});
|
|
4431
|
+
}
|
|
4432
|
+
};
|
|
4433
|
+
//获取老师用户名
|
|
4434
|
+
var getUserName = function(uid) {
|
|
4435
|
+
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
4436
|
+
params: {
|
|
4437
|
+
uid: uid
|
|
4438
|
+
}
|
|
4439
|
+
});
|
|
4440
|
+
};
|
|
4409
4441
|
//设置滚动条滚动到底部
|
|
4410
4442
|
var scrollToBottom = function() {
|
|
4411
4443
|
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
@@ -4420,11 +4452,18 @@ var CustomerService = function(props) {
|
|
|
4420
4452
|
container.scrollTop = 60;
|
|
4421
4453
|
try {
|
|
4422
4454
|
setTimeout(function() {
|
|
4423
|
-
|
|
4455
|
+
// let top2 =
|
|
4456
|
+
// showType == 1 || showType == 3
|
|
4457
|
+
// ? $("#li_flag").offset().top - 20
|
|
4458
|
+
// : $("#chat_content_modal #li_flag").offset().top -
|
|
4459
|
+
// $("#chat_content_modal").offset().top +
|
|
4460
|
+
// 24;
|
|
4461
|
+
var top = showType == 1 || showType == 3 ? $("#li_flag").offset().top : $("#chat_content_modal #li_flag").offset().top - $("#chat_content_modal").offset().top;
|
|
4462
|
+
// console.log(top2,top,444444444444)
|
|
4424
4463
|
$("#".concat(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal")).animate({
|
|
4425
4464
|
scrollTop: top
|
|
4426
4465
|
}, 0);
|
|
4427
|
-
},
|
|
4466
|
+
}, 100);
|
|
4428
4467
|
} catch (error) {}
|
|
4429
4468
|
setLoading(false);
|
|
4430
4469
|
}
|
|
@@ -4444,19 +4483,34 @@ var CustomerService = function(props) {
|
|
|
4444
4483
|
});
|
|
4445
4484
|
});
|
|
4446
4485
|
};
|
|
4447
|
-
|
|
4448
|
-
var
|
|
4449
|
-
var
|
|
4486
|
+
//显示未读消息
|
|
4487
|
+
var showUnreadMessage = function() {
|
|
4488
|
+
var count = 0;
|
|
4489
|
+
contactsList.map(function(item) {
|
|
4490
|
+
count = count + item.unreadCount;
|
|
4491
|
+
});
|
|
4492
|
+
if (count > 0) {
|
|
4493
|
+
return /*#__PURE__*/ jsx("span", {
|
|
4494
|
+
className: styles.count,
|
|
4495
|
+
children: count > 99 ? "99+" : count
|
|
4496
|
+
});
|
|
4497
|
+
} else {
|
|
4498
|
+
return "";
|
|
4499
|
+
}
|
|
4500
|
+
};
|
|
4501
|
+
//显示聊天室名字
|
|
4502
|
+
var showChatRoomName = function() {
|
|
4503
|
+
var title = "AI助手";
|
|
4504
|
+
var list = contactsList.filter(function(e) {
|
|
4450
4505
|
return e.roomId == roomId;
|
|
4451
4506
|
});
|
|
4452
|
-
var title = "智能问答";
|
|
4453
4507
|
if (list.length > 0 && list[0].name) {
|
|
4454
4508
|
title = list[0].name;
|
|
4455
4509
|
}
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4510
|
+
return title;
|
|
4511
|
+
};
|
|
4512
|
+
//渲染头部
|
|
4513
|
+
var renderHeader = function() {
|
|
4460
4514
|
if (showType == 4) {
|
|
4461
4515
|
return /*#__PURE__*/ jsxs("div", {
|
|
4462
4516
|
className: styles.top,
|
|
@@ -4464,7 +4518,7 @@ var CustomerService = function(props) {
|
|
|
4464
4518
|
/*#__PURE__*/ jsx("div", {
|
|
4465
4519
|
className: styles.user,
|
|
4466
4520
|
children: /*#__PURE__*/ jsx("p", {
|
|
4467
|
-
children:
|
|
4521
|
+
children: showChatRoomName()
|
|
4468
4522
|
})
|
|
4469
4523
|
}),
|
|
4470
4524
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -4515,13 +4569,10 @@ var CustomerService = function(props) {
|
|
|
4515
4569
|
},
|
|
4516
4570
|
children: [
|
|
4517
4571
|
/*#__PURE__*/ jsx(CustomContacts$1, {}),
|
|
4518
|
-
|
|
4519
|
-
className: styles.count,
|
|
4520
|
-
children: count > 99 ? "99+" : count
|
|
4521
|
-
}) : ""
|
|
4572
|
+
showUnreadMessage()
|
|
4522
4573
|
]
|
|
4523
4574
|
}),
|
|
4524
|
-
|
|
4575
|
+
showChatRoomName()
|
|
4525
4576
|
]
|
|
4526
4577
|
})
|
|
4527
4578
|
}),
|
|
@@ -4544,7 +4595,13 @@ var CustomerService = function(props) {
|
|
|
4544
4595
|
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
4545
4596
|
// switchDialogBox(3, true);
|
|
4546
4597
|
setShowType(2);
|
|
4547
|
-
|
|
4598
|
+
setTimeout(function() {
|
|
4599
|
+
setKeyWord(" ");
|
|
4600
|
+
}, 100);
|
|
4601
|
+
setTimeout(function() {
|
|
4602
|
+
setKeyWord("");
|
|
4603
|
+
}, 300);
|
|
4604
|
+
// childRef.current.roomsListTimer();
|
|
4548
4605
|
},
|
|
4549
4606
|
children: /*#__PURE__*/ jsx(CustomFullScreen$1, {})
|
|
4550
4607
|
}) : /*#__PURE__*/ jsx("i", {
|
|
@@ -4569,7 +4626,7 @@ var CustomerService = function(props) {
|
|
|
4569
4626
|
var resettingBottomHei = function() {
|
|
4570
4627
|
setTimeout(function() {
|
|
4571
4628
|
if (showType == 1 || showType == 3) {
|
|
4572
|
-
if (document.getElementById("
|
|
4629
|
+
if (document.getElementById("Drawer_buttom")) {
|
|
4573
4630
|
var hei = document.getElementById("Drawer_buttom").offsetHeight;
|
|
4574
4631
|
setButtomHei(hei);
|
|
4575
4632
|
}
|
|
@@ -4583,28 +4640,50 @@ var CustomerService = function(props) {
|
|
|
4583
4640
|
};
|
|
4584
4641
|
//切换聊天室 type == renew ,存在新消息
|
|
4585
4642
|
var switchChatRoom = function(id, type) {
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4643
|
+
if (type != "1") {
|
|
4644
|
+
readMessage(id, urllocation, userData, http);
|
|
4645
|
+
setLastId("");
|
|
4646
|
+
setPageNum(1);
|
|
4647
|
+
setPageCount(0);
|
|
4648
|
+
setRoomId(id);
|
|
4649
|
+
try {
|
|
4650
|
+
if (ctrl && ctrl.current) {
|
|
4651
|
+
ctrl.current.abort();
|
|
4652
|
+
}
|
|
4653
|
+
setFinished(true);
|
|
4654
|
+
} catch (error) {}
|
|
4655
|
+
setTimeout(function() {
|
|
4656
|
+
roomsListTimer();
|
|
4657
|
+
}, 500);
|
|
4658
|
+
}
|
|
4659
|
+
//删除聊天室
|
|
4660
|
+
if (type == "1") {
|
|
4661
|
+
if (id == roomId) {
|
|
4662
|
+
// console.log(contactsList,888888);
|
|
4663
|
+
switchChatRoom(contactsList[0].roomId, "");
|
|
4664
|
+
}
|
|
4665
|
+
setContactsList(function(list) {
|
|
4666
|
+
var newList = list;
|
|
4667
|
+
newList = newList.filter(function(v) {
|
|
4668
|
+
return v.roomId != id;
|
|
4669
|
+
});
|
|
4670
|
+
return newList;
|
|
4671
|
+
});
|
|
4601
4672
|
}
|
|
4673
|
+
// if (type == "renew") {
|
|
4674
|
+
// getHistoryMessage(1, 3,id);
|
|
4675
|
+
// }else{
|
|
4676
|
+
// setRoomId(id);
|
|
4677
|
+
// }
|
|
4602
4678
|
};
|
|
4679
|
+
// const saveContactsList = (list: any)=>{
|
|
4680
|
+
// console.log(list,44444444)
|
|
4681
|
+
// // if(list != undefined){
|
|
4682
|
+
// // setRoomList(list);
|
|
4683
|
+
// // }
|
|
4684
|
+
// }
|
|
4603
4685
|
//渲染问答
|
|
4604
4686
|
var renderQuestion = function() {
|
|
4605
|
-
// 2023-12-01T14:34:07
|
|
4606
|
-
// console.log(lastId,'lastIdlastIdlastId')
|
|
4607
|
-
// console.log(mid, historyMessageList, "ddkfdscksdcs");
|
|
4608
4687
|
if (historyMessageList.length > 0) {
|
|
4609
4688
|
return /*#__PURE__*/ jsx("ul", {
|
|
4610
4689
|
className: styles.message_con,
|
|
@@ -4655,62 +4734,67 @@ var CustomerService = function(props) {
|
|
|
4655
4734
|
children: /*#__PURE__*/ jsxs("div", {
|
|
4656
4735
|
className: styles.main_content,
|
|
4657
4736
|
children: [
|
|
4658
|
-
/*#__PURE__*/
|
|
4659
|
-
className: styles.
|
|
4660
|
-
children:
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
/*#__PURE__*/
|
|
4664
|
-
className:
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4737
|
+
/*#__PURE__*/ jsxs("div", {
|
|
4738
|
+
className: styles.main_content_flag,
|
|
4739
|
+
children: [
|
|
4740
|
+
/*#__PURE__*/ jsx("div", {
|
|
4741
|
+
className: styles.operate_modal,
|
|
4742
|
+
children: /*#__PURE__*/ jsxs("p", {
|
|
4743
|
+
className: styles.operate,
|
|
4744
|
+
children: [
|
|
4745
|
+
/*#__PURE__*/ jsx("i", {
|
|
4746
|
+
className: "yinyong_quote1",
|
|
4747
|
+
onClick: function() {
|
|
4748
|
+
setCitationContent({
|
|
4749
|
+
content: item.message,
|
|
4750
|
+
id: item.id
|
|
4751
|
+
});
|
|
4752
|
+
resettingBottomHei();
|
|
4753
|
+
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
4754
|
+
},
|
|
4755
|
+
children: /*#__PURE__*/ jsx(CustomQuote$1, {})
|
|
4756
|
+
}),
|
|
4757
|
+
copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
|
|
4758
|
+
return list == item.id;
|
|
4759
|
+
}) ? /*#__PURE__*/ jsx("i", {
|
|
4760
|
+
className: "tongyong-xuanzhongdui",
|
|
4761
|
+
children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
|
|
4762
|
+
}) : /*#__PURE__*/ jsx("i", {
|
|
4763
|
+
className: "fuzhi21",
|
|
4764
|
+
onClick: function() {
|
|
4765
|
+
copyText(item.message);
|
|
4766
|
+
{
|
|
4767
|
+
var obj = copyTextOBJ;
|
|
4768
|
+
obj = obj.filter(function(list) {
|
|
4769
|
+
return list != item.id;
|
|
4770
|
+
});
|
|
4771
|
+
obj.push(item.id);
|
|
4772
|
+
setCopyTextObj(obj);
|
|
4773
|
+
}
|
|
4774
|
+
setTimeout(function() {
|
|
4775
|
+
var obj = copyTextOBJ;
|
|
4776
|
+
obj = obj.filter(function(list) {
|
|
4777
|
+
return list != item.id;
|
|
4778
|
+
});
|
|
4779
|
+
setCopyTextObj(obj);
|
|
4780
|
+
}, 3000);
|
|
4781
|
+
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
4782
|
+
},
|
|
4783
|
+
children: /*#__PURE__*/ jsx(CustomCopy$1, {})
|
|
4784
|
+
})
|
|
4785
|
+
]
|
|
4786
|
+
})
|
|
4787
|
+
}),
|
|
4788
|
+
/*#__PURE__*/ jsx("div", {
|
|
4789
|
+
className: styles.content,
|
|
4790
|
+
children: /*#__PURE__*/ jsx("p", {
|
|
4791
|
+
dangerouslySetInnerHTML: {
|
|
4792
|
+
__html: remarkable.render(message)
|
|
4700
4793
|
},
|
|
4701
|
-
|
|
4794
|
+
className: styles.content_child
|
|
4702
4795
|
})
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
}),
|
|
4706
|
-
/*#__PURE__*/ jsx("div", {
|
|
4707
|
-
className: styles.content,
|
|
4708
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
4709
|
-
dangerouslySetInnerHTML: {
|
|
4710
|
-
__html: remarkable.render(message)
|
|
4711
|
-
},
|
|
4712
|
-
className: styles.content_child
|
|
4713
|
-
})
|
|
4796
|
+
})
|
|
4797
|
+
]
|
|
4714
4798
|
}),
|
|
4715
4799
|
//引用消息
|
|
4716
4800
|
item.quotedMessage && /*#__PURE__*/ jsx("div", {
|
|
@@ -4749,14 +4833,17 @@ var CustomerService = function(props) {
|
|
|
4749
4833
|
} else {
|
|
4750
4834
|
//获取用户头像
|
|
4751
4835
|
var headImg = "";
|
|
4752
|
-
var chatWindow =
|
|
4836
|
+
var chatWindow = [];
|
|
4837
|
+
var isAiChatWindow;
|
|
4838
|
+
chatWindow = contactsList.filter(function(item) {
|
|
4753
4839
|
return item.roomId == roomId;
|
|
4754
4840
|
});
|
|
4755
4841
|
if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
|
|
4756
4842
|
headImg = chatWindow[0].headImg;
|
|
4757
4843
|
}
|
|
4844
|
+
// console.log(chatWindow,'chatWindowchatWindow')
|
|
4758
4845
|
//是否在智能客服窗口
|
|
4759
|
-
|
|
4846
|
+
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
4760
4847
|
var header = 2; //代表是ai头像
|
|
4761
4848
|
if (isAiChatWindow && item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
4762
4849
|
//使用AI头像
|
|
@@ -4788,34 +4875,39 @@ var CustomerService = function(props) {
|
|
|
4788
4875
|
children: /*#__PURE__*/ jsxs("div", {
|
|
4789
4876
|
className: styles.main_content,
|
|
4790
4877
|
children: [
|
|
4791
|
-
/*#__PURE__*/ jsx("div", {
|
|
4792
|
-
className: styles.operate_modal,
|
|
4793
|
-
children: // 不是最后一行,
|
|
4794
|
-
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
4795
|
-
}),
|
|
4796
4878
|
/*#__PURE__*/ jsxs("div", {
|
|
4797
|
-
className: styles.
|
|
4879
|
+
className: styles.main_content_flag,
|
|
4798
4880
|
children: [
|
|
4799
|
-
/*#__PURE__*/ jsx("
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
className: styles.content_child
|
|
4881
|
+
/*#__PURE__*/ jsx("div", {
|
|
4882
|
+
className: styles.operate_modal,
|
|
4883
|
+
children: // 不是最后一行,
|
|
4884
|
+
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
4804
4885
|
}),
|
|
4805
|
-
|
|
4806
|
-
className: styles.
|
|
4807
|
-
children:
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4886
|
+
/*#__PURE__*/ jsxs("div", {
|
|
4887
|
+
className: styles.content,
|
|
4888
|
+
children: [
|
|
4889
|
+
/*#__PURE__*/ jsx("p", {
|
|
4890
|
+
dangerouslySetInnerHTML: {
|
|
4891
|
+
__html: remarkable.render(message)
|
|
4811
4892
|
},
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4893
|
+
className: styles.content_child
|
|
4894
|
+
}),
|
|
4895
|
+
item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ jsx("ul", {
|
|
4896
|
+
className: styles.association_problem,
|
|
4897
|
+
children: JSON.parse(item.extraInfo).map(function(list, index) {
|
|
4898
|
+
return /*#__PURE__*/ jsxs("li", {
|
|
4899
|
+
onClick: function() {
|
|
4900
|
+
sendMessage(list, 1);
|
|
4901
|
+
},
|
|
4902
|
+
children: [
|
|
4903
|
+
index + 1,
|
|
4904
|
+
".",
|
|
4905
|
+
list.question
|
|
4906
|
+
]
|
|
4907
|
+
}, i + "_" + index + "_" + list.value);
|
|
4908
|
+
})
|
|
4909
|
+
})
|
|
4910
|
+
]
|
|
4819
4911
|
})
|
|
4820
4912
|
]
|
|
4821
4913
|
}),
|
|
@@ -4843,7 +4935,7 @@ var CustomerService = function(props) {
|
|
|
4843
4935
|
isAiChatWindow && item.findTeacher && userData.modules.some(function(item) {
|
|
4844
4936
|
return item.short == "TeacherAnswer";
|
|
4845
4937
|
}) ? /*#__PURE__*/ jsx("div", {
|
|
4846
|
-
className: "".concat(styles.operate_modal_bottom),
|
|
4938
|
+
className: "".concat(styles.operate_modal_bottom, " "),
|
|
4847
4939
|
children: /*#__PURE__*/ jsx("p", {
|
|
4848
4940
|
className: styles.stop_findTeacher,
|
|
4849
4941
|
children: /*#__PURE__*/ jsx("span", {
|
|
@@ -5041,6 +5133,9 @@ var CustomerService = function(props) {
|
|
|
5041
5133
|
}
|
|
5042
5134
|
return /*#__PURE__*/ jsxs("div", {
|
|
5043
5135
|
className: "".concat(styles.operate_modal_bottom),
|
|
5136
|
+
style: {
|
|
5137
|
+
position: showStopBtn ? "sticky" : "relative"
|
|
5138
|
+
},
|
|
5044
5139
|
children: [
|
|
5045
5140
|
/*#__PURE__*/ jsxs("p", {
|
|
5046
5141
|
className: styles.stop_generate,
|
|
@@ -5097,8 +5192,6 @@ var CustomerService = function(props) {
|
|
|
5097
5192
|
question: historyMessageList[i - 1].message,
|
|
5098
5193
|
user: problem.user
|
|
5099
5194
|
});
|
|
5100
|
-
console.log(item, "88888999999");
|
|
5101
|
-
// if(item.extraInfo == null){
|
|
5102
5195
|
setHistoryMessageList(function(historyMessageList) {
|
|
5103
5196
|
var newHistoryMessageList = historyMessageList.concat({
|
|
5104
5197
|
id: -1,
|
|
@@ -5117,30 +5210,6 @@ var CustomerService = function(props) {
|
|
|
5117
5210
|
});
|
|
5118
5211
|
return newHistoryMessageList;
|
|
5119
5212
|
});
|
|
5120
|
-
// }else{
|
|
5121
|
-
// setHistoryMessageList(
|
|
5122
|
-
// (historyMessageList) => {
|
|
5123
|
-
// let newHistoryMessageList =
|
|
5124
|
-
// historyMessageList.concat({
|
|
5125
|
-
// id: -1,
|
|
5126
|
-
// roomId: roomId,
|
|
5127
|
-
// sender: "AI",
|
|
5128
|
-
// recevier: mid,
|
|
5129
|
-
// message:
|
|
5130
|
-
// "请告诉我您要召唤的老师名字",
|
|
5131
|
-
// createdAt: getDataTime(-1),
|
|
5132
|
-
// findTeacher:true,
|
|
5133
|
-
// extraInfo: JSON.stringify([
|
|
5134
|
-
// {
|
|
5135
|
-
// key: "questionId",
|
|
5136
|
-
// value: "questionId",
|
|
5137
|
-
// },
|
|
5138
|
-
// ])
|
|
5139
|
-
// });
|
|
5140
|
-
// return newHistoryMessageList;
|
|
5141
|
-
// }
|
|
5142
|
-
// );
|
|
5143
|
-
// }
|
|
5144
5213
|
setTimeout(function() {
|
|
5145
5214
|
scrollToBottom();
|
|
5146
5215
|
}, 200);
|
|
@@ -5311,6 +5380,7 @@ var CustomerService = function(props) {
|
|
|
5311
5380
|
if (answerMode == 1) {
|
|
5312
5381
|
getTeacherList(String(e.target.value));
|
|
5313
5382
|
} else {
|
|
5383
|
+
var roomList = contactsList;
|
|
5314
5384
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
5315
5385
|
getQuestiionsList(String(e.target.value), 2);
|
|
5316
5386
|
}
|
|
@@ -5326,10 +5396,26 @@ var CustomerService = function(props) {
|
|
|
5326
5396
|
clearTimeout(timer.current);
|
|
5327
5397
|
setKeyWord("");
|
|
5328
5398
|
setCitationContent({});
|
|
5399
|
+
//查找是否是召唤老师回答并有相应的老师名称
|
|
5400
|
+
if (answerMode == 1 && teacherList.length > 0) {
|
|
5401
|
+
var list = teacherList.filter(function(v) {
|
|
5402
|
+
return v.name == keyWord.trim();
|
|
5403
|
+
});
|
|
5404
|
+
if (list.length > 0) {
|
|
5405
|
+
//直接进入召唤老师回答模式
|
|
5406
|
+
enterTeacherChat(list[0]);
|
|
5407
|
+
setButtomHei(45);
|
|
5408
|
+
return;
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
5329
5411
|
//跟老师对话
|
|
5412
|
+
var roomList = contactsList;
|
|
5330
5413
|
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
5331
5414
|
sendToTeacher(2);
|
|
5332
5415
|
} else {
|
|
5416
|
+
setAnswerMode(-1);
|
|
5417
|
+
setQuestionsList([]);
|
|
5418
|
+
setTeacherList([]);
|
|
5333
5419
|
sendMessage("", 0);
|
|
5334
5420
|
}
|
|
5335
5421
|
setButtomHei(45);
|
|
@@ -5412,8 +5498,21 @@ var CustomerService = function(props) {
|
|
|
5412
5498
|
setCitationContent({});
|
|
5413
5499
|
setButtomHei(45);
|
|
5414
5500
|
if (keyWord.trim() != "") {
|
|
5501
|
+
//查找是否是召唤老师回答并有相应的老师名称
|
|
5502
|
+
if (answerMode == 1 && teacherList.length > 0) {
|
|
5503
|
+
var list = teacherList.filter(function(v) {
|
|
5504
|
+
return v.name == keyWord.trim();
|
|
5505
|
+
});
|
|
5506
|
+
if (list.length > 0) {
|
|
5507
|
+
//直接进入召唤老师回答模式
|
|
5508
|
+
enterTeacherChat(list[0]);
|
|
5509
|
+
setButtomHei(45);
|
|
5510
|
+
return;
|
|
5511
|
+
}
|
|
5512
|
+
}
|
|
5415
5513
|
setKeyWord("");
|
|
5416
5514
|
//跟老师对话
|
|
5515
|
+
var roomList = contactsList;
|
|
5417
5516
|
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
5418
5517
|
sendToTeacher(2);
|
|
5419
5518
|
} else {
|
|
@@ -5428,6 +5527,34 @@ var CustomerService = function(props) {
|
|
|
5428
5527
|
]
|
|
5429
5528
|
});
|
|
5430
5529
|
};
|
|
5530
|
+
//进入与老师的聊天
|
|
5531
|
+
var enterTeacherChat = function(item) {
|
|
5532
|
+
setTeacherList([]);
|
|
5533
|
+
//提问的问题
|
|
5534
|
+
setProblem({
|
|
5535
|
+
question: problem.question,
|
|
5536
|
+
user: item.uid
|
|
5537
|
+
});
|
|
5538
|
+
setKeyWord("");
|
|
5539
|
+
//setUpdateRecords(true);
|
|
5540
|
+
setAnswerMode(-1);
|
|
5541
|
+
setChatWith(item);
|
|
5542
|
+
var roomList = contactsList;
|
|
5543
|
+
var list = roomList.filter(function(e) {
|
|
5544
|
+
return e.sender == item.uid;
|
|
5545
|
+
});
|
|
5546
|
+
setShowContacts(true);
|
|
5547
|
+
if (list.length > 0) {
|
|
5548
|
+
setRoomId(list[0].roomId); //已有聊天室
|
|
5549
|
+
} else {
|
|
5550
|
+
createRooms(item.uid).then(function(res) {
|
|
5551
|
+
// childRef.current.roomsListTimer();
|
|
5552
|
+
roomsListTimer();
|
|
5553
|
+
var id = res.data.id;
|
|
5554
|
+
setRoomId(id); //新的聊天室id
|
|
5555
|
+
});
|
|
5556
|
+
}
|
|
5557
|
+
};
|
|
5431
5558
|
//渲染联想问题及联想的老师名称
|
|
5432
5559
|
var renderAssociationProblem = function() {
|
|
5433
5560
|
if (answerMode == 1) {
|
|
@@ -5437,35 +5564,14 @@ var CustomerService = function(props) {
|
|
|
5437
5564
|
bottom: "".concat(buttomHei + 14, "px")
|
|
5438
5565
|
},
|
|
5439
5566
|
children: teacherList.map(function(item) {
|
|
5440
|
-
var span = item.name.replaceAll(keyWord, function() {
|
|
5441
|
-
return "<span class=".concat(styles.sign, ">").concat(
|
|
5567
|
+
var span = item.name.replaceAll(new RegExp(keyWord, "ig"), function(i) {
|
|
5568
|
+
return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
|
|
5442
5569
|
});
|
|
5443
5570
|
return /*#__PURE__*/ jsx("p", {
|
|
5444
5571
|
className: styles.item,
|
|
5445
5572
|
children: /*#__PURE__*/ jsx("span", {
|
|
5446
5573
|
onClick: function() {
|
|
5447
|
-
|
|
5448
|
-
//提问的问题
|
|
5449
|
-
setProblem({
|
|
5450
|
-
question: problem.question,
|
|
5451
|
-
user: item.uid
|
|
5452
|
-
});
|
|
5453
|
-
setKeyWord("");
|
|
5454
|
-
//setUpdateRecords(true);
|
|
5455
|
-
setAnswerMode(-1);
|
|
5456
|
-
setChatWith(item);
|
|
5457
|
-
var list = roomList.filter(function(e) {
|
|
5458
|
-
return e.sender == item.uid;
|
|
5459
|
-
});
|
|
5460
|
-
if (list.length > 0) {
|
|
5461
|
-
setRoomId(list[0].roomId); //已有聊天室
|
|
5462
|
-
} else {
|
|
5463
|
-
createRooms(item.uid).then(function(res) {
|
|
5464
|
-
childRef.current.roomsListTimer();
|
|
5465
|
-
var id = res.data.id;
|
|
5466
|
-
setRoomId(id); //新的聊天室id
|
|
5467
|
-
});
|
|
5468
|
-
}
|
|
5574
|
+
enterTeacherChat(item);
|
|
5469
5575
|
},
|
|
5470
5576
|
dangerouslySetInnerHTML: {
|
|
5471
5577
|
__html: span
|
|
@@ -5481,8 +5587,8 @@ var CustomerService = function(props) {
|
|
|
5481
5587
|
bottom: "".concat(buttomHei + 6, "px")
|
|
5482
5588
|
},
|
|
5483
5589
|
children: questionsList.map(function(item) {
|
|
5484
|
-
var span = item.question.replaceAll(keyWord, function() {
|
|
5485
|
-
return "<span class=".concat(styles.sign, ">").concat(
|
|
5590
|
+
var span = item.question.replaceAll(new RegExp(keyWord, "ig"), function(i) {
|
|
5591
|
+
return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
|
|
5486
5592
|
});
|
|
5487
5593
|
return /*#__PURE__*/ jsx("p", {
|
|
5488
5594
|
className: styles.item,
|
|
@@ -5513,20 +5619,22 @@ var CustomerService = function(props) {
|
|
|
5513
5619
|
getHistoryMessage(page, 1);
|
|
5514
5620
|
} else {
|
|
5515
5621
|
setRoomId(renewRoomId);
|
|
5516
|
-
if (childRef.current) {
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
}
|
|
5520
|
-
setTimeout(function() {
|
|
5521
|
-
childRef.current.roomsListTimer();
|
|
5522
|
-
}, 500);
|
|
5622
|
+
// if (childRef.current) {
|
|
5623
|
+
if (receiver != mid) {
|
|
5624
|
+
createRooms(receiver);
|
|
5523
5625
|
}
|
|
5626
|
+
setTimeout(function() {
|
|
5627
|
+
// childRef.current.roomsListTimer();
|
|
5628
|
+
roomsListTimer();
|
|
5629
|
+
}, 500);
|
|
5630
|
+
// }
|
|
5524
5631
|
}
|
|
5632
|
+
setShowContacts(true);
|
|
5525
5633
|
};
|
|
5526
5634
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
5527
5635
|
children: [
|
|
5528
5636
|
/*#__PURE__*/ jsxs(Drawer, {
|
|
5529
|
-
title: "
|
|
5637
|
+
title: "AI助手",
|
|
5530
5638
|
width: 560,
|
|
5531
5639
|
onClose: function() {
|
|
5532
5640
|
onCancel();
|
|
@@ -5551,9 +5659,9 @@ var CustomerService = function(props) {
|
|
|
5551
5659
|
onClose: function() {
|
|
5552
5660
|
setShowContacts(false);
|
|
5553
5661
|
},
|
|
5554
|
-
// roomIdAi={roomIdAi}
|
|
5555
5662
|
switchChatRoom: switchChatRoom,
|
|
5556
|
-
|
|
5663
|
+
// saveContactsList={saveContactsList}
|
|
5664
|
+
contactsList: contactsList,
|
|
5557
5665
|
ref: childRef
|
|
5558
5666
|
})
|
|
5559
5667
|
}),
|
|
@@ -5610,7 +5718,7 @@ var CustomerService = function(props) {
|
|
|
5610
5718
|
]
|
|
5611
5719
|
}),
|
|
5612
5720
|
/*#__PURE__*/ jsxs(Modal, {
|
|
5613
|
-
title: "
|
|
5721
|
+
title: "AI助手",
|
|
5614
5722
|
open: showType == 2 ? true : false,
|
|
5615
5723
|
onCancel: function() {
|
|
5616
5724
|
onCancel();
|
|
@@ -5649,7 +5757,8 @@ var CustomerService = function(props) {
|
|
|
5649
5757
|
setShowContacts(false);
|
|
5650
5758
|
},
|
|
5651
5759
|
switchChatRoom: switchChatRoom,
|
|
5652
|
-
|
|
5760
|
+
contactsList: contactsList,
|
|
5761
|
+
// saveContactsList={saveContactsList}
|
|
5653
5762
|
ref: childRef
|
|
5654
5763
|
}),
|
|
5655
5764
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -5705,13 +5814,7 @@ var CustomerService = function(props) {
|
|
|
5705
5814
|
/*#__PURE__*/ jsx("div", {
|
|
5706
5815
|
className: styles.user,
|
|
5707
5816
|
children: /*#__PURE__*/ jsx("p", {
|
|
5708
|
-
children:
|
|
5709
|
-
return e.roomId == roomId;
|
|
5710
|
-
}).length > 0 && roomList.filter(function(e) {
|
|
5711
|
-
return e.roomId == roomId;
|
|
5712
|
-
})[0].name != undefined ? roomList.filter(function(e) {
|
|
5713
|
-
return e.roomId == roomId;
|
|
5714
|
-
})[0].name : "智能问答"
|
|
5817
|
+
children: showChatRoomName()
|
|
5715
5818
|
})
|
|
5716
5819
|
}),
|
|
5717
5820
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -5732,7 +5835,7 @@ var CustomerService = function(props) {
|
|
|
5732
5835
|
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
5733
5836
|
setFirstLoad(false);
|
|
5734
5837
|
setShowType(4);
|
|
5735
|
-
|
|
5838
|
+
// childRef.current.roomsListTimer();
|
|
5736
5839
|
},
|
|
5737
5840
|
children: /*#__PURE__*/ jsx(CustomFullScreen$1, {})
|
|
5738
5841
|
}),
|
|
@@ -5800,8 +5903,9 @@ var CustomerService = function(props) {
|
|
|
5800
5903
|
onClose: function() {
|
|
5801
5904
|
setShowContacts(false);
|
|
5802
5905
|
},
|
|
5906
|
+
contactsList: contactsList,
|
|
5803
5907
|
switchChatRoom: switchChatRoom,
|
|
5804
|
-
|
|
5908
|
+
// saveContactsList={saveContactsList}
|
|
5805
5909
|
ref: childRef
|
|
5806
5910
|
})
|
|
5807
5911
|
})
|
|
@@ -5810,7 +5914,7 @@ var CustomerService = function(props) {
|
|
|
5810
5914
|
showType == 4 && /*#__PURE__*/ jsxs(Fragment, {
|
|
5811
5915
|
children: [
|
|
5812
5916
|
/*#__PURE__*/ jsxs(Modal, {
|
|
5813
|
-
title: "
|
|
5917
|
+
title: "AI助手",
|
|
5814
5918
|
open: true,
|
|
5815
5919
|
onCancel: function() {
|
|
5816
5920
|
onCancel();
|
|
@@ -5848,8 +5952,9 @@ var CustomerService = function(props) {
|
|
|
5848
5952
|
onClose: function() {
|
|
5849
5953
|
setShowContacts(false);
|
|
5850
5954
|
},
|
|
5955
|
+
contactsList: contactsList,
|
|
5851
5956
|
switchChatRoom: switchChatRoom,
|
|
5852
|
-
|
|
5957
|
+
// saveContactsList={saveContactsList}
|
|
5853
5958
|
ref: childRef
|
|
5854
5959
|
}),
|
|
5855
5960
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -5905,13 +6010,7 @@ var CustomerService = function(props) {
|
|
|
5905
6010
|
/*#__PURE__*/ jsx("div", {
|
|
5906
6011
|
className: styles.user,
|
|
5907
6012
|
children: /*#__PURE__*/ jsx("p", {
|
|
5908
|
-
children:
|
|
5909
|
-
return e.roomId == roomId;
|
|
5910
|
-
}).length > 0 && !roomList.filter(function(e) {
|
|
5911
|
-
return e.roomId == roomId;
|
|
5912
|
-
})[0].name ? roomList.filter(function(e) {
|
|
5913
|
-
return e.roomId == roomId;
|
|
5914
|
-
})[0].name : "智能问答"
|
|
6013
|
+
children: showChatRoomName()
|
|
5915
6014
|
})
|
|
5916
6015
|
}),
|
|
5917
6016
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -5930,7 +6029,7 @@ var CustomerService = function(props) {
|
|
|
5930
6029
|
onClick: function() {
|
|
5931
6030
|
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
5932
6031
|
setShowType(4);
|
|
5933
|
-
|
|
6032
|
+
// childRef.current.roomsListTimer();
|
|
5934
6033
|
},
|
|
5935
6034
|
children: /*#__PURE__*/ jsx(CustomFullScreen$1, {})
|
|
5936
6035
|
}),
|
|
@@ -5987,8 +6086,9 @@ var CustomerService = function(props) {
|
|
|
5987
6086
|
onClose: function() {
|
|
5988
6087
|
setShowContacts(false);
|
|
5989
6088
|
},
|
|
6089
|
+
contactsList: contactsList,
|
|
5990
6090
|
switchChatRoom: switchChatRoom,
|
|
5991
|
-
|
|
6091
|
+
// saveContactsList={saveContactsList}
|
|
5992
6092
|
ref: childRef
|
|
5993
6093
|
})
|
|
5994
6094
|
})
|