bhd-components 0.5.7 → 0.5.8
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/dist/5764783e.esm.es5.production.js +468 -0
- package/dist/{535fc6c5.esm.es5.development.js → f2b01b9c.esm.es5.development.js} +98068 -25721
- package/dist/index.esm.es5.development.css +8467 -0
- package/dist/index.esm.es5.development.js +5835 -0
- package/dist/index.esm.es5.production.css +1 -0
- package/dist/index.esm.es5.production.js +1 -0
- package/es2017/customerService/contactsList/index.d.ts +3 -2
- package/es2017/customerService/contactsList/index.js +93 -90
- package/es2017/customerService/contactsList/index.module.less +32 -13
- package/es2017/customerService/function.js +18 -13
- package/es2017/customerService/historyFun/index.d.ts +2 -1
- package/es2017/customerService/historyFun/index.js +121 -86
- package/es2017/customerService/historyFun/index.module.less +40 -6
- package/es2017/customerService/index.js +771 -577
- package/es2017/customerService/index.module.less +747 -684
- package/es2017/icons/components/custom-duihao.js +1 -1
- package/esm/customerService/contactsList/index.d.ts +3 -2
- package/esm/customerService/contactsList/index.js +104 -97
- package/esm/customerService/contactsList/index.module.less +32 -13
- package/esm/customerService/function.js +18 -13
- package/esm/customerService/historyFun/index.d.ts +2 -1
- package/esm/customerService/historyFun/index.js +127 -94
- package/esm/customerService/historyFun/index.module.less +40 -6
- package/esm/customerService/index.js +836 -619
- package/esm/customerService/index.module.less +747 -684
- package/esm/icons/components/custom-duihao.js +1 -1
- package/package.json +4 -3
- package/dist/1bddec89.esm.es5.production.js +0 -72
- package/dist/CustomerService.esm.es5.development.css +0 -2827
- package/dist/CustomerService.esm.es5.development.js +0 -3823
- package/dist/CustomerService.esm.es5.production.css +0 -1
- package/dist/CustomerService.esm.es5.production.js +0 -1
|
@@ -1,3823 +0,0 @@
|
|
|
1
|
-
import { j as jsx, _ as _object_spread_props, a as _object_spread, I as Icon, b as jsxs, c as _sliced_to_array, S as SearchOutlined, d as Input, C as CloseOutlined, z as zhCN, e as ConfigProvider, f as _extends, g as _object_destructuring_empty, h as StyleProvider, t as transform, i as _async_to_generator, k as __generator, R as Remarkable, D as Drawer, M as Modal, H as HighlightJS, l as dayjs, T as Tooltip } from './535fc6c5.esm.es5.development.js';
|
|
2
|
-
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import { render } from 'react-dom';
|
|
4
|
-
import { Fragment } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var modules_63b47c51$2 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__9ce9eb29","ChatWindow_Modal":"index_module_ChatWindow_Modal__9ce9eb29","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__9ce9eb29","header_wrap":"index_module_header_wrap__9ce9eb29","top":"index_module_top__9ce9eb29","user":"index_module_user__9ce9eb29","operate":"index_module_operate__9ce9eb29","line":"index_module_line__9ce9eb29","header_wrap_newlabo":"index_module_header_wrap_newlabo__9ce9eb29","Drawer_main":"index_module_Drawer_main__9ce9eb29","loading":"index_module_loading__9ce9eb29","message_con":"index_module_message_con__9ce9eb29","left":"index_module_left__9ce9eb29","head_sculpture":"index_module_head_sculpture__9ce9eb29","right":"index_module_right__9ce9eb29","main":"index_module_main__9ce9eb29","main_content":"index_module_main_content__9ce9eb29","operate_modal":"index_module_operate_modal__9ce9eb29","content":"index_module_content__9ce9eb29","content_child":"index_module_content_child__9ce9eb29","active":"index_module_active__9ce9eb29","ask_question":"index_module_ask_question__9ce9eb29","operate_modal_bottom":"index_module_operate_modal_bottom__9ce9eb29","stop_generate":"index_module_stop_generate__9ce9eb29","stop_findTeacher":"index_module_stop_findTeacher__9ce9eb29","association_problem":"index_module_association_problem__9ce9eb29","time":"index_module_time__9ce9eb29","citation_content":"index_module_citation_content__9ce9eb29","popover_content":"index_module_popover_content__9ce9eb29","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__9ce9eb29","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__9ce9eb29","issues_list_teacherList":"index_module_issues_list_teacherList__9ce9eb29","item":"index_module_item__9ce9eb29","issues_list":"index_module_issues_list__9ce9eb29","sign":"index_module_sign__9ce9eb29","Drawer_buttom":"index_module_Drawer_buttom__9ce9eb29","input_wrap":"index_module_input_wrap__9ce9eb29","input":"index_module_input__9ce9eb29","no_AI":"index_module_no_AI__9ce9eb29","voice":"index_module_voice__9ce9eb29","voice_btn":"index_module_voice_btn__9ce9eb29","content_main":"index_module_content_main__9ce9eb29","content_con":"index_module_content_con__9ce9eb29","delete_quote":"index_module_delete_quote__9ce9eb29","sending":"index_module_sending__9ce9eb29","disabled":"index_module_disabled__9ce9eb29","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__9ce9eb29","main_list":"index_module_main_list__9ce9eb29","chat_content":"index_module_chat_content__9ce9eb29","popover_main_content":"index_module_popover_main_content__9ce9eb29"};
|
|
7
|
-
|
|
8
|
-
var CustomCloseSvg = function() {
|
|
9
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
10
|
-
className: "icon",
|
|
11
|
-
viewBox: "0 0 1024 1024",
|
|
12
|
-
version: "1.1",
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
-
"p-id": "8340",
|
|
15
|
-
width: "1em",
|
|
16
|
-
height: "1em",
|
|
17
|
-
fill: "currentColor",
|
|
18
|
-
"aria-hidden": "true",
|
|
19
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
20
|
-
d: "M21.41203 22.311627a73.0786 73.0786 0 0 1 103.33314 0L511.550201 409.116658 898.355232 22.311627a73.0786 73.0786 0 1 1 103.333141 103.333141L614.883342 512.449799l386.805031 386.805031a73.0786 73.0786 0 0 1-103.333141 103.33314L511.550201 615.782939l-386.805031 386.805031a73.0786 73.0786 0 0 1-103.33314-103.33314L408.217061 512.449799 21.41203 125.644768a73.0786 73.0786 0 0 1 0-103.333141z",
|
|
21
|
-
"p-id": "8341"
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var CustomClose = function(props) {
|
|
26
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
27
|
-
component: CustomCloseSvg
|
|
28
|
-
}));
|
|
29
|
-
};
|
|
30
|
-
var CustomClose$1 = CustomClose;
|
|
31
|
-
|
|
32
|
-
var CustomRecordSvg = function() {
|
|
33
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
34
|
-
width: "1em",
|
|
35
|
-
height: "1em",
|
|
36
|
-
viewBox: "0 0 16 16",
|
|
37
|
-
"shape-rendering": "geometricPrecision",
|
|
38
|
-
fill: "currentColor",
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ jsx("g", {
|
|
42
|
-
"clip-path": "url(#clip0_518_8403)",
|
|
43
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
44
|
-
d: "M8 14.6667C11.682 14.6667 14.6667 11.682 14.6667 8C14.6667 4.318 11.682 1.33333 8 1.33333C4.318 1.33333 1.33333 4.318 1.33333 8C1.33333 11.682 4.318 14.6667 8 14.6667ZM8 16C3.582 16 0 12.418 0 8C0 3.582 3.582 0 8 0C12.418 0 16 3.582 16 8C16 12.418 12.418 16 8 16ZM8.66667 8.39267V4.66467C8.66667 4.302 8.368 4 8 4C7.62933 4 7.33333 4.29733 7.33333 4.66467V8.66867C7.33277 8.75518 7.34933 8.84096 7.38205 8.92105C7.41477 9.00114 7.46302 9.07396 7.524 9.13533L9.41867 11.03C9.48048 11.0914 9.55381 11.1401 9.63446 11.1731C9.71511 11.2061 9.80149 11.2229 9.88864 11.2225C9.97578 11.222 10.062 11.2044 10.1423 11.1706C10.2226 11.1367 10.2955 11.0874 10.3567 11.0253C10.4808 10.9011 10.551 10.7329 10.5519 10.5573C10.5527 10.3817 10.4843 10.2128 10.3613 10.0873L8.66667 8.39267Z"
|
|
45
|
-
})
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ jsx("defs", {
|
|
48
|
-
children: /*#__PURE__*/ jsx("clipPath", {
|
|
49
|
-
id: "clip0_518_8403",
|
|
50
|
-
children: /*#__PURE__*/ jsx("rect", {
|
|
51
|
-
width: "1em",
|
|
52
|
-
height: "1em",
|
|
53
|
-
fill: "white"
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
var CustomRecord = function(props) {
|
|
61
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
62
|
-
component: CustomRecordSvg
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
var CustomRecord$1 = CustomRecord;
|
|
66
|
-
|
|
67
|
-
var CustomFullScreenSvg = function() {
|
|
68
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
69
|
-
width: "1em",
|
|
70
|
-
height: "1em",
|
|
71
|
-
"shape-rendering": "geometricPrecision",
|
|
72
|
-
fill: "currentColor",
|
|
73
|
-
viewBox: "0 0 14 14",
|
|
74
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
75
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
76
|
-
d: "M10.2 2.79995C10.2 2.46858 10.4686 2.19995 10.8 2.19995L13.2 2.19995C13.5313 2.19995 13.8 2.46858 13.8 2.79995V5.19995C13.8 5.53132 13.5313 5.79995 13.2 5.79995C12.8686 5.79995 12.6 5.53132 12.6 5.19995V4.24848L10.4242 6.42422C10.1899 6.65853 9.81 6.65853 9.57569 6.42422C9.34137 6.1899 9.34137 5.81 9.57569 5.57569L11.7514 3.39995H10.8C10.4686 3.39995 10.2 3.13132 10.2 2.79995ZM2.19995 2.79995C2.19995 2.46858 2.46858 2.19995 2.79995 2.19995H5.19995C5.53132 2.19995 5.79995 2.46858 5.79995 2.79995C5.79995 3.13132 5.53132 3.39995 5.19995 3.39995H4.24848L6.42422 5.57569C6.65853 5.81 6.65853 6.1899 6.42422 6.42422C6.1899 6.65853 5.81 6.65853 5.57569 6.42422L3.39995 4.24848V5.19995C3.39995 5.53132 3.13132 5.79995 2.79995 5.79995C2.46858 5.79995 2.19995 5.53132 2.19995 5.19995V2.79995ZM6.42422 9.57569C6.65853 9.81 6.65853 10.1899 6.42422 10.4242L4.24848 12.6H5.19995C5.53132 12.6 5.79995 12.8686 5.79995 13.2C5.79995 13.5313 5.53132 13.8 5.19995 13.8H2.79995C2.64082 13.8 2.48821 13.7367 2.37569 13.6242C2.26317 13.5117 2.19995 13.3591 2.19995 13.2L2.19995 10.8C2.19995 10.4686 2.46858 10.2 2.79995 10.2C3.13132 10.2 3.39995 10.4686 3.39995 10.8L3.39995 11.7514L5.57569 9.57569C5.81 9.34137 6.1899 9.34137 6.42422 9.57569ZM9.57569 9.57569C9.81 9.34137 10.1899 9.34137 10.4242 9.57569L12.6 11.7514V10.8C12.6 10.4686 12.8686 10.2 13.2 10.2C13.5313 10.2 13.8 10.4686 13.8 10.8V13.2C13.8 13.5313 13.5313 13.8 13.2 13.8H10.8C10.4686 13.8 10.2 13.5313 10.2 13.2C10.2 12.8686 10.4686 12.6 10.8 12.6H11.7514L9.57569 10.4242C9.34137 10.1899 9.34137 9.81 9.57569 9.57569Z"
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
var CustomFullScreen = function(props) {
|
|
81
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
82
|
-
component: CustomFullScreenSvg
|
|
83
|
-
}));
|
|
84
|
-
};
|
|
85
|
-
var CustomFullScreen$1 = CustomFullScreen;
|
|
86
|
-
|
|
87
|
-
var CustomExitFullScreenSvg = function() {
|
|
88
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
89
|
-
className: "icon",
|
|
90
|
-
width: "1em",
|
|
91
|
-
height: "1em",
|
|
92
|
-
"shape-rendering": "geometricPrecision",
|
|
93
|
-
fill: "currentColor",
|
|
94
|
-
viewBox: "0 0 14 14",
|
|
95
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
96
|
-
version: "1.1",
|
|
97
|
-
"p-id": "8340",
|
|
98
|
-
"aria-hidden": "true",
|
|
99
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
100
|
-
d: "M2.37575 2.37575C2.61006 2.14143 2.98996 2.14143 3.22428 2.37575L5.40001 4.55148V3.60001C5.40001 3.26864 5.66864 3.00001 6.00001 3.00001C6.33138 3.00001 6.60001 3.26864 6.60001 3.60001V6.00001C6.60001 6.33138 6.33138 6.60001 6.00001 6.60001H3.60001C3.26864 6.60001 3.00001 6.33138 3.00001 6.00001C3.00001 5.66864 3.26864 5.40001 3.60001 5.40001H4.55148L2.37575 3.22428C2.14143 2.98996 2.14143 2.61006 2.37575 2.37575ZM13.6243 2.37575C13.8586 2.61006 13.8586 2.98996 13.6243 3.22428L11.4485 5.40001H12.4C12.7314 5.40001 13 5.66864 13 6.00001C13 6.33138 12.7314 6.60001 12.4 6.60001H10C9.66864 6.60001 9.40001 6.33138 9.40001 6.00001V3.60001C9.40001 3.26864 9.66864 3.00001 10 3.00001C10.3314 3.00001 10.6 3.26864 10.6 3.60001V4.55148L12.7757 2.37575C13.0101 2.14143 13.39 2.14143 13.6243 2.37575ZM3.60001 10.6C3.26864 10.6 3.00001 10.3314 3.00001 10C3.00001 9.66864 3.26864 9.40001 3.60001 9.40001H6.00001C6.33138 9.40001 6.60001 9.66864 6.60001 10V12.4C6.60001 12.7314 6.33138 13 6.00001 13C5.66864 13 5.40001 12.7314 5.40001 12.4V11.4485L3.22428 13.6243C2.98996 13.8586 2.61006 13.8586 2.37575 13.6243C2.14143 13.39 2.14143 13.0101 2.37575 12.7757L4.55148 10.6H3.60001ZM9.40001 10C9.40001 9.66864 9.66864 9.40001 10 9.40001H12.4C12.7314 9.40001 13 9.66864 13 10C13 10.3314 12.7314 10.6 12.4 10.6H11.4485L13.6243 12.7757C13.8586 13.0101 13.8586 13.39 13.6243 13.6243C13.39 13.8586 13.0101 13.8586 12.7757 13.6243L10.6 11.4485V12.4C10.6 12.7314 10.3314 13 10 13C9.66864 13 9.40001 12.7314 9.40001 12.4V10Z"
|
|
101
|
-
})
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
var CustomExitFullScreen = function(props) {
|
|
105
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
106
|
-
component: CustomExitFullScreenSvg
|
|
107
|
-
}));
|
|
108
|
-
};
|
|
109
|
-
var CustomExitFullScreen$1 = CustomExitFullScreen;
|
|
110
|
-
|
|
111
|
-
var CustomReloadingSvg = function() {
|
|
112
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
113
|
-
className: "icon",
|
|
114
|
-
viewBox: "0 0 14 14",
|
|
115
|
-
version: "1.1",
|
|
116
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
-
"p-id": "8340",
|
|
118
|
-
width: "1em",
|
|
119
|
-
height: "1em",
|
|
120
|
-
fill: "currentColor",
|
|
121
|
-
"shape-rendering": "geometricPrecision",
|
|
122
|
-
"aria-hidden": "true",
|
|
123
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
124
|
-
d: "M8 3.80001C7.27938 3.80001 6.60141 3.97512 6.00464 4.2846C5.71048 4.43715 5.34834 4.32235 5.19579 4.02818C5.04324 3.73401 5.15804 3.37187 5.4522 3.21932C6.21563 2.82342 7.0826 2.60001 8 2.60001C11.0603 2.60001 13.5412 5.08088 13.5412 8.14118C13.5412 8.40936 13.5221 8.67343 13.4851 8.93202C13.4737 9.01141 13.4607 9.09026 13.446 9.16853L13.7175 9.02364C14.0098 8.86759 14.3733 8.97808 14.5293 9.27041C14.6854 9.56274 14.5749 9.92622 14.2825 10.0823L12.6718 10.9421C12.3819 11.0968 12.0215 10.9896 11.8633 10.7016L11.0035 9.13588C10.844 8.84542 10.9501 8.48065 11.2406 8.32115C11.5311 8.16164 11.8958 8.2678 12.0553 8.55825L12.2672 8.94405C12.2784 8.88383 12.2885 8.82318 12.2972 8.76211C12.3261 8.55962 12.3412 8.35233 12.3412 8.14118C12.3412 5.74362 10.3976 3.80001 8 3.80001ZM3.32824 5.34029C3.61811 5.18556 3.97853 5.29278 4.13669 5.58079L4.99651 7.14649C5.15601 7.43694 5.04986 7.80171 4.7594 7.96122C4.46895 8.12072 4.10418 8.01457 3.94467 7.72411L3.73281 7.33832C3.72156 7.39853 3.71155 7.45919 3.70282 7.52026C3.67386 7.72275 3.65883 7.93003 3.65883 8.14118C3.65883 10.5387 5.60244 12.4824 8 12.4824C8.72063 12.4824 9.39859 12.3072 9.99536 11.9978C10.2895 11.8452 10.6517 11.96 10.8042 12.2542C10.9568 12.5484 10.842 12.9105 10.5478 13.063C9.78437 13.4589 8.9174 13.6824 8 13.6824C4.93969 13.6824 2.45883 11.2015 2.45883 8.14118C2.45883 7.87301 2.47792 7.60894 2.51491 7.35034C2.52627 7.27095 2.5393 7.19211 2.55399 7.11384L2.28254 7.25873C1.99021 7.41477 1.62673 7.30429 1.47069 7.01196C1.31465 6.71963 1.42513 6.35615 1.71746 6.20011L3.32824 5.34029Z"
|
|
125
|
-
})
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
var CustomReloading = function(props) {
|
|
129
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
130
|
-
component: CustomReloadingSvg
|
|
131
|
-
}));
|
|
132
|
-
};
|
|
133
|
-
var CustomReloading$1 = CustomReloading;
|
|
134
|
-
|
|
135
|
-
var CustomCopySvg = function() {
|
|
136
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
137
|
-
width: "1em",
|
|
138
|
-
height: "1em",
|
|
139
|
-
viewBox: "0 0 14 14",
|
|
140
|
-
"shape-rendering": "geometricPrecision",
|
|
141
|
-
fill: "currentColor",
|
|
142
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
143
|
-
children: [
|
|
144
|
-
/*#__PURE__*/ jsx("g", {
|
|
145
|
-
"clip-path": "url(#clip0_518_8403)",
|
|
146
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
147
|
-
d: "M6.16666 1.66666H13.1667C13.4761 1.66666 13.7728 1.78957 13.9916 2.00837C14.2104 2.22716 14.3333 2.5239 14.3333 2.83332V9.83332C14.3333 10.1427 14.2104 10.4395 13.9916 10.6583C13.7728 10.8771 13.4761 11 13.1667 11H6.16666C5.85724 11 5.5605 10.8771 5.34171 10.6583C5.12291 10.4395 5 10.1427 5 9.83332V2.83332C5 2.5239 5.12291 2.22716 5.34171 2.00837C5.5605 1.78957 5.85724 1.66666 6.16666 1.66666ZM6.16666 2.66666C6.12246 2.66666 6.08007 2.68422 6.04881 2.71547C6.01756 2.74673 6 2.78912 6 2.83332V9.83332C6 9.85521 6.00431 9.87688 6.01268 9.8971C6.02106 9.91732 6.03334 9.9357 6.04881 9.95117C6.06429 9.96665 6.08266 9.97893 6.10288 9.9873C6.1231 9.99568 6.14478 9.99999 6.16666 9.99999H13.1667C13.2109 9.99999 13.2533 9.98243 13.2845 9.95117C13.3158 9.91992 13.3333 9.87753 13.3333 9.83332V2.83332C13.3333 2.78912 13.3158 2.74673 13.2845 2.71547C13.2533 2.68422 13.2109 2.66666 13.1667 2.66666H6.16666ZM10 12C10 11.8674 10.0527 11.7402 10.1464 11.6464C10.2402 11.5527 10.3674 11.5 10.5 11.5C10.6326 11.5 10.7598 11.5527 10.8536 11.6464C10.9473 11.7402 11 11.8674 11 12V13.1667C11 13.4761 10.8771 13.7728 10.6583 13.9916C10.4395 14.2104 10.1427 14.3333 9.83333 14.3333H2.83333C2.52391 14.3333 2.22717 14.2104 2.00837 13.9916C1.78958 13.7728 1.66666 13.4761 1.66666 13.1667V6.16666C1.66666 5.85724 1.78958 5.56049 2.00837 5.3417C2.22717 5.12291 2.52391 4.99999 2.83333 4.99999H4C4.13261 4.99999 4.25978 5.05267 4.35355 5.14644C4.44732 5.2402 4.5 5.36738 4.5 5.49999C4.5 5.6326 4.44732 5.75978 4.35355 5.85354C4.25978 5.94731 4.13261 5.99999 4 5.99999H2.83333C2.78913 5.99999 2.74674 6.01755 2.71548 6.04881C2.68422 6.08006 2.66666 6.12245 2.66666 6.16666V13.1667C2.66666 13.2109 2.68422 13.2533 2.71548 13.2845C2.74674 13.3158 2.78913 13.3333 2.83333 13.3333H9.83333C9.87753 13.3333 9.91993 13.3158 9.95118 13.2845C9.98244 13.2533 10 13.2109 10 13.1667V12Z"
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
/*#__PURE__*/ jsx("defs", {
|
|
151
|
-
children: /*#__PURE__*/ jsx("clipPath", {
|
|
152
|
-
id: "clip0_518_8403",
|
|
153
|
-
children: /*#__PURE__*/ jsx("rect", {
|
|
154
|
-
width: "16",
|
|
155
|
-
height: "16"
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
]
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
var CustomCopy = function(props) {
|
|
163
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
164
|
-
component: CustomCopySvg
|
|
165
|
-
}));
|
|
166
|
-
};
|
|
167
|
-
var CustomCopy$1 = CustomCopy;
|
|
168
|
-
|
|
169
|
-
var CustomLikeSvg = function() {
|
|
170
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
171
|
-
width: "1em",
|
|
172
|
-
height: "1em",
|
|
173
|
-
viewBox: "0 0 16 16",
|
|
174
|
-
"shape-rendering": "geometricPrecision",
|
|
175
|
-
fill: "currentColor",
|
|
176
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
177
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
178
|
-
d: "M14.9948 7.82355C14.999 7.88679 14.9948 7.95002 14.978 8.01326L13.7172 13.4046C13.7003 13.4699 13.6709 13.527 13.633 13.58C13.4983 13.8411 13.292 14.0716 13.0205 14.2409C12.7321 14.4184 12.4122 14.5 12.0944 14.5V14.4959L4.00144 14.4918C3.97408 14.4959 3.94461 14.498 3.91514 14.498C3.88568 14.498 3.85621 14.4959 3.82885 14.4918H1.67564C1.64617 14.4959 1.6146 14.5 1.58303 14.5C1.26099 14.5 1 14.2471 1 13.935L1.00631 7.1504C1.00631 6.8383 1.26731 6.58536 1.58934 6.58536C1.6125 6.58536 1.63775 6.5874 1.66091 6.58944L3.59522 6.58536V6.57516C5.37587 6.45073 6.78609 5.03711 6.8366 3.29303C6.83239 3.24408 6.82818 3.19512 6.82818 3.14412C6.82818 2.23639 7.58802 1.5 8.52465 1.5C9.32868 1.5 10.0022 2.04464 10.1769 2.77287L10.1853 2.77083C10.2801 3.18696 10.3327 3.61941 10.3327 4.06206C10.3327 4.74745 10.2127 5.40428 9.99169 6.0142L13.2457 6.01828C13.2752 6.01828 13.3046 6.02032 13.3341 6.02644C13.8898 6.04684 14.4244 6.32426 14.7401 6.8179C14.9422 7.13204 15.0222 7.4829 14.9948 7.82355ZM2.16816 13.3618H3.33422L3.33843 7.71544L2.17448 7.71748L2.16816 13.3618ZM13.7572 7.40946C13.6456 7.23403 13.4478 7.14224 13.2478 7.15244V7.1504H13.2457L9.13294 7.14632C8.8109 7.14632 8.54991 6.89338 8.54991 6.58128C8.54991 6.49153 8.57306 6.40585 8.61095 6.33038L8.60463 6.3263C8.83827 5.90609 9.00665 5.44712 9.10347 4.96367H9.10979C9.10979 4.96367 9.18766 4.6577 9.18556 4.0743C9.18556 3.61125 9.09716 3.18696 9.09716 3.18696H9.09295C9.09295 3.1788 9.09505 3.17064 9.09505 3.16248C9.09505 2.87078 8.85089 2.63416 8.54991 2.63416C8.24892 2.63416 8.00477 2.87078 8.00477 3.16248C8.00477 3.17472 8.00687 3.18696 8.00687 3.1992H7.99845C7.99845 3.1992 8.00687 3.63981 7.91636 4.09878C7.87848 4.29256 7.82375 4.47411 7.77324 4.6169C7.77324 4.6169 7.77113 4.6169 7.77113 4.61486C7.28072 6.06928 6.0473 7.19528 4.50449 7.57673L4.49817 13.3638L12.0965 13.3658C12.1217 13.3658 12.147 13.3679 12.1723 13.372C12.248 13.3618 12.3238 13.3373 12.3912 13.2944C12.488 13.2353 12.5595 13.1496 12.6016 13.0517H12.6037L13.8161 7.86231L13.8119 7.86027C13.8624 7.71544 13.8477 7.55021 13.7572 7.40946Z"
|
|
179
|
-
})
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
var CustomLike = function(props) {
|
|
183
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
184
|
-
component: CustomLikeSvg
|
|
185
|
-
}));
|
|
186
|
-
};
|
|
187
|
-
var CustomLike$1 = CustomLike;
|
|
188
|
-
|
|
189
|
-
var CustomDislikeSvg = function() {
|
|
190
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
191
|
-
width: "1em",
|
|
192
|
-
height: "1em",
|
|
193
|
-
"shape-rendering": "geometricPrecision",
|
|
194
|
-
fill: "currentColor",
|
|
195
|
-
viewBox: "0 0 16 16",
|
|
196
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
197
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
198
|
-
d: "M1.0052 8.17645C1.00099 8.11321 1.0052 8.04998 1.02204 7.98674L2.28281 2.5954C2.29965 2.53013 2.32912 2.47301 2.36701 2.41998C2.50171 2.15887 2.70798 1.92837 2.9795 1.75906C3.26786 1.58159 3.58779 1.5 3.90561 1.5V1.50408L11.9986 1.50816C12.0259 1.50408 12.0554 1.50204 12.0849 1.50204C12.1143 1.50204 12.1438 1.50408 12.1712 1.50816H14.3244C14.3538 1.50408 14.3854 1.5 14.417 1.5C14.739 1.5 15 1.75294 15 2.06504L14.9937 8.8496C14.9937 9.1617 14.7327 9.41464 14.4107 9.41464C14.3875 9.41464 14.3622 9.4126 14.3391 9.41056L12.4048 9.41464V9.42484C10.6241 9.54927 9.21391 10.9629 9.1634 12.707C9.16761 12.7559 9.17182 12.8049 9.17182 12.8559C9.17182 13.7636 8.41198 14.5 7.47535 14.5C6.67132 14.5 5.99778 13.9554 5.82308 13.2271L5.81466 13.2292C5.71995 12.813 5.66733 12.3806 5.66733 11.9379C5.66733 11.2526 5.7873 10.5957 6.00831 9.9858L2.75429 9.98172C2.72482 9.98172 2.69535 9.97968 2.66589 9.97356C2.11022 9.95316 1.5756 9.67574 1.25988 9.1821C1.05782 8.86796 0.977839 8.5171 1.0052 8.17645ZM13.8318 2.63824H12.6658L12.6616 8.28456L13.8255 8.28252L13.8318 2.63824ZM2.24282 8.59054C2.35438 8.76597 2.55223 8.85776 2.75218 8.84756V8.8496H2.75429L6.86706 8.85368C7.1891 8.85368 7.45009 9.10662 7.45009 9.41872C7.45009 9.50847 7.42694 9.59415 7.38905 9.66962L7.39537 9.6737C7.16173 10.0939 6.99335 10.5529 6.89653 11.0363H6.89021C6.89021 11.0363 6.81234 11.3423 6.81444 11.9257C6.81444 12.3887 6.90284 12.813 6.90284 12.813H6.90705C6.90705 12.8212 6.90495 12.8294 6.90495 12.8375C6.90495 13.1292 7.14911 13.3658 7.45009 13.3658C7.75108 13.3658 7.99523 13.1292 7.99523 12.8375C7.99523 12.8253 7.99313 12.813 7.99313 12.8008H8.00155C8.00155 12.8008 7.99313 12.3602 8.08364 11.9012C8.12152 11.7074 8.17625 11.5259 8.22676 11.3831C8.22676 11.3831 8.22887 11.3831 8.22887 11.3851C8.71928 9.93072 9.9527 8.80472 11.4955 8.42327L11.5018 2.6362L3.90351 2.63416C3.87825 2.63416 3.85299 2.63212 3.82773 2.62804C3.75196 2.63824 3.67619 2.66272 3.60884 2.70555C3.51201 2.76471 3.44045 2.85038 3.39836 2.9483H3.39625L2.18389 8.13769L2.1881 8.13973C2.13758 8.28456 2.15232 8.44979 2.24282 8.59054Z"
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
var CustomDislike = function(props) {
|
|
203
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
204
|
-
component: CustomDislikeSvg
|
|
205
|
-
}));
|
|
206
|
-
};
|
|
207
|
-
var CustomDislike$1 = CustomDislike;
|
|
208
|
-
|
|
209
|
-
var CustomQuoteSvg = function() {
|
|
210
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
211
|
-
width: "1em",
|
|
212
|
-
height: "1em",
|
|
213
|
-
"shape-rendering": "geometricPrecision",
|
|
214
|
-
fill: "currentColor",
|
|
215
|
-
viewBox: "0 0 14 14",
|
|
216
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
217
|
-
children: [
|
|
218
|
-
/*#__PURE__*/ jsx("path", {
|
|
219
|
-
"fill-rule": "evenodd",
|
|
220
|
-
"clip-rule": "evenodd",
|
|
221
|
-
d: "M6.28443 3.03861C3.77423 4.65069 2.37971 6.52702 2.10085 8.66759C1.66674 12 4.6468 13.6311 6.15677 12.1655C7.66673 10.7 6.7616 8.83982 5.66823 8.33136C4.57487 7.82286 3.90623 7.99996 4.02287 7.32046C4.1395 6.64099 5.69503 4.75706 7.06163 3.87969C7.1523 3.80259 7.1868 3.65299 7.0995 3.53949C7.04207 3.46486 6.92943 3.31847 6.7616 3.10033C6.61483 2.90957 6.47423 2.91671 6.28443 3.03861Z"
|
|
222
|
-
}),
|
|
223
|
-
/*#__PURE__*/ jsx("path", {
|
|
224
|
-
"fill-rule": "evenodd",
|
|
225
|
-
"clip-rule": "evenodd",
|
|
226
|
-
d: "M12.893 3.03861C10.3828 4.65069 8.98827 6.52702 8.7094 8.66759C8.2753 12 11.2554 13.6311 12.7653 12.1655C14.2753 10.7 13.3702 8.83982 12.2768 8.33136C11.1834 7.82286 10.5148 7.99996 10.6314 7.32046C10.7481 6.64099 12.3036 4.75706 13.6702 3.87969C13.7609 3.80259 13.7954 3.65299 13.708 3.53949C13.6506 3.46486 13.538 3.31847 13.3702 3.10033C13.2234 2.90957 13.0828 2.91671 12.893 3.03861Z"
|
|
227
|
-
})
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
var CustomQuote = function(props) {
|
|
232
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
233
|
-
component: CustomQuoteSvg
|
|
234
|
-
}));
|
|
235
|
-
};
|
|
236
|
-
var CustomQuote$1 = CustomQuote;
|
|
237
|
-
|
|
238
|
-
var CustomSendingSvg = function() {
|
|
239
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
240
|
-
width: "1em",
|
|
241
|
-
height: "1em",
|
|
242
|
-
"shape-rendering": "geometricPrecision",
|
|
243
|
-
fill: "currentColor",
|
|
244
|
-
viewBox: "0 0 20 21",
|
|
245
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
246
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
247
|
-
d: "M18.0403 2.308C17.7369 2.15628 17.4335 2.15628 17.2818 2.308L2.1114 9.89316C1.808 9.89316 1.65628 10.1966 1.65628 10.5C1.65628 10.8034 1.808 11.1068 1.9597 11.1068L5.60058 13.3824C5.904 13.5341 6.20741 13.5341 6.51081 13.2307L14.5511 5.94888L14.8545 6.10058L7.57273 13.8375C7.42103 13.9892 7.42103 14.1409 7.42103 14.2926V17.6301C7.42103 17.9335 7.57273 18.2369 7.87614 18.3886C8.17954 18.5403 8.48296 18.3886 8.63466 18.2369L10.4551 16.4164L14.096 18.8437C14.2477 18.9954 14.3994 18.9954 14.5511 18.9954H14.8545C15.1579 18.8437 15.3096 18.692 15.3096 18.3886L18.3437 3.21822C18.3437 2.7631 18.3437 2.4597 18.0403 2.308Z"
|
|
248
|
-
})
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
var CustomSending = function(props) {
|
|
252
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
253
|
-
component: CustomSendingSvg
|
|
254
|
-
}));
|
|
255
|
-
};
|
|
256
|
-
var CustomSending$1 = CustomSending;
|
|
257
|
-
|
|
258
|
-
var CustomSoundRecordingSvg = function() {
|
|
259
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
260
|
-
width: "1em",
|
|
261
|
-
height: "1em",
|
|
262
|
-
viewBox: "0 0 13.33 19.56",
|
|
263
|
-
"shape-rendering": "geometricPrecision",
|
|
264
|
-
fill: "currentColor",
|
|
265
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
266
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
267
|
-
d: "M10.6 18V18.8H9.4V18H10.6ZM10.6 16.4V17.6H9.4V16.4H10.6ZM15.4 7.79995C15.4788 7.79995 15.5568 7.81547 15.6296 7.84562C15.7024 7.87578 15.7685 7.91997 15.8243 7.97569C15.88 8.0314 15.9242 8.09755 15.9543 8.17034C15.9845 8.24314 16 8.32116 16 8.39995C16 11.6104 13.636 14.258 10.6 14.5692V16H9.4V14.5696C6.364 14.2584 4 11.6108 4 8.39995C4 8.24082 4.06321 8.08821 4.17574 7.97569C4.28826 7.86316 4.44087 7.79995 4.6 7.79995C4.75913 7.79995 4.91174 7.86316 5.02426 7.97569C5.13679 8.08821 5.2 8.24082 5.2 8.39995C5.2 11.1664 7.354 13.4 10 13.4C12.646 13.4 14.8 11.1664 14.8 8.39995C14.8 8.24082 14.8632 8.08821 14.9757 7.97569C15.0883 7.86316 15.2409 7.79995 15.4 7.79995ZM10 1.19995C10.9548 1.19995 11.8705 1.57924 12.5456 2.25437C13.2207 2.9295 13.6 3.84517 13.6 4.79995V8.39995C13.6 9.35473 13.2207 10.2704 12.5456 10.9455C11.8705 11.6207 10.9548 12 10 12C9.04522 12 8.12955 11.6207 7.45442 10.9455C6.77928 10.2704 6.4 9.35473 6.4 8.39995V4.79995C6.4 3.84517 6.77928 2.9295 7.45442 2.25437C8.12955 1.57924 9.04522 1.19995 10 1.19995Z"
|
|
268
|
-
})
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
var CustomSoundRecording = function(props) {
|
|
272
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
273
|
-
component: CustomSoundRecordingSvg
|
|
274
|
-
}));
|
|
275
|
-
};
|
|
276
|
-
var CustomSoundRecording$1 = CustomSoundRecording;
|
|
277
|
-
|
|
278
|
-
var CustomRetractSvg = function() {
|
|
279
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
280
|
-
width: "1em",
|
|
281
|
-
height: "1em",
|
|
282
|
-
"shape-rendering": "geometricPrecision",
|
|
283
|
-
fill: "currentColor",
|
|
284
|
-
viewBox: "0 0 20 20",
|
|
285
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
286
|
-
children: [
|
|
287
|
-
/*#__PURE__*/ jsx("path", {
|
|
288
|
-
d: "M6.03033 15.5303C5.73744 15.8232 5.26256 15.8232 4.96967 15.5303C4.67678 15.2374 4.67678 14.7626 4.96967 14.4697L9.43934 10L4.96967 5.53033C4.67678 5.23744 4.67678 4.76256 4.96967 4.46967C5.26256 4.17678 5.73744 4.17678 6.03033 4.46967L11.0303 9.46967C11.3232 9.76256 11.3232 10.2374 11.0303 10.5303L6.03033 15.5303Z"
|
|
289
|
-
}),
|
|
290
|
-
/*#__PURE__*/ jsx("path", {
|
|
291
|
-
d: "M10.0303 15.5303C9.73744 15.8232 9.26256 15.8232 8.96967 15.5303C8.67678 15.2374 8.67678 14.7626 8.96967 14.4697L13.4393 10L8.96967 5.53033C8.67678 5.23744 8.67678 4.76256 8.96967 4.46967C9.26256 4.17678 9.73744 4.17678 10.0303 4.46967L15.0303 9.46967C15.3232 9.76256 15.3232 10.2374 15.0303 10.5303L10.0303 15.5303Z"
|
|
292
|
-
})
|
|
293
|
-
]
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
|
-
var CustomRetract = function(props) {
|
|
297
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
298
|
-
component: CustomRetractSvg
|
|
299
|
-
}));
|
|
300
|
-
};
|
|
301
|
-
var CustomRetract$1 = CustomRetract;
|
|
302
|
-
|
|
303
|
-
var CustomContactsSvg = function() {
|
|
304
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
305
|
-
className: "icon",
|
|
306
|
-
viewBox: "0 0 18 18",
|
|
307
|
-
version: "1.1",
|
|
308
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
309
|
-
"p-id": "8340",
|
|
310
|
-
width: "1em",
|
|
311
|
-
height: "1em",
|
|
312
|
-
fill: "currentColor",
|
|
313
|
-
"shape-rendering": "geometricPrecision",
|
|
314
|
-
"aria-hidden": "true",
|
|
315
|
-
children: [
|
|
316
|
-
/*#__PURE__*/ jsx("path", {
|
|
317
|
-
d: "M7.91669 2.70833C10.7934 2.70833 13.125 5.04 13.125 7.91667C13.125 9.8275 12.0959 11.4979 10.5625 12.4042C12.6263 13.2646 14.1979 15.1063 14.6567 17.3888C14.6756 17.4703 14.678 17.5547 14.6637 17.6372C14.6494 17.7196 14.6187 17.7983 14.5734 17.8687C14.5281 17.939 14.4691 17.9996 14.4 18.0467C14.3308 18.0938 14.2529 18.1266 14.1709 18.1431C14.0889 18.1595 14.0044 18.1593 13.9224 18.1425C13.8404 18.1257 13.7627 18.0926 13.6937 18.0452C13.6248 17.9978 13.5661 17.937 13.5211 17.8665C13.476 17.7959 13.4457 17.7171 13.4317 17.6346C12.9163 15.0729 10.6842 13.1888 8.05086 13.1263L7.92753 13.1246L7.91669 13.125H7.90003C5.21669 13.1325 2.92544 15.0342 2.40253 17.6333C2.36823 17.7942 2.2719 17.9351 2.13442 18.0254C1.99694 18.1157 1.8294 18.1482 1.66813 18.1158C1.50686 18.0834 1.36487 17.9887 1.27295 17.8523C1.18103 17.7159 1.1466 17.5487 1.17711 17.3871C1.63586 15.1054 3.20794 13.2646 5.27128 12.4038C4.49034 11.9438 3.84307 11.2878 3.39355 10.5008C2.94403 9.71377 2.70784 8.82301 2.70836 7.91667C2.70836 5.04 5.04003 2.70833 7.91669 2.70833ZM12.9167 1.875C15.5629 1.875 17.7084 4.02042 17.7084 6.66667C17.7084 8.225 16.9575 9.63792 15.7659 10.5204L15.7192 10.5538C17.6704 11.5604 18.9584 13.55 18.9584 15.8333C18.9584 15.9991 18.8925 16.1581 18.7753 16.2753C18.6581 16.3925 18.4991 16.4583 18.3334 16.4583C18.1676 16.4583 18.0086 16.3925 17.8914 16.2753C17.7742 16.1581 17.7084 15.9991 17.7084 15.8333C17.7084 13.6254 16.1834 11.765 14.0217 11.2487C13.8861 11.2164 13.7653 11.1398 13.6783 11.0309C13.5913 10.922 13.5432 10.7872 13.5416 10.6479C13.5401 10.5085 13.5851 10.3727 13.6696 10.2618C13.7541 10.151 13.8732 10.0716 14.0079 10.0363L13.9838 10.0446C14.7016 9.81749 15.3285 9.36764 15.7734 8.76026C16.2184 8.15289 16.4583 7.41958 16.4584 6.66667C16.4585 6.14268 16.3423 5.6252 16.1182 5.15154C15.8942 4.67787 15.5678 4.25983 15.1627 3.92754C14.7575 3.59525 14.2837 3.357 13.7753 3.22997C13.267 3.10293 12.7368 3.09028 12.2229 3.19292C12.0603 3.22513 11.8916 3.19143 11.7538 3.09922C11.6161 3.00701 11.5206 2.86386 11.4884 2.70125C11.4561 2.53864 11.4899 2.36989 11.5821 2.23213C11.6743 2.09437 11.8174 1.99888 11.98 1.96667C12.2863 1.90583 12.5996 1.875 12.9167 1.875ZM7.91669 3.95833C6.86693 3.95841 5.86018 4.37548 5.11791 5.1178C4.37564 5.86012 3.95864 6.8669 3.95864 7.91667C3.95864 8.96643 4.37564 9.97321 5.11791 10.7155C5.86018 11.4579 6.86693 11.8749 7.91669 11.875H7.93253C8.98234 11.8729 9.98833 11.4538 10.7292 10.71C11.47 9.96622 11.885 8.95857 11.8829 7.90875C11.8808 6.85893 11.4618 5.85295 10.718 5.1121C9.97416 4.37126 8.96651 3.95623 7.91669 3.95833Z"
|
|
318
|
-
}),
|
|
319
|
-
" "
|
|
320
|
-
]
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
|
-
var CustomContacts = function(props) {
|
|
324
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
325
|
-
component: CustomContactsSvg
|
|
326
|
-
}));
|
|
327
|
-
};
|
|
328
|
-
var CustomContacts$1 = CustomContacts;
|
|
329
|
-
|
|
330
|
-
var CustomDuihaoSvg = function() {
|
|
331
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
332
|
-
width: "1em",
|
|
333
|
-
height: "1em",
|
|
334
|
-
"shape-rendering": "geometricPrecision",
|
|
335
|
-
fill: "currentColor",
|
|
336
|
-
viewBox: "0 0 14 14",
|
|
337
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
338
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
339
|
-
d: "M11.2242 0.375687C11.4586 0.610002 11.4586 0.989901 11.2242 1.22422L4.82424 7.62422C4.58992 7.85853 4.21003 7.85853 3.97571 7.62422L0.775712 4.42422C0.541397 4.1899 0.541397 3.81 0.775712 3.57569C1.01003 3.34137 1.38993 3.34137 1.62424 3.57569L4.39998 6.35142L10.3757 0.375687C10.61 0.141373 10.9899 0.141373 11.2242 0.375687Z"
|
|
340
|
-
})
|
|
341
|
-
});
|
|
342
|
-
};
|
|
343
|
-
var CustomDuihao = function(props) {
|
|
344
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
345
|
-
component: CustomDuihaoSvg
|
|
346
|
-
}));
|
|
347
|
-
};
|
|
348
|
-
var CustomDuihao$1 = CustomDuihao;
|
|
349
|
-
|
|
350
|
-
var CustomRoundCloseSvg = function() {
|
|
351
|
-
return /*#__PURE__*/ jsx("svg", {
|
|
352
|
-
width: "1em",
|
|
353
|
-
height: "1em",
|
|
354
|
-
viewBox: "0 0 20 20",
|
|
355
|
-
"shape-rendering": "geometricPrecision",
|
|
356
|
-
fill: "currentColor",
|
|
357
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
358
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
359
|
-
"fill-rule": "evenodd",
|
|
360
|
-
"clip-rule": "evenodd",
|
|
361
|
-
d: "M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM9.2929 8.23223C9.68343 8.62276 10.3166 8.62276 10.7071 8.23223L11.7678 7.17158C12.0607 6.87869 12.5355 6.87869 12.8284 7.17158C13.1213 7.46447 13.1213 7.93935 12.8284 8.23224L11.7678 9.29289C11.3773 9.68342 11.3773 10.3166 11.7678 10.7071L12.8284 11.7678C13.1213 12.0607 13.1213 12.5355 12.8284 12.8284C12.5355 13.1213 12.0607 13.1213 11.7678 12.8284L10.7071 11.7678C10.3166 11.3772 9.68343 11.3772 9.2929 11.7678L8.23223 12.8284C7.93934 13.1213 7.46447 13.1213 7.17157 12.8284C6.87868 12.5355 6.87868 12.0607 7.17157 11.7678L8.23224 10.7071C8.62277 10.3166 8.62277 9.68342 8.23224 9.29289L7.17158 8.23223C6.87869 7.93934 6.87869 7.46447 7.17158 7.17157C7.46448 6.87868 7.93935 6.87868 8.23224 7.17157L9.2929 8.23223Z"
|
|
362
|
-
})
|
|
363
|
-
});
|
|
364
|
-
};
|
|
365
|
-
var CustomRoundClose = function(props) {
|
|
366
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
367
|
-
component: CustomRoundCloseSvg
|
|
368
|
-
}));
|
|
369
|
-
};
|
|
370
|
-
var CustomRoundClose$1 = CustomRoundClose;
|
|
371
|
-
|
|
372
|
-
var CustomAiIconSvg = function() {
|
|
373
|
-
return /*#__PURE__*/ jsxs("svg", {
|
|
374
|
-
width: "32",
|
|
375
|
-
height: "32",
|
|
376
|
-
viewBox: "0 0 32 32",
|
|
377
|
-
fill: "none",
|
|
378
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
379
|
-
children: [
|
|
380
|
-
/*#__PURE__*/ jsx("circle", {
|
|
381
|
-
cx: "16",
|
|
382
|
-
cy: "16",
|
|
383
|
-
r: "16",
|
|
384
|
-
fill: "#F4523B"
|
|
385
|
-
}),
|
|
386
|
-
/*#__PURE__*/ jsxs("g", {
|
|
387
|
-
"clip-path": "url(#clip0_528_8598)",
|
|
388
|
-
children: [
|
|
389
|
-
/*#__PURE__*/ jsx("path", {
|
|
390
|
-
d: "M8.08182 20.4364C6.93636 20.4364 6 19.5046 6 18.3546V16.6864C6 15.5364 6.93636 14.6046 8.08182 14.6046C9.22727 14.6046 10.1636 15.5409 10.1636 16.6864V18.3546C10.1682 19.5046 9.23182 20.4364 8.08182 20.4364ZM8.08182 16.2727C7.85455 16.2727 7.66364 16.4636 7.66364 16.6909V18.3591C7.66364 18.5864 7.85455 18.7773 8.08182 18.7773C8.30909 18.7773 8.5 18.5864 8.5 18.3591V16.6909C8.5 16.4636 8.30909 16.2727 8.08182 16.2727ZM23.9182 20.4364C22.7682 20.4364 21.8364 19.5 21.8364 18.3546V16.6864C21.8364 15.5364 22.7727 14.6046 23.9182 14.6046C25.0682 14.6046 26 15.5409 26 16.6864V18.3546C26 19.5046 25.0636 20.4364 23.9182 20.4364ZM23.9182 16.2727C23.6909 16.2727 23.5 16.4636 23.5 16.6909V18.3591C23.5 18.5864 23.6909 18.7773 23.9182 18.7773C24.1455 18.7773 24.3364 18.5864 24.3364 18.3591V16.6909C24.3318 16.4636 24.1409 16.2727 23.9182 16.2727Z",
|
|
391
|
-
fill: "white"
|
|
392
|
-
}),
|
|
393
|
-
/*#__PURE__*/ jsx("path", {
|
|
394
|
-
d: "M16.4181 25.7273H15.5863C14.8999 25.7273 14.3363 25.1636 14.3363 24.4773C14.3363 23.7909 14.8999 23.2273 15.5863 23.2273H16.4181C17.1045 23.2273 17.6681 23.7909 17.6681 24.4773C17.6681 25.1636 17.1045 25.7273 16.4181 25.7273Z",
|
|
395
|
-
fill: "white"
|
|
396
|
-
}),
|
|
397
|
-
/*#__PURE__*/ jsx("path", {
|
|
398
|
-
d: "M24.3318 16.3091C23.8727 16.3091 23.4999 15.9727 23.4999 15.5136C23.4999 11.3046 20.1363 7.94092 15.9999 7.94092C11.8636 7.94092 8.49994 11.3046 8.49994 15.4409C8.49994 15.9 8.12722 16.3091 7.66813 16.3091C7.20903 16.3091 6.83631 15.9727 6.83631 15.5136V15.4409C6.83176 10.3864 10.9454 6.27274 15.9999 6.27274C21.0545 6.27274 25.1681 10.3864 25.1681 15.4409C25.1681 15.9 24.7954 16.3091 24.3318 16.3091ZM15.9999 25.4364C15.7793 25.4364 15.5678 25.3487 15.4118 25.1927C15.2558 25.0367 15.1681 24.8252 15.1681 24.6046C15.1681 24.3839 15.2558 24.1724 15.4118 24.0164C15.5678 23.8604 15.7793 23.7727 15.9999 23.7727C18.9818 23.7727 21.6772 22.0046 22.8681 19.2727C22.9117 19.1725 22.9746 19.0817 23.0532 19.0058C23.1319 18.9298 23.2247 18.87 23.3264 18.83C23.4281 18.7899 23.5368 18.7702 23.6461 18.7721C23.7554 18.7739 23.8633 18.7973 23.9636 18.8409C24.0639 18.8845 24.1546 18.9474 24.2306 19.026C24.3065 19.1047 24.3663 19.1975 24.4064 19.2992C24.4465 19.4009 24.4661 19.5096 24.4643 19.6189C24.4624 19.7282 24.439 19.8361 24.3954 19.9364C23.6832 21.5708 22.5095 22.9619 21.0182 23.9389C19.5269 24.9158 17.7828 25.4363 15.9999 25.4364Z",
|
|
399
|
-
fill: "white"
|
|
400
|
-
}),
|
|
401
|
-
/*#__PURE__*/ jsx("path", {
|
|
402
|
-
d: "M17.9842 14.1622L16.4947 16.6079L14.6521 13L13.2104 15.8485L11 16.1887L13.6149 16.2843L14.6355 14.5612L16.5112 18.0754L18.0246 15.3961L18.7657 16.3027L21 16.1942L19.0434 15.8761L17.9842 14.1622Z",
|
|
403
|
-
fill: "white"
|
|
404
|
-
})
|
|
405
|
-
]
|
|
406
|
-
}),
|
|
407
|
-
/*#__PURE__*/ jsx("defs", {
|
|
408
|
-
children: /*#__PURE__*/ jsx("clipPath", {
|
|
409
|
-
id: "clip0_528_8598",
|
|
410
|
-
children: /*#__PURE__*/ jsx("rect", {
|
|
411
|
-
width: "20",
|
|
412
|
-
height: "20",
|
|
413
|
-
fill: "white",
|
|
414
|
-
transform: "translate(6 6)"
|
|
415
|
-
})
|
|
416
|
-
})
|
|
417
|
-
})
|
|
418
|
-
]
|
|
419
|
-
});
|
|
420
|
-
};
|
|
421
|
-
var CustomAiIcon = function(props) {
|
|
422
|
-
return /*#__PURE__*/ jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
423
|
-
component: CustomAiIconSvg
|
|
424
|
-
}));
|
|
425
|
-
};
|
|
426
|
-
var CustomAiIcon$1 = CustomAiIcon;
|
|
427
|
-
|
|
428
|
-
var modules_63b47c51$1 = {"history_list":"index_module_history_list__81d1a4f5","search_layout":"index_module_search_layout__81d1a4f5","mymove":"index_module_mymove__81d1a4f5","title":"index_module_title__81d1a4f5","search_top":"index_module_search_top__81d1a4f5","main_list":"index_module_main_list__81d1a4f5","list":"index_module_list__81d1a4f5","name":"index_module_name__81d1a4f5","time":"index_module_time__81d1a4f5","con":"index_module_con__81d1a4f5","history_list_broadside":"index_module_history_list_broadside__81d1a4f5"};
|
|
429
|
-
|
|
430
|
-
//消息已读
|
|
431
|
-
var readMessage = function(roomId, urllocation, userData, http) {
|
|
432
|
-
http.patch("".concat(urllocation, "/chat-service/public/v1.0/history-messages:read"), {
|
|
433
|
-
roomId: roomId
|
|
434
|
-
}, {
|
|
435
|
-
headers: {
|
|
436
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
437
|
-
return ele.short == "IntelligentCustomerService";
|
|
438
|
-
}).id,
|
|
439
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
};
|
|
443
|
-
var getByteLen = function(val) {
|
|
444
|
-
var len = 0;
|
|
445
|
-
for(var i = 0; i < val.length; i++){
|
|
446
|
-
var a = val.charAt(i);
|
|
447
|
-
if (a.match(/[^\x00-\xff]/gi) != null) {
|
|
448
|
-
//\x00-\xff→GBK双字节编码范围
|
|
449
|
-
len += 2;
|
|
450
|
-
} else {
|
|
451
|
-
len += 1;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
return len;
|
|
455
|
-
};
|
|
456
|
-
//当前服务url
|
|
457
|
-
var serverUrl = function() {
|
|
458
|
-
var hashName = "";
|
|
459
|
-
window.location.hash.replace(/#\/(.[^/?]+)([?/].)*/, function($1, $2) {
|
|
460
|
-
hashName = $2;
|
|
461
|
-
});
|
|
462
|
-
return hashName;
|
|
463
|
-
};
|
|
464
|
-
//复制内容
|
|
465
|
-
var copyText = function(text) {
|
|
466
|
-
// text是复制文本
|
|
467
|
-
// 创建input元素
|
|
468
|
-
var el = document.createElement("input");
|
|
469
|
-
// 给input元素赋值需要复制的文本
|
|
470
|
-
el.setAttribute("value", text);
|
|
471
|
-
// 将input元素插入页面
|
|
472
|
-
document.body.appendChild(el);
|
|
473
|
-
// 选中input元素的文本
|
|
474
|
-
el.select();
|
|
475
|
-
// 复制内容到剪贴板
|
|
476
|
-
document.execCommand("copy");
|
|
477
|
-
// 删除input元素
|
|
478
|
-
document.body.removeChild(el);
|
|
479
|
-
return true;
|
|
480
|
-
};
|
|
481
|
-
//获取当前时间
|
|
482
|
-
var getDataTime = function(time) {
|
|
483
|
-
var currentDate;
|
|
484
|
-
if (time != undefined && time != -1) {
|
|
485
|
-
currentDate = new Date(time);
|
|
486
|
-
} else {
|
|
487
|
-
currentDate = new Date();
|
|
488
|
-
}
|
|
489
|
-
var currentYear = currentDate.getFullYear();
|
|
490
|
-
var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,所以要加1
|
|
491
|
-
var currentDay = currentDate.getDate();
|
|
492
|
-
var hour = currentDate.getHours();
|
|
493
|
-
var minute = currentDate.getMinutes();
|
|
494
|
-
var second = currentDate.getSeconds();
|
|
495
|
-
var dataTime = currentYear + "-" + currentMonth + "-" + currentDay + " " + hour + ":" + minute + ":" + second;
|
|
496
|
-
return dataTime;
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
var HistoryFun = function(props) {
|
|
500
|
-
var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, loadSpecifiedData = props.loadSpecifiedData, roomList = props.roomList;
|
|
501
|
-
var _useState = _sliced_to_array(useState(""), 2), keyWordProblem = _useState[0], setKeyWordProblem = _useState[1]; //搜索内容
|
|
502
|
-
var _useState1 = _sliced_to_array(useState([]), 2), keyHistoryMessageList = _useState1[0], setKeyHistoryMessageList = _useState1[1]; //搜索的历史记录
|
|
503
|
-
var _useState2 = _sliced_to_array(useState([]), 2), userNameObj = _useState2[0], setUserNameObj = _useState2[1]; //根据用户id,存储一些用户名
|
|
504
|
-
var timer = useRef(null); //文本框输入时
|
|
505
|
-
//获取搜索中的历史消息记录
|
|
506
|
-
var getKeyHistoryMessage = function(keyWordProblem) {
|
|
507
|
-
if (roomId == "") return;
|
|
508
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
509
|
-
params: {
|
|
510
|
-
roomId: "",
|
|
511
|
-
message: keyWordProblem,
|
|
512
|
-
page: 1,
|
|
513
|
-
maxPageSize: 300,
|
|
514
|
-
direction: "desc"
|
|
515
|
-
},
|
|
516
|
-
headers: {
|
|
517
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
518
|
-
return ele.short == "IntelligentCustomerService";
|
|
519
|
-
}).id,
|
|
520
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
521
|
-
}
|
|
522
|
-
}).then(function(res) {
|
|
523
|
-
console.log(res.data, 3434378);
|
|
524
|
-
if (res.data.messages.length > 0) {
|
|
525
|
-
var dataList = res.data.messages;
|
|
526
|
-
setKeyHistoryMessageList(dataList);
|
|
527
|
-
getUserName(dataList);
|
|
528
|
-
}
|
|
529
|
-
}).catch(function(res) {});
|
|
530
|
-
};
|
|
531
|
-
//获取全部数据
|
|
532
|
-
var allData = function(roomId) {
|
|
533
|
-
if (roomId == "") return;
|
|
534
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
535
|
-
params: {
|
|
536
|
-
roomId: roomId,
|
|
537
|
-
page: 1,
|
|
538
|
-
maxPageSize: 9999999
|
|
539
|
-
},
|
|
540
|
-
headers: {
|
|
541
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
542
|
-
return ele.short == "IntelligentCustomerService";
|
|
543
|
-
}).id,
|
|
544
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
|
-
};
|
|
548
|
-
var findPageNumber = function(perPage, totalPages, targetPosition) {
|
|
549
|
-
var pageNumber = Math.ceil(targetPosition / perPage);
|
|
550
|
-
if (pageNumber > totalPages) {
|
|
551
|
-
return -1; // 数据不存在于给定的页数范围内
|
|
552
|
-
}
|
|
553
|
-
return pageNumber;
|
|
554
|
-
};
|
|
555
|
-
//根据index,计算历史数据在第几页
|
|
556
|
-
var calculationData = function(roomId, index, id) {
|
|
557
|
-
allData(roomId).then(function(res) {
|
|
558
|
-
// console.log(res.data.messages,'11111111')
|
|
559
|
-
if (res.data) {
|
|
560
|
-
var total = res.data.total;
|
|
561
|
-
var dataList = res.data.messages.reverse();
|
|
562
|
-
// console.log(dataList,'sldkcmsdklc');
|
|
563
|
-
var number;
|
|
564
|
-
dataList.map(function(item, index) {
|
|
565
|
-
if (item.id == id) {
|
|
566
|
-
number = index;
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
var pageNumber = findPageNumber(30, Math.ceil(total / 30), number);
|
|
570
|
-
console.log(number, pageNumber, "第几页第几页第几页第几页第几页第几页");
|
|
571
|
-
loadSpecifiedData(roomId, pageNumber, id);
|
|
572
|
-
onClose();
|
|
573
|
-
setKeyWordProblem("");
|
|
574
|
-
setKeyHistoryMessageList([]);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
};
|
|
578
|
-
var getUserName = function(dataList) {
|
|
579
|
-
try {
|
|
580
|
-
dataList.map(function(item) {
|
|
581
|
-
var id = item.sender;
|
|
582
|
-
//判断 不是当前登录用户
|
|
583
|
-
if (id != userData.mid) {
|
|
584
|
-
var roomListName = roomList.filter(function(item) {
|
|
585
|
-
return item.sender == id;
|
|
586
|
-
});
|
|
587
|
-
console.log(roomListName, 1111111);
|
|
588
|
-
//判断如果是当前聊天列表中的用户
|
|
589
|
-
if (roomListName.length > 0 && !roomListName[0].name) {
|
|
590
|
-
console.log(roomListName[0], "2222222222");
|
|
591
|
-
setUserNameObj(function(userNameObj) {
|
|
592
|
-
var list = userNameObj;
|
|
593
|
-
return list.concat({
|
|
594
|
-
id: id,
|
|
595
|
-
name: roomListName[0].name
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
} else {
|
|
599
|
-
//判断是否需要重新请求数据
|
|
600
|
-
var getData = false;
|
|
601
|
-
setUserNameObj(function(userNameObj) {
|
|
602
|
-
console.log(userNameObj, "userNameObjuserNameObj");
|
|
603
|
-
if (userNameObj.filter(function(e) {
|
|
604
|
-
return e.id == id;
|
|
605
|
-
}).length == 0) {
|
|
606
|
-
console.log("没有相同的id");
|
|
607
|
-
getData = true;
|
|
608
|
-
}
|
|
609
|
-
return userNameObj;
|
|
610
|
-
});
|
|
611
|
-
if (getData) {
|
|
612
|
-
if (id == "AI") {
|
|
613
|
-
id == item.recevier;
|
|
614
|
-
}
|
|
615
|
-
userName(id).then(function(res) {
|
|
616
|
-
if (res.data) {
|
|
617
|
-
setUserNameObj(function(userNameObj) {
|
|
618
|
-
var list = userNameObj;
|
|
619
|
-
return list.concat({
|
|
620
|
-
name: res.data.name,
|
|
621
|
-
id: id
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
console.log(7777777, res.data.name);
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
} catch (error) {}
|
|
632
|
-
};
|
|
633
|
-
var userName = function(uid) {
|
|
634
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
635
|
-
params: {
|
|
636
|
-
uid: uid
|
|
637
|
-
},
|
|
638
|
-
headers: {
|
|
639
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
640
|
-
return ele.short == "TeacherAnswer";
|
|
641
|
-
}).id,
|
|
642
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
};
|
|
646
|
-
return /*#__PURE__*/ jsx("div", {
|
|
647
|
-
className: "".concat(modules_63b47c51$1.history_list, " ").concat(type == 2 ? modules_63b47c51$1.history_list_broadside : "", " "),
|
|
648
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
649
|
-
className: modules_63b47c51$1.search_layout,
|
|
650
|
-
children: [
|
|
651
|
-
/*#__PURE__*/ jsxs("div", {
|
|
652
|
-
className: modules_63b47c51$1.title,
|
|
653
|
-
children: [
|
|
654
|
-
/*#__PURE__*/ jsx("span", {
|
|
655
|
-
children: "历史记录"
|
|
656
|
-
}),
|
|
657
|
-
/*#__PURE__*/ jsx("span", {
|
|
658
|
-
onClick: function() {
|
|
659
|
-
onClose();
|
|
660
|
-
},
|
|
661
|
-
children: /*#__PURE__*/ jsx(CustomClose$1, {})
|
|
662
|
-
})
|
|
663
|
-
]
|
|
664
|
-
}),
|
|
665
|
-
/*#__PURE__*/ jsxs("div", {
|
|
666
|
-
className: modules_63b47c51$1.search_top,
|
|
667
|
-
children: [
|
|
668
|
-
/*#__PURE__*/ jsx(SearchOutlined, {}),
|
|
669
|
-
/*#__PURE__*/ jsx(Input, {
|
|
670
|
-
placeholder: "请输入您要搜索的内容",
|
|
671
|
-
value: keyWordProblem,
|
|
672
|
-
onChange: function(e) {
|
|
673
|
-
var val = String(e.target.value);
|
|
674
|
-
setKeyWordProblem(val);
|
|
675
|
-
clearTimeout(timer.current);
|
|
676
|
-
timer.current = setTimeout(function() {
|
|
677
|
-
if (val != "") {
|
|
678
|
-
getKeyHistoryMessage(val);
|
|
679
|
-
}
|
|
680
|
-
}, 1000);
|
|
681
|
-
}
|
|
682
|
-
}),
|
|
683
|
-
/*#__PURE__*/ jsx("i", {
|
|
684
|
-
className: "guanbi_Close",
|
|
685
|
-
onClick: function() {
|
|
686
|
-
setKeyWordProblem("");
|
|
687
|
-
setKeyHistoryMessageList([]);
|
|
688
|
-
},
|
|
689
|
-
children: /*#__PURE__*/ jsx(CustomClose$1, {})
|
|
690
|
-
})
|
|
691
|
-
]
|
|
692
|
-
}),
|
|
693
|
-
/*#__PURE__*/ jsx("div", {
|
|
694
|
-
className: modules_63b47c51$1.main_list,
|
|
695
|
-
children: keyHistoryMessageList.map(function(item, index) {
|
|
696
|
-
var span = item.message.replaceAll(keyWordProblem, function() {
|
|
697
|
-
return "<span class=".concat(modules_63b47c51$1.sign, ">").concat(keyWordProblem, "</span>");
|
|
698
|
-
});
|
|
699
|
-
{
|
|
700
|
-
console.log(userNameObj);
|
|
701
|
-
}
|
|
702
|
-
var name = "";
|
|
703
|
-
if (item.sender == userData.mid) {
|
|
704
|
-
name = userData.real_name;
|
|
705
|
-
} else if (item.sender == "AI") {
|
|
706
|
-
name = userNameObj.filter(function(e) {
|
|
707
|
-
return e.id == item.recevier;
|
|
708
|
-
})[0].name;
|
|
709
|
-
} else {
|
|
710
|
-
name = userNameObj.filter(function(e) {
|
|
711
|
-
return e.id == item.sender;
|
|
712
|
-
})[0].name;
|
|
713
|
-
}
|
|
714
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
715
|
-
className: modules_63b47c51$1.list,
|
|
716
|
-
onClick: function() {
|
|
717
|
-
calculationData(item.roomId, item.messageIdWithinRoom, item.id);
|
|
718
|
-
},
|
|
719
|
-
children: [
|
|
720
|
-
/*#__PURE__*/ jsxs("div", {
|
|
721
|
-
className: modules_63b47c51$1.name,
|
|
722
|
-
children: [
|
|
723
|
-
/*#__PURE__*/ jsx("p", {
|
|
724
|
-
children: name
|
|
725
|
-
}),
|
|
726
|
-
/*#__PURE__*/ jsx("span", {
|
|
727
|
-
className: modules_63b47c51$1.time,
|
|
728
|
-
children: getDataTime(item.updatedAt)
|
|
729
|
-
})
|
|
730
|
-
]
|
|
731
|
-
}),
|
|
732
|
-
/*#__PURE__*/ jsx("div", {
|
|
733
|
-
className: modules_63b47c51$1.con,
|
|
734
|
-
dangerouslySetInnerHTML: {
|
|
735
|
-
__html: span
|
|
736
|
-
}
|
|
737
|
-
})
|
|
738
|
-
]
|
|
739
|
-
}, item.id);
|
|
740
|
-
})
|
|
741
|
-
})
|
|
742
|
-
]
|
|
743
|
-
})
|
|
744
|
-
});
|
|
745
|
-
};
|
|
746
|
-
var HistoryFun$1 = HistoryFun;
|
|
747
|
-
|
|
748
|
-
var modules_63b47c51 = {"teacher_layout":"index_module_teacher_layout__5df53994","top":"index_module_top__5df53994","bottom":"index_module_bottom__5df53994","delete":"index_module_delete__5df53994","num":"index_module_num__5df53994","shrink":"index_module_shrink__5df53994","active":"index_module_active__5df53994","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__5df53994","teacher_layout_modal":"index_module_teacher_layout_modal__5df53994","ai":"index_module_ai__5df53994","user_info":"index_module_user_info__5df53994","message":"index_module_message__5df53994","time":"index_module_time__5df53994","con":"index_module_con__5df53994"};
|
|
749
|
-
|
|
750
|
-
var ContactsList = function(props) {
|
|
751
|
-
var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, switchChatRoom = props.switchChatRoom, saveContactsList = props.saveContactsList;
|
|
752
|
-
var _useState = _sliced_to_array(useState([]), 2), contactsList = _useState[0], setContactsList = _useState[1]; //老师列表
|
|
753
|
-
var timer = useRef(null); //文本框输入时
|
|
754
|
-
//获取聊天室列表
|
|
755
|
-
useEffect(function() {
|
|
756
|
-
// if (roomId != "") {
|
|
757
|
-
roomsListTimer();
|
|
758
|
-
// }
|
|
759
|
-
return function() {
|
|
760
|
-
clearTimeout(timer.current);
|
|
761
|
-
};
|
|
762
|
-
}, []);
|
|
763
|
-
var roomsListTimer = function() {
|
|
764
|
-
if (timer != null) clearTimeout(timer.current);
|
|
765
|
-
timer.current = setTimeout(function() {
|
|
766
|
-
return roomsListTimer();
|
|
767
|
-
}, 100000);
|
|
768
|
-
http.get("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
769
|
-
params: {
|
|
770
|
-
page: 1,
|
|
771
|
-
maxPageSize: 100002
|
|
772
|
-
},
|
|
773
|
-
headers: {
|
|
774
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
775
|
-
return ele.short == "IntelligentCustomerService";
|
|
776
|
-
}).id,
|
|
777
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
778
|
-
}
|
|
779
|
-
}).then(function(res) {
|
|
780
|
-
if (res.data) {
|
|
781
|
-
var list = res.data.contacts;
|
|
782
|
-
// let list2 = list.slice(1);
|
|
783
|
-
var list2 = list;
|
|
784
|
-
setContactsList(function(contactsList) {
|
|
785
|
-
if (contactsList.length > 0 && roomId != "") {
|
|
786
|
-
//查找当前聊天室的未读消息
|
|
787
|
-
var message = 0;
|
|
788
|
-
var messageList = contactsList.filter(function(item) {
|
|
789
|
-
return item.id == roomId;
|
|
790
|
-
});
|
|
791
|
-
if (messageList.length > 0) {
|
|
792
|
-
// console.log(messageList,'messagemessagemessage');
|
|
793
|
-
message = messageList[0].unreadCount;
|
|
794
|
-
}
|
|
795
|
-
var new_message = 0;
|
|
796
|
-
if (list.length > 0) {
|
|
797
|
-
var new_message_list = list.filter(function(item) {
|
|
798
|
-
return item.id == roomId;
|
|
799
|
-
});
|
|
800
|
-
if (new_message_list.length > 0) {
|
|
801
|
-
console.log(new_message_list, "new_messagenew_messagenew_messagenew_message");
|
|
802
|
-
new_message = new_message_list[0].unreadCount;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
// console.log(message,new_message,'lsdlcksdcmsdlkc')
|
|
806
|
-
//存在新消息
|
|
807
|
-
if (message != new_message) {
|
|
808
|
-
console.log("有新消息");
|
|
809
|
-
switchChatRoom(roomId, "renew");
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
list2 = list2.map(function(item, index) {
|
|
813
|
-
// if(contactsList[index] != undefined){
|
|
814
|
-
return _object_spread({}, item, contactsList[index] || "");
|
|
815
|
-
// }else{
|
|
816
|
-
// return item
|
|
817
|
-
// }
|
|
818
|
-
});
|
|
819
|
-
return list2;
|
|
820
|
-
});
|
|
821
|
-
console.log(list2, "list2list2list2list2");
|
|
822
|
-
// setAi(res.data.contacts[0]);
|
|
823
|
-
getUserInfo(list2);
|
|
824
|
-
//切换到有聊天的窗口
|
|
825
|
-
list2.forEach(function(ele) {
|
|
826
|
-
console.log(ele);
|
|
827
|
-
if (ele.unreadCount > 0) {
|
|
828
|
-
switchChatRoom(ele.roomId, "");
|
|
829
|
-
return;
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
saveContactsList(list);
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
};
|
|
836
|
-
//删除聊天室
|
|
837
|
-
var deleteRoom = function(roomId) {
|
|
838
|
-
http.delete("".concat(urllocation, "/chat-service/public/v1.0/rooms/").concat(roomId), {
|
|
839
|
-
headers: {
|
|
840
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
841
|
-
return ele.short == "IntelligentCustomerService";
|
|
842
|
-
}).id,
|
|
843
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
844
|
-
}
|
|
845
|
-
}).then(function(res) {
|
|
846
|
-
console.log(res, "sdcsdcsdc");
|
|
847
|
-
// roomsList();
|
|
848
|
-
roomsListTimer();
|
|
849
|
-
});
|
|
850
|
-
};
|
|
851
|
-
//获取老师的信息等
|
|
852
|
-
var getUserInfo = function(list2) {
|
|
853
|
-
list2.map(function(item, i) {
|
|
854
|
-
if (!item.name && !item.headImg && item.sender != "AI") {
|
|
855
|
-
getUserName(item.sender).then(function(res) {
|
|
856
|
-
if (res.data) {
|
|
857
|
-
var list;
|
|
858
|
-
setContactsList(function(contactsList) {
|
|
859
|
-
list = contactsList.map(function(item, index) {
|
|
860
|
-
if (item.sender == res.data.uid) {
|
|
861
|
-
return _object_spread({}, item, res.data);
|
|
862
|
-
} else {
|
|
863
|
-
return item;
|
|
864
|
-
}
|
|
865
|
-
});
|
|
866
|
-
return list;
|
|
867
|
-
});
|
|
868
|
-
saveContactsList(list);
|
|
869
|
-
}
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
};
|
|
874
|
-
var getUserName = function(uid) {
|
|
875
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
876
|
-
params: {
|
|
877
|
-
uid: uid
|
|
878
|
-
},
|
|
879
|
-
headers: {
|
|
880
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
881
|
-
return ele.short == "TeacherAnswer";
|
|
882
|
-
}).id,
|
|
883
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
};
|
|
887
|
-
// //获取当前时间
|
|
888
|
-
// const getDataTime = (time: string | number | Date) => {
|
|
889
|
-
// let currentDate;
|
|
890
|
-
// if (time != undefined && time != -1) {
|
|
891
|
-
// currentDate = new Date(time);
|
|
892
|
-
// } else {
|
|
893
|
-
// currentDate = new Date();
|
|
894
|
-
// }
|
|
895
|
-
// const currentYear = currentDate.getFullYear();
|
|
896
|
-
// const currentMonth = currentDate.getMonth() + 1; // 月份从0开始,所以要加1
|
|
897
|
-
// const currentDay = currentDate.getDate();
|
|
898
|
-
// const hour = currentDate.getHours();
|
|
899
|
-
// const minute = currentDate.getMinutes();
|
|
900
|
-
// const second = currentDate.getSeconds();
|
|
901
|
-
// let dataTime =
|
|
902
|
-
// currentYear +
|
|
903
|
-
// "-" +
|
|
904
|
-
// currentMonth +
|
|
905
|
-
// "-" +
|
|
906
|
-
// currentDay +
|
|
907
|
-
// " " +
|
|
908
|
-
// hour +
|
|
909
|
-
// ":" +
|
|
910
|
-
// minute +
|
|
911
|
-
// ":" +
|
|
912
|
-
// second;
|
|
913
|
-
// return dataTime;
|
|
914
|
-
// };
|
|
915
|
-
return type == 2 || type == 4 ? //联系人展开
|
|
916
|
-
/*#__PURE__*/ jsxs("div", {
|
|
917
|
-
className: modules_63b47c51.teacher_layout_modal,
|
|
918
|
-
children: [
|
|
919
|
-
/*#__PURE__*/ jsx("div", {
|
|
920
|
-
className: modules_63b47c51.top,
|
|
921
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
922
|
-
className: "".concat(modules_63b47c51.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId ? modules_63b47c51.active : ""),
|
|
923
|
-
onClick: function() {
|
|
924
|
-
switchChatRoom(contactsList[0].roomId, "");
|
|
925
|
-
},
|
|
926
|
-
children: [
|
|
927
|
-
/*#__PURE__*/ jsx(CustomAiIcon$1, {}),
|
|
928
|
-
/*#__PURE__*/ jsxs("div", {
|
|
929
|
-
className: modules_63b47c51.user_info,
|
|
930
|
-
children: [
|
|
931
|
-
/*#__PURE__*/ jsxs("p", {
|
|
932
|
-
className: modules_63b47c51.message,
|
|
933
|
-
children: [
|
|
934
|
-
"AI助手",
|
|
935
|
-
/*#__PURE__*/ jsx("span", {
|
|
936
|
-
className: modules_63b47c51.time,
|
|
937
|
-
children: contactsList.length > 0 && getDataTime(contactsList[0].createdAt)
|
|
938
|
-
})
|
|
939
|
-
]
|
|
940
|
-
}),
|
|
941
|
-
/*#__PURE__*/ jsx("p", {
|
|
942
|
-
className: modules_63b47c51.con,
|
|
943
|
-
children: contactsList.length > 0 && contactsList[0].lastMsg
|
|
944
|
-
})
|
|
945
|
-
]
|
|
946
|
-
})
|
|
947
|
-
]
|
|
948
|
-
})
|
|
949
|
-
}),
|
|
950
|
-
/*#__PURE__*/ jsx("div", {
|
|
951
|
-
className: modules_63b47c51.bottom,
|
|
952
|
-
children: contactsList.map(function(item, index) {
|
|
953
|
-
if (index != 0) {
|
|
954
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
955
|
-
className: "".concat(modules_63b47c51.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? modules_63b47c51.active : ""),
|
|
956
|
-
onClick: function() {
|
|
957
|
-
switchChatRoom(item.roomId, "");
|
|
958
|
-
},
|
|
959
|
-
children: [
|
|
960
|
-
/*#__PURE__*/ jsx("img", {
|
|
961
|
-
src: item.headImg
|
|
962
|
-
}),
|
|
963
|
-
/*#__PURE__*/ jsxs("div", {
|
|
964
|
-
className: modules_63b47c51.user_info,
|
|
965
|
-
children: [
|
|
966
|
-
/*#__PURE__*/ jsxs("p", {
|
|
967
|
-
className: modules_63b47c51.message,
|
|
968
|
-
children: [
|
|
969
|
-
item.name,
|
|
970
|
-
item.unreadCount != undefined && item.unreadCount > 0 && /*#__PURE__*/ jsx("span", {
|
|
971
|
-
className: modules_63b47c51.num,
|
|
972
|
-
children: item.unreadCount
|
|
973
|
-
}),
|
|
974
|
-
/*#__PURE__*/ jsx("span", {
|
|
975
|
-
className: modules_63b47c51.time,
|
|
976
|
-
children: getDataTime(item.createdAt)
|
|
977
|
-
})
|
|
978
|
-
]
|
|
979
|
-
}),
|
|
980
|
-
/*#__PURE__*/ jsx("p", {
|
|
981
|
-
className: modules_63b47c51.con,
|
|
982
|
-
children: item.lastMsg
|
|
983
|
-
})
|
|
984
|
-
]
|
|
985
|
-
})
|
|
986
|
-
]
|
|
987
|
-
}, item.roomId);
|
|
988
|
-
} else {
|
|
989
|
-
return null;
|
|
990
|
-
}
|
|
991
|
-
})
|
|
992
|
-
})
|
|
993
|
-
]
|
|
994
|
-
}) : /*#__PURE__*/ jsxs("div", {
|
|
995
|
-
className: "".concat(modules_63b47c51.teacher_layout, " ").concat(type == 3 ? modules_63b47c51.teacher_layout_newlabo : ""),
|
|
996
|
-
style: {
|
|
997
|
-
left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
998
|
-
},
|
|
999
|
-
children: [
|
|
1000
|
-
/*#__PURE__*/ jsxs("div", {
|
|
1001
|
-
className: modules_63b47c51.top,
|
|
1002
|
-
children: [
|
|
1003
|
-
/*#__PURE__*/ jsxs("div", {
|
|
1004
|
-
className: "".concat(modules_63b47c51.ai, " ").concat(modules_63b47c51.shrink),
|
|
1005
|
-
onClick: function() {
|
|
1006
|
-
onClose();
|
|
1007
|
-
},
|
|
1008
|
-
children: [
|
|
1009
|
-
/*#__PURE__*/ jsx(CustomRetract$1, {}),
|
|
1010
|
-
/*#__PURE__*/ jsx("p", {
|
|
1011
|
-
children: "收起"
|
|
1012
|
-
})
|
|
1013
|
-
]
|
|
1014
|
-
}),
|
|
1015
|
-
/*#__PURE__*/ jsxs("div", {
|
|
1016
|
-
className: "".concat(modules_63b47c51.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId ? modules_63b47c51.active : ""),
|
|
1017
|
-
onClick: function() {
|
|
1018
|
-
switchChatRoom(contactsList[0].roomId, "");
|
|
1019
|
-
},
|
|
1020
|
-
children: [
|
|
1021
|
-
/*#__PURE__*/ jsx(CustomAiIcon$1, {}),
|
|
1022
|
-
/*#__PURE__*/ jsx("p", {
|
|
1023
|
-
children: "AI助手"
|
|
1024
|
-
})
|
|
1025
|
-
]
|
|
1026
|
-
})
|
|
1027
|
-
]
|
|
1028
|
-
}),
|
|
1029
|
-
/*#__PURE__*/ jsx("div", {
|
|
1030
|
-
className: modules_63b47c51.bottom,
|
|
1031
|
-
children: contactsList.map(function(item, index) {
|
|
1032
|
-
if (index != 0) {
|
|
1033
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
1034
|
-
className: "".concat(modules_63b47c51.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? modules_63b47c51.active : ""),
|
|
1035
|
-
onClick: function() {
|
|
1036
|
-
switchChatRoom(item.roomId, "");
|
|
1037
|
-
},
|
|
1038
|
-
children: [
|
|
1039
|
-
/*#__PURE__*/ jsx("img", {
|
|
1040
|
-
src: item.headImg
|
|
1041
|
-
}),
|
|
1042
|
-
/*#__PURE__*/ jsx("p", {
|
|
1043
|
-
children: item.name
|
|
1044
|
-
}),
|
|
1045
|
-
item.unreadCount != undefined && item.unreadCount > 0 && /*#__PURE__*/ jsx("span", {
|
|
1046
|
-
className: modules_63b47c51.num,
|
|
1047
|
-
children: item.unreadCount
|
|
1048
|
-
}),
|
|
1049
|
-
/*#__PURE__*/ jsx("span", {
|
|
1050
|
-
className: modules_63b47c51.delete,
|
|
1051
|
-
onClick: function(e) {
|
|
1052
|
-
e.stopPropagation();
|
|
1053
|
-
deleteRoom(item.roomId);
|
|
1054
|
-
},
|
|
1055
|
-
children: /*#__PURE__*/ jsx(CloseOutlined, {})
|
|
1056
|
-
})
|
|
1057
|
-
]
|
|
1058
|
-
}, item.roomId);
|
|
1059
|
-
} else {
|
|
1060
|
-
return null;
|
|
1061
|
-
}
|
|
1062
|
-
})
|
|
1063
|
-
})
|
|
1064
|
-
]
|
|
1065
|
-
});
|
|
1066
|
-
};
|
|
1067
|
-
var ContactsList$1 = ContactsList;
|
|
1068
|
-
|
|
1069
|
-
var config = {
|
|
1070
|
-
prefixCls: "bhd",
|
|
1071
|
-
theme: {
|
|
1072
|
-
token: {
|
|
1073
|
-
colorPrimary: "#f4523b",
|
|
1074
|
-
colorError: "#f8700c",
|
|
1075
|
-
colorSuccess: "#23d9c3",
|
|
1076
|
-
colorWarning: "#f9d579",
|
|
1077
|
-
colorInfo: "#5991ef",
|
|
1078
|
-
wireframe: true,
|
|
1079
|
-
borderRadius: 4,
|
|
1080
|
-
borderRadiusLG: 8,
|
|
1081
|
-
fontSizeHeading1: 36,
|
|
1082
|
-
fontSizeHeading2: 24,
|
|
1083
|
-
fontSizeHeading3: 20,
|
|
1084
|
-
fontSizeHeading4: 18,
|
|
1085
|
-
// lineHeight: 1.5,
|
|
1086
|
-
// lineHeightSM: 1.5,
|
|
1087
|
-
colorInfoActive: "#3D7DE8",
|
|
1088
|
-
colorInfoHover: "#7EAEFF",
|
|
1089
|
-
colorInfoBorderHover: "#7EAEFF",
|
|
1090
|
-
colorPrimaryBorderHover: "#FC6955",
|
|
1091
|
-
colorPrimaryBorder: "#FC6955",
|
|
1092
|
-
colorPrimaryActive: "#D54632",
|
|
1093
|
-
colorText: "rgba(0, 0, 0, 0.85)",
|
|
1094
|
-
colorTextQuaternary: "rgba(0, 0, 0, 0.25)",
|
|
1095
|
-
colorBorder: "rgba(0, 0, 0, 0.15)",
|
|
1096
|
-
colorBorderSecondary: "rgba(0, 0, 0, 0.05)",
|
|
1097
|
-
fontFamily: '"PingFang SC", "helvetica neue", "Source Han Sans CN","hiragino sans gb", "arial", "microsoft yahei ui","microsoft yahei", "simsun", "sans-serif"'
|
|
1098
|
-
},
|
|
1099
|
-
components: {
|
|
1100
|
-
Button: {
|
|
1101
|
-
borderRadiusLG: 8,
|
|
1102
|
-
colorBgContainer: "#ffffff",
|
|
1103
|
-
colorLinkHover: "#7EAEFF",
|
|
1104
|
-
colorLinkActive: "#3D7DE8",
|
|
1105
|
-
colorPrimaryBorder: "#FC6955"
|
|
1106
|
-
},
|
|
1107
|
-
Slider: {
|
|
1108
|
-
colorPrimaryBorder: "#FC6955"
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
},
|
|
1112
|
-
locale: zhCN
|
|
1113
|
-
};
|
|
1114
|
-
var config$1 = config;
|
|
1115
|
-
|
|
1116
|
-
var Provider = function(Component) {
|
|
1117
|
-
var customConfig = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1118
|
-
var AppConfig = Object.assign(config$1, customConfig);
|
|
1119
|
-
ConfigProvider.config(AppConfig);
|
|
1120
|
-
ConfigProvider.__proto__.lang = AppConfig.locale.locale;
|
|
1121
|
-
return function(_param) {
|
|
1122
|
-
var props = _extends({}, _object_destructuring_empty(_param));
|
|
1123
|
-
return /*#__PURE__*/ jsx(ConfigProvider, _object_spread_props(_object_spread({}, AppConfig), {
|
|
1124
|
-
children: /*#__PURE__*/ jsx(StyleProvider, {
|
|
1125
|
-
hashPriority: "high",
|
|
1126
|
-
transformers: [
|
|
1127
|
-
transform
|
|
1128
|
-
],
|
|
1129
|
-
children: /*#__PURE__*/ jsx(Component, _object_spread({}, props))
|
|
1130
|
-
})
|
|
1131
|
-
}));
|
|
1132
|
-
};
|
|
1133
|
-
};
|
|
1134
|
-
Provider.Component = function(props) {
|
|
1135
|
-
var AppConfig = Object.assign(config$1, props);
|
|
1136
|
-
ConfigProvider.__proto__.lang = AppConfig.locale.locale;
|
|
1137
|
-
ConfigProvider.config(AppConfig);
|
|
1138
|
-
return /*#__PURE__*/ jsx(ConfigProvider, _object_spread_props(_object_spread({}, AppConfig), {
|
|
1139
|
-
children: /*#__PURE__*/ jsx(StyleProvider, {
|
|
1140
|
-
hashPriority: "high",
|
|
1141
|
-
transformers: [
|
|
1142
|
-
transform
|
|
1143
|
-
],
|
|
1144
|
-
children: props.children
|
|
1145
|
-
})
|
|
1146
|
-
}));
|
|
1147
|
-
};
|
|
1148
|
-
var Provider$1 = Provider;
|
|
1149
|
-
|
|
1150
|
-
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA4vSURBVHgB3VtpcBTXEe43MyutxCGJQwiLQ2BucJDAgB1zSNixY5eNHVdcldgpIySIj0oCxPmTVKoA/8qPxMH+kaNASJSPcqrsxNgxIcYBYYMvsCXuG624QUISOtjV7s68fD1vL61W0upCEl0lrXbmzZvpft1ff91vJKiXJf+v7ixKoFxdimwSYrwUlEVSpgrCZ4RIIhfO1wlJLmlZBy2hlTt9VvnfXkpyUS+KoF6Q/E3uXF2Ip6Dsk9GKdkFceMxS07K2lqxKKqUelh4zwJpimVpP3tXCkmvwNZV6R+Al2npHs7mnpzyj2wa4TYpHS53UxMYEj7W1u4bolgEKiz2ryaL1dPsUjxbbI4oKErZSF6VLBnix2J3lk6IYyJVL/UNcDq/M64o3aNRJ4VX3WaKsHynPkuVLEGUFRZ41nbyucx5QUOz5s7Co0ze5nQJsWL9lReKGeMfHbYCCouZiQTKfBoSIkqLCxBVxjYxn0MotzWVSymwaSCKotKjAmdfRsA4xgFd+wCnPAowqxLN3NKxdAxQUN68bOG4fS2T+SuBWeyPaDIFAjt9Id4Cgzli7pdAZU5eYBrDzPKe6viM4PS114Ak5sXhCzBCA8rvpzlGeJdWXKGLiQSsDFBS586n7FVz/E4BiLKLUIgQCrs+rn9XeXMKeLz7hsUOcgqaNFpQ9Vqe3v/ZTU3O8V/e41Jla4oSSFaIueMCIPOslsbqj+n1wIor8HJ0aPZK2lZttj0sQNCdLo/kTNBo/UlBSgrL11ZsafXjQpD6SVM1ve8H64IGQB8QDfDNGa7RisUFpg9Rlu46Z9GGZSY2BFdVweEqGRg9N12lapiCnozXGNnqIfvNuM/kt6itp4QUhD/BalCvaUf7Re3R6+l4DXavwsTwo2ugm2n7Yb/+9aLJOdw2LnVklbOT2ElVct2hMmkauG31mgRZeEDKAILEu1mgDMPnsAoMWQ8FIOX1V0ieHTUofSvSnnyTQIGdLxT1Q9jyUPHzRospqSVUNkm40SbL6LPzDIjSxmgIGsJ/a7uFpNvi1EB1nX8xzUE5WOFnUNhJ9+J2fdNjjCWBBSrJS3HVNUtl5E2Eg6EKthZWWNGmUoHEjNJo1RqNBDqLfvu+lfqC/Lehg5W1Gj9H2ACiaHz2Alc9faISU//qURZ+fNqnJK2n5AwZlpavjHh/R/rMm7Tlp0vV6IgcM8/KDBk0YqZEWkWQ5BDJSBF252T9MYKJpiw9lAAT2kugBT8016P7Jyu1rGiV9BuVr4MKPfU+3lT+LFf/ijEmnrkiaCcDLX+igQYlku/jwIa1xgLFjVqYGA/RZBmghAOwn8bFGBNC/IvLkYij+/CJlmzKXRaUnTHo8W6fMNEGuKqKdR/22MZbOMGjeBEHJiS0V5tVuhmfcxJjKGkleP0IHf1dUWXToUt/Bf7SYXjnB8JkWNizCAMekZdkc9X3nEazwVYteyDPoFkDtzX3s5haMYVD2eC2UERjdz1yz6EqdpAMVJtXeQq5xS9sQ/Vk0bNgYUmrZkantaSifijy/nfM74v3lBx1Uetyk7SAvD83U6ed5CbbijPJllSZ+LDp4wSKzh5UVwV9SsU4RQT9ljDGRx+MVid0qQwhtdvDSEVD83omand5u+SQ9gZV+Y6fPPv27ZQ5KTeYQkDCGn04iDfKY3pKMoYLSBwsaP1yjPcCfIU6iUTh2Cp42O1On8oumHXrzANLlWIQaN7NPdW1VU3zPxazXEJrMCrrqnCwdbkx07JJJzy9MoNd2eClnnE6PIv7PIa29uddHhxHDt8Ozx6ZqdBKkKX2oxMIQjRmm0dHLFs3I0MkLHM1BXVF7S9pa3A1QrocXcpYZBaN9eipOoAVLF6iQKoL8//ePJ9B7B/z03P0Gbf3cTw9M0eAROr37lR9ob1E1LHu7wjo1SZAZwEs7BIixBkQKn8lcVwQO8nFOzUy7OetyKLrj90yXEVSeJ7qGHD0H4LYHqD8HRcxEWPa1HT5agL9vNIiQa3E8LpiokvwZeEZ1Q/xm4fmZIzShmNpxxLTrh7HYK06Mqht4Rle1hd5E6zmCtcfDwKRkXHcaYXH0SpeyS1aICg+CVcvPW7QQq34Vhhg3XNDfS/026eFMcOJa+AZstcLFDtsQ733jBwNU56TFq0GoFg0aMViN9cEbdwFETwauvwfxu2iaRlX1ygDP3mfQkmk6WTjt86trmGUaOocienKf+Oxjj8zSaXSqMnrQVPdPVpnoer1GZ67KkKd8CX5y/Gp8BgnXArhyOOKHyc3SGajbv/DTL5EBeJptZf4WF/GqsJfMm6DTj+cb+MGqIO1VAiAvw3hLZ2p04YakrzDXM6gjZo7VaO3bzfZ1zARP4WFr4DX8sEyT+d4f4R7/PqRiN3eKTj8DC52Jc7rtbeo+jFWcjdT6S/r4oEWxunpuP8UtIQM0wK2SEnjFBL2/36QfgQmOBKj8cbsvZun61pd++h/K4VefVmmxCJhxFCu2/AGHfZ5XmAsmFicOMS12wt8PnDNp7ymVZTQRuykpo+6XNjh8nBdjHCrOVUsc1AxF/7LLR9WNXUcmg9/MCOLAKaDsuBGCMnGDe8ZpdKkGrt+OK/kjwBZ7Bx1WetPRFXrpQRU6Ow756V/fdZ4Wz4ZX5IOlcvXJHvHKI45WhOtdhOWhi3GFgMvAKtQFJ6gHMF2oQRG0WDnGxRrqUSlDqnoHocXuveBuvUsGuFALxDeU35RXchHWWlFXdXweIaG7IS2BPXa189PQTDQpQ9hMkIUpbixh1/3VDxyUglQVZJHPzHfQD5GXDav93bYQixOqZvAojLPdev54BXIT09Uc7PLR6jFJ1wOBu++0ZRMmZqhce6zb5qVOCVoVGkhsZfB7HTxgxphwDTslI7Yy7Op7Uf6euxaAI3ycvijpSzxQlSf+eOSR/4C7nkRFOSRJozwUV/yTnqLREXjL1r3+VmE1eVS4DGc3HwSGOAJGyEgV1GmRshxUWJRHHrsCF8sZr/7m9tasu/Awl1u72QHQz1EpfFOF4pMQ328BPKdmdu6Vg+OYW1oKttl1PWAyU9PVnOdrWhuz3hMm/r9Y6kBqVIozyK5+SOHBf5BNTld1jAGarpVplkalkQc/AMruOmqGXPMF3ISNEC2cnvIi2mSZ4A2jh3Z+FRjUXnnMYf9w/mcFCpcY9vecca3n48UoAj/ZecRPlWi51dwKG4mJEx+rj7Pt7m+2DholK5JcoMOhTMAu9w56958ixU1Fh3cS4vGnyOUnkQ0+AGgFJ89GlrCxQqpsYCAu547v9AsnlJGmlOTmanC/oKpBpb6JI3Xae6b1Sn5dEQbPZXCVqaOV4T4KtNvjKcM5+5Vgq8xQF1jbUBWujhxwHUTleoOJNpj6zsAXRF+WeQEqzI1PLpefX+SwkZ2pMUsyV28pIvRAIV4f8XBJmG/iSDXPiSvhIosbqFMQUkEwjBRmoGxopsNen6LF+2EQH/5+DmSJF/CbCqvDEAB8l/Kn6glK8QFSwuroQbwPcN8kdIIQZ+ye9agFjuNBjwO05mYp9//0KG4GMGQqOwrjtsFLmEZzaf0UegvVIET7UM4GyRSXscua1N7CoqkajQy0zy7XhR/4LKpALsQY3Njwl2tVc+YaGi57wS6LPgsYEHXA6BSy59Bhx6FOYAc+J8NzR6UyGVNz+WN4hLCsrcoQQcsWeXCb8L5A7lSdnvu+Ya/cPiD+rhOW3dZKBltktjd9jECJbNEfPvbZVudaguxGieywOcKAxSm0wa2qOIehUq7HFy620gLdZk5v6UNUmswcptNYfKahPB42WKVg0QHssMedA0X/Bobjxk2goq3AdvlEPh+iwtKSr6Nfvi74/VE0P3nuzbv9dOB8OOb4wafcJezK8eB5iQ6SQcfgFSevxN8VYm+pDVSWdmXXrFYiBexuOubmxksmNk8mo63ODVbReWy1hRdv/1nLDimm4/fdrdHhC6hZ6mhDcEzIAJbh2ahbSRwGthecBugNQjPk2wjlOT2tyjXoJpD3dVRpjBMJOk+s08OguFwJHkNudoFCc9ETncNZD1aGXTcdis1AdmGcYBfOgCsPTuq6stHyLXCAKXFt6+5QHZqheyKfKSQFm9zrg14wBC1uRv/LoMOsELe05wP4uPRlCtsYlWp4omxUfXPRO5iCrk1asqoQG5vVirNi7OrsuhwCbSnKLssM8CaubcA+Ind9uHfQhHluIbxYIU+zWl2eIxErO3yosDGFvYaB87/gAf/81h+zeYMNkQ3YEFkf0wD5xbWp8IIKisACBrMRAaC6WCtbKR5LeHNkEtCd43aMHbsa+nfh/iUr2eRRP9cbLLuj04A0yDmd0yFvoTHh4ZDqTGeZDcJ9xKrG2IUZx77llUtLIt4UabUOBZs8a4Ck7b5YNGBFaPnR7xXHdMTCLZ7d/exV2G5LJPJHSkzqZgq5Ah91dIcIlK9l1491LqYBmB4DiDbQHSIoeV8taeNN8jbJ+5ZVzo2A49dpgItCfWeb7zt2mHULN7tLAK/LaSCKlCVFK5NWtDckLtpRsMVTJiQNrPeFJe0uWulc2tGwuOrXLQXOHFhzKw0UsVe+Y+VZ4i7g4Ur5HE/Uv4UrnY0duX2kdKqDwRQS2WEt9cMUyalOWPRrrPzazlzXpdIjv9idpVlit+gfr9TyqpeaPllQ0oV/mupW7aXeKxbr+soQvOqc49tLcx1Jt4tP9gbdlGuk0JaL2/SGuVJcvuE3nBsj3/vtivRQ9R0MC64fes0juDCs6ynFg9JjBoiUlZvcuegx5kshlnTDGDLwywUOsk1IuW1zf/7n6bZEhYiVrV7GErMlGwRdLxHr3+fR7xD2f4tTpRTyYIKXSnv73+f/Dw0ZPU1J1FnUAAAAAElFTkSuQmCC";
|
|
1151
|
-
var knowledge_icon = img;
|
|
1152
|
-
|
|
1153
|
-
//录音相关功能
|
|
1154
|
-
var useMediaRecorder = function() {
|
|
1155
|
-
var _useState = _sliced_to_array(useState(""), 2), mediaUrl = _useState[0]; _useState[1];
|
|
1156
|
-
var _useState1 = _sliced_to_array(useState(""), 2), bese64String = _useState1[0], setBese64String = _useState1[1];
|
|
1157
|
-
var mediaStream = useRef();
|
|
1158
|
-
var mediaRecorder = useRef();
|
|
1159
|
-
var mediaBlobs = useRef([]);
|
|
1160
|
-
var startRecord = function() {
|
|
1161
|
-
var _ref = _async_to_generator(function() {
|
|
1162
|
-
var // eslint-disable-next-line no-unused-expressions
|
|
1163
|
-
_mediaRecorder_current;
|
|
1164
|
-
return __generator(this, function(_state) {
|
|
1165
|
-
switch(_state.label){
|
|
1166
|
-
case 0:
|
|
1167
|
-
setBese64String("");
|
|
1168
|
-
return [
|
|
1169
|
-
4,
|
|
1170
|
-
navigator.mediaDevices.getUserMedia({
|
|
1171
|
-
audio: true,
|
|
1172
|
-
video: false
|
|
1173
|
-
})
|
|
1174
|
-
];
|
|
1175
|
-
case 1:
|
|
1176
|
-
mediaStream.current = _state.sent();
|
|
1177
|
-
mediaRecorder.current = new MediaRecorder(mediaStream.current);
|
|
1178
|
-
mediaRecorder.current.ondataavailable = function(blobEvent) {
|
|
1179
|
-
mediaBlobs.current.push(blobEvent.data);
|
|
1180
|
-
};
|
|
1181
|
-
mediaRecorder.current.onstop = function() {
|
|
1182
|
-
var blob = new Blob(mediaBlobs.current, {
|
|
1183
|
-
type: "audio/wav"
|
|
1184
|
-
});
|
|
1185
|
-
blobToBase64(blob).then(function(res) {
|
|
1186
|
-
// console.log(res, "录音格式转换成功,发给后端");
|
|
1187
|
-
setBese64String(res);
|
|
1188
|
-
}).catch(function(err) {
|
|
1189
|
-
// console.log(err, "录音格式转换失败,相应提示");
|
|
1190
|
-
});
|
|
1191
|
-
// const url = URL.createObjectURL(blob);
|
|
1192
|
-
// setMediaUrl(url);
|
|
1193
|
-
// console.log(blob,url,'结束录音')
|
|
1194
|
-
return blob;
|
|
1195
|
-
};
|
|
1196
|
-
(_mediaRecorder_current = mediaRecorder.current) === null || _mediaRecorder_current === void 0 ? void 0 : _mediaRecorder_current.start();
|
|
1197
|
-
return [
|
|
1198
|
-
2
|
|
1199
|
-
];
|
|
1200
|
-
}
|
|
1201
|
-
});
|
|
1202
|
-
});
|
|
1203
|
-
return function startRecord() {
|
|
1204
|
-
return _ref.apply(this, arguments);
|
|
1205
|
-
};
|
|
1206
|
-
}();
|
|
1207
|
-
var pauseRecord = function() {
|
|
1208
|
-
var _ref = _async_to_generator(function() {
|
|
1209
|
-
var // eslint-disable-next-line no-unused-expressions
|
|
1210
|
-
_mediaRecorder_current;
|
|
1211
|
-
return __generator(this, function(_state) {
|
|
1212
|
-
(_mediaRecorder_current = mediaRecorder.current) === null || _mediaRecorder_current === void 0 ? void 0 : _mediaRecorder_current.pause();
|
|
1213
|
-
return [
|
|
1214
|
-
2
|
|
1215
|
-
];
|
|
1216
|
-
});
|
|
1217
|
-
});
|
|
1218
|
-
return function pauseRecord() {
|
|
1219
|
-
return _ref.apply(this, arguments);
|
|
1220
|
-
};
|
|
1221
|
-
}();
|
|
1222
|
-
var resumeRecord = function() {
|
|
1223
|
-
var _ref = _async_to_generator(function() {
|
|
1224
|
-
var // eslint-disable-next-line no-unused-expressions
|
|
1225
|
-
_mediaRecorder_current;
|
|
1226
|
-
return __generator(this, function(_state) {
|
|
1227
|
-
(_mediaRecorder_current = mediaRecorder.current) === null || _mediaRecorder_current === void 0 ? void 0 : _mediaRecorder_current.resume();
|
|
1228
|
-
return [
|
|
1229
|
-
2
|
|
1230
|
-
];
|
|
1231
|
-
});
|
|
1232
|
-
});
|
|
1233
|
-
return function resumeRecord() {
|
|
1234
|
-
return _ref.apply(this, arguments);
|
|
1235
|
-
};
|
|
1236
|
-
}();
|
|
1237
|
-
var stopRecord = function() {
|
|
1238
|
-
var // eslint-disable-next-line no-unused-expressions
|
|
1239
|
-
_mediaRecorder_current, // eslint-disable-next-line no-unused-expressions
|
|
1240
|
-
_mediaStream_current;
|
|
1241
|
-
(_mediaRecorder_current = mediaRecorder.current) === null || _mediaRecorder_current === void 0 ? void 0 : _mediaRecorder_current.stop();
|
|
1242
|
-
(_mediaStream_current = mediaStream.current) === null || _mediaStream_current === void 0 ? void 0 : _mediaStream_current.getTracks().forEach(function(track) {
|
|
1243
|
-
return track.stop();
|
|
1244
|
-
});
|
|
1245
|
-
mediaBlobs.current = [];
|
|
1246
|
-
};
|
|
1247
|
-
var blobToBase64 = function(blob) {
|
|
1248
|
-
return new Promise(function(resolve, reject) {
|
|
1249
|
-
var fileReader = new FileReader();
|
|
1250
|
-
fileReader.readAsDataURL(blob);
|
|
1251
|
-
fileReader.onload = function(e) {
|
|
1252
|
-
var bese64 = fileReader.result.split(",")[1];
|
|
1253
|
-
resolve(bese64);
|
|
1254
|
-
};
|
|
1255
|
-
fileReader.onerror = function() {
|
|
1256
|
-
reject(new Error("blobToBase64 error"));
|
|
1257
|
-
};
|
|
1258
|
-
});
|
|
1259
|
-
};
|
|
1260
|
-
return {
|
|
1261
|
-
bese64String: bese64String,
|
|
1262
|
-
mediaUrl: mediaUrl,
|
|
1263
|
-
startRecord: startRecord,
|
|
1264
|
-
pauseRecord: pauseRecord,
|
|
1265
|
-
resumeRecord: resumeRecord,
|
|
1266
|
-
stopRecord: stopRecord
|
|
1267
|
-
};
|
|
1268
|
-
};
|
|
1269
|
-
|
|
1270
|
-
var TextArea = Input.TextArea;
|
|
1271
|
-
var CustomerService = function(props) {
|
|
1272
|
-
var userData = props.userData, http = props.http, urllocation = props.urllocation, onCancel = props.onCancel, serverName = props.serverName, fetchEventSource = props.fetchEventSource, initShowType = props.initShowType, onEvent = props.onEvent, stepIds = props.stepIds, stepId = props.stepId;
|
|
1273
|
-
// urllocation = "/zhong";
|
|
1274
|
-
var _useState = _sliced_to_array(useState(props.userData.mid), 2), mid = _useState[0]; _useState[1]; //当前用户id
|
|
1275
|
-
var _useMediaRecorder = useMediaRecorder(), bese64String = _useMediaRecorder.bese64String, startRecord = _useMediaRecorder.startRecord, stopRecord = _useMediaRecorder.stopRecord; //语音转文字
|
|
1276
|
-
var _useState1 = _sliced_to_array(useState(3), 2), voiceRecordingStatus = _useState1[0], setVoiceRecordingStatus = _useState1[1]; //语音录制状态 3,语音识别完成 2,录制中, 1,录制结束
|
|
1277
|
-
var _useState2 = _sliced_to_array(useState([]), 2), copyTextOBJ = _useState2[0], setCopyTextObj = _useState2[1]; //复制的消息id
|
|
1278
|
-
var _useState3 = _sliced_to_array(useState({}), 2), citationContent = _useState3[0], setCitationContent = _useState3[1]; //引用内容
|
|
1279
|
-
var _useState4 = _sliced_to_array(useState(""), 2), roomId = _useState4[0], setRoomId = _useState4[1]; //聊天室id
|
|
1280
|
-
var _useState5 = _sliced_to_array(useState([]), 2), historyMessageList = _useState5[0], setHistoryMessageList = _useState5[1]; //历史消息
|
|
1281
|
-
var _useState6 = _sliced_to_array(useState(""), 2), keyWord = _useState6[0], setKeyWord = _useState6[1]; //搜索内容
|
|
1282
|
-
var _useState7 = _sliced_to_array(useState([]), 2), questionsList = _useState7[0], setQuestionsList = _useState7[1]; //问题列表
|
|
1283
|
-
var _useState8 = _sliced_to_array(useState([]), 2), hotQuestionsList = _useState8[0], setHotQuestionsList = _useState8[1]; //热门问题
|
|
1284
|
-
var _useState9 = _sliced_to_array(useState(false), 2), greetingMessage = _useState9[0], setGreetingMessage = _useState9[1]; //聊天记录列表是否请求完成
|
|
1285
|
-
var _useState10 = _sliced_to_array(useState(1), 2), pageNum = _useState10[0], setPageNum = _useState10[1]; //页码
|
|
1286
|
-
var _useState11 = _sliced_to_array(useState(0), 2), pageCount = _useState11[0], setPageCount = _useState11[1]; //总页数
|
|
1287
|
-
var _useState12 = _sliced_to_array(useState(false), 2), loading = _useState12[0], setLoading = _useState12[1]; //是否显示加载图标
|
|
1288
|
-
var _useState13 = _sliced_to_array(useState(true), 2), finished = _useState13[0], setFinished = _useState13[1]; //是否结束生成
|
|
1289
|
-
var _useState14 = _sliced_to_array(useState(""), 2), lastId = _useState14[0], setLastId = _useState14[1]; //最后一条数据的id,可用于定位当前位置
|
|
1290
|
-
var _useState15 = _sliced_to_array(useState({}), 2), chatWith = _useState15[0], setChatWith = _useState15[1]; //聊天的老师id或ai
|
|
1291
|
-
var _useState16 = _sliced_to_array(useState(false), 2), firstLoad = _useState16[0], setFirstLoad = _useState16[1]; //第一次切换全屏时滚动到页面底部
|
|
1292
|
-
var _useState17 = _sliced_to_array(useState(45), 2), buttomHei = _useState17[0], setButtomHei = _useState17[1]; //底部输入框的高度
|
|
1293
|
-
var _useState18 = _sliced_to_array(useState(false), 2), showHistory = _useState18[0], setShowHistory = _useState18[1]; //是否显示历史记录
|
|
1294
|
-
var _useState19 = _sliced_to_array(useState(false), 2), showContacts = _useState19[0], setShowContacts = _useState19[1]; //是否显示关联老师
|
|
1295
|
-
var _useState20 = _sliced_to_array(useState(-1), 2), showType = _useState20[0], setShowType = _useState20[1]; //显示聊天框类型 1、侧边栏 2 modal 3 相应的div中 newlabo中使用
|
|
1296
|
-
var _useState21 = _sliced_to_array(useState(-1), 2), answerMode = _useState21[0], setAnswerMode = _useState21[1]; //设置回答模式。1,召唤老师回答
|
|
1297
|
-
var _useState22 = _sliced_to_array(useState([]), 2), teacherList = _useState22[0], setTeacherList = _useState22[1]; //老师列表
|
|
1298
|
-
var _useState23 = _sliced_to_array(useState({}), 2), problem = _useState23[0], setProblem = _useState23[1]; //召唤老师回答的问题
|
|
1299
|
-
var _useState24 = _sliced_to_array(useState([]), 2), roomList = _useState24[0], setRoomList = _useState24[1]; //聊天列表
|
|
1300
|
-
var _useState25 = _sliced_to_array(useState([]), 2), chatObj = _useState25[0], setChatObj = _useState25[1]; //聊天记录id保存,用来在实验报告中记录
|
|
1301
|
-
var timer = useRef(null); //文本框输入时
|
|
1302
|
-
var receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
1303
|
-
var voiceCountdownTimer = useRef(null); //语音录制倒计时
|
|
1304
|
-
var listTimer = useRef(null); // 请求列表倒计时
|
|
1305
|
-
var ctrl = useRef(); //停止生成ai回答时使用
|
|
1306
|
-
var remarkable = new Remarkable({
|
|
1307
|
-
highlight: function highlight(str, lang) {
|
|
1308
|
-
if (lang && HighlightJS.getLanguage(lang)) {
|
|
1309
|
-
try {
|
|
1310
|
-
return HighlightJS.highlight(lang, str).value;
|
|
1311
|
-
} catch (err) {}
|
|
1312
|
-
}
|
|
1313
|
-
try {
|
|
1314
|
-
return HighlightJS.highlightAuto(str).value;
|
|
1315
|
-
} catch (err) {}
|
|
1316
|
-
return ""; // use external default escaping
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
useEffect(function() {
|
|
1320
|
-
return function() {
|
|
1321
|
-
clearTimeout(receiveMessageTimer.current);
|
|
1322
|
-
clearTimeout(voiceCountdownTimer.current);
|
|
1323
|
-
clearTimeout(listTimer.current);
|
|
1324
|
-
clearTimeout(timer.current);
|
|
1325
|
-
};
|
|
1326
|
-
}, []);
|
|
1327
|
-
useEffect(function() {
|
|
1328
|
-
// console.log("重新加载",pageCount);
|
|
1329
|
-
if (showType == 2 && !firstLoad && pageCount > 0) {
|
|
1330
|
-
setFirstLoad(true);
|
|
1331
|
-
setTimeout(function() {
|
|
1332
|
-
scrollToBottom();
|
|
1333
|
-
}, 100);
|
|
1334
|
-
}
|
|
1335
|
-
function handleScroll() {
|
|
1336
|
-
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
1337
|
-
var scrollTop = container.scrollTop;
|
|
1338
|
-
// const scrollBottom = container.scroll;
|
|
1339
|
-
// console.log(container,'sdcsdcsdcsdc');
|
|
1340
|
-
container.onscroll = function(e) {
|
|
1341
|
-
//元素内部页面滚动到达底部
|
|
1342
|
-
if (e.target.clientHeight + e.target.scrollTop >= e.target.scrollHeight) {
|
|
1343
|
-
//console.log('元素内部页面滚动到达底部');
|
|
1344
|
-
if (pageNum > 1) {
|
|
1345
|
-
var number = pageNum - 1;
|
|
1346
|
-
setPageNum(function(pageNum) {
|
|
1347
|
-
return pageNum - 1;
|
|
1348
|
-
});
|
|
1349
|
-
clearTimeout(listTimer.current);
|
|
1350
|
-
listTimer.current = setTimeout(function() {
|
|
1351
|
-
console.log("加载下一页", number);
|
|
1352
|
-
getHistoryMessage(number, 2);
|
|
1353
|
-
}, 1000);
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
};
|
|
1357
|
-
if (scrollTop == 0 && pageCount > pageNum && pageCount > 0) {
|
|
1358
|
-
setLoading(true);
|
|
1359
|
-
var number = pageNum + 1;
|
|
1360
|
-
setPageNum(function(pageNum) {
|
|
1361
|
-
return pageNum + 1;
|
|
1362
|
-
});
|
|
1363
|
-
clearTimeout(listTimer.current);
|
|
1364
|
-
listTimer.current = setTimeout(function() {
|
|
1365
|
-
console.log("加载下一页", number);
|
|
1366
|
-
getHistoryMessage(number, 0);
|
|
1367
|
-
}, 1000);
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
var content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
1371
|
-
if (content) {
|
|
1372
|
-
content.addEventListener("scroll", handleScroll);
|
|
1373
|
-
}
|
|
1374
|
-
return function() {
|
|
1375
|
-
var content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
1376
|
-
if (content) {
|
|
1377
|
-
content.removeEventListener("scroll", handleScroll);
|
|
1378
|
-
}
|
|
1379
|
-
};
|
|
1380
|
-
}, [
|
|
1381
|
-
historyMessageList,
|
|
1382
|
-
showType,
|
|
1383
|
-
pageCount
|
|
1384
|
-
]);
|
|
1385
|
-
useEffect(function() {
|
|
1386
|
-
resettingBottomHei();
|
|
1387
|
-
var dom = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
1388
|
-
if (dom) {
|
|
1389
|
-
if (showType == 1) {
|
|
1390
|
-
dom.style.maxHeight = "".concat(window.innerHeight - 60 - buttomHei, "px");
|
|
1391
|
-
} else if (showType == 3) {
|
|
1392
|
-
dom.style.maxHeight = "".concat(window.innerHeight - 50 - buttomHei, "px");
|
|
1393
|
-
} else {
|
|
1394
|
-
dom.style.maxHeight = "".concat(window.innerHeight - 160 - 60 - buttomHei, "px");
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
}, [
|
|
1398
|
-
buttomHei,
|
|
1399
|
-
showType
|
|
1400
|
-
]);
|
|
1401
|
-
useEffect(function() {
|
|
1402
|
-
console.log(props, "lsdkcmsdlcksd");
|
|
1403
|
-
getQuestiionsList("", 1);
|
|
1404
|
-
scrollToBottom();
|
|
1405
|
-
// less.modifyVars({ "@color-border-Tr": "#f4523b" });
|
|
1406
|
-
// console.log("9999999", less);
|
|
1407
|
-
// getRoomList();
|
|
1408
|
-
setShowType(initShowType);
|
|
1409
|
-
}, [
|
|
1410
|
-
initShowType
|
|
1411
|
-
]);
|
|
1412
|
-
useEffect(function() {
|
|
1413
|
-
// console.log(roomId,1111111)
|
|
1414
|
-
if (roomId != "") {
|
|
1415
|
-
// console.log(roomId,2222222)
|
|
1416
|
-
var num = pageNum != 1 ? pageNum : 1;
|
|
1417
|
-
getHistoryMessage(num, 0);
|
|
1418
|
-
scrollToBottom();
|
|
1419
|
-
}
|
|
1420
|
-
}, [
|
|
1421
|
-
roomId
|
|
1422
|
-
]);
|
|
1423
|
-
useEffect(function() {
|
|
1424
|
-
console.log(roomList, "roomListroomListroomListroomListroomList");
|
|
1425
|
-
if (roomList.length > 0) {
|
|
1426
|
-
//切换到有聊天的窗口
|
|
1427
|
-
var message = roomList.filter(function(item) {
|
|
1428
|
-
return item.unreadCount > 0;
|
|
1429
|
-
});
|
|
1430
|
-
if (message.length > 0) {
|
|
1431
|
-
setRoomId(message[0].roomId);
|
|
1432
|
-
readMessage(message[0].roomId, urllocation, userData, http);
|
|
1433
|
-
} else {
|
|
1434
|
-
setRoomId(roomList[0].roomId);
|
|
1435
|
-
}
|
|
1436
|
-
} else {
|
|
1437
|
-
createRooms("AI").then(function(res) {
|
|
1438
|
-
// console.log(res.data,'dlfkvdlkfvmdf');
|
|
1439
|
-
setRoomId(res.data.id);
|
|
1440
|
-
setRoomList([
|
|
1441
|
-
{
|
|
1442
|
-
roomId: res.data.id,
|
|
1443
|
-
unreadCount: 0,
|
|
1444
|
-
uid: mid
|
|
1445
|
-
}
|
|
1446
|
-
]);
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
}, [
|
|
1450
|
-
roomList
|
|
1451
|
-
]);
|
|
1452
|
-
//进入页面,发送打招呼信息
|
|
1453
|
-
useEffect(function() {
|
|
1454
|
-
// console.log(historyMessageList, "dkjvndfkjvd33333f");
|
|
1455
|
-
//老师的聊天窗口不发送打招呼信息
|
|
1456
|
-
if (!(roomList.length > 0 && roomList[0].roomId != roomId)) {
|
|
1457
|
-
//是否发送打招呼信息
|
|
1458
|
-
if (greetingMessage && historyMessageList.length == 0) {
|
|
1459
|
-
sendGreetingMessage(1);
|
|
1460
|
-
} else {
|
|
1461
|
-
try {
|
|
1462
|
-
if (historyMessageList[historyMessageList.length - 1].extraInfo == null) {
|
|
1463
|
-
sendGreetingMessage(1);
|
|
1464
|
-
} else if (JSON.parse(historyMessageList[historyMessageList.length - 1].extraInfo).length > 0 && (JSON.parse(historyMessageList[historyMessageList.length - 1].extraInfo)[0].key == "questionId" || JSON.parse(historyMessageList[historyMessageList.length - 1].extraInfo)[0].value == "knowledgebase")) {
|
|
1465
|
-
console.log(JSON.parse(historyMessageList[historyMessageList.length - 1].extraInfo, "sdklsdksd"));
|
|
1466
|
-
sendGreetingMessage(1);
|
|
1467
|
-
}
|
|
1468
|
-
} catch (error) {}
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
scrollToBottom();
|
|
1472
|
-
}, [
|
|
1473
|
-
greetingMessage,
|
|
1474
|
-
hotQuestionsList
|
|
1475
|
-
]);
|
|
1476
|
-
//语音转文字
|
|
1477
|
-
useEffect(function() {
|
|
1478
|
-
if (bese64String != "") {
|
|
1479
|
-
speechToText();
|
|
1480
|
-
}
|
|
1481
|
-
//发送给后端语音brse64
|
|
1482
|
-
}, [
|
|
1483
|
-
bese64String
|
|
1484
|
-
]);
|
|
1485
|
-
//AI窗口,type:1发送打招呼信息 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
1486
|
-
var sendGreetingMessage = function(type) {
|
|
1487
|
-
var questionsList = [];
|
|
1488
|
-
var obj = {};
|
|
1489
|
-
if (type == 1) {
|
|
1490
|
-
questionsList = hotQuestionsList.map(function(item, index) {
|
|
1491
|
-
if (index < 3) {
|
|
1492
|
-
return {
|
|
1493
|
-
key: "messageSource",
|
|
1494
|
-
value: item.id,
|
|
1495
|
-
question: item.question,
|
|
1496
|
-
answer: item.answer
|
|
1497
|
-
};
|
|
1498
|
-
} else {
|
|
1499
|
-
return null;
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
|
-
questionsList = questionsList.filter(function(i) {
|
|
1503
|
-
return i != null;
|
|
1504
|
-
});
|
|
1505
|
-
obj = {
|
|
1506
|
-
roomId: roomId,
|
|
1507
|
-
sender: "AI",
|
|
1508
|
-
recevier: mid,
|
|
1509
|
-
message: "Hi!我是有问必答的实训云智能客服,请问您遇到了什么问题?",
|
|
1510
|
-
extraInfos: questionsList
|
|
1511
|
-
};
|
|
1512
|
-
} else if (type == 2) {
|
|
1513
|
-
obj = {
|
|
1514
|
-
roomId: roomId,
|
|
1515
|
-
sender: "AI",
|
|
1516
|
-
recevier: mid,
|
|
1517
|
-
message: "您的点赞是我最大的鼓励!",
|
|
1518
|
-
createdAt: getDataTime(-1),
|
|
1519
|
-
extraInfos: [
|
|
1520
|
-
{
|
|
1521
|
-
key: "messageSource",
|
|
1522
|
-
value: "knowledgebase"
|
|
1523
|
-
}
|
|
1524
|
-
]
|
|
1525
|
-
};
|
|
1526
|
-
} else if (type == 3) {
|
|
1527
|
-
obj = {
|
|
1528
|
-
roomId: roomId,
|
|
1529
|
-
sender: "AI",
|
|
1530
|
-
recevier: mid,
|
|
1531
|
-
message: "谢谢您的反馈,我会努力改进的!",
|
|
1532
|
-
createdAt: getDataTime(-1),
|
|
1533
|
-
extraInfos: [
|
|
1534
|
-
{
|
|
1535
|
-
key: "messageSource",
|
|
1536
|
-
value: "knowledgebase"
|
|
1537
|
-
}
|
|
1538
|
-
]
|
|
1539
|
-
};
|
|
1540
|
-
} else if (type == 4) {
|
|
1541
|
-
obj = {
|
|
1542
|
-
roomId: roomId,
|
|
1543
|
-
sender: mid,
|
|
1544
|
-
recevier: "AI",
|
|
1545
|
-
message: keyWord,
|
|
1546
|
-
createdAt: getDataTime(-1),
|
|
1547
|
-
quotedMessage: citationContent.content,
|
|
1548
|
-
extraInfos: [
|
|
1549
|
-
{
|
|
1550
|
-
key: "messageSource",
|
|
1551
|
-
value: "knowledgebase"
|
|
1552
|
-
}
|
|
1553
|
-
]
|
|
1554
|
-
};
|
|
1555
|
-
} else if (type == 5) {
|
|
1556
|
-
obj = {
|
|
1557
|
-
roomId: roomId,
|
|
1558
|
-
sender: "AI",
|
|
1559
|
-
recevier: mid,
|
|
1560
|
-
message: "抱歉!您今日的提问量已经达到最大限额,请您明日再来提问。",
|
|
1561
|
-
createdAt: getDataTime(-1),
|
|
1562
|
-
quotedMessage: citationContent.content,
|
|
1563
|
-
extraInfos: [
|
|
1564
|
-
{
|
|
1565
|
-
key: "messageSource",
|
|
1566
|
-
value: "knowledgebase"
|
|
1567
|
-
}
|
|
1568
|
-
]
|
|
1569
|
-
};
|
|
1570
|
-
} else if (type == 6) {
|
|
1571
|
-
questionsList = hotQuestionsList.map(function(item) {
|
|
1572
|
-
return {
|
|
1573
|
-
key: "messageSource",
|
|
1574
|
-
value: item.id,
|
|
1575
|
-
question: item.question,
|
|
1576
|
-
answer: item.answer
|
|
1577
|
-
};
|
|
1578
|
-
});
|
|
1579
|
-
obj = {
|
|
1580
|
-
roomId: roomId,
|
|
1581
|
-
sender: "AI",
|
|
1582
|
-
recevier: mid,
|
|
1583
|
-
message: "猜你想问:",
|
|
1584
|
-
extraInfos: questionsList
|
|
1585
|
-
};
|
|
1586
|
-
}
|
|
1587
|
-
setKeyWord("");
|
|
1588
|
-
setQuestionsList([]);
|
|
1589
|
-
setCitationContent({});
|
|
1590
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj, {
|
|
1591
|
-
headers: {
|
|
1592
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
1593
|
-
return ele.short == "IntelligentCustomerService";
|
|
1594
|
-
}).id,
|
|
1595
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
1596
|
-
}
|
|
1597
|
-
}).then(function(res) {
|
|
1598
|
-
if (res.data.id) {
|
|
1599
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1600
|
-
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
1601
|
-
id: res.data.id,
|
|
1602
|
-
upvoted: false,
|
|
1603
|
-
downvoted: false,
|
|
1604
|
-
quotedMessage: "",
|
|
1605
|
-
createdAt: getDataTime(-1),
|
|
1606
|
-
extraInfo: JSON.stringify(obj.extraInfos)
|
|
1607
|
-
}));
|
|
1608
|
-
return newHistoryMessageList;
|
|
1609
|
-
});
|
|
1610
|
-
scrollToBottom();
|
|
1611
|
-
if (type == 4) {
|
|
1612
|
-
sendGreetingMessage(6);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
}).catch(function(err) {
|
|
1616
|
-
console.log(err);
|
|
1617
|
-
});
|
|
1618
|
-
};
|
|
1619
|
-
//消息发送给老师type == 1,召唤老师时发送,type == 2,在老师聊天窗口聊天
|
|
1620
|
-
var sendToTeacher = function(type) {
|
|
1621
|
-
console.log("消息发送给老师111");
|
|
1622
|
-
var obj = {};
|
|
1623
|
-
if (type == 1) {
|
|
1624
|
-
obj = {
|
|
1625
|
-
roomId: roomId,
|
|
1626
|
-
sender: mid,
|
|
1627
|
-
recevier: chatWith.uid,
|
|
1628
|
-
message: problem.question
|
|
1629
|
-
};
|
|
1630
|
-
} else if (type == 2) {
|
|
1631
|
-
var list = roomList.filter(function(item) {
|
|
1632
|
-
return item.roomId == roomId;
|
|
1633
|
-
});
|
|
1634
|
-
var recevier = "";
|
|
1635
|
-
if (list.length > 0) {
|
|
1636
|
-
recevier = list[0].sender;
|
|
1637
|
-
}
|
|
1638
|
-
obj = {
|
|
1639
|
-
roomId: roomId,
|
|
1640
|
-
sender: mid,
|
|
1641
|
-
recevier: recevier,
|
|
1642
|
-
message: keyWord
|
|
1643
|
-
};
|
|
1644
|
-
}
|
|
1645
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/chat-with-user/messages"), obj, {
|
|
1646
|
-
headers: {
|
|
1647
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
1648
|
-
return ele.short == "TeacherAnswer";
|
|
1649
|
-
}).id,
|
|
1650
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
1651
|
-
}
|
|
1652
|
-
}).then(function(res) {
|
|
1653
|
-
if (res.data.id) {
|
|
1654
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1655
|
-
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
1656
|
-
id: res.data.id,
|
|
1657
|
-
upvoted: false,
|
|
1658
|
-
downvoted: false,
|
|
1659
|
-
quotedMessage: "",
|
|
1660
|
-
createdAt: getDataTime(-1)
|
|
1661
|
-
}));
|
|
1662
|
-
return newHistoryMessageList;
|
|
1663
|
-
});
|
|
1664
|
-
scrollToBottom();
|
|
1665
|
-
//记录一个问题id,用于记录老师和学生之间的聊天保存到实验报告中
|
|
1666
|
-
if (stepIds != undefined && stepIds != "" && (showType == 3 || showType == 4)) {
|
|
1667
|
-
// setChatObj({'roomId':roomId,'id':res.data.id});
|
|
1668
|
-
var obj1 = [
|
|
1669
|
-
{
|
|
1670
|
-
"roomId": roomId,
|
|
1671
|
-
"id": res.data.id
|
|
1672
|
-
}
|
|
1673
|
-
];
|
|
1674
|
-
setChatObj(function(list) {
|
|
1675
|
-
var list2 = list.filter(function(item) {
|
|
1676
|
-
return item.id != obj1[0].id;
|
|
1677
|
-
});
|
|
1678
|
-
return list2.concat(obj1);
|
|
1679
|
-
});
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
}).catch(function(err) {
|
|
1683
|
-
console.log(err);
|
|
1684
|
-
});
|
|
1685
|
-
};
|
|
1686
|
-
//发送知识库问题 item,flag == 1 是获取问候信息的答案,flag == 2 是普通消息
|
|
1687
|
-
var sendMessage = function(item, flag) {
|
|
1688
|
-
var questions = [];
|
|
1689
|
-
if (item && flag) {
|
|
1690
|
-
questions = [
|
|
1691
|
-
item
|
|
1692
|
-
];
|
|
1693
|
-
}
|
|
1694
|
-
//点击知识库的问题,或者是点击问候消息
|
|
1695
|
-
if (questions.length > 0) {
|
|
1696
|
-
questions = questions[0];
|
|
1697
|
-
//向知识库发送问题 type 1,发送问题 2 发送答案 obj 需要的参数
|
|
1698
|
-
var obj = {
|
|
1699
|
-
roomId: roomId,
|
|
1700
|
-
sender: mid,
|
|
1701
|
-
recevier: "AI",
|
|
1702
|
-
message: questions.question,
|
|
1703
|
-
extraInfos: [
|
|
1704
|
-
{
|
|
1705
|
-
key: "questionId",
|
|
1706
|
-
value: flag == 1 ? questions.value : questions.id
|
|
1707
|
-
}
|
|
1708
|
-
]
|
|
1709
|
-
};
|
|
1710
|
-
//发送问题 1 类型,发送问题需要的参数,问题的答案id等
|
|
1711
|
-
sendingExistingIssues(1, obj, {
|
|
1712
|
-
key: "questionId",
|
|
1713
|
-
value: flag == 1 ? questions.value : questions.id,
|
|
1714
|
-
answer: questions.answer
|
|
1715
|
-
});
|
|
1716
|
-
setKeyWord("");
|
|
1717
|
-
setQuestionsList([]);
|
|
1718
|
-
setCitationContent({});
|
|
1719
|
-
} else if (userData.modules.some(function(item) {
|
|
1720
|
-
return item.short == "AIservice";
|
|
1721
|
-
})) {
|
|
1722
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1723
|
-
var newHistoryMessageList = historyMessageList.concat({
|
|
1724
|
-
roomId: roomId,
|
|
1725
|
-
sender: mid,
|
|
1726
|
-
recevier: "AI",
|
|
1727
|
-
message: keyWord,
|
|
1728
|
-
quotedMessage: citationContent.content,
|
|
1729
|
-
id: "654321",
|
|
1730
|
-
upvoted: false,
|
|
1731
|
-
downvoted: false,
|
|
1732
|
-
createdAt: getDataTime(-1),
|
|
1733
|
-
extraInfo: JSON.stringify([])
|
|
1734
|
-
});
|
|
1735
|
-
return newHistoryMessageList;
|
|
1736
|
-
});
|
|
1737
|
-
setFinished(false);
|
|
1738
|
-
aiSendQuestions(3, {
|
|
1739
|
-
//相关数据
|
|
1740
|
-
roomId: roomId,
|
|
1741
|
-
message: keyWord,
|
|
1742
|
-
quotedMessage: citationContent.content || "",
|
|
1743
|
-
regenerate: citationContent.content != "" ? false : true,
|
|
1744
|
-
generateUpvoteOrDownvoteMessage: false
|
|
1745
|
-
}, 1);
|
|
1746
|
-
//存在AI客服
|
|
1747
|
-
} else {
|
|
1748
|
-
//不存在AI客服
|
|
1749
|
-
sendGreetingMessage(4);
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
//向知识库发送问题 或答案 type:1 发送问题 2 接受答案
|
|
1753
|
-
var sendingExistingIssues = function(type, obj, questions) {
|
|
1754
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1755
|
-
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
1756
|
-
id: null,
|
|
1757
|
-
upvoted: false,
|
|
1758
|
-
downvoted: false,
|
|
1759
|
-
createdAt: getDataTime(-1),
|
|
1760
|
-
extraInfo: JSON.stringify(obj.extraInfos)
|
|
1761
|
-
}));
|
|
1762
|
-
return newHistoryMessageList;
|
|
1763
|
-
});
|
|
1764
|
-
scrollToBottom();
|
|
1765
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj, {
|
|
1766
|
-
headers: {
|
|
1767
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
1768
|
-
return ele.short == "IntelligentCustomerService";
|
|
1769
|
-
}).id,
|
|
1770
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
1771
|
-
}
|
|
1772
|
-
}).then(function(res) {
|
|
1773
|
-
if (res.data.id) {
|
|
1774
|
-
//更新聊天记录id
|
|
1775
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1776
|
-
var newHistoryMessageList = historyMessageList.map(function(item) {
|
|
1777
|
-
if (item.id == null) {
|
|
1778
|
-
return _object_spread_props(_object_spread({}, item), {
|
|
1779
|
-
id: res.data.id
|
|
1780
|
-
});
|
|
1781
|
-
} else {
|
|
1782
|
-
return item;
|
|
1783
|
-
}
|
|
1784
|
-
});
|
|
1785
|
-
return newHistoryMessageList;
|
|
1786
|
-
});
|
|
1787
|
-
}
|
|
1788
|
-
if (type == 1) {
|
|
1789
|
-
//发送答案,调用自动回答
|
|
1790
|
-
var dataObj = {
|
|
1791
|
-
roomId: roomId,
|
|
1792
|
-
sender: "AI",
|
|
1793
|
-
recevier: mid,
|
|
1794
|
-
message: questions.answer,
|
|
1795
|
-
extraInfos: [
|
|
1796
|
-
{
|
|
1797
|
-
key: "questionId",
|
|
1798
|
-
value: questions.value
|
|
1799
|
-
}
|
|
1800
|
-
]
|
|
1801
|
-
};
|
|
1802
|
-
sendingExistingIssues(2, dataObj, "");
|
|
1803
|
-
testLabQuestion(obj.message, questions.answer, "");
|
|
1804
|
-
}
|
|
1805
|
-
}).then(function(res) {
|
|
1806
|
-
console.log(res);
|
|
1807
|
-
});
|
|
1808
|
-
};
|
|
1809
|
-
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
1810
|
-
var content = ""; //用于实验报告的问题记录
|
|
1811
|
-
var aiSendQuestions = function(type, obj, id) {
|
|
1812
|
-
content = "";
|
|
1813
|
-
// if (type == 3) {
|
|
1814
|
-
// try {
|
|
1815
|
-
// if (ctrl && ctrl.current) {
|
|
1816
|
-
// ctrl.current.abort();
|
|
1817
|
-
// }
|
|
1818
|
-
// } catch (error) {}
|
|
1819
|
-
// clearTimeout(receiveMessageTimer.current);
|
|
1820
|
-
// setHistoryMessageList((historyMessageList) => {
|
|
1821
|
-
// return historyMessageList.filter((item) => item.id != "123456");
|
|
1822
|
-
// });
|
|
1823
|
-
// setFinished(true);
|
|
1824
|
-
// return;
|
|
1825
|
-
// }
|
|
1826
|
-
ctrl.current = new AbortController();
|
|
1827
|
-
clearTimeout(receiveMessageTimer.current);
|
|
1828
|
-
receiveMessageTimer.current = setTimeout(function() {
|
|
1829
|
-
// console.log('超时终止1111')
|
|
1830
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1831
|
-
return historyMessageList.filter(function(item) {
|
|
1832
|
-
return item.id != "123456" && item.id != "654321";
|
|
1833
|
-
});
|
|
1834
|
-
});
|
|
1835
|
-
setFinished(true);
|
|
1836
|
-
ctrl.current.abort();
|
|
1837
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1838
|
-
return historyMessageList.concat({
|
|
1839
|
-
roomId: roomId,
|
|
1840
|
-
sender: "AI",
|
|
1841
|
-
recevier: mid,
|
|
1842
|
-
message: "网络异常,请稍后重试!",
|
|
1843
|
-
id: "123456",
|
|
1844
|
-
createdAt: getDataTime(-1),
|
|
1845
|
-
extraInfo: null
|
|
1846
|
-
});
|
|
1847
|
-
});
|
|
1848
|
-
}, 60 * 1000);
|
|
1849
|
-
var data = JSON.stringify(obj);
|
|
1850
|
-
// if (type == 1 || type == 2) {
|
|
1851
|
-
// data = JSON.stringify(obj);
|
|
1852
|
-
// } else if(type == 3){
|
|
1853
|
-
// data = JSON.stringify({
|
|
1854
|
-
// //相关数据
|
|
1855
|
-
// roomId: roomId,
|
|
1856
|
-
// message: keyWord,
|
|
1857
|
-
// quotedMessage: citationContent.content || "",
|
|
1858
|
-
// regenerate: citationContent.content != "" ? false : true,
|
|
1859
|
-
// generateUpvoteOrDownvoteMessage: false,
|
|
1860
|
-
// });
|
|
1861
|
-
// }
|
|
1862
|
-
setKeyWord("");
|
|
1863
|
-
setQuestionsList([]);
|
|
1864
|
-
setTimeout(function() {
|
|
1865
|
-
setQuestionsList([]);
|
|
1866
|
-
}, 2000);
|
|
1867
|
-
//占位信息
|
|
1868
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1869
|
-
if (type == 2) {
|
|
1870
|
-
return historyMessageList.map(function(item) {
|
|
1871
|
-
if (item.id == id) {
|
|
1872
|
-
return {
|
|
1873
|
-
roomId: roomId,
|
|
1874
|
-
sender: "AI",
|
|
1875
|
-
recevier: mid,
|
|
1876
|
-
message: "正在输入...",
|
|
1877
|
-
id: "123456",
|
|
1878
|
-
createdAt: getDataTime(-1),
|
|
1879
|
-
extraInfo: null
|
|
1880
|
-
};
|
|
1881
|
-
} else {
|
|
1882
|
-
return item;
|
|
1883
|
-
}
|
|
1884
|
-
});
|
|
1885
|
-
} else {
|
|
1886
|
-
return historyMessageList.concat({
|
|
1887
|
-
roomId: roomId,
|
|
1888
|
-
sender: "AI",
|
|
1889
|
-
recevier: mid,
|
|
1890
|
-
message: "正在输入...",
|
|
1891
|
-
id: "123456",
|
|
1892
|
-
createdAt: getDataTime(-1),
|
|
1893
|
-
extraInfo: null
|
|
1894
|
-
});
|
|
1895
|
-
}
|
|
1896
|
-
});
|
|
1897
|
-
setTimeout(function() {
|
|
1898
|
-
scrollToBottom();
|
|
1899
|
-
}, 10);
|
|
1900
|
-
//使用fetchEventSource接收数据
|
|
1901
|
-
fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
|
|
1902
|
-
method: "POST",
|
|
1903
|
-
headers: {
|
|
1904
|
-
"Content-Type": "application/json",
|
|
1905
|
-
Accept: "text/event-stream,application/json",
|
|
1906
|
-
"X-Auth-Jwt": window.localStorage.getItem("usertoken") || "",
|
|
1907
|
-
"Auth-Token": userData.token,
|
|
1908
|
-
"X-Module-Id": userData.modules.find(function(ele) {
|
|
1909
|
-
return ele.short == "AIservice";
|
|
1910
|
-
}).id
|
|
1911
|
-
},
|
|
1912
|
-
body: data,
|
|
1913
|
-
signal: ctrl.current.signal,
|
|
1914
|
-
openWhenHidden: true,
|
|
1915
|
-
onopen: function(res) {
|
|
1916
|
-
console.info("eventSource open: ", res);
|
|
1917
|
-
clearTimeout(receiveMessageTimer.current);
|
|
1918
|
-
if (res.status >= 300) {
|
|
1919
|
-
console.log("sdckjsdncskdcjsdc", res.status);
|
|
1920
|
-
setFinished(true);
|
|
1921
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1922
|
-
return historyMessageList.filter(function(item) {
|
|
1923
|
-
return item.id != "123456" && item.id != "654321";
|
|
1924
|
-
});
|
|
1925
|
-
});
|
|
1926
|
-
ctrl.current.abort();
|
|
1927
|
-
}
|
|
1928
|
-
if (res.status == 200) {
|
|
1929
|
-
setFinished(false);
|
|
1930
|
-
}
|
|
1931
|
-
if (res.status == 401) {
|
|
1932
|
-
//身份认证未通过,从新请求新的token后再次发送请求
|
|
1933
|
-
verifyJWT(urllocation).then(function() {
|
|
1934
|
-
console.log("重新请求");
|
|
1935
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1936
|
-
return historyMessageList.filter(function(item) {
|
|
1937
|
-
return item.id != "123456" && item.id != "654321";
|
|
1938
|
-
});
|
|
1939
|
-
});
|
|
1940
|
-
aiSendQuestions(type, obj, id);
|
|
1941
|
-
});
|
|
1942
|
-
}
|
|
1943
|
-
if (res.status == 403) {
|
|
1944
|
-
//暂无权限
|
|
1945
|
-
console.log("暂无权限");
|
|
1946
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1947
|
-
return historyMessageList.concat({
|
|
1948
|
-
roomId: roomId,
|
|
1949
|
-
sender: "AI",
|
|
1950
|
-
recevier: mid,
|
|
1951
|
-
message: "暂无权限",
|
|
1952
|
-
id: "123456",
|
|
1953
|
-
createdAt: "",
|
|
1954
|
-
extraInfo: null
|
|
1955
|
-
});
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
if (res.status == 429) ;
|
|
1959
|
-
if (res.status == 429) {
|
|
1960
|
-
//每天问答的 Token 数必须小于等于 10 万。
|
|
1961
|
-
sendGreetingMessage(5);
|
|
1962
|
-
}
|
|
1963
|
-
if (res.status == 500) {
|
|
1964
|
-
// 系统错误,请稍后再试。
|
|
1965
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1966
|
-
return historyMessageList.concat({
|
|
1967
|
-
roomId: roomId,
|
|
1968
|
-
sender: "AI",
|
|
1969
|
-
recevier: mid,
|
|
1970
|
-
message: "系统出错了,请稍后重试!",
|
|
1971
|
-
id: "123456",
|
|
1972
|
-
createdAt: "",
|
|
1973
|
-
extraInfo: null
|
|
1974
|
-
});
|
|
1975
|
-
});
|
|
1976
|
-
}
|
|
1977
|
-
},
|
|
1978
|
-
onerror: function(err) {
|
|
1979
|
-
console.log(err, "dflkvdmfvlkdfv");
|
|
1980
|
-
err.response;
|
|
1981
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
1982
|
-
return historyMessageList.concat({
|
|
1983
|
-
roomId: roomId,
|
|
1984
|
-
sender: "AI",
|
|
1985
|
-
recevier: mid,
|
|
1986
|
-
message: "系统出错了,请稍后重试!",
|
|
1987
|
-
id: "123456",
|
|
1988
|
-
createdAt: "",
|
|
1989
|
-
extraInfo: null
|
|
1990
|
-
});
|
|
1991
|
-
});
|
|
1992
|
-
},
|
|
1993
|
-
onmessage: function(event) {
|
|
1994
|
-
//识别的内容
|
|
1995
|
-
// console.log("eventSource msg: ", event.data);
|
|
1996
|
-
var msg = JSON.parse(event.data);
|
|
1997
|
-
if (msg.message) {
|
|
1998
|
-
content = content + msg.message;
|
|
1999
|
-
renderAiAnswer(msg, id, type);
|
|
2000
|
-
}
|
|
2001
|
-
if (msg.finished) {
|
|
2002
|
-
setFinished(true); //发送结束
|
|
2003
|
-
console.log(content, JSON.parse(data), "sdklcksdlcms");
|
|
2004
|
-
testLabQuestion(JSON.parse(data).message, content, "");
|
|
2005
|
-
}
|
|
2006
|
-
},
|
|
2007
|
-
onclose: function() {
|
|
2008
|
-
setFinished(true); //发送结束
|
|
2009
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2010
|
-
return historyMessageList.filter(function(item) {
|
|
2011
|
-
return item.id != "123456";
|
|
2012
|
-
});
|
|
2013
|
-
});
|
|
2014
|
-
}
|
|
2015
|
-
});
|
|
2016
|
-
};
|
|
2017
|
-
//渲染AI回答
|
|
2018
|
-
var renderAiAnswer = function(msg, message_id, type) {
|
|
2019
|
-
// console.log(aiSendQuestions().abort(),'slkdsdsdsd')
|
|
2020
|
-
var obj = msg;
|
|
2021
|
-
var id = msg.messageId;
|
|
2022
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2023
|
-
var list1 = historyMessageList;
|
|
2024
|
-
//删除临时数据
|
|
2025
|
-
list1 = list1.filter(function(item) {
|
|
2026
|
-
return item.id != "123456";
|
|
2027
|
-
});
|
|
2028
|
-
//重新生成答案时,使用原来的消息
|
|
2029
|
-
if (message_id != undefined) {
|
|
2030
|
-
list1 = list1.filter(function(item) {
|
|
2031
|
-
return item.id != message_id;
|
|
2032
|
-
});
|
|
2033
|
-
}
|
|
2034
|
-
var list = historyMessageList.filter(function(item) {
|
|
2035
|
-
return item.id == id;
|
|
2036
|
-
});
|
|
2037
|
-
var message = "";
|
|
2038
|
-
if (list.length == 0) {
|
|
2039
|
-
message = obj.message;
|
|
2040
|
-
var newHistoryMessageList = list1.concat({
|
|
2041
|
-
roomId: roomId,
|
|
2042
|
-
sender: "AI",
|
|
2043
|
-
recevier: mid,
|
|
2044
|
-
message: message,
|
|
2045
|
-
id: id,
|
|
2046
|
-
upvoted: false,
|
|
2047
|
-
downvoted: false,
|
|
2048
|
-
createdAt: getDataTime(-1),
|
|
2049
|
-
extraInfo: type == 1 ? JSON.stringify([
|
|
2050
|
-
{
|
|
2051
|
-
key: "isVoteMessage",
|
|
2052
|
-
value: true
|
|
2053
|
-
}
|
|
2054
|
-
]) : null
|
|
2055
|
-
});
|
|
2056
|
-
return newHistoryMessageList;
|
|
2057
|
-
} else {
|
|
2058
|
-
var newHistoryMessageList2 = list1.map(function(item) {
|
|
2059
|
-
message = item.message + obj.message;
|
|
2060
|
-
if (item.id == id) {
|
|
2061
|
-
return _object_spread_props(_object_spread({}, item), {
|
|
2062
|
-
message: message
|
|
2063
|
-
});
|
|
2064
|
-
} else {
|
|
2065
|
-
return item;
|
|
2066
|
-
}
|
|
2067
|
-
});
|
|
2068
|
-
return newHistoryMessageList2;
|
|
2069
|
-
}
|
|
2070
|
-
});
|
|
2071
|
-
setTimeout(function() {
|
|
2072
|
-
scrollToBottom();
|
|
2073
|
-
}, 10);
|
|
2074
|
-
};
|
|
2075
|
-
//问题记录到实验报告中
|
|
2076
|
-
var testLabQuestion = function(title, content, teachId) {
|
|
2077
|
-
console.log(title, content, "记录到实验报告中");
|
|
2078
|
-
if (stepIds != undefined && stepIds != "" && (showType == 3 || showType == 4)) {
|
|
2079
|
-
http.post("".concat(urllocation, "/sandboxes/public/v1.0/labquestion"), {
|
|
2080
|
-
title: title,
|
|
2081
|
-
content: content,
|
|
2082
|
-
teachId: teachId != undefined ? teachId : chatWith.uid | mid,
|
|
2083
|
-
stepId: stepId,
|
|
2084
|
-
stepIds: stepIds
|
|
2085
|
-
}, {
|
|
2086
|
-
headers: {
|
|
2087
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2088
|
-
return ele.short == "IntelligentCustomerService";
|
|
2089
|
-
}).id,
|
|
2090
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2091
|
-
}
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
|
-
};
|
|
2095
|
-
//语音转文字
|
|
2096
|
-
var speechToText = function() {
|
|
2097
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/speech:recognize"), {
|
|
2098
|
-
audio: bese64String
|
|
2099
|
-
}, {
|
|
2100
|
-
headers: {
|
|
2101
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2102
|
-
return ele.short == "AIservice";
|
|
2103
|
-
}).id,
|
|
2104
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2105
|
-
}
|
|
2106
|
-
}).then(function(res) {
|
|
2107
|
-
setVoiceRecordingStatus(3);
|
|
2108
|
-
if (res.data) {
|
|
2109
|
-
setKeyWord(res.data.text);
|
|
2110
|
-
resettingBottomHei();
|
|
2111
|
-
}
|
|
2112
|
-
}).catch(function(err) {
|
|
2113
|
-
setKeyWord("");
|
|
2114
|
-
setVoiceRecordingStatus(3);
|
|
2115
|
-
});
|
|
2116
|
-
};
|
|
2117
|
-
//创建聊天室
|
|
2118
|
-
var createRooms = function(uid) {
|
|
2119
|
-
return http.post("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
2120
|
-
chatWith: uid
|
|
2121
|
-
}, {
|
|
2122
|
-
headers: {
|
|
2123
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2124
|
-
return ele.short == "IntelligentCustomerService";
|
|
2125
|
-
}).id,
|
|
2126
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2127
|
-
}
|
|
2128
|
-
});
|
|
2129
|
-
};
|
|
2130
|
-
//获取历史消息 flag:1,历史记录点击定位,2,代表是下拉加载,3,存在新的消息-->老师回答等
|
|
2131
|
-
var getHistoryMessage = function(pageNum, flag) {
|
|
2132
|
-
console.log(pageNum, flag, "重新加载数据2222");
|
|
2133
|
-
if (roomId == "") return;
|
|
2134
|
-
return http.get("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), {
|
|
2135
|
-
params: {
|
|
2136
|
-
roomId: roomId,
|
|
2137
|
-
page: pageNum != undefined && pageNum != -1 ? pageNum : 1,
|
|
2138
|
-
maxPageSize: 30,
|
|
2139
|
-
direction: "desc"
|
|
2140
|
-
},
|
|
2141
|
-
headers: {
|
|
2142
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2143
|
-
return ele.short == "IntelligentCustomerService";
|
|
2144
|
-
}).id,
|
|
2145
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2146
|
-
}
|
|
2147
|
-
}).then(function(res) {
|
|
2148
|
-
if (res.data.messages.length > 0) {
|
|
2149
|
-
clearTimeout(listTimer.current);
|
|
2150
|
-
var last_id = "";
|
|
2151
|
-
var total = res.data.total;
|
|
2152
|
-
var maxPageSize = 30;
|
|
2153
|
-
var dataList = res.data.messages.reverse();
|
|
2154
|
-
setPageCount(Math.ceil(total / maxPageSize));
|
|
2155
|
-
var newHistoryMessageList = [];
|
|
2156
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2157
|
-
if (flag != 1 && historyMessageList.length > 0) {
|
|
2158
|
-
if (flag == 2) {
|
|
2159
|
-
last_id = historyMessageList[historyMessageList.length - 1].id;
|
|
2160
|
-
} else {
|
|
2161
|
-
last_id = historyMessageList[0].id;
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
newHistoryMessageList = [];
|
|
2165
|
-
//查找历史记录flag==1
|
|
2166
|
-
if (pageNum == 1 || flag == 1 || flag == 3) {
|
|
2167
|
-
newHistoryMessageList = dataList;
|
|
2168
|
-
} else if (flag == 2) {
|
|
2169
|
-
//下拉加载
|
|
2170
|
-
newHistoryMessageList = historyMessageList.concat(dataList);
|
|
2171
|
-
} else {
|
|
2172
|
-
newHistoryMessageList = dataList.concat(historyMessageList);
|
|
2173
|
-
}
|
|
2174
|
-
var _$res = new Map();
|
|
2175
|
-
newHistoryMessageList = newHistoryMessageList.filter(function(a) {
|
|
2176
|
-
return !_$res.has(a.id) && _$res.set(a.id, 1);
|
|
2177
|
-
});
|
|
2178
|
-
return newHistoryMessageList;
|
|
2179
|
-
});
|
|
2180
|
-
//如果在跟老师的聊天窗口,用于找到与老师的最新的聊天,并不在与老师对话的窗口中,并聊天窗口相同
|
|
2181
|
-
try {
|
|
2182
|
-
if (stepIds != undefined && stepIds != "" && (showType == 3 || showType == 4) && roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
2183
|
-
fildChatRecords(newHistoryMessageList);
|
|
2184
|
-
}
|
|
2185
|
-
} catch (error) {}
|
|
2186
|
-
if (flag != 1) {
|
|
2187
|
-
setLastId(last_id);
|
|
2188
|
-
}
|
|
2189
|
-
if (pageNum == 1 && flag != 1 || flag == 3) {
|
|
2190
|
-
scrollToBottom();
|
|
2191
|
-
} else {
|
|
2192
|
-
console.log("滚动到相应为止3333");
|
|
2193
|
-
scrollTo("li_flag");
|
|
2194
|
-
}
|
|
2195
|
-
setGreetingMessage(true);
|
|
2196
|
-
//召唤老师回答
|
|
2197
|
-
console.log(problem, 8888888);
|
|
2198
|
-
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
2199
|
-
console.log(problem, 77777);
|
|
2200
|
-
sendToTeacher(1);
|
|
2201
|
-
}
|
|
2202
|
-
} else {
|
|
2203
|
-
setPageCount(0);
|
|
2204
|
-
setGreetingMessage(true);
|
|
2205
|
-
setLoading(false);
|
|
2206
|
-
setHistoryMessageList([]);
|
|
2207
|
-
//召唤老师回答
|
|
2208
|
-
console.log(problem, 8888888);
|
|
2209
|
-
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
2210
|
-
console.log(problem, 77777);
|
|
2211
|
-
sendToTeacher(1);
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
}).catch(function(res) {
|
|
2215
|
-
setLoading(false);
|
|
2216
|
-
});
|
|
2217
|
-
};
|
|
2218
|
-
//在聊天对话框中查找需要记录的问题及答案
|
|
2219
|
-
var fildChatRecords = function(newHistoryMessageList) {
|
|
2220
|
-
//1、找到对应的聊天室
|
|
2221
|
-
//2、找到与老师对话的新聊天
|
|
2222
|
-
//3、保存聊天到实验报告
|
|
2223
|
-
console.log("查找聊天111", chatObj);
|
|
2224
|
-
var room = chatObj.filter(function(item) {
|
|
2225
|
-
return item.roomId == roomId;
|
|
2226
|
-
});
|
|
2227
|
-
if (room.length > 0) {
|
|
2228
|
-
console.log(room, "dfvdfvdfvdfv");
|
|
2229
|
-
var roomIDnumber = room[0].roomId;
|
|
2230
|
-
var chatID = room[0].id;
|
|
2231
|
-
var index = -1;
|
|
2232
|
-
newHistoryMessageList.forEach(function(item, i) {
|
|
2233
|
-
console.log(item, item.id, "lskdcmsldksdcsdc");
|
|
2234
|
-
if (item.id == chatID) {
|
|
2235
|
-
index = i;
|
|
2236
|
-
return false;
|
|
2237
|
-
}
|
|
2238
|
-
});
|
|
2239
|
-
//有新的消息
|
|
2240
|
-
if (index != -1) {
|
|
2241
|
-
var newMessage = newHistoryMessageList.slice(index);
|
|
2242
|
-
console.log(newMessage, "需要记录的聊天");
|
|
2243
|
-
//1、查找 sender发送者
|
|
2244
|
-
var objList = [];
|
|
2245
|
-
var obj = {};
|
|
2246
|
-
var position = -1;
|
|
2247
|
-
newMessage.map(function(item, i) {
|
|
2248
|
-
if (item.sender == mid && position != i) {
|
|
2249
|
-
objList.push(obj);
|
|
2250
|
-
obj = {};
|
|
2251
|
-
}
|
|
2252
|
-
//发送者
|
|
2253
|
-
if (item.sender == mid) {
|
|
2254
|
-
obj.title = item.message;
|
|
2255
|
-
position = i;
|
|
2256
|
-
}
|
|
2257
|
-
if (item.sender != mid) {
|
|
2258
|
-
obj.con = item.message;
|
|
2259
|
-
obj.teachId = item.receiver;
|
|
2260
|
-
}
|
|
2261
|
-
});
|
|
2262
|
-
//需要保存的记录
|
|
2263
|
-
objList = objList.filter(function(item) {
|
|
2264
|
-
return item.title != undefined;
|
|
2265
|
-
});
|
|
2266
|
-
objList.map(function(item) {
|
|
2267
|
-
//保存聊天记录
|
|
2268
|
-
testLabQuestion(item.title, item.con, item.teachId);
|
|
2269
|
-
//删除已经保存的记录
|
|
2270
|
-
setChatObj(function(list) {
|
|
2271
|
-
return list.filter(function(a) {
|
|
2272
|
-
return a.roomId != roomIDnumber;
|
|
2273
|
-
});
|
|
2274
|
-
});
|
|
2275
|
-
});
|
|
2276
|
-
console.log(objList, "sdkcjnsdkjcsd");
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
};
|
|
2280
|
-
//点赞消息
|
|
2281
|
-
var likeMessage = function(id, state) {
|
|
2282
|
-
var url = "";
|
|
2283
|
-
//点赞状态
|
|
2284
|
-
if (!state) {
|
|
2285
|
-
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:upvote");
|
|
2286
|
-
} else {
|
|
2287
|
-
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:cancelUpvote");
|
|
2288
|
-
}
|
|
2289
|
-
http.post(url, {
|
|
2290
|
-
messageId: id
|
|
2291
|
-
}, {
|
|
2292
|
-
headers: {
|
|
2293
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2294
|
-
return ele.short == "IntelligentCustomerService";
|
|
2295
|
-
}).id,
|
|
2296
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2297
|
-
}
|
|
2298
|
-
}).then(function(res) {
|
|
2299
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2300
|
-
var list = historyMessageList;
|
|
2301
|
-
list = list.map(function(item) {
|
|
2302
|
-
return _object_spread_props(_object_spread({}, item), {
|
|
2303
|
-
upvoted: item.id == id ? !state : item.upvoted,
|
|
2304
|
-
downvoted: item.id == id && !state ? state : item.downvoted
|
|
2305
|
-
});
|
|
2306
|
-
});
|
|
2307
|
-
return list;
|
|
2308
|
-
});
|
|
2309
|
-
});
|
|
2310
|
-
};
|
|
2311
|
-
//踩
|
|
2312
|
-
var disagreeMessage = function(id, state) {
|
|
2313
|
-
var url = "";
|
|
2314
|
-
//点赞状态
|
|
2315
|
-
if (!state) {
|
|
2316
|
-
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:downvote");
|
|
2317
|
-
} else {
|
|
2318
|
-
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:cancelDownvote");
|
|
2319
|
-
}
|
|
2320
|
-
http.post(url, {
|
|
2321
|
-
messageId: id
|
|
2322
|
-
}, {
|
|
2323
|
-
headers: {
|
|
2324
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2325
|
-
return ele.short == "IntelligentCustomerService";
|
|
2326
|
-
}).id,
|
|
2327
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2328
|
-
}
|
|
2329
|
-
}).then(function(res) {
|
|
2330
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2331
|
-
var list = historyMessageList;
|
|
2332
|
-
list = list.map(function(item) {
|
|
2333
|
-
return _object_spread_props(_object_spread({}, item), {
|
|
2334
|
-
downvoted: item.id == id ? !state : item.downvoted,
|
|
2335
|
-
upvoted: item.id == id && !state ? state : item.upvoted
|
|
2336
|
-
});
|
|
2337
|
-
});
|
|
2338
|
-
return list;
|
|
2339
|
-
});
|
|
2340
|
-
});
|
|
2341
|
-
};
|
|
2342
|
-
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题
|
|
2343
|
-
var getQuestiionsList = function(value, flag) {
|
|
2344
|
-
var data = {};
|
|
2345
|
-
if (flag == 1) {
|
|
2346
|
-
data = {
|
|
2347
|
-
page: 1,
|
|
2348
|
-
maxPageSize: 5
|
|
2349
|
-
};
|
|
2350
|
-
} else {
|
|
2351
|
-
data = {
|
|
2352
|
-
page: 1,
|
|
2353
|
-
maxPageSize: 4,
|
|
2354
|
-
question: value
|
|
2355
|
-
};
|
|
2356
|
-
}
|
|
2357
|
-
http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
|
|
2358
|
-
params: data,
|
|
2359
|
-
headers: {
|
|
2360
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2361
|
-
return ele.short == "IntelligentCustomerService";
|
|
2362
|
-
}).id,
|
|
2363
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2364
|
-
}
|
|
2365
|
-
}).then(function(res) {
|
|
2366
|
-
if (res.data.questions) {
|
|
2367
|
-
if (flag == 1) {
|
|
2368
|
-
setHotQuestionsList(res.data.questions);
|
|
2369
|
-
} else {
|
|
2370
|
-
setQuestionsList(res.data.questions);
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
});
|
|
2374
|
-
};
|
|
2375
|
-
//获取老师列表
|
|
2376
|
-
var getTeacherList = function(keyWord) {
|
|
2377
|
-
http.get("".concat(urllocation, "/chat-service/public/v1.0/teachers"), {
|
|
2378
|
-
params: {
|
|
2379
|
-
name: keyWord
|
|
2380
|
-
},
|
|
2381
|
-
headers: {
|
|
2382
|
-
"x-module-id": userData.modules.find(function(ele) {
|
|
2383
|
-
return ele.short == "TeacherAnswer";
|
|
2384
|
-
}).id,
|
|
2385
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
2386
|
-
}
|
|
2387
|
-
}).then(function(res) {
|
|
2388
|
-
console.log(res);
|
|
2389
|
-
if (res.data) {
|
|
2390
|
-
setTeacherList(res.data.teachers);
|
|
2391
|
-
}
|
|
2392
|
-
});
|
|
2393
|
-
};
|
|
2394
|
-
//设置滚动条滚动到底部
|
|
2395
|
-
var scrollToBottom = function() {
|
|
2396
|
-
console.log("滚动条滚动到底部");
|
|
2397
|
-
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
2398
|
-
if (container) {
|
|
2399
|
-
container.scrollTop = container.scrollHeight;
|
|
2400
|
-
}
|
|
2401
|
-
};
|
|
2402
|
-
var scrollTo = function(id) {
|
|
2403
|
-
console.log(id, "滚动到指定位置");
|
|
2404
|
-
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
2405
|
-
var container2 = document.getElementById(id);
|
|
2406
|
-
// clearTimeout(listTimer.current)
|
|
2407
|
-
if (container && container2) {
|
|
2408
|
-
// container.scrollTop = container2.scrollHeight;
|
|
2409
|
-
// if(container2.scrollTop == 0){
|
|
2410
|
-
container.scrollTop = 60;
|
|
2411
|
-
setTimeout(function() {
|
|
2412
|
-
var top = showType == 1 ? $("#li_flag").offset().top - 20 : $("#chat_content_modal #li_flag").offset().top - $("#chat_content_modal").offset().top + 24;
|
|
2413
|
-
$("#".concat(showType == 1 ? "chat_content" : "chat_content_modal")).animate({
|
|
2414
|
-
scrollTop: top
|
|
2415
|
-
}, 0);
|
|
2416
|
-
}, 10);
|
|
2417
|
-
// }
|
|
2418
|
-
// clearTimeout(listTimer.current)
|
|
2419
|
-
setLoading(false);
|
|
2420
|
-
}
|
|
2421
|
-
};
|
|
2422
|
-
// 获取新的JWT
|
|
2423
|
-
var verifyJWT = function(url) {
|
|
2424
|
-
return new Promise(function(resolve) {
|
|
2425
|
-
http.get("".concat(url, "/regusers/login/Refreshtoken")).then(function(res) {
|
|
2426
|
-
if (res.data.code == 200) {
|
|
2427
|
-
window.localStorage.setItem("usertoken", res.data.data);
|
|
2428
|
-
resolve(res.data.data);
|
|
2429
|
-
} else {
|
|
2430
|
-
throw new Error(res.data.code);
|
|
2431
|
-
}
|
|
2432
|
-
}).catch(function(err) {
|
|
2433
|
-
resolve(err);
|
|
2434
|
-
});
|
|
2435
|
-
});
|
|
2436
|
-
};
|
|
2437
|
-
//渲染头部
|
|
2438
|
-
var renderHeader = function() {
|
|
2439
|
-
if (showType == 4) {
|
|
2440
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
2441
|
-
className: modules_63b47c51$2.top,
|
|
2442
|
-
children: [
|
|
2443
|
-
/*#__PURE__*/ jsx("div", {
|
|
2444
|
-
className: modules_63b47c51$2.user,
|
|
2445
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
2446
|
-
children: "智能回答"
|
|
2447
|
-
})
|
|
2448
|
-
}),
|
|
2449
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2450
|
-
className: modules_63b47c51$2.operate,
|
|
2451
|
-
children: [
|
|
2452
|
-
/*#__PURE__*/ jsx("i", {
|
|
2453
|
-
onClick: function() {
|
|
2454
|
-
setShowHistory(true);
|
|
2455
|
-
},
|
|
2456
|
-
children: /*#__PURE__*/ jsx(CustomRecord$1, {})
|
|
2457
|
-
}),
|
|
2458
|
-
/*#__PURE__*/ jsx("span", {
|
|
2459
|
-
className: modules_63b47c51$2.line
|
|
2460
|
-
}),
|
|
2461
|
-
/*#__PURE__*/ jsx("i", {
|
|
2462
|
-
onClick: function() {
|
|
2463
|
-
onEvent(serverName + serverUrl(), "click_智能问答_退出全屏", "提交");
|
|
2464
|
-
setShowType(3);
|
|
2465
|
-
},
|
|
2466
|
-
children: /*#__PURE__*/ jsx(CustomExitFullScreen$1, {})
|
|
2467
|
-
}),
|
|
2468
|
-
/*#__PURE__*/ jsx("i", {
|
|
2469
|
-
onClick: function() {
|
|
2470
|
-
onEvent(serverName + serverUrl(), "click_智能问答_退出全屏", "提交");
|
|
2471
|
-
setShowType(3);
|
|
2472
|
-
},
|
|
2473
|
-
children: /*#__PURE__*/ jsx(CloseOutlined, {})
|
|
2474
|
-
})
|
|
2475
|
-
]
|
|
2476
|
-
})
|
|
2477
|
-
]
|
|
2478
|
-
});
|
|
2479
|
-
} else if (showType == 3) {
|
|
2480
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
2481
|
-
className: modules_63b47c51$2.top,
|
|
2482
|
-
children: [
|
|
2483
|
-
/*#__PURE__*/ jsx("div", {
|
|
2484
|
-
className: modules_63b47c51$2.user,
|
|
2485
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
2486
|
-
children: "智能回答"
|
|
2487
|
-
})
|
|
2488
|
-
}),
|
|
2489
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2490
|
-
className: modules_63b47c51$2.operate,
|
|
2491
|
-
children: [
|
|
2492
|
-
/*#__PURE__*/ jsx("i", {
|
|
2493
|
-
onClick: function() {
|
|
2494
|
-
setShowHistory(true);
|
|
2495
|
-
},
|
|
2496
|
-
children: /*#__PURE__*/ jsx(CustomRecord$1, {})
|
|
2497
|
-
}),
|
|
2498
|
-
/*#__PURE__*/ jsx("span", {
|
|
2499
|
-
className: modules_63b47c51$2.line
|
|
2500
|
-
}),
|
|
2501
|
-
/*#__PURE__*/ jsx("i", {
|
|
2502
|
-
onClick: function() {
|
|
2503
|
-
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
2504
|
-
setShowType(4);
|
|
2505
|
-
},
|
|
2506
|
-
children: /*#__PURE__*/ jsx(CustomExitFullScreen$1, {})
|
|
2507
|
-
}),
|
|
2508
|
-
/*#__PURE__*/ jsx("i", {
|
|
2509
|
-
className: "lianxiren21",
|
|
2510
|
-
onClick: function() {
|
|
2511
|
-
setShowContacts(true);
|
|
2512
|
-
},
|
|
2513
|
-
children: /*#__PURE__*/ jsx(CustomContacts$1, {})
|
|
2514
|
-
})
|
|
2515
|
-
]
|
|
2516
|
-
})
|
|
2517
|
-
]
|
|
2518
|
-
});
|
|
2519
|
-
} else {
|
|
2520
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
2521
|
-
className: modules_63b47c51$2.top,
|
|
2522
|
-
children: [
|
|
2523
|
-
/*#__PURE__*/ jsx("div", {
|
|
2524
|
-
className: modules_63b47c51$2.user,
|
|
2525
|
-
children: /*#__PURE__*/ jsxs("p", {
|
|
2526
|
-
children: [
|
|
2527
|
-
showType == 1 && /*#__PURE__*/ jsx("i", {
|
|
2528
|
-
className: "lianxiren21",
|
|
2529
|
-
onClick: function() {
|
|
2530
|
-
setShowContacts(true);
|
|
2531
|
-
},
|
|
2532
|
-
children: /*#__PURE__*/ jsx(CustomContacts$1, {})
|
|
2533
|
-
}),
|
|
2534
|
-
"智能回答"
|
|
2535
|
-
]
|
|
2536
|
-
})
|
|
2537
|
-
}),
|
|
2538
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2539
|
-
className: modules_63b47c51$2.operate,
|
|
2540
|
-
children: [
|
|
2541
|
-
/*#__PURE__*/ jsx("i", {
|
|
2542
|
-
className: "_lishixiao22",
|
|
2543
|
-
onClick: function() {
|
|
2544
|
-
setShowHistory(true);
|
|
2545
|
-
},
|
|
2546
|
-
children: /*#__PURE__*/ jsx(CustomRecord$1, {})
|
|
2547
|
-
}),
|
|
2548
|
-
/*#__PURE__*/ jsx("span", {
|
|
2549
|
-
className: modules_63b47c51$2.line
|
|
2550
|
-
}),
|
|
2551
|
-
showType == 1 ? /*#__PURE__*/ jsx("i", {
|
|
2552
|
-
onClick: function() {
|
|
2553
|
-
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
2554
|
-
// switchDialogBox(3, true);
|
|
2555
|
-
setShowType(2);
|
|
2556
|
-
},
|
|
2557
|
-
children: /*#__PURE__*/ jsx(CustomFullScreen$1, {})
|
|
2558
|
-
}) : /*#__PURE__*/ jsx("i", {
|
|
2559
|
-
onClick: function() {
|
|
2560
|
-
onEvent(serverName + serverUrl(), "click_智能问答_退出全屏", "提交");
|
|
2561
|
-
// switchDialogBox(1, true);
|
|
2562
|
-
setShowType(1);
|
|
2563
|
-
},
|
|
2564
|
-
children: /*#__PURE__*/ jsx(CustomExitFullScreen$1, {})
|
|
2565
|
-
}),
|
|
2566
|
-
/*#__PURE__*/ jsx("i", {
|
|
2567
|
-
onClick: onCancel,
|
|
2568
|
-
children: /*#__PURE__*/ jsx(CloseOutlined, {})
|
|
2569
|
-
})
|
|
2570
|
-
]
|
|
2571
|
-
})
|
|
2572
|
-
]
|
|
2573
|
-
});
|
|
2574
|
-
}
|
|
2575
|
-
};
|
|
2576
|
-
//重置底部输入框高度
|
|
2577
|
-
var resettingBottomHei = function() {
|
|
2578
|
-
setTimeout(function() {
|
|
2579
|
-
if (showType == 1 || showType == 3) {
|
|
2580
|
-
var hei = document.getElementById("Drawer_buttom").offsetHeight;
|
|
2581
|
-
setButtomHei(hei);
|
|
2582
|
-
} else {
|
|
2583
|
-
var hei1 = document.getElementById("Drawer_buttom_modal").offsetHeight;
|
|
2584
|
-
setButtomHei(hei1);
|
|
2585
|
-
}
|
|
2586
|
-
}, 50);
|
|
2587
|
-
};
|
|
2588
|
-
//切换聊天室 type == renew ,存在新消息
|
|
2589
|
-
var switchChatRoom = function(id, type) {
|
|
2590
|
-
if (type == "renew") {
|
|
2591
|
-
getHistoryMessage(1, 3);
|
|
2592
|
-
}
|
|
2593
|
-
setRoomId(id);
|
|
2594
|
-
readMessage(id, urllocation, userData, http);
|
|
2595
|
-
};
|
|
2596
|
-
var saveContactsList = function(list) {
|
|
2597
|
-
if (list != undefined) {
|
|
2598
|
-
setRoomList(list);
|
|
2599
|
-
}
|
|
2600
|
-
};
|
|
2601
|
-
//渲染问答
|
|
2602
|
-
var renderQuestion = function() {
|
|
2603
|
-
// console.log(mid, historyMessageList, "ddkfdscksdcs");
|
|
2604
|
-
if (historyMessageList.length > 0) {
|
|
2605
|
-
// let historyData = "";
|
|
2606
|
-
// let showData = true;
|
|
2607
|
-
return /*#__PURE__*/ jsx("ul", {
|
|
2608
|
-
className: modules_63b47c51$2.message_con,
|
|
2609
|
-
children: historyMessageList.map(function(item, i) {
|
|
2610
|
-
// console.log(item.message);
|
|
2611
|
-
var message = item.message;
|
|
2612
|
-
var li;
|
|
2613
|
-
// 是否需要显示日期
|
|
2614
|
-
var itemIndex = historyMessageList.findIndex(function(ite) {
|
|
2615
|
-
return ite.id === item.id;
|
|
2616
|
-
});
|
|
2617
|
-
var time = "";
|
|
2618
|
-
if (itemIndex <= 0) {
|
|
2619
|
-
//第一项
|
|
2620
|
-
time = dayjs(item.createdAt).format("YYYY-MM-DD HH:mm");
|
|
2621
|
-
} else {
|
|
2622
|
-
//非第一项 与上一项进行对比
|
|
2623
|
-
var beforeTime = historyMessageList[itemIndex - 1].createdAt;
|
|
2624
|
-
//判断与上一条数据 是否跨天
|
|
2625
|
-
if (dayjs(beforeTime).format("YYYY-MM-DD") !== dayjs(item.createdAt).format("YYYY-MM-DD")) {
|
|
2626
|
-
time = dayjs(item.createdAt).format("YYYY-MM-DD HH:mm");
|
|
2627
|
-
} else {
|
|
2628
|
-
//没有跨天 判断是否相隔超过10分钟
|
|
2629
|
-
if (dayjs(item.createdAt).valueOf() - dayjs(beforeTime).valueOf() > 10 * 60 * 1000) {
|
|
2630
|
-
time = dayjs(item.createdAt).format("HH:mm");
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
var dataTime = time;
|
|
2635
|
-
if (item.sender == mid) {
|
|
2636
|
-
//只有引用和复制功能
|
|
2637
|
-
li = /*#__PURE__*/ jsxs(Fragment, {
|
|
2638
|
-
children: [
|
|
2639
|
-
dataTime ? /*#__PURE__*/ jsx("li", {
|
|
2640
|
-
className: modules_63b47c51$2.time,
|
|
2641
|
-
children: dataTime
|
|
2642
|
-
}) : "",
|
|
2643
|
-
/*#__PURE__*/ jsxs("li", {
|
|
2644
|
-
className: modules_63b47c51$2.left,
|
|
2645
|
-
id: lastId == item.id ? "li_flag" : "",
|
|
2646
|
-
children: [
|
|
2647
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2648
|
-
className: modules_63b47c51$2.main,
|
|
2649
|
-
children: [
|
|
2650
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2651
|
-
className: modules_63b47c51$2.main_content,
|
|
2652
|
-
children: [
|
|
2653
|
-
/*#__PURE__*/ jsx("div", {
|
|
2654
|
-
className: modules_63b47c51$2.operate_modal,
|
|
2655
|
-
children: /*#__PURE__*/ jsxs("p", {
|
|
2656
|
-
className: modules_63b47c51$2.operate,
|
|
2657
|
-
children: [
|
|
2658
|
-
/*#__PURE__*/ jsx("i", {
|
|
2659
|
-
className: "yinyong_quote1",
|
|
2660
|
-
onClick: function() {
|
|
2661
|
-
setCitationContent({
|
|
2662
|
-
content: item.message,
|
|
2663
|
-
id: item.id
|
|
2664
|
-
});
|
|
2665
|
-
resettingBottomHei();
|
|
2666
|
-
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
2667
|
-
},
|
|
2668
|
-
children: /*#__PURE__*/ jsx(CustomQuote$1, {})
|
|
2669
|
-
}),
|
|
2670
|
-
copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
|
|
2671
|
-
return list == item.id;
|
|
2672
|
-
}) ? /*#__PURE__*/ jsx("i", {
|
|
2673
|
-
className: "tongyong-xuanzhongdui",
|
|
2674
|
-
children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
|
|
2675
|
-
}) : /*#__PURE__*/ jsx("i", {
|
|
2676
|
-
className: "fuzhi21",
|
|
2677
|
-
onClick: function() {
|
|
2678
|
-
copyText(item.message);
|
|
2679
|
-
{
|
|
2680
|
-
var obj = copyTextOBJ;
|
|
2681
|
-
obj = obj.filter(function(list) {
|
|
2682
|
-
return list != item.id;
|
|
2683
|
-
});
|
|
2684
|
-
obj.push(item.id);
|
|
2685
|
-
setCopyTextObj(obj);
|
|
2686
|
-
}
|
|
2687
|
-
setTimeout(function() {
|
|
2688
|
-
var obj = copyTextOBJ;
|
|
2689
|
-
obj = obj.filter(function(list) {
|
|
2690
|
-
return list != item.id;
|
|
2691
|
-
});
|
|
2692
|
-
setCopyTextObj(obj);
|
|
2693
|
-
}, 3000);
|
|
2694
|
-
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
2695
|
-
},
|
|
2696
|
-
children: /*#__PURE__*/ jsx(CustomCopy$1, {})
|
|
2697
|
-
})
|
|
2698
|
-
]
|
|
2699
|
-
})
|
|
2700
|
-
}),
|
|
2701
|
-
/*#__PURE__*/ jsx("div", {
|
|
2702
|
-
className: modules_63b47c51$2.content,
|
|
2703
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
2704
|
-
dangerouslySetInnerHTML: {
|
|
2705
|
-
__html: remarkable.render(message)
|
|
2706
|
-
},
|
|
2707
|
-
className: modules_63b47c51$2.content_child
|
|
2708
|
-
})
|
|
2709
|
-
})
|
|
2710
|
-
]
|
|
2711
|
-
}),
|
|
2712
|
-
//引用消息
|
|
2713
|
-
item.quotedMessage != "" && item.quotedMessage != null && item.quotedMessage != undefined ? /*#__PURE__*/ jsx("div", {
|
|
2714
|
-
className: modules_63b47c51$2.citation_content,
|
|
2715
|
-
children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
|
|
2716
|
-
overlayClassName: modules_63b47c51$2.popover_main_content,
|
|
2717
|
-
title: item.quotedMessage,
|
|
2718
|
-
placement: "leftTop",
|
|
2719
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
2720
|
-
children: item.quotedMessage
|
|
2721
|
-
})
|
|
2722
|
-
}) : /*#__PURE__*/ jsx("p", {
|
|
2723
|
-
children: item.quotedMessage
|
|
2724
|
-
})
|
|
2725
|
-
}) : ""
|
|
2726
|
-
]
|
|
2727
|
-
}),
|
|
2728
|
-
showType == 2 || showType == 4 ? /*#__PURE__*/ jsx("div", {
|
|
2729
|
-
className: modules_63b47c51$2.head_sculpture,
|
|
2730
|
-
style: {
|
|
2731
|
-
marginLeft: "12px"
|
|
2732
|
-
},
|
|
2733
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
2734
|
-
src: userData.avatar
|
|
2735
|
-
})
|
|
2736
|
-
}) : ""
|
|
2737
|
-
]
|
|
2738
|
-
}, item.id)
|
|
2739
|
-
]
|
|
2740
|
-
});
|
|
2741
|
-
} else {
|
|
2742
|
-
//获取用户头像
|
|
2743
|
-
var headImg = "";
|
|
2744
|
-
var chatWindow = roomList.filter(function(item) {
|
|
2745
|
-
return item.roomId == roomId;
|
|
2746
|
-
});
|
|
2747
|
-
if (chatWindow.length > 0 && chatWindow[0].headImg != "") {
|
|
2748
|
-
headImg = chatWindow[0].headImg;
|
|
2749
|
-
}
|
|
2750
|
-
//是否在智能客服窗口
|
|
2751
|
-
var isAiChatWindow = chatWindow[0].sender == "AI" ? true : false;
|
|
2752
|
-
li = /*#__PURE__*/ jsxs(Fragment, {
|
|
2753
|
-
children: [
|
|
2754
|
-
dataTime ? /*#__PURE__*/ jsx("li", {
|
|
2755
|
-
className: modules_63b47c51$2.time,
|
|
2756
|
-
children: dataTime
|
|
2757
|
-
}) : "",
|
|
2758
|
-
/*#__PURE__*/ jsxs("li", {
|
|
2759
|
-
className: modules_63b47c51$2.right,
|
|
2760
|
-
id: lastId == item.id ? "li_flag" : "",
|
|
2761
|
-
children: [
|
|
2762
|
-
showType == 2 || showType == 4 && /*#__PURE__*/ jsx("div", {
|
|
2763
|
-
className: modules_63b47c51$2.head_sculpture,
|
|
2764
|
-
style: {
|
|
2765
|
-
marginRight: "12px"
|
|
2766
|
-
},
|
|
2767
|
-
children: isAiChatWindow ? item.extraInfo == null ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
|
|
2768
|
-
src: knowledge_icon
|
|
2769
|
-
}) : /*#__PURE__*/ jsx("img", {
|
|
2770
|
-
src: headImg
|
|
2771
|
-
})
|
|
2772
|
-
}),
|
|
2773
|
-
/*#__PURE__*/ jsx("div", {
|
|
2774
|
-
className: modules_63b47c51$2.main,
|
|
2775
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
2776
|
-
className: modules_63b47c51$2.main_content,
|
|
2777
|
-
children: [
|
|
2778
|
-
/*#__PURE__*/ jsx("div", {
|
|
2779
|
-
className: modules_63b47c51$2.operate_modal,
|
|
2780
|
-
children: historyMessageList.length - 1 == i && item.extraInfo == null || item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && (JSON.parse(item.extraInfo)[0].key == "messageSource" || JSON.parse(item.extraInfo)[0].key == "isVoteMessage") ? "" : /*#__PURE__*/ jsxs("p", {
|
|
2781
|
-
className: modules_63b47c51$2.operate,
|
|
2782
|
-
children: [
|
|
2783
|
-
/*#__PURE__*/ jsx("span", {
|
|
2784
|
-
className: modules_63b47c51$2.ask_question,
|
|
2785
|
-
onClick: function() {
|
|
2786
|
-
setAnswerMode(1);
|
|
2787
|
-
setProblem({
|
|
2788
|
-
question: historyMessageList[i - 1].message,
|
|
2789
|
-
user: problem.user
|
|
2790
|
-
});
|
|
2791
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2792
|
-
var newHistoryMessageList = historyMessageList.concat({
|
|
2793
|
-
id: -1,
|
|
2794
|
-
roomId: roomId,
|
|
2795
|
-
sender: "AI",
|
|
2796
|
-
recevier: mid,
|
|
2797
|
-
message: "请在输入框中输入您要召唤的老师的姓名",
|
|
2798
|
-
createdAt: getDataTime(-1),
|
|
2799
|
-
findTeacher: true
|
|
2800
|
-
});
|
|
2801
|
-
return newHistoryMessageList;
|
|
2802
|
-
});
|
|
2803
|
-
scrollToBottom();
|
|
2804
|
-
},
|
|
2805
|
-
children: "召唤老师回答"
|
|
2806
|
-
}),
|
|
2807
|
-
/*#__PURE__*/ jsx("i", {
|
|
2808
|
-
className: "yinyong_quote1",
|
|
2809
|
-
onClick: function() {
|
|
2810
|
-
setCitationContent({
|
|
2811
|
-
content: item.message,
|
|
2812
|
-
id: item.id
|
|
2813
|
-
});
|
|
2814
|
-
resettingBottomHei();
|
|
2815
|
-
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
2816
|
-
console.log("引用222222");
|
|
2817
|
-
},
|
|
2818
|
-
children: /*#__PURE__*/ jsx(CustomQuote$1, {})
|
|
2819
|
-
}),
|
|
2820
|
-
copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
|
|
2821
|
-
return list == item.id;
|
|
2822
|
-
}) ? /*#__PURE__*/ jsx("i", {
|
|
2823
|
-
className: "tongyong-xuanzhongdui",
|
|
2824
|
-
children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
|
|
2825
|
-
}) : /*#__PURE__*/ jsx("i", {
|
|
2826
|
-
className: "fuzhi21",
|
|
2827
|
-
onClick: function() {
|
|
2828
|
-
copyText(item.message);
|
|
2829
|
-
{
|
|
2830
|
-
var obj = copyTextOBJ;
|
|
2831
|
-
obj = obj.filter(function(list) {
|
|
2832
|
-
return list != item.id;
|
|
2833
|
-
});
|
|
2834
|
-
obj.push(item.id);
|
|
2835
|
-
setCopyTextObj(obj);
|
|
2836
|
-
}
|
|
2837
|
-
setTimeout(function() {
|
|
2838
|
-
var obj = copyTextOBJ;
|
|
2839
|
-
obj = obj.filter(function(list) {
|
|
2840
|
-
return list != item.id;
|
|
2841
|
-
});
|
|
2842
|
-
setCopyTextObj(obj);
|
|
2843
|
-
}, 3000);
|
|
2844
|
-
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
2845
|
-
},
|
|
2846
|
-
children: /*#__PURE__*/ jsx(CustomCopy$1, {})
|
|
2847
|
-
}),
|
|
2848
|
-
/*#__PURE__*/ jsx("span", {
|
|
2849
|
-
children: "|"
|
|
2850
|
-
}),
|
|
2851
|
-
/*#__PURE__*/ jsx("i", {
|
|
2852
|
-
className: "Frame427319094 ".concat(item.upvoted ? modules_63b47c51$2.active : ""),
|
|
2853
|
-
onClick: function() {
|
|
2854
|
-
likeMessage(item.id, item.upvoted);
|
|
2855
|
-
console.log("判断是AI还是智能回答", item);
|
|
2856
|
-
//只有最后一条回答,支持发送点赞或踩
|
|
2857
|
-
if (!item.upvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
2858
|
-
console.log("判断是AI还是智能回答", item);
|
|
2859
|
-
if (!item.extraInfo && item.sender == "AI") {
|
|
2860
|
-
aiSendQuestions(1, {
|
|
2861
|
-
roomId: roomId,
|
|
2862
|
-
message: "你给出的答案我非常满意,赞!",
|
|
2863
|
-
quotedMessage: "",
|
|
2864
|
-
regenerate: false,
|
|
2865
|
-
generateUpvoteOrDownvoteMessage: true
|
|
2866
|
-
}, 1);
|
|
2867
|
-
} else {
|
|
2868
|
-
console.log("AI回答2255555");
|
|
2869
|
-
sendGreetingMessage(2);
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
},
|
|
2873
|
-
children: /*#__PURE__*/ jsx(CustomLike$1, {})
|
|
2874
|
-
}),
|
|
2875
|
-
/*#__PURE__*/ jsx("i", {
|
|
2876
|
-
className: "Frame427319095 ".concat(item.downvoted ? modules_63b47c51$2.active : ""),
|
|
2877
|
-
onClick: function() {
|
|
2878
|
-
disagreeMessage(item.id, item.downvoted);
|
|
2879
|
-
//只有最后一条回答,支持发送点赞或踩
|
|
2880
|
-
console.log(item, "dlfkvmdflkv");
|
|
2881
|
-
if (!item.downvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
2882
|
-
if (!item.extraInfo && item.sender == "AI") {
|
|
2883
|
-
aiSendQuestions(1, {
|
|
2884
|
-
roomId: roomId,
|
|
2885
|
-
message: "你给出的答案很糟糕,我不满意,踩!",
|
|
2886
|
-
quotedMessage: "",
|
|
2887
|
-
regenerate: false,
|
|
2888
|
-
generateUpvoteOrDownvoteMessage: true
|
|
2889
|
-
}, 1);
|
|
2890
|
-
} else {
|
|
2891
|
-
sendGreetingMessage(3);
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
},
|
|
2895
|
-
children: /*#__PURE__*/ jsx(CustomDislike$1, {})
|
|
2896
|
-
})
|
|
2897
|
-
]
|
|
2898
|
-
})
|
|
2899
|
-
}),
|
|
2900
|
-
/*#__PURE__*/ jsxs("div", {
|
|
2901
|
-
className: modules_63b47c51$2.content,
|
|
2902
|
-
children: [
|
|
2903
|
-
/*#__PURE__*/ jsx("p", {
|
|
2904
|
-
dangerouslySetInnerHTML: {
|
|
2905
|
-
__html: remarkable.render(message)
|
|
2906
|
-
},
|
|
2907
|
-
className: modules_63b47c51$2.content_child
|
|
2908
|
-
}),
|
|
2909
|
-
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", {
|
|
2910
|
-
className: modules_63b47c51$2.association_problem,
|
|
2911
|
-
children: JSON.parse(item.extraInfo).map(function(list, index) {
|
|
2912
|
-
return /*#__PURE__*/ jsxs("li", {
|
|
2913
|
-
onClick: function() {
|
|
2914
|
-
sendMessage(list, 1);
|
|
2915
|
-
},
|
|
2916
|
-
children: [
|
|
2917
|
-
index + 1,
|
|
2918
|
-
".",
|
|
2919
|
-
list.question
|
|
2920
|
-
]
|
|
2921
|
-
}, i + "_" + index + "_" + list.value);
|
|
2922
|
-
})
|
|
2923
|
-
}) : ""
|
|
2924
|
-
]
|
|
2925
|
-
}),
|
|
2926
|
-
!item.findTeacher && historyMessageList.length - 1 == i && item.extraInfo == null && item.id != "123456" ? /*#__PURE__*/ jsx("div", {
|
|
2927
|
-
className: "".concat(modules_63b47c51$2.operate_modal_bottom),
|
|
2928
|
-
children: item.extraInfo != undefined && JSON.parse(item.extraInfo).length > 0 && (JSON.parse(item.extraInfo)[0].key == "messageSource" || JSON.parse(item.extraInfo)[0].key == "isVoteMessage") ? "" : /*#__PURE__*/ jsxs(Fragment, {
|
|
2929
|
-
children: [
|
|
2930
|
-
/*#__PURE__*/ jsx("p", {
|
|
2931
|
-
className: modules_63b47c51$2.stop_generate,
|
|
2932
|
-
children: !finished ? /*#__PURE__*/ jsxs(Fragment, {
|
|
2933
|
-
children: [
|
|
2934
|
-
/*#__PURE__*/ jsx("span", {
|
|
2935
|
-
onClick: function() {
|
|
2936
|
-
// aiSendQuestions(3,{},1);
|
|
2937
|
-
// if (type == 3) {
|
|
2938
|
-
try {
|
|
2939
|
-
if (ctrl && ctrl.current) {
|
|
2940
|
-
ctrl.current.abort();
|
|
2941
|
-
}
|
|
2942
|
-
} catch (error) {}
|
|
2943
|
-
clearTimeout(receiveMessageTimer.current);
|
|
2944
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2945
|
-
return historyMessageList.filter(function(item) {
|
|
2946
|
-
return item.id != "123456";
|
|
2947
|
-
});
|
|
2948
|
-
});
|
|
2949
|
-
setFinished(true);
|
|
2950
|
-
// return;
|
|
2951
|
-
// }
|
|
2952
|
-
onEvent(serverName + serverUrl(), "click_智能问答_停止生成", "提交");
|
|
2953
|
-
}
|
|
2954
|
-
}),
|
|
2955
|
-
/*#__PURE__*/ jsx("i", {
|
|
2956
|
-
onClick: function() {
|
|
2957
|
-
// aiSendQuestions(3,{},1);
|
|
2958
|
-
try {
|
|
2959
|
-
if (ctrl && ctrl.current) {
|
|
2960
|
-
ctrl.current.abort();
|
|
2961
|
-
}
|
|
2962
|
-
} catch (error) {}
|
|
2963
|
-
clearTimeout(receiveMessageTimer.current);
|
|
2964
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
2965
|
-
return historyMessageList.filter(function(item) {
|
|
2966
|
-
return item.id != "123456";
|
|
2967
|
-
});
|
|
2968
|
-
});
|
|
2969
|
-
setFinished(true);
|
|
2970
|
-
onEvent(serverName + serverUrl(), "click_智能问答_停止生成", "提交");
|
|
2971
|
-
},
|
|
2972
|
-
children: "停止生成"
|
|
2973
|
-
})
|
|
2974
|
-
]
|
|
2975
|
-
}) : ""
|
|
2976
|
-
}),
|
|
2977
|
-
finished ? /*#__PURE__*/ jsxs("p", {
|
|
2978
|
-
className: "".concat(modules_63b47c51$2.operate),
|
|
2979
|
-
children: [
|
|
2980
|
-
/*#__PURE__*/ jsx("i", {
|
|
2981
|
-
onClick: function() {
|
|
2982
|
-
setFinished(false);
|
|
2983
|
-
aiSendQuestions(2, {
|
|
2984
|
-
roomId: roomId,
|
|
2985
|
-
message: historyMessageList[i - 1].message,
|
|
2986
|
-
quotedMessage: citationContent.content || "",
|
|
2987
|
-
regenerate: true,
|
|
2988
|
-
generateUpvoteOrDownvoteMessage: false
|
|
2989
|
-
}, item.id);
|
|
2990
|
-
onEvent(serverName + serverUrl(), "click_智能问答_重新生成", "提交");
|
|
2991
|
-
},
|
|
2992
|
-
children: /*#__PURE__*/ jsx(CustomReloading$1, {})
|
|
2993
|
-
}),
|
|
2994
|
-
/*#__PURE__*/ jsx("i", {
|
|
2995
|
-
className: "yinyong_quote1",
|
|
2996
|
-
onClick: function() {
|
|
2997
|
-
setCitationContent({
|
|
2998
|
-
content: item.message,
|
|
2999
|
-
id: item.id
|
|
3000
|
-
});
|
|
3001
|
-
resettingBottomHei();
|
|
3002
|
-
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
3003
|
-
},
|
|
3004
|
-
children: /*#__PURE__*/ jsx(CustomQuote$1, {})
|
|
3005
|
-
}),
|
|
3006
|
-
copyTextOBJ.length > 0 && copyTextOBJ.some(function(list) {
|
|
3007
|
-
return list == item.id;
|
|
3008
|
-
}) ? /*#__PURE__*/ jsx("i", {
|
|
3009
|
-
className: "tongyong-xuanzhongdui",
|
|
3010
|
-
children: /*#__PURE__*/ jsx(CustomDuihao$1, {})
|
|
3011
|
-
}) : /*#__PURE__*/ jsx("i", {
|
|
3012
|
-
className: "fuzhi21",
|
|
3013
|
-
onClick: function() {
|
|
3014
|
-
copyText(item.message);
|
|
3015
|
-
{
|
|
3016
|
-
var obj = copyTextOBJ;
|
|
3017
|
-
obj = obj.filter(function(list) {
|
|
3018
|
-
return list != item.id;
|
|
3019
|
-
});
|
|
3020
|
-
obj.push(item.id);
|
|
3021
|
-
setCopyTextObj(obj);
|
|
3022
|
-
}
|
|
3023
|
-
setTimeout(function() {
|
|
3024
|
-
var obj = copyTextOBJ;
|
|
3025
|
-
obj = obj.filter(function(list) {
|
|
3026
|
-
return list != item.id;
|
|
3027
|
-
});
|
|
3028
|
-
setCopyTextObj(obj);
|
|
3029
|
-
}, 3000);
|
|
3030
|
-
onEvent(serverName + serverUrl(), "click_智能问答_复制", "提交");
|
|
3031
|
-
},
|
|
3032
|
-
children: /*#__PURE__*/ jsx(CustomCopy$1, {})
|
|
3033
|
-
}),
|
|
3034
|
-
/*#__PURE__*/ jsx("span", {
|
|
3035
|
-
children: "|"
|
|
3036
|
-
}),
|
|
3037
|
-
/*#__PURE__*/ jsx("i", {
|
|
3038
|
-
className: "Frame427319094 ".concat(item.upvoted ? modules_63b47c51$2.active : ""),
|
|
3039
|
-
onClick: function() {
|
|
3040
|
-
likeMessage(item.id, item.upvoted);
|
|
3041
|
-
console.log("判断是AI还是智能回答", item);
|
|
3042
|
-
//只有最后一条回答,支持发送点赞或踩
|
|
3043
|
-
if (!item.upvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
3044
|
-
console.log("判断是AI还是智能回答", item);
|
|
3045
|
-
if (!item.extraInfo && item.sender == "AI") {
|
|
3046
|
-
aiSendQuestions(1, {
|
|
3047
|
-
roomId: roomId,
|
|
3048
|
-
message: "你给出的答案我非常满意,赞!",
|
|
3049
|
-
quotedMessage: "",
|
|
3050
|
-
regenerate: false,
|
|
3051
|
-
generateUpvoteOrDownvoteMessage: true
|
|
3052
|
-
}, 1);
|
|
3053
|
-
} else {
|
|
3054
|
-
console.log("AI回答2255555");
|
|
3055
|
-
sendGreetingMessage(2);
|
|
3056
|
-
}
|
|
3057
|
-
}
|
|
3058
|
-
},
|
|
3059
|
-
children: /*#__PURE__*/ jsx(CustomLike$1, {})
|
|
3060
|
-
}),
|
|
3061
|
-
/*#__PURE__*/ jsx("i", {
|
|
3062
|
-
className: "Frame427319095 ".concat(item.downvoted ? modules_63b47c51$2.active : ""),
|
|
3063
|
-
onClick: function() {
|
|
3064
|
-
disagreeMessage(item.id, item.downvoted);
|
|
3065
|
-
//只有最后一条回答,支持发送点赞或踩
|
|
3066
|
-
console.log(item, "dlfkvmdflkv");
|
|
3067
|
-
if (!item.downvoted && (historyMessageList.length == i + 1 || historyMessageList.length - 2 == i)) {
|
|
3068
|
-
if (!item.extraInfo && item.sender == "AI") {
|
|
3069
|
-
console.log("AI回答2222");
|
|
3070
|
-
//AI回答
|
|
3071
|
-
aiSendQuestions(1, {
|
|
3072
|
-
roomId: roomId,
|
|
3073
|
-
message: "你给出的答案很糟糕,我不满意,踩!",
|
|
3074
|
-
quotedMessage: "",
|
|
3075
|
-
regenerate: false,
|
|
3076
|
-
generateUpvoteOrDownvoteMessage: true
|
|
3077
|
-
}, 1);
|
|
3078
|
-
} else {
|
|
3079
|
-
sendGreetingMessage(3);
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3082
|
-
},
|
|
3083
|
-
children: /*#__PURE__*/ jsx(CustomDislike$1, {})
|
|
3084
|
-
})
|
|
3085
|
-
]
|
|
3086
|
-
}) : ""
|
|
3087
|
-
]
|
|
3088
|
-
})
|
|
3089
|
-
}) : "",
|
|
3090
|
-
//召唤老师回答按钮
|
|
3091
|
-
item.findTeacher ? /*#__PURE__*/ jsx("div", {
|
|
3092
|
-
className: "".concat(modules_63b47c51$2.operate_modal_bottom),
|
|
3093
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
3094
|
-
className: modules_63b47c51$2.stop_findTeacher,
|
|
3095
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
3096
|
-
onClick: function() {
|
|
3097
|
-
setAnswerMode(-1);
|
|
3098
|
-
setTeacherList([]);
|
|
3099
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
3100
|
-
return historyMessageList.filter(function(item) {
|
|
3101
|
-
return item.id != "-1";
|
|
3102
|
-
});
|
|
3103
|
-
});
|
|
3104
|
-
},
|
|
3105
|
-
children: "停止召唤老师"
|
|
3106
|
-
})
|
|
3107
|
-
})
|
|
3108
|
-
}) : ""
|
|
3109
|
-
]
|
|
3110
|
-
})
|
|
3111
|
-
})
|
|
3112
|
-
]
|
|
3113
|
-
}, item.id)
|
|
3114
|
-
]
|
|
3115
|
-
});
|
|
3116
|
-
}
|
|
3117
|
-
return li;
|
|
3118
|
-
})
|
|
3119
|
-
});
|
|
3120
|
-
} else {
|
|
3121
|
-
return "";
|
|
3122
|
-
}
|
|
3123
|
-
};
|
|
3124
|
-
//渲染底部按钮
|
|
3125
|
-
var renderBottomAnt = function() {
|
|
3126
|
-
var placeholder = "";
|
|
3127
|
-
var disabled = false;
|
|
3128
|
-
if (voiceRecordingStatus == 2) {
|
|
3129
|
-
placeholder = "录制中...";
|
|
3130
|
-
} else if (voiceRecordingStatus == 1) {
|
|
3131
|
-
placeholder = "正在语音识别文字,请稍后...";
|
|
3132
|
-
} else if (!finished) {
|
|
3133
|
-
placeholder = "答案生成中,请稍后再发送...";
|
|
3134
|
-
} else {
|
|
3135
|
-
placeholder = "请输入问题,按Enter发送,Shift+Enter换行";
|
|
3136
|
-
disabled = true;
|
|
3137
|
-
}
|
|
3138
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
3139
|
-
children: [
|
|
3140
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3141
|
-
className: modules_63b47c51$2.input_wrap,
|
|
3142
|
-
onChange: function() {
|
|
3143
|
-
resettingBottomHei();
|
|
3144
|
-
},
|
|
3145
|
-
children: [
|
|
3146
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3147
|
-
className: "".concat(modules_63b47c51$2.input, " ").concat(userData.modules.some(function(item) {
|
|
3148
|
-
return item.short == "AIservice";
|
|
3149
|
-
}) ? "" : modules_63b47c51$2.no_AI),
|
|
3150
|
-
children: [
|
|
3151
|
-
/*#__PURE__*/ jsx(TextArea, {
|
|
3152
|
-
placeholder: placeholder,
|
|
3153
|
-
autoSize: {
|
|
3154
|
-
minRows: 1,
|
|
3155
|
-
maxRows: 6
|
|
3156
|
-
},
|
|
3157
|
-
value: keyWord,
|
|
3158
|
-
onChange: function(e) {
|
|
3159
|
-
setKeyWord(e.target.value);
|
|
3160
|
-
if (e.target.value == "") {
|
|
3161
|
-
setQuestionsList([]);
|
|
3162
|
-
clearTimeout(timer.current);
|
|
3163
|
-
} else {
|
|
3164
|
-
clearTimeout(timer.current);
|
|
3165
|
-
timer.current = setTimeout(function() {
|
|
3166
|
-
if (answerMode == 1) {
|
|
3167
|
-
getTeacherList(String(e.target.value));
|
|
3168
|
-
} else {
|
|
3169
|
-
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
3170
|
-
getQuestiionsList(String(e.target.value), 2);
|
|
3171
|
-
}
|
|
3172
|
-
}, 1000);
|
|
3173
|
-
}
|
|
3174
|
-
},
|
|
3175
|
-
onPressEnter: function(e) {
|
|
3176
|
-
// console.log('发送内容22222',props)
|
|
3177
|
-
console.log(roomList, roomId, "发送内容22222wewewewewewewe");
|
|
3178
|
-
if (!e.shiftKey && !e.altKey && !e.ctrlKey && keyWord.trim() != "") {
|
|
3179
|
-
e.stopPropagation();
|
|
3180
|
-
e.preventDefault();
|
|
3181
|
-
clearTimeout(timer.current);
|
|
3182
|
-
setKeyWord("");
|
|
3183
|
-
setCitationContent({});
|
|
3184
|
-
//跟老师对话
|
|
3185
|
-
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
3186
|
-
sendToTeacher(2);
|
|
3187
|
-
} else {
|
|
3188
|
-
sendMessage();
|
|
3189
|
-
}
|
|
3190
|
-
setButtomHei(45);
|
|
3191
|
-
} else {
|
|
3192
|
-
console.log("回车事件");
|
|
3193
|
-
resettingBottomHei();
|
|
3194
|
-
}
|
|
3195
|
-
},
|
|
3196
|
-
onFocus: function() {
|
|
3197
|
-
onEvent(serverName + serverUrl(), "click_智能问答_输入框", "提交");
|
|
3198
|
-
},
|
|
3199
|
-
disabled: !disabled,
|
|
3200
|
-
maxLength: 1000
|
|
3201
|
-
}),
|
|
3202
|
-
citationContent.content != undefined && citationContent.content != "" ? /*#__PURE__*/ jsxs("div", {
|
|
3203
|
-
className: modules_63b47c51$2.content_main,
|
|
3204
|
-
children: [
|
|
3205
|
-
/*#__PURE__*/ jsx("div", {
|
|
3206
|
-
className: modules_63b47c51$2.content_con,
|
|
3207
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
3208
|
-
children: citationContent.content
|
|
3209
|
-
})
|
|
3210
|
-
}),
|
|
3211
|
-
/*#__PURE__*/ jsx("i", {
|
|
3212
|
-
className: modules_63b47c51$2.delete_quote,
|
|
3213
|
-
onClick: function() {
|
|
3214
|
-
setCitationContent({});
|
|
3215
|
-
resettingBottomHei();
|
|
3216
|
-
},
|
|
3217
|
-
children: /*#__PURE__*/ jsx(CustomRoundClose$1, {})
|
|
3218
|
-
})
|
|
3219
|
-
]
|
|
3220
|
-
}) : ""
|
|
3221
|
-
]
|
|
3222
|
-
}),
|
|
3223
|
-
userData.modules.some(function(item) {
|
|
3224
|
-
return item.short == "AIservice";
|
|
3225
|
-
}) ? /*#__PURE__*/ jsxs("p", {
|
|
3226
|
-
className: modules_63b47c51$2.voice,
|
|
3227
|
-
children: [
|
|
3228
|
-
voiceRecordingStatus == 1 || voiceRecordingStatus == 3 ? /*#__PURE__*/ jsx("i", {
|
|
3229
|
-
className: "yuyin-kai12",
|
|
3230
|
-
style: {
|
|
3231
|
-
color: disabled ? "rgba(0, 0, 0, 0.65)" : "rgba(0, 0, 0, 0.25)"
|
|
3232
|
-
},
|
|
3233
|
-
onClick: function() {
|
|
3234
|
-
//开始录音
|
|
3235
|
-
if (!disabled) return;
|
|
3236
|
-
startRecord();
|
|
3237
|
-
setVoiceRecordingStatus(2);
|
|
3238
|
-
setKeyWord("");
|
|
3239
|
-
voiceCountdownTimer.current = setTimeout(function() {
|
|
3240
|
-
stopRecord();
|
|
3241
|
-
setVoiceRecordingStatus(1);
|
|
3242
|
-
}, 120000);
|
|
3243
|
-
onEvent(serverName + serverUrl(), "click_智能问答_ 麦克风", "提交");
|
|
3244
|
-
},
|
|
3245
|
-
children: /*#__PURE__*/ jsx(CustomSoundRecording$1, {})
|
|
3246
|
-
}) : "",
|
|
3247
|
-
voiceRecordingStatus == 2 ? /*#__PURE__*/ jsx("img", {
|
|
3248
|
-
// src={Voice_btn}
|
|
3249
|
-
src: "/new_yun/images/aiService/voice_btn.gif",
|
|
3250
|
-
className: modules_63b47c51$2.voice_btn,
|
|
3251
|
-
onClick: function() {
|
|
3252
|
-
//结束录音
|
|
3253
|
-
// console.log(mediaRecorder,'3333333');
|
|
3254
|
-
// mediaRecorder.stop();
|
|
3255
|
-
stopRecord();
|
|
3256
|
-
setVoiceRecordingStatus(1);
|
|
3257
|
-
clearTimeout(voiceCountdownTimer.current);
|
|
3258
|
-
}
|
|
3259
|
-
}) : ""
|
|
3260
|
-
]
|
|
3261
|
-
}) : ""
|
|
3262
|
-
]
|
|
3263
|
-
}),
|
|
3264
|
-
/*#__PURE__*/ jsx("p", {
|
|
3265
|
-
className: "".concat(modules_63b47c51$2.sending),
|
|
3266
|
-
children: /*#__PURE__*/ jsx("i", {
|
|
3267
|
-
className: "".concat(!disabled ? modules_63b47c51$2.disabled : ""),
|
|
3268
|
-
onClick: function() {
|
|
3269
|
-
if (!disabled) return;
|
|
3270
|
-
setCitationContent({});
|
|
3271
|
-
setButtomHei(45);
|
|
3272
|
-
if (keyWord.trim() != "") {
|
|
3273
|
-
setKeyWord("");
|
|
3274
|
-
//跟老师对话
|
|
3275
|
-
if (roomList.length > 0 && roomList[0].roomId != roomId) {
|
|
3276
|
-
sendToTeacher(2);
|
|
3277
|
-
} else {
|
|
3278
|
-
sendMessage();
|
|
3279
|
-
}
|
|
3280
|
-
onEvent(serverName + serverUrl(), "click_智能问答_ Enter", "提交");
|
|
3281
|
-
}
|
|
3282
|
-
},
|
|
3283
|
-
children: /*#__PURE__*/ jsx(CustomSending$1, {})
|
|
3284
|
-
})
|
|
3285
|
-
})
|
|
3286
|
-
]
|
|
3287
|
-
});
|
|
3288
|
-
};
|
|
3289
|
-
//渲染联想问题及联想的老师名称
|
|
3290
|
-
var renderAssociationProblem = function() {
|
|
3291
|
-
if (answerMode == 1) {
|
|
3292
|
-
return /*#__PURE__*/ jsx("div", {
|
|
3293
|
-
className: "".concat(modules_63b47c51$2.issues_list, " ").concat(modules_63b47c51$2.issues_list_teacherList),
|
|
3294
|
-
style: {
|
|
3295
|
-
bottom: "".concat(buttomHei + 6, "px")
|
|
3296
|
-
},
|
|
3297
|
-
children: teacherList.map(function(item) {
|
|
3298
|
-
var span = item.name.replaceAll(keyWord, function() {
|
|
3299
|
-
return "<span class=".concat(modules_63b47c51$2.sign, ">").concat(keyWord, "</span>");
|
|
3300
|
-
});
|
|
3301
|
-
return /*#__PURE__*/ jsx("p", {
|
|
3302
|
-
className: modules_63b47c51$2.item,
|
|
3303
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
3304
|
-
onClick: function() {
|
|
3305
|
-
setTeacherList([]);
|
|
3306
|
-
//提问的问题
|
|
3307
|
-
setProblem({
|
|
3308
|
-
question: problem.question,
|
|
3309
|
-
user: item.uid
|
|
3310
|
-
});
|
|
3311
|
-
setKeyWord("");
|
|
3312
|
-
//setUpdateRecords(true);
|
|
3313
|
-
setAnswerMode(-1);
|
|
3314
|
-
setChatWith(item);
|
|
3315
|
-
createRooms(item.uid).then(function(res) {
|
|
3316
|
-
var id = res.data.id;
|
|
3317
|
-
setRoomId(id); //新的聊天室id
|
|
3318
|
-
});
|
|
3319
|
-
},
|
|
3320
|
-
dangerouslySetInnerHTML: {
|
|
3321
|
-
__html: span
|
|
3322
|
-
}
|
|
3323
|
-
})
|
|
3324
|
-
});
|
|
3325
|
-
})
|
|
3326
|
-
});
|
|
3327
|
-
} else {
|
|
3328
|
-
return /*#__PURE__*/ jsx("div", {
|
|
3329
|
-
className: modules_63b47c51$2.issues_list,
|
|
3330
|
-
style: {
|
|
3331
|
-
bottom: "".concat(buttomHei + 6, "px")
|
|
3332
|
-
},
|
|
3333
|
-
children: questionsList.map(function(item) {
|
|
3334
|
-
console.log(item, 44444444);
|
|
3335
|
-
var span = item.question.replaceAll(keyWord, function() {
|
|
3336
|
-
return "<span class=".concat(modules_63b47c51$2.sign, ">").concat(keyWord, "</span>");
|
|
3337
|
-
});
|
|
3338
|
-
return /*#__PURE__*/ jsx("p", {
|
|
3339
|
-
className: modules_63b47c51$2.item,
|
|
3340
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
3341
|
-
onClick: function() {
|
|
3342
|
-
sendMessage(item, 2);
|
|
3343
|
-
setKeyWord("");
|
|
3344
|
-
onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
|
|
3345
|
-
},
|
|
3346
|
-
dangerouslySetInnerHTML: {
|
|
3347
|
-
__html: span
|
|
3348
|
-
}
|
|
3349
|
-
})
|
|
3350
|
-
});
|
|
3351
|
-
})
|
|
3352
|
-
});
|
|
3353
|
-
}
|
|
3354
|
-
};
|
|
3355
|
-
//加载指定数据,点击历史记录
|
|
3356
|
-
var loadSpecifiedData = function(renewRoomId, page, id) {
|
|
3357
|
-
setPageNum(page);
|
|
3358
|
-
setLastId(id); //用于定位
|
|
3359
|
-
//如果是当前聊天室
|
|
3360
|
-
if (renewRoomId == roomId) {
|
|
3361
|
-
console.log("当前聊天窗口111111");
|
|
3362
|
-
getHistoryMessage(page, 1);
|
|
3363
|
-
} else {
|
|
3364
|
-
setRoomId(renewRoomId);
|
|
3365
|
-
}
|
|
3366
|
-
};
|
|
3367
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
3368
|
-
children: [
|
|
3369
|
-
/*#__PURE__*/ jsxs(Drawer, {
|
|
3370
|
-
title: "智能回答",
|
|
3371
|
-
width: 560,
|
|
3372
|
-
onClose: function() {
|
|
3373
|
-
onCancel();
|
|
3374
|
-
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
3375
|
-
},
|
|
3376
|
-
open: showType == 1 ? true : false,
|
|
3377
|
-
className: modules_63b47c51$2.ChatWindow_Drawer,
|
|
3378
|
-
mask: false,
|
|
3379
|
-
// maskClosable={false}
|
|
3380
|
-
rootClassName: modules_63b47c51$2.service_ChatWindow_Drawer,
|
|
3381
|
-
children: [
|
|
3382
|
-
/*#__PURE__*/ jsx("div", {
|
|
3383
|
-
style: {
|
|
3384
|
-
display: "".concat(showContacts && roomId != "" ? "block" : "none")
|
|
3385
|
-
},
|
|
3386
|
-
children: /*#__PURE__*/ jsx(ContactsList$1, {
|
|
3387
|
-
type: 1,
|
|
3388
|
-
roomId: roomId,
|
|
3389
|
-
userData: userData,
|
|
3390
|
-
http: http,
|
|
3391
|
-
urllocation: urllocation,
|
|
3392
|
-
onClose: function() {
|
|
3393
|
-
setShowContacts(false);
|
|
3394
|
-
},
|
|
3395
|
-
// roomIdAi={roomIdAi}
|
|
3396
|
-
switchChatRoom: switchChatRoom,
|
|
3397
|
-
saveContactsList: saveContactsList
|
|
3398
|
-
})
|
|
3399
|
-
}),
|
|
3400
|
-
/*#__PURE__*/ jsx("div", {
|
|
3401
|
-
className: modules_63b47c51$2.header_wrap,
|
|
3402
|
-
children: renderHeader()
|
|
3403
|
-
}),
|
|
3404
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3405
|
-
className: "".concat(modules_63b47c51$2.Drawer_main),
|
|
3406
|
-
id: "chat_content",
|
|
3407
|
-
style: {
|
|
3408
|
-
maxHeight: "calc(100vh-".concat(buttomHei + 48, "px)")
|
|
3409
|
-
},
|
|
3410
|
-
children: [
|
|
3411
|
-
loading ? /*#__PURE__*/ jsx("div", {
|
|
3412
|
-
className: modules_63b47c51$2.loading,
|
|
3413
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
3414
|
-
src: "/new_yun/images/loading_d.gif",
|
|
3415
|
-
alt: ""
|
|
3416
|
-
})
|
|
3417
|
-
}) : "",
|
|
3418
|
-
renderQuestion()
|
|
3419
|
-
]
|
|
3420
|
-
}),
|
|
3421
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3422
|
-
className: modules_63b47c51$2.Drawer_buttom_Issues_List,
|
|
3423
|
-
children: [
|
|
3424
|
-
renderAssociationProblem(),
|
|
3425
|
-
/*#__PURE__*/ jsx("div", {
|
|
3426
|
-
className: modules_63b47c51$2.Drawer_buttom,
|
|
3427
|
-
id: "Drawer_buttom",
|
|
3428
|
-
children: renderBottomAnt()
|
|
3429
|
-
})
|
|
3430
|
-
]
|
|
3431
|
-
}),
|
|
3432
|
-
showType == 1 && showHistory && /*#__PURE__*/ jsx(HistoryFun$1, {
|
|
3433
|
-
type: 1,
|
|
3434
|
-
roomId: roomId,
|
|
3435
|
-
userData: userData,
|
|
3436
|
-
http: http,
|
|
3437
|
-
urllocation: urllocation,
|
|
3438
|
-
onClose: function() {
|
|
3439
|
-
setShowHistory(false);
|
|
3440
|
-
},
|
|
3441
|
-
loadSpecifiedData: loadSpecifiedData,
|
|
3442
|
-
roomList: roomList
|
|
3443
|
-
})
|
|
3444
|
-
]
|
|
3445
|
-
}),
|
|
3446
|
-
/*#__PURE__*/ jsxs(Modal, {
|
|
3447
|
-
title: "智能回答",
|
|
3448
|
-
open: showType == 2 ? true : false,
|
|
3449
|
-
onCancel: function() {
|
|
3450
|
-
onCancel();
|
|
3451
|
-
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
3452
|
-
},
|
|
3453
|
-
centered: true,
|
|
3454
|
-
width: 1014,
|
|
3455
|
-
height: window.innerHeight - 160,
|
|
3456
|
-
wrapClassName: modules_63b47c51$2.ChatWindow_Modal,
|
|
3457
|
-
footer: false,
|
|
3458
|
-
maskClosable: false,
|
|
3459
|
-
closeIcon: null,
|
|
3460
|
-
children: [
|
|
3461
|
-
/*#__PURE__*/ jsx("div", {
|
|
3462
|
-
className: modules_63b47c51$2.header_wrap,
|
|
3463
|
-
children: renderHeader()
|
|
3464
|
-
}),
|
|
3465
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3466
|
-
className: "".concat(modules_63b47c51$2.Drawer_wrap_main),
|
|
3467
|
-
children: [
|
|
3468
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3469
|
-
className: "".concat(modules_63b47c51$2.Drawer_main, " ChatWindow_Modal_history_list"),
|
|
3470
|
-
id: "chat_content_modal",
|
|
3471
|
-
style: {
|
|
3472
|
-
maxHeight: "".concat(window.innerHeight - 148 - buttomHei, "px")
|
|
3473
|
-
},
|
|
3474
|
-
children: [
|
|
3475
|
-
/*#__PURE__*/ jsx(ContactsList$1, {
|
|
3476
|
-
type: 2,
|
|
3477
|
-
roomId: roomId,
|
|
3478
|
-
userData: userData,
|
|
3479
|
-
http: http,
|
|
3480
|
-
urllocation: urllocation,
|
|
3481
|
-
onClose: function() {
|
|
3482
|
-
setShowContacts(false);
|
|
3483
|
-
},
|
|
3484
|
-
switchChatRoom: switchChatRoom,
|
|
3485
|
-
saveContactsList: saveContactsList
|
|
3486
|
-
}),
|
|
3487
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3488
|
-
className: modules_63b47c51$2.chat_content,
|
|
3489
|
-
children: [
|
|
3490
|
-
loading ? /*#__PURE__*/ jsx("div", {
|
|
3491
|
-
className: modules_63b47c51$2.loading,
|
|
3492
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
3493
|
-
src: "/new_yun/images/loading_d.gif",
|
|
3494
|
-
alt: ""
|
|
3495
|
-
})
|
|
3496
|
-
}) : "",
|
|
3497
|
-
renderQuestion()
|
|
3498
|
-
]
|
|
3499
|
-
})
|
|
3500
|
-
]
|
|
3501
|
-
}),
|
|
3502
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3503
|
-
className: modules_63b47c51$2.Drawer_buttom_Issues_List,
|
|
3504
|
-
children: [
|
|
3505
|
-
renderAssociationProblem(),
|
|
3506
|
-
/*#__PURE__*/ jsx("div", {
|
|
3507
|
-
className: modules_63b47c51$2.Drawer_buttom,
|
|
3508
|
-
id: "Drawer_buttom_modal",
|
|
3509
|
-
children: renderBottomAnt()
|
|
3510
|
-
})
|
|
3511
|
-
]
|
|
3512
|
-
}),
|
|
3513
|
-
showType == 2 && showHistory && /*#__PURE__*/ jsx(HistoryFun$1, {
|
|
3514
|
-
type: 2,
|
|
3515
|
-
roomId: roomId,
|
|
3516
|
-
userData: userData,
|
|
3517
|
-
http: http,
|
|
3518
|
-
urllocation: urllocation,
|
|
3519
|
-
onClose: function() {
|
|
3520
|
-
setShowHistory(false);
|
|
3521
|
-
},
|
|
3522
|
-
loadSpecifiedData: loadSpecifiedData,
|
|
3523
|
-
roomList: roomList
|
|
3524
|
-
})
|
|
3525
|
-
]
|
|
3526
|
-
})
|
|
3527
|
-
]
|
|
3528
|
-
}),
|
|
3529
|
-
showType == 3 && /*#__PURE__*/ jsxs("div", {
|
|
3530
|
-
className: "".concat(modules_63b47c51$2.ChatWindow_Drawer),
|
|
3531
|
-
id: "",
|
|
3532
|
-
children: [
|
|
3533
|
-
/*#__PURE__*/ jsx("div", {
|
|
3534
|
-
className: "".concat(modules_63b47c51$2.header_wrap, " ").concat(modules_63b47c51$2.header_wrap_newlabo),
|
|
3535
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
3536
|
-
className: modules_63b47c51$2.top,
|
|
3537
|
-
children: [
|
|
3538
|
-
/*#__PURE__*/ jsx("div", {
|
|
3539
|
-
className: modules_63b47c51$2.user,
|
|
3540
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
3541
|
-
children: "智能回答"
|
|
3542
|
-
})
|
|
3543
|
-
}),
|
|
3544
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3545
|
-
className: modules_63b47c51$2.operate,
|
|
3546
|
-
children: [
|
|
3547
|
-
/*#__PURE__*/ jsx("i", {
|
|
3548
|
-
onClick: function() {
|
|
3549
|
-
setShowHistory(true);
|
|
3550
|
-
},
|
|
3551
|
-
children: /*#__PURE__*/ jsx(CustomRecord$1, {})
|
|
3552
|
-
}),
|
|
3553
|
-
/*#__PURE__*/ jsx("span", {
|
|
3554
|
-
className: modules_63b47c51$2.line
|
|
3555
|
-
}),
|
|
3556
|
-
/*#__PURE__*/ jsx("i", {
|
|
3557
|
-
onClick: function() {
|
|
3558
|
-
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
3559
|
-
setShowType(4);
|
|
3560
|
-
},
|
|
3561
|
-
children: /*#__PURE__*/ jsx(CustomExitFullScreen$1, {})
|
|
3562
|
-
}),
|
|
3563
|
-
/*#__PURE__*/ jsx("i", {
|
|
3564
|
-
className: "lianxiren21",
|
|
3565
|
-
onClick: function() {
|
|
3566
|
-
setShowContacts(true);
|
|
3567
|
-
},
|
|
3568
|
-
children: /*#__PURE__*/ jsx(CustomContacts$1, {})
|
|
3569
|
-
})
|
|
3570
|
-
]
|
|
3571
|
-
})
|
|
3572
|
-
]
|
|
3573
|
-
})
|
|
3574
|
-
}),
|
|
3575
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3576
|
-
className: "".concat(modules_63b47c51$2.Drawer_main, " ").concat(modules_63b47c51$2.Drawer_main_newlabo),
|
|
3577
|
-
id: "chat_content",
|
|
3578
|
-
style: {
|
|
3579
|
-
maxHeight: "calc(100vh-".concat(100, "-").concat(buttomHei, "px)")
|
|
3580
|
-
},
|
|
3581
|
-
children: [
|
|
3582
|
-
loading ? /*#__PURE__*/ jsx("div", {
|
|
3583
|
-
className: modules_63b47c51$2.loading,
|
|
3584
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
3585
|
-
src: "/new_yun/images/loading_d.gif",
|
|
3586
|
-
alt: ""
|
|
3587
|
-
})
|
|
3588
|
-
}) : "",
|
|
3589
|
-
renderQuestion()
|
|
3590
|
-
]
|
|
3591
|
-
}),
|
|
3592
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3593
|
-
className: "".concat(modules_63b47c51$2.Drawer_buttom_Issues_List, " ").concat(modules_63b47c51$2.Drawer_buttom_Issues_List_newlabo),
|
|
3594
|
-
children: [
|
|
3595
|
-
renderAssociationProblem(),
|
|
3596
|
-
/*#__PURE__*/ jsx("div", {
|
|
3597
|
-
className: modules_63b47c51$2.Drawer_buttom,
|
|
3598
|
-
id: "Drawer_buttom",
|
|
3599
|
-
children: renderBottomAnt()
|
|
3600
|
-
})
|
|
3601
|
-
]
|
|
3602
|
-
}),
|
|
3603
|
-
showType == 3 && showHistory && /*#__PURE__*/ jsx(HistoryFun$1, {
|
|
3604
|
-
type: 3,
|
|
3605
|
-
roomId: roomId,
|
|
3606
|
-
userData: userData,
|
|
3607
|
-
http: http,
|
|
3608
|
-
urllocation: urllocation,
|
|
3609
|
-
onClose: function() {
|
|
3610
|
-
setShowHistory(false);
|
|
3611
|
-
},
|
|
3612
|
-
loadSpecifiedData: loadSpecifiedData,
|
|
3613
|
-
roomList: roomList
|
|
3614
|
-
}),
|
|
3615
|
-
/*#__PURE__*/ jsx("div", {
|
|
3616
|
-
style: {
|
|
3617
|
-
display: "".concat(showType == 3 && showContacts && roomId != "" ? "block" : "none")
|
|
3618
|
-
},
|
|
3619
|
-
children: /*#__PURE__*/ jsx(ContactsList$1, {
|
|
3620
|
-
type: 3,
|
|
3621
|
-
roomId: roomId,
|
|
3622
|
-
userData: userData,
|
|
3623
|
-
http: http,
|
|
3624
|
-
urllocation: urllocation,
|
|
3625
|
-
onClose: function() {
|
|
3626
|
-
setShowContacts(false);
|
|
3627
|
-
},
|
|
3628
|
-
switchChatRoom: switchChatRoom,
|
|
3629
|
-
saveContactsList: saveContactsList
|
|
3630
|
-
})
|
|
3631
|
-
})
|
|
3632
|
-
]
|
|
3633
|
-
}),
|
|
3634
|
-
showType == 4 && /*#__PURE__*/ jsxs(Fragment, {
|
|
3635
|
-
children: [
|
|
3636
|
-
/*#__PURE__*/ jsxs(Modal, {
|
|
3637
|
-
title: "智能回答",
|
|
3638
|
-
open: true,
|
|
3639
|
-
onCancel: function() {
|
|
3640
|
-
onCancel();
|
|
3641
|
-
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
3642
|
-
},
|
|
3643
|
-
centered: true,
|
|
3644
|
-
width: 1014,
|
|
3645
|
-
height: window.innerHeight - 160,
|
|
3646
|
-
wrapClassName: "".concat(modules_63b47c51$2.ChatWindow_Modal),
|
|
3647
|
-
footer: false,
|
|
3648
|
-
maskClosable: false,
|
|
3649
|
-
closeIcon: null,
|
|
3650
|
-
children: [
|
|
3651
|
-
/*#__PURE__*/ jsx("div", {
|
|
3652
|
-
className: modules_63b47c51$2.header_wrap,
|
|
3653
|
-
children: renderHeader()
|
|
3654
|
-
}),
|
|
3655
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3656
|
-
className: "".concat(modules_63b47c51$2.Drawer_wrap_main),
|
|
3657
|
-
children: [
|
|
3658
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3659
|
-
className: "".concat(modules_63b47c51$2.Drawer_main, " ").concat(modules_63b47c51$2.Drawer_main_newlabo),
|
|
3660
|
-
id: "chat_content_modal",
|
|
3661
|
-
style: {
|
|
3662
|
-
maxHeight: "".concat(window.innerHeight - 148 - buttomHei, "px")
|
|
3663
|
-
},
|
|
3664
|
-
children: [
|
|
3665
|
-
/*#__PURE__*/ jsx(ContactsList$1, {
|
|
3666
|
-
type: 4,
|
|
3667
|
-
roomId: roomId,
|
|
3668
|
-
userData: userData,
|
|
3669
|
-
http: http,
|
|
3670
|
-
urllocation: urllocation,
|
|
3671
|
-
onClose: function() {
|
|
3672
|
-
setShowContacts(false);
|
|
3673
|
-
},
|
|
3674
|
-
switchChatRoom: switchChatRoom,
|
|
3675
|
-
saveContactsList: saveContactsList
|
|
3676
|
-
}),
|
|
3677
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3678
|
-
className: modules_63b47c51$2.chat_content,
|
|
3679
|
-
children: [
|
|
3680
|
-
loading ? /*#__PURE__*/ jsx("div", {
|
|
3681
|
-
className: modules_63b47c51$2.loading,
|
|
3682
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
3683
|
-
src: "/new_yun/images/loading_d.gif",
|
|
3684
|
-
alt: ""
|
|
3685
|
-
})
|
|
3686
|
-
}) : "",
|
|
3687
|
-
renderQuestion()
|
|
3688
|
-
]
|
|
3689
|
-
})
|
|
3690
|
-
]
|
|
3691
|
-
}),
|
|
3692
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3693
|
-
className: modules_63b47c51$2.Drawer_buttom_Issues_List,
|
|
3694
|
-
children: [
|
|
3695
|
-
renderAssociationProblem(),
|
|
3696
|
-
/*#__PURE__*/ jsx("div", {
|
|
3697
|
-
className: modules_63b47c51$2.Drawer_buttom,
|
|
3698
|
-
id: "Drawer_buttom_modal",
|
|
3699
|
-
children: renderBottomAnt()
|
|
3700
|
-
})
|
|
3701
|
-
]
|
|
3702
|
-
}),
|
|
3703
|
-
showHistory && /*#__PURE__*/ jsx(HistoryFun$1, {
|
|
3704
|
-
type: 2,
|
|
3705
|
-
roomId: roomId,
|
|
3706
|
-
userData: userData,
|
|
3707
|
-
http: http,
|
|
3708
|
-
urllocation: urllocation,
|
|
3709
|
-
onClose: function() {
|
|
3710
|
-
setShowHistory(false);
|
|
3711
|
-
},
|
|
3712
|
-
loadSpecifiedData: loadSpecifiedData,
|
|
3713
|
-
roomList: roomList
|
|
3714
|
-
})
|
|
3715
|
-
]
|
|
3716
|
-
})
|
|
3717
|
-
]
|
|
3718
|
-
}),
|
|
3719
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3720
|
-
className: "".concat(modules_63b47c51$2.ChatWindow_Drawer),
|
|
3721
|
-
id: "",
|
|
3722
|
-
children: [
|
|
3723
|
-
/*#__PURE__*/ jsx("div", {
|
|
3724
|
-
className: "".concat(modules_63b47c51$2.header_wrap, " ").concat(modules_63b47c51$2.header_wrap_newlabo),
|
|
3725
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
3726
|
-
className: modules_63b47c51$2.top,
|
|
3727
|
-
children: [
|
|
3728
|
-
/*#__PURE__*/ jsx("div", {
|
|
3729
|
-
className: modules_63b47c51$2.user,
|
|
3730
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
3731
|
-
children: "智能回答"
|
|
3732
|
-
})
|
|
3733
|
-
}),
|
|
3734
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3735
|
-
className: modules_63b47c51$2.operate,
|
|
3736
|
-
children: [
|
|
3737
|
-
/*#__PURE__*/ jsx("i", {
|
|
3738
|
-
onClick: function() {
|
|
3739
|
-
setShowHistory(true);
|
|
3740
|
-
},
|
|
3741
|
-
children: /*#__PURE__*/ jsx(CustomRecord$1, {})
|
|
3742
|
-
}),
|
|
3743
|
-
/*#__PURE__*/ jsx("span", {
|
|
3744
|
-
className: modules_63b47c51$2.line
|
|
3745
|
-
}),
|
|
3746
|
-
/*#__PURE__*/ jsx("i", {
|
|
3747
|
-
onClick: function() {
|
|
3748
|
-
onEvent(serverName + serverUrl(), "click_智能问答_全屏", "提交");
|
|
3749
|
-
setShowType(4);
|
|
3750
|
-
},
|
|
3751
|
-
children: /*#__PURE__*/ jsx(CustomExitFullScreen$1, {})
|
|
3752
|
-
}),
|
|
3753
|
-
/*#__PURE__*/ jsx("i", {
|
|
3754
|
-
className: "lianxiren21",
|
|
3755
|
-
onClick: function() {
|
|
3756
|
-
setShowContacts(true);
|
|
3757
|
-
},
|
|
3758
|
-
children: /*#__PURE__*/ jsx(CustomContacts$1, {})
|
|
3759
|
-
})
|
|
3760
|
-
]
|
|
3761
|
-
})
|
|
3762
|
-
]
|
|
3763
|
-
})
|
|
3764
|
-
}),
|
|
3765
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3766
|
-
className: "".concat(modules_63b47c51$2.Drawer_main, " ").concat(modules_63b47c51$2.Drawer_main_newlabo),
|
|
3767
|
-
id: "chat_content",
|
|
3768
|
-
style: {
|
|
3769
|
-
maxHeight: "calc(100vh-".concat(100, "-").concat(buttomHei, "px)")
|
|
3770
|
-
},
|
|
3771
|
-
children: [
|
|
3772
|
-
loading ? /*#__PURE__*/ jsx("div", {
|
|
3773
|
-
className: modules_63b47c51$2.loading,
|
|
3774
|
-
children: /*#__PURE__*/ jsx("img", {
|
|
3775
|
-
src: "/new_yun/images/loading_d.gif",
|
|
3776
|
-
alt: ""
|
|
3777
|
-
})
|
|
3778
|
-
}) : "",
|
|
3779
|
-
renderQuestion()
|
|
3780
|
-
]
|
|
3781
|
-
}),
|
|
3782
|
-
/*#__PURE__*/ jsxs("div", {
|
|
3783
|
-
className: "".concat(modules_63b47c51$2.Drawer_buttom_Issues_List, " ").concat(modules_63b47c51$2.Drawer_buttom_Issues_List_newlabo),
|
|
3784
|
-
children: [
|
|
3785
|
-
renderAssociationProblem(),
|
|
3786
|
-
/*#__PURE__*/ jsx("div", {
|
|
3787
|
-
className: modules_63b47c51$2.Drawer_buttom,
|
|
3788
|
-
id: "Drawer_buttom",
|
|
3789
|
-
children: renderBottomAnt()
|
|
3790
|
-
})
|
|
3791
|
-
]
|
|
3792
|
-
}),
|
|
3793
|
-
/*#__PURE__*/ jsx("div", {
|
|
3794
|
-
style: {
|
|
3795
|
-
display: "".concat(showContacts && roomId != "" ? "block" : "none")
|
|
3796
|
-
},
|
|
3797
|
-
children: /*#__PURE__*/ jsx(ContactsList$1, {
|
|
3798
|
-
type: 3,
|
|
3799
|
-
roomId: roomId,
|
|
3800
|
-
userData: userData,
|
|
3801
|
-
http: http,
|
|
3802
|
-
urllocation: urllocation,
|
|
3803
|
-
onClose: function() {
|
|
3804
|
-
setShowContacts(false);
|
|
3805
|
-
},
|
|
3806
|
-
switchChatRoom: switchChatRoom,
|
|
3807
|
-
saveContactsList: saveContactsList
|
|
3808
|
-
})
|
|
3809
|
-
})
|
|
3810
|
-
]
|
|
3811
|
-
})
|
|
3812
|
-
]
|
|
3813
|
-
})
|
|
3814
|
-
]
|
|
3815
|
-
});
|
|
3816
|
-
};
|
|
3817
|
-
window.appendDom = function(root, props) {
|
|
3818
|
-
render(/*#__PURE__*/ jsx(Provider$1.Component, {
|
|
3819
|
-
children: /*#__PURE__*/ jsx(CustomerService, _object_spread({}, props))
|
|
3820
|
-
}), root);
|
|
3821
|
-
};
|
|
3822
|
-
|
|
3823
|
-
export { CustomerService as default };
|