bhd-components 0.5.6 → 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.
Files changed (115) hide show
  1. package/dist/5764783e.esm.es5.production.js +468 -0
  2. package/dist/f2b01b9c.esm.es5.development.js +167840 -0
  3. package/dist/index.esm.es5.development.css +8467 -0
  4. package/dist/index.esm.es5.development.js +5835 -0
  5. package/dist/index.esm.es5.production.css +1 -0
  6. package/dist/index.esm.es5.production.js +1 -0
  7. package/dist/vendor.esm.es5.development.esm.es5.development.css +117 -0
  8. package/dist/vendor.esm.es5.production.esm.es5.production.css +9 -0
  9. package/es2017/customerService/contactsList/index.d.ts +14 -0
  10. package/es2017/customerService/contactsList/index.js +316 -0
  11. package/es2017/customerService/contactsList/index.module.less +206 -0
  12. package/es2017/customerService/function.d.ts +17 -0
  13. package/es2017/customerService/function.js +72 -0
  14. package/es2017/customerService/historyFun/index.d.ts +14 -0
  15. package/es2017/customerService/historyFun/index.js +276 -0
  16. package/es2017/customerService/historyFun/index.module.less +223 -0
  17. package/es2017/customerService/images/knowledge_icon.png +0 -0
  18. package/es2017/customerService/images/voice_btn.gif +0 -0
  19. package/es2017/customerService/index.d.ts +16 -0
  20. package/es2017/customerService/index.js +2687 -0
  21. package/es2017/customerService/index.module.less +790 -0
  22. package/es2017/customerService/useMediaRecorder.d.ts +9 -0
  23. package/es2017/customerService/useMediaRecorder.js +78 -0
  24. package/es2017/customerService/voice_btn.gif +0 -0
  25. package/es2017/icons/components/custom-ai_icon.d.ts +4 -0
  26. package/es2017/icons/components/custom-ai_icon.js +58 -0
  27. package/es2017/icons/components/custom-contacts.d.ts +4 -0
  28. package/es2017/icons/components/custom-contacts.js +29 -0
  29. package/es2017/icons/components/custom-copy.d.ts +4 -0
  30. package/es2017/icons/components/custom-copy.js +36 -0
  31. package/es2017/icons/components/custom-dislike.d.ts +4 -0
  32. package/es2017/icons/components/custom-dislike.js +22 -0
  33. package/es2017/icons/components/custom-duihao.d.ts +4 -0
  34. package/es2017/icons/components/custom-duihao.js +22 -0
  35. package/es2017/icons/components/custom-exit_full_screen.d.ts +4 -0
  36. package/es2017/icons/components/custom-exit_full_screen.js +26 -0
  37. package/es2017/icons/components/custom-full_screen.d.ts +4 -0
  38. package/es2017/icons/components/custom-full_screen.js +22 -0
  39. package/es2017/icons/components/custom-like.d.ts +4 -0
  40. package/es2017/icons/components/custom-like.js +22 -0
  41. package/es2017/icons/components/custom-quote.d.ts +4 -0
  42. package/es2017/icons/components/custom-quote.js +31 -0
  43. package/es2017/icons/components/custom-record.d.ts +4 -0
  44. package/es2017/icons/components/custom-record.js +37 -0
  45. package/es2017/icons/components/custom-reloading.d.ts +4 -0
  46. package/es2017/icons/components/custom-reloading.js +26 -0
  47. package/es2017/icons/components/custom-retract.d.ts +4 -0
  48. package/es2017/icons/components/custom-retract.js +27 -0
  49. package/es2017/icons/components/custom-round_close.d.ts +4 -0
  50. package/es2017/icons/components/custom-round_close.js +24 -0
  51. package/es2017/icons/components/custom-sending.d.ts +4 -0
  52. package/es2017/icons/components/custom-sending.js +22 -0
  53. package/es2017/icons/components/custom-sound_recording.d.ts +4 -0
  54. package/es2017/icons/components/custom-sound_recording.js +22 -0
  55. package/es2017/icons/components/index.d.ts +15 -0
  56. package/es2017/icons/components/index.js +15 -0
  57. package/es2017/index.d.ts +1 -0
  58. package/es2017/index.js +1 -0
  59. package/esm/customerService/contactsList/index.d.ts +14 -0
  60. package/esm/customerService/contactsList/index.js +333 -0
  61. package/esm/customerService/contactsList/index.module.less +206 -0
  62. package/esm/customerService/function.d.ts +17 -0
  63. package/esm/customerService/function.js +74 -0
  64. package/esm/customerService/historyFun/index.d.ts +14 -0
  65. package/esm/customerService/historyFun/index.js +289 -0
  66. package/esm/customerService/historyFun/index.module.less +223 -0
  67. package/esm/customerService/images/knowledge_icon.png +0 -0
  68. package/esm/customerService/images/voice_btn.gif +0 -0
  69. package/esm/customerService/index.d.ts +16 -0
  70. package/esm/customerService/index.js +2793 -0
  71. package/esm/customerService/index.module.less +790 -0
  72. package/esm/customerService/useMediaRecorder.d.ts +9 -0
  73. package/esm/customerService/useMediaRecorder.js +121 -0
  74. package/esm/customerService/voice_btn.gif +0 -0
  75. package/esm/icons/components/custom-ai_icon.d.ts +4 -0
  76. package/esm/icons/components/custom-ai_icon.js +60 -0
  77. package/esm/icons/components/custom-contacts.d.ts +4 -0
  78. package/esm/icons/components/custom-contacts.js +31 -0
  79. package/esm/icons/components/custom-copy.d.ts +4 -0
  80. package/esm/icons/components/custom-copy.js +38 -0
  81. package/esm/icons/components/custom-dislike.d.ts +4 -0
  82. package/esm/icons/components/custom-dislike.js +24 -0
  83. package/esm/icons/components/custom-duihao.d.ts +4 -0
  84. package/esm/icons/components/custom-duihao.js +24 -0
  85. package/esm/icons/components/custom-exit_full_screen.d.ts +4 -0
  86. package/esm/icons/components/custom-exit_full_screen.js +28 -0
  87. package/esm/icons/components/custom-full_screen.d.ts +4 -0
  88. package/esm/icons/components/custom-full_screen.js +24 -0
  89. package/esm/icons/components/custom-like.d.ts +4 -0
  90. package/esm/icons/components/custom-like.js +24 -0
  91. package/esm/icons/components/custom-quote.d.ts +4 -0
  92. package/esm/icons/components/custom-quote.js +33 -0
  93. package/esm/icons/components/custom-record.d.ts +4 -0
  94. package/esm/icons/components/custom-record.js +39 -0
  95. package/esm/icons/components/custom-reloading.d.ts +4 -0
  96. package/esm/icons/components/custom-reloading.js +28 -0
  97. package/esm/icons/components/custom-retract.d.ts +4 -0
  98. package/esm/icons/components/custom-retract.js +29 -0
  99. package/esm/icons/components/custom-round_close.d.ts +4 -0
  100. package/esm/icons/components/custom-round_close.js +26 -0
  101. package/esm/icons/components/custom-sending.d.ts +4 -0
  102. package/esm/icons/components/custom-sending.js +24 -0
  103. package/esm/icons/components/custom-sound_recording.d.ts +4 -0
  104. package/esm/icons/components/custom-sound_recording.js +24 -0
  105. package/esm/icons/components/index.d.ts +15 -0
  106. package/esm/icons/components/index.js +15 -0
  107. package/esm/index.d.ts +1 -0
  108. package/esm/index.js +1 -0
  109. package/package.json +11 -2
  110. package/dist/1951bd5c.esm.es5.development.js +0 -45417
  111. package/dist/28cd83d3.esm.es5.production.js +0 -256
  112. package/dist/table.esm.es5.development.css +0 -772
  113. package/dist/table.esm.es5.development.js +0 -289
  114. package/dist/table.esm.es5.production.css +0 -1
  115. package/dist/table.esm.es5.production.js +0 -1
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { CustomIconComponentProps } from "@ant-design/icons/lib/components/Icon";
3
+ declare const CustomSoundRecording: (props: Partial<CustomIconComponentProps>) => React.JSX.Element;
4
+ export default CustomSoundRecording;
@@ -0,0 +1,22 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import Icon from "@ant-design/icons";
6
+ const CustomSoundRecordingSvg = ()=>/*#__PURE__*/ _jsx("svg", {
7
+ width: "1em",
8
+ height: "1em",
9
+ viewBox: "0 0 13.33 19.56",
10
+ "shape-rendering": "geometricPrecision",
11
+ fill: "currentColor",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ children: /*#__PURE__*/ _jsx("path", {
14
+ 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"
15
+ })
16
+ });
17
+ const CustomSoundRecording = (props)=>{
18
+ return /*#__PURE__*/ _jsx(Icon, _object_spread_props(_object_spread({}, props), {
19
+ component: CustomSoundRecordingSvg
20
+ }));
21
+ };
22
+ export default CustomSoundRecording;
@@ -2,3 +2,18 @@ export { default as CustomClose } from "./custom-close";
2
2
  export { default as CustomXuanZuan } from "./custom-xuanzuan";
3
3
  export { default as CustomDownLoad } from "./custom-download";
4
4
  export { default as CustomArrow } from "./custom-arrow";
5
+ export { default as CustomRecord } from "./custom-record";
6
+ export { default as CustomFullScreen } from "./custom-full_screen";
7
+ export { default as CustomExitFullScreen } from "./custom-exit_full_screen";
8
+ export { default as CustomReloading } from "./custom-reloading";
9
+ export { default as CustomCopy } from "./custom-copy";
10
+ export { default as CustomLike } from "./custom-like";
11
+ export { default as CustomDislike } from "./custom-dislike";
12
+ export { default as CustomQuote } from "./custom-quote";
13
+ export { default as CustomSending } from "./custom-sending";
14
+ export { default as CustomSoundRecording } from "./custom-sound_recording";
15
+ export { default as CustomRetract } from "./custom-retract";
16
+ export { default as CustomContacts } from "./custom-contacts";
17
+ export { default as CustomDuihao } from "./custom-duihao";
18
+ export { default as CustomRoundClose } from "./custom-round_close";
19
+ export { default as CustomAiIcon } from "./custom-ai_icon";
@@ -2,3 +2,18 @@
2
2
  export { default as CustomXuanZuan } from "./custom-xuanzuan";
3
3
  export { default as CustomDownLoad } from "./custom-download";
4
4
  export { default as CustomArrow } from "./custom-arrow";
5
+ export { default as CustomRecord } from "./custom-record";
6
+ export { default as CustomFullScreen } from "./custom-full_screen";
7
+ export { default as CustomExitFullScreen } from "./custom-exit_full_screen";
8
+ export { default as CustomReloading } from "./custom-reloading";
9
+ export { default as CustomCopy } from "./custom-copy";
10
+ export { default as CustomLike } from "./custom-like";
11
+ export { default as CustomDislike } from "./custom-dislike";
12
+ export { default as CustomQuote } from "./custom-quote";
13
+ export { default as CustomSending } from "./custom-sending";
14
+ export { default as CustomSoundRecording } from "./custom-sound_recording";
15
+ export { default as CustomRetract } from "./custom-retract";
16
+ export { default as CustomContacts } from "./custom-contacts";
17
+ export { default as CustomDuihao } from "./custom-duihao";
18
+ export { default as CustomRoundClose } from "./custom-round_close";
19
+ export { default as CustomAiIcon } from "./custom-ai_icon";
package/es2017/index.d.ts CHANGED
@@ -77,3 +77,4 @@ export { default as ViewImage } from "./viewImage";
77
77
  export { default as BhdTipModal } from "./bhdTipModal";
78
78
  export { default as BhdSelect } from './bhdSelect';
79
79
  export { default as BhdAppLayout } from './bhdAppLayout';
80
+ export { default as CustomerService } from './customerService';
package/es2017/index.js CHANGED
@@ -82,3 +82,4 @@ export { default as ViewImage } from "./viewImage/index"; //查看大图
82
82
  export { default as BhdTipModal } from "./bhdTipModal/index"; //提示框
83
83
  export { default as BhdSelect } from "./bhdSelect/index"; //封装 bhdSelect
84
84
  export { default as BhdAppLayout } from "./bhdAppLayout/index"; //封装 BhdAppLayout
85
+ export { default as CustomerService } from "./customerService/index"; //封装 智能客服
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ interface data {
3
+ type: number;
4
+ roomId: string;
5
+ userData: any;
6
+ http: any;
7
+ urllocation: String;
8
+ onClose: any;
9
+ switchChatRoom: any;
10
+ saveContactsList: any;
11
+ ref: any;
12
+ }
13
+ declare const ContactsList: import("react").ForwardRefExoticComponent<Omit<data, "ref"> & import("react").RefAttributes<unknown>>;
14
+ export default ContactsList;
@@ -0,0 +1,333 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
+ import React, { useEffect, useState, useRef, useImperativeHandle, forwardRef } from "react";
5
+ import styles from "./index.module.less";
6
+ import { CustomAiIcon, CustomRetract } from "../../icons/index";
7
+ import { CloseOutlined } from "@ant-design/icons";
8
+ import { getDataTime } from "../function"; //录音使用文件
9
+ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
10
+ 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;
11
+ var _useState = _sliced_to_array(useState([]), 2), contactsList = _useState[0], setContactsList = _useState[1]; //老师列表
12
+ var _useState1 = _sliced_to_array(useState(""), 2), newRoomId = _useState1[0], setNewRoomId = _useState1[1];
13
+ var _useState2 = _sliced_to_array(useState(true), 2), firstLoading = _useState2[0], setFirstLoading = _useState2[1];
14
+ // const [type,setType] = useState(0);
15
+ var timer = useRef(null); //文本框输入时
16
+ //获取聊天室列表
17
+ useEffect(function() {
18
+ roomsListTimer();
19
+ if (roomId != "") {
20
+ setNewRoomId(roomId);
21
+ }
22
+ return function() {
23
+ clearTimeout(timer.current);
24
+ };
25
+ }, []);
26
+ useImperativeHandle(ref, function() {
27
+ return {
28
+ roomsListTimer: function() {
29
+ return roomsListTimer();
30
+ }
31
+ };
32
+ });
33
+ // useEffect(()=>{
34
+ // //重新调用接口
35
+ // console.log(44444444,contactsList)
36
+ // roomsListTimer();
37
+ // },[type])
38
+ var roomsListTimer = function() {
39
+ if (timer != null) clearTimeout(timer.current);
40
+ timer.current = setTimeout(function() {
41
+ return roomsListTimer();
42
+ }, 60000);
43
+ http.get("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
44
+ params: {
45
+ page: 1,
46
+ maxPageSize: 100002
47
+ },
48
+ headers: {
49
+ "x-module-id": userData.modules.find(function(ele) {
50
+ return ele.short == "IntelligentCustomerService";
51
+ }).id,
52
+ "x-auth-jwt": window.localStorage.getItem("usertoken") || ""
53
+ }
54
+ }).then(function(res) {
55
+ if (res.data) {
56
+ var list = res.data.contacts;
57
+ // let newMessage = false;
58
+ setContactsList(function(contactsList) {
59
+ list = list.map(function(item, index) {
60
+ var c_list = contactsList.filter(function(e) {
61
+ return e.sender == item.sender;
62
+ });
63
+ var obj = {};
64
+ if (c_list.length > 0) {
65
+ obj = c_list[0];
66
+ }
67
+ return _object_spread({}, obj, item);
68
+ });
69
+ return list;
70
+ });
71
+ getUserInfo(list);
72
+ // if(firstLoading){
73
+ // setFirstLoading(false);
74
+ // let isRoom = false;
75
+ // for (let index = 0; index < list.length; index++) {
76
+ // let count = list[index].unreadCount;
77
+ // if(count > 0 && list[index].roomId == roomId){
78
+ // isRoom = true;
79
+ // //在当前窗口
80
+ // return null;
81
+ // }else if(count > 0){
82
+ // isRoom = true;
83
+ // switchChatRoom(list[index].roomId, "");
84
+ // setContactsList((contactsList)=>{
85
+ // let new_list = contactsList;
86
+ // new_list = new_list.map((item)=>{
87
+ // if(item.roomId == list[index].roomId){
88
+ // return {
89
+ // ...item,
90
+ // unreadCount:0,
91
+ // }
92
+ // }else{
93
+ // return item;
94
+ // }
95
+ // })
96
+ // return new_list;
97
+ // })
98
+ // return null;
99
+ // }
100
+ // }
101
+ // }
102
+ saveContactsList(list);
103
+ }
104
+ });
105
+ };
106
+ //删除聊天室
107
+ var deleteRoom = function(roomId) {
108
+ http.delete("".concat(urllocation, "/chat-service/public/v1.0/rooms/").concat(roomId), {
109
+ headers: {
110
+ "x-module-id": userData.modules.find(function(ele) {
111
+ return ele.short == "IntelligentCustomerService";
112
+ }).id,
113
+ "x-auth-jwt": window.localStorage.getItem("usertoken") || ""
114
+ }
115
+ }).then(function(res) {
116
+ roomsListTimer();
117
+ // let contactsList;
118
+ // setContactsList((list)=>{
119
+ // contactsList = list.filter(e=>e.roomId != roomId);
120
+ // //切换到AI聊天窗口
121
+ // if(roomId == props.roomId){
122
+ // switchChatRoom(contactsList[0].roomId, "");
123
+ // }
124
+ // return contactsList;
125
+ // })
126
+ // saveContactsList(contactsList);
127
+ });
128
+ };
129
+ //获取老师的信息等
130
+ var getUserInfo = function(list) {
131
+ list.map(function(item, i) {
132
+ if (!item.name && !item.headImg && item.sender != "AI") {
133
+ getUserName(item.sender).then(function(res) {
134
+ if (res.data) {
135
+ var _$list;
136
+ setContactsList(function(contactsList) {
137
+ _$list = contactsList.map(function(item, index) {
138
+ if (item.sender == res.data.uid) {
139
+ return _object_spread({}, item, res.data);
140
+ } else {
141
+ return item;
142
+ }
143
+ });
144
+ return _$list;
145
+ });
146
+ saveContactsList(_$list);
147
+ }
148
+ });
149
+ }
150
+ });
151
+ };
152
+ var getUserName = function(uid) {
153
+ return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
154
+ params: {
155
+ uid: uid
156
+ },
157
+ headers: {
158
+ "x-module-id": userData.modules.find(function(ele) {
159
+ return ele.short == "TeacherAnswer";
160
+ }).id,
161
+ "x-auth-jwt": window.localStorage.getItem("usertoken") || ""
162
+ }
163
+ });
164
+ };
165
+ return type == 2 || type == 4 ? //联系人展开
166
+ /*#__PURE__*/ _jsxs("div", {
167
+ className: styles.teacher_layout_modal,
168
+ children: [
169
+ /*#__PURE__*/ _jsx("div", {
170
+ className: styles.top,
171
+ children: /*#__PURE__*/ _jsxs("div", {
172
+ className: "".concat(styles.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId || contactsList.length == 0 ? styles.active : ""),
173
+ onClick: function() {
174
+ setNewRoomId(contactsList[0].roomId);
175
+ switchChatRoom(contactsList[0].roomId, "");
176
+ roomsListTimer();
177
+ },
178
+ children: [
179
+ /*#__PURE__*/ _jsx(CustomAiIcon, {}),
180
+ /*#__PURE__*/ _jsxs("div", {
181
+ className: styles.user_info,
182
+ children: [
183
+ /*#__PURE__*/ _jsxs("p", {
184
+ className: styles.message,
185
+ children: [
186
+ "AI助手",
187
+ /*#__PURE__*/ _jsx("span", {
188
+ className: styles.time,
189
+ children: contactsList.length > 0 && getDataTime(contactsList[0].createdAt)
190
+ })
191
+ ]
192
+ }),
193
+ /*#__PURE__*/ _jsx("p", {
194
+ className: styles.con,
195
+ children: contactsList.length > 0 && contactsList[0].lastMsg
196
+ })
197
+ ]
198
+ })
199
+ ]
200
+ })
201
+ }),
202
+ userData.modules.some(function(item) {
203
+ return item.short == "TeacherAnswer";
204
+ }) ? /*#__PURE__*/ _jsx("div", {
205
+ className: styles.bottom,
206
+ children: contactsList.map(function(item, index) {
207
+ if (index != 0) {
208
+ return /*#__PURE__*/ _jsxs("div", {
209
+ className: "".concat(styles.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? styles.active : ""),
210
+ onClick: function() {
211
+ setNewRoomId(item.roomId);
212
+ switchChatRoom(item.roomId, "");
213
+ roomsListTimer();
214
+ },
215
+ children: [
216
+ /*#__PURE__*/ _jsx("img", {
217
+ src: item.headImg
218
+ }),
219
+ /*#__PURE__*/ _jsxs("div", {
220
+ className: styles.user_info,
221
+ children: [
222
+ /*#__PURE__*/ _jsxs("p", {
223
+ className: styles.message,
224
+ children: [
225
+ item.name,
226
+ item.unreadCount != undefined && item.unreadCount > 0 && !(item.roomId != undefined && roomId != "" && item.roomId == roomId) && /*#__PURE__*/ _jsx("span", {
227
+ className: styles.num,
228
+ children: item.unreadCount > 99 ? "99+" : item.unreadCount
229
+ }),
230
+ /*#__PURE__*/ _jsx("span", {
231
+ className: styles.time,
232
+ children: getDataTime(item.createdAt)
233
+ })
234
+ ]
235
+ }),
236
+ /*#__PURE__*/ _jsx("p", {
237
+ className: styles.con,
238
+ children: item.lastMsg
239
+ })
240
+ ]
241
+ })
242
+ ]
243
+ }, item.roomId);
244
+ } else {
245
+ return null;
246
+ }
247
+ })
248
+ }) : ""
249
+ ]
250
+ }) : /*#__PURE__*/ _jsxs("div", {
251
+ className: "".concat(styles.teacher_layout, " ").concat(type == 3 ? styles.teacher_layout_newlabo : ""),
252
+ style: {
253
+ left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
254
+ },
255
+ children: [
256
+ /*#__PURE__*/ _jsxs("div", {
257
+ className: styles.top,
258
+ children: [
259
+ /*#__PURE__*/ _jsxs("div", {
260
+ className: "".concat(styles.ai, " ").concat(styles.shrink),
261
+ onClick: function() {
262
+ onClose();
263
+ },
264
+ children: [
265
+ /*#__PURE__*/ _jsx(CustomRetract, {}),
266
+ /*#__PURE__*/ _jsx("p", {
267
+ style: {
268
+ marginTop: "8px"
269
+ },
270
+ children: "收起"
271
+ })
272
+ ]
273
+ }),
274
+ /*#__PURE__*/ _jsxs("div", {
275
+ className: "".concat(styles.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId || contactsList.length == 0 ? styles.active : ""),
276
+ onClick: function() {
277
+ setNewRoomId(contactsList[0].roomId);
278
+ switchChatRoom(contactsList[0].roomId, "");
279
+ roomsListTimer();
280
+ },
281
+ children: [
282
+ /*#__PURE__*/ _jsx(CustomAiIcon, {}),
283
+ /*#__PURE__*/ _jsx("p", {
284
+ children: "AI助手"
285
+ })
286
+ ]
287
+ })
288
+ ]
289
+ }),
290
+ userData.modules.some(function(item) {
291
+ return item.short == "TeacherAnswer";
292
+ }) && /*#__PURE__*/ _jsx("div", {
293
+ className: styles.bottom,
294
+ children: contactsList.map(function(item, index) {
295
+ if (index != 0) {
296
+ return /*#__PURE__*/ _jsxs("div", {
297
+ className: "".concat(styles.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? styles.active : ""),
298
+ onClick: function() {
299
+ setNewRoomId(item.roomId);
300
+ switchChatRoom(item.roomId, "");
301
+ roomsListTimer();
302
+ },
303
+ children: [
304
+ /*#__PURE__*/ _jsx("img", {
305
+ src: item.headImg
306
+ }),
307
+ /*#__PURE__*/ _jsx("p", {
308
+ children: item.name
309
+ }),
310
+ item.unreadCount != undefined && item.unreadCount > 0 && !(item.roomId != undefined && roomId != "" && item.roomId == roomId) && /*#__PURE__*/ _jsx("span", {
311
+ className: styles.num,
312
+ children: item.unreadCount > 99 ? "99+" : item.unreadCount
313
+ }),
314
+ // 没有消息时,可点击删除
315
+ !item.unreadCount && /*#__PURE__*/ _jsx("span", {
316
+ className: styles.delete,
317
+ onClick: function(e) {
318
+ e.stopPropagation();
319
+ deleteRoom(item.roomId);
320
+ },
321
+ children: /*#__PURE__*/ _jsx(CloseOutlined, {})
322
+ })
323
+ ]
324
+ }, item.roomId);
325
+ } else {
326
+ return null;
327
+ }
328
+ })
329
+ })
330
+ ]
331
+ });
332
+ });
333
+ export default ContactsList;
@@ -0,0 +1,206 @@
1
+ @import "../../theme/variable.less";
2
+ // @color-background-primary-weak-hover:@color-background-info-weak;
3
+
4
+ //联系人列表
5
+ .teacher_layout {
6
+ position: fixed;
7
+ right: 568px;
8
+
9
+ border-radius: 8px;
10
+ background: rgba(255, 255, 255, 0.5);
11
+ box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.05);
12
+ backdrop-filter: blur(7.5px);
13
+ width: 80px;
14
+ .top > div,
15
+ .bottom > div {
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: center;
19
+ padding: 8px;
20
+ border-radius: 8px;
21
+ margin: 8px 0;
22
+ max-width: 60px;
23
+ overflow: hidden;
24
+ position: relative;
25
+ cursor: pointer;
26
+ &:hover {
27
+ background-color: #f5f5f5;
28
+ .delete {
29
+ display: block;
30
+ }
31
+ }
32
+ p {
33
+ max-width: 60px;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ color: @color-text-Secondary-Tr;
38
+ font-size: 12px;
39
+ line-height: 1;
40
+ padding-top: 12px;
41
+ }
42
+ img {
43
+ width: 32px;
44
+ height: 32px;
45
+ border-radius: 50%;
46
+ }
47
+ .num {
48
+ position: absolute;
49
+ top: 0;
50
+ right: 0;
51
+ border-radius: 26px;
52
+ background-color: #f4523b;
53
+ color: #fff;
54
+ padding: 0 5px;
55
+ border-radius: 25px;
56
+ font-size: 12px;
57
+ line-height: 1.2;
58
+ }
59
+ .delete {
60
+ position: absolute;
61
+ top: 2px;
62
+ right: 2px;
63
+ color: rgba(0, 0, 0, 0.65);
64
+ font-size: 12px;
65
+ display: none;
66
+ }
67
+ }
68
+ .top > div {
69
+ margin: 0 8px;
70
+ }
71
+ .top .shrink {
72
+ border-bottom: 1px solid @color-border-secondary;
73
+ border-radius: 0;
74
+ margin-bottom: 8px;
75
+ margin-top: 8px;
76
+ & > span {
77
+ font-size: 20px;
78
+ }
79
+ p {
80
+ padding-top: 0;
81
+ }
82
+ &:hover {
83
+ background-color: #fff !important;
84
+ }
85
+ }
86
+ .top .active,
87
+ .bottom .active {
88
+ background: @color-background-primary-weak-hover;
89
+ }
90
+ .bottom > div:last-child {
91
+ margin-bottom: 0;
92
+ }
93
+ .bottom > div:first-child {
94
+ margin-top: 0;
95
+ }
96
+ .bottom {
97
+ max-height: 524px;
98
+ padding: 0 8px;
99
+ padding-right: 4px;
100
+ overflow-y: auto;
101
+ margin-bottom: 8px;
102
+ margin-top: 8px;
103
+ }
104
+ .bottom::-webkit-scrollbar {
105
+ background-color: #eaedf1;
106
+ background-color: transparent;
107
+ width: 4px;
108
+ height: 4px;
109
+ }
110
+ .bottom::-webkit-scrollbar-thumb {
111
+ border-radius: 4px;
112
+ background-color: rgba(0, 0, 0, 0.25);
113
+ }
114
+ }
115
+ .teacher_layout_newlabo {
116
+ top: 50px;
117
+ right: 0;
118
+ .top{
119
+ svg{
120
+ transform: rotate(180deg);
121
+ }
122
+ }
123
+ }
124
+ .teacher_layout_modal {
125
+ width: 328px;
126
+ height: calc(100% - 48px);
127
+ background-color: #fff;
128
+ position: absolute;
129
+ border-top: 1px solid @color-border-secondary;
130
+ .top,
131
+ .bottom {
132
+ .ai {
133
+ border-bottom: 1px solid @color-border-secondary;
134
+ padding: 16px;
135
+ display: flex;
136
+ align-items: center;
137
+ cursor: pointer;
138
+ img {
139
+ width: 32px;
140
+ height: 32px;
141
+ border-radius: 50%;
142
+ margin-right: 12px;
143
+ }
144
+ & > span {
145
+ margin-right: 12px;
146
+ }
147
+ .user_info {
148
+ width: 252px;
149
+ .message {
150
+ color: #000;
151
+ font-size: 14px;
152
+ line-height: 1;
153
+ padding-right: 10px;
154
+ .num {
155
+ margin-left: 12px;
156
+ border-radius: 26px;
157
+ background-color: #f4523b;
158
+ color: #fff;
159
+ padding: 0 5px;
160
+ border-radius: 25px;
161
+ font-size: 12px;
162
+ line-height: 1;
163
+ }
164
+
165
+ .time {
166
+ font-size: 12px;
167
+ color: @color-text-quaternary-Tr;
168
+ float: right;
169
+ }
170
+ }
171
+ .con {
172
+ color: @color-text-quaternary-Tr;
173
+ font-size: 12px;
174
+ line-height: 1.5;
175
+ margin-top: 8px;
176
+ overflow: hidden;
177
+ white-space: nowrap;
178
+ text-overflow: ellipsis;
179
+ }
180
+ }
181
+ }
182
+ .active {
183
+ background: @color-background-primary-weak-hover;
184
+ }
185
+ }
186
+ .bottom{
187
+ overflow: auto;
188
+ height: calc(100% - 70px);
189
+ }
190
+ .bottom::-webkit-scrollbar {
191
+ background-color: #eaedf1;
192
+ background-color: transparent;
193
+ width: 4px;
194
+ height: 4px;
195
+ }
196
+ .bottom::-webkit-scrollbar-thumb {
197
+ border-radius: 4px;
198
+ background-color: rgba(0, 0, 0, 0.25);
199
+ }
200
+
201
+ :global {
202
+ .anticon {
203
+ vertical-align: 0;
204
+ }
205
+ }
206
+ }
@@ -0,0 +1,17 @@
1
+ declare const readMessage: (roomId: number | string, urllocation: any, userData: {
2
+ modules: any[];
3
+ }, http: {
4
+ patch: (arg0: string, arg1: {
5
+ roomId: any;
6
+ }, arg2: {
7
+ headers: {
8
+ "x-module-id": any;
9
+ "x-auth-jwt": string;
10
+ };
11
+ }) => void;
12
+ }) => void;
13
+ declare const getByteLen: (val: string) => number;
14
+ declare const serverUrl: () => string;
15
+ declare const copyText: (text: string) => boolean;
16
+ declare const getDataTime: (time: string | number | Date) => string;
17
+ export { readMessage, getByteLen, serverUrl, copyText, getDataTime };