bhd-components 0.5.5 → 0.5.7
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/1bddec89.esm.es5.production.js +72 -0
- package/dist/535fc6c5.esm.es5.development.js +95493 -0
- package/dist/CustomerService.esm.es5.development.css +2827 -0
- package/dist/CustomerService.esm.es5.development.js +3823 -0
- package/dist/CustomerService.esm.es5.production.css +1 -0
- package/dist/CustomerService.esm.es5.production.js +1 -0
- package/dist/vendor.esm.es5.development.esm.es5.development.css +117 -0
- package/dist/vendor.esm.es5.production.esm.es5.production.css +9 -0
- package/es2017/customerService/contactsList/index.d.ts +13 -0
- package/es2017/customerService/contactsList/index.js +313 -0
- package/es2017/customerService/contactsList/index.module.less +187 -0
- package/es2017/customerService/function.d.ts +17 -0
- package/es2017/customerService/function.js +67 -0
- package/es2017/customerService/historyFun/index.d.ts +13 -0
- package/es2017/customerService/historyFun/index.js +241 -0
- package/es2017/customerService/historyFun/index.module.less +189 -0
- package/es2017/customerService/images/knowledge_icon.png +0 -0
- package/es2017/customerService/images/voice_btn.gif +0 -0
- package/es2017/customerService/index.d.ts +16 -0
- package/es2017/customerService/index.js +2493 -0
- package/es2017/customerService/index.module.less +727 -0
- package/es2017/customerService/useMediaRecorder.d.ts +9 -0
- package/es2017/customerService/useMediaRecorder.js +78 -0
- package/es2017/customerService/voice_btn.gif +0 -0
- package/es2017/icons/components/custom-ai_icon.d.ts +4 -0
- package/es2017/icons/components/custom-ai_icon.js +58 -0
- package/es2017/icons/components/custom-contacts.d.ts +4 -0
- package/es2017/icons/components/custom-contacts.js +29 -0
- package/es2017/icons/components/custom-copy.d.ts +4 -0
- package/es2017/icons/components/custom-copy.js +36 -0
- package/es2017/icons/components/custom-dislike.d.ts +4 -0
- package/es2017/icons/components/custom-dislike.js +22 -0
- package/es2017/icons/components/custom-duihao.d.ts +4 -0
- package/es2017/icons/components/custom-duihao.js +22 -0
- package/es2017/icons/components/custom-exit_full_screen.d.ts +4 -0
- package/es2017/icons/components/custom-exit_full_screen.js +26 -0
- package/es2017/icons/components/custom-full_screen.d.ts +4 -0
- package/es2017/icons/components/custom-full_screen.js +22 -0
- package/es2017/icons/components/custom-like.d.ts +4 -0
- package/es2017/icons/components/custom-like.js +22 -0
- package/es2017/icons/components/custom-quote.d.ts +4 -0
- package/es2017/icons/components/custom-quote.js +31 -0
- package/es2017/icons/components/custom-record.d.ts +4 -0
- package/es2017/icons/components/custom-record.js +37 -0
- package/es2017/icons/components/custom-reloading.d.ts +4 -0
- package/es2017/icons/components/custom-reloading.js +26 -0
- package/es2017/icons/components/custom-retract.d.ts +4 -0
- package/es2017/icons/components/custom-retract.js +27 -0
- package/es2017/icons/components/custom-round_close.d.ts +4 -0
- package/es2017/icons/components/custom-round_close.js +24 -0
- package/es2017/icons/components/custom-sending.d.ts +4 -0
- package/es2017/icons/components/custom-sending.js +22 -0
- package/es2017/icons/components/custom-sound_recording.d.ts +4 -0
- package/es2017/icons/components/custom-sound_recording.js +22 -0
- package/es2017/icons/components/index.d.ts +15 -0
- package/es2017/icons/components/index.js +15 -0
- package/es2017/index.d.ts +1 -0
- package/es2017/index.js +1 -0
- package/es2017/provider/config.js +3 -3
- package/esm/customerService/contactsList/index.d.ts +13 -0
- package/esm/customerService/contactsList/index.js +326 -0
- package/esm/customerService/contactsList/index.module.less +187 -0
- package/esm/customerService/function.d.ts +17 -0
- package/esm/customerService/function.js +69 -0
- package/esm/customerService/historyFun/index.d.ts +13 -0
- package/esm/customerService/historyFun/index.js +256 -0
- package/esm/customerService/historyFun/index.module.less +189 -0
- package/esm/customerService/images/knowledge_icon.png +0 -0
- package/esm/customerService/images/voice_btn.gif +0 -0
- package/esm/customerService/index.d.ts +16 -0
- package/esm/customerService/index.js +2576 -0
- package/esm/customerService/index.module.less +727 -0
- package/esm/customerService/useMediaRecorder.d.ts +9 -0
- package/esm/customerService/useMediaRecorder.js +121 -0
- package/esm/customerService/voice_btn.gif +0 -0
- package/esm/icons/components/custom-ai_icon.d.ts +4 -0
- package/esm/icons/components/custom-ai_icon.js +60 -0
- package/esm/icons/components/custom-contacts.d.ts +4 -0
- package/esm/icons/components/custom-contacts.js +31 -0
- package/esm/icons/components/custom-copy.d.ts +4 -0
- package/esm/icons/components/custom-copy.js +38 -0
- package/esm/icons/components/custom-dislike.d.ts +4 -0
- package/esm/icons/components/custom-dislike.js +24 -0
- package/esm/icons/components/custom-duihao.d.ts +4 -0
- package/esm/icons/components/custom-duihao.js +24 -0
- package/esm/icons/components/custom-exit_full_screen.d.ts +4 -0
- package/esm/icons/components/custom-exit_full_screen.js +28 -0
- package/esm/icons/components/custom-full_screen.d.ts +4 -0
- package/esm/icons/components/custom-full_screen.js +24 -0
- package/esm/icons/components/custom-like.d.ts +4 -0
- package/esm/icons/components/custom-like.js +24 -0
- package/esm/icons/components/custom-quote.d.ts +4 -0
- package/esm/icons/components/custom-quote.js +33 -0
- package/esm/icons/components/custom-record.d.ts +4 -0
- package/esm/icons/components/custom-record.js +39 -0
- package/esm/icons/components/custom-reloading.d.ts +4 -0
- package/esm/icons/components/custom-reloading.js +28 -0
- package/esm/icons/components/custom-retract.d.ts +4 -0
- package/esm/icons/components/custom-retract.js +29 -0
- package/esm/icons/components/custom-round_close.d.ts +4 -0
- package/esm/icons/components/custom-round_close.js +26 -0
- package/esm/icons/components/custom-sending.d.ts +4 -0
- package/esm/icons/components/custom-sending.js +24 -0
- package/esm/icons/components/custom-sound_recording.d.ts +4 -0
- package/esm/icons/components/custom-sound_recording.js +24 -0
- package/esm/icons/components/index.d.ts +15 -0
- package/esm/icons/components/index.js +15 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/provider/config.js +3 -3
- package/package.json +10 -2
- package/dist/1951bd5c.esm.es5.development.js +0 -45417
- package/dist/28cd83d3.esm.es5.production.js +0 -256
- package/dist/table.esm.es5.development.css +0 -772
- package/dist/table.esm.es5.development.js +0 -289
- package/dist/table.esm.es5.production.css +0 -1
- package/dist/table.esm.es5.production.js +0 -1
|
@@ -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"; //封装 智能客服
|
|
@@ -15,8 +15,8 @@ const config = {
|
|
|
15
15
|
fontSizeHeading2: 24,
|
|
16
16
|
fontSizeHeading3: 20,
|
|
17
17
|
fontSizeHeading4: 18,
|
|
18
|
-
lineHeight: 1.5,
|
|
19
|
-
lineHeightSM: 1.5,
|
|
18
|
+
// lineHeight: 1.5,
|
|
19
|
+
// lineHeightSM: 1.5,
|
|
20
20
|
colorInfoActive: "#3D7DE8",
|
|
21
21
|
colorInfoHover: "#7EAEFF",
|
|
22
22
|
colorInfoBorderHover: "#7EAEFF",
|
|
@@ -27,7 +27,7 @@ const config = {
|
|
|
27
27
|
colorTextQuaternary: "rgba(0, 0, 0, 0.25)",
|
|
28
28
|
colorBorder: "rgba(0, 0, 0, 0.15)",
|
|
29
29
|
colorBorderSecondary: "rgba(0, 0, 0, 0.05)",
|
|
30
|
-
fontFamily: 'PingFang SC", "helvetica neue", "Source Han Sans CN","hiragino sans gb", "arial", "microsoft yahei ui","microsoft yahei", "simsun", "sans-serif'
|
|
30
|
+
fontFamily: '"PingFang SC", "helvetica neue", "Source Han Sans CN","hiragino sans gb", "arial", "microsoft yahei ui","microsoft yahei", "simsun", "sans-serif"'
|
|
31
31
|
},
|
|
32
32
|
components: {
|
|
33
33
|
Button: {
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
12
|
+
declare const ContactsList: (props: data) => JSX.Element;
|
|
13
|
+
export default ContactsList;
|
|
@@ -0,0 +1,326 @@
|
|
|
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 } 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 = function(props) {
|
|
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 timer = useRef(null); //文本框输入时
|
|
13
|
+
//获取聊天室列表
|
|
14
|
+
useEffect(function() {
|
|
15
|
+
// if (roomId != "") {
|
|
16
|
+
roomsListTimer();
|
|
17
|
+
// }
|
|
18
|
+
return function() {
|
|
19
|
+
clearTimeout(timer.current);
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
var roomsListTimer = function() {
|
|
23
|
+
if (timer != null) clearTimeout(timer.current);
|
|
24
|
+
timer.current = setTimeout(function() {
|
|
25
|
+
return roomsListTimer();
|
|
26
|
+
}, 100000);
|
|
27
|
+
http.get("".concat(urllocation, "/chat-service/public/v1.0/rooms"), {
|
|
28
|
+
params: {
|
|
29
|
+
page: 1,
|
|
30
|
+
maxPageSize: 100002
|
|
31
|
+
},
|
|
32
|
+
headers: {
|
|
33
|
+
"x-module-id": userData.modules.find(function(ele) {
|
|
34
|
+
return ele.short == "IntelligentCustomerService";
|
|
35
|
+
}).id,
|
|
36
|
+
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
37
|
+
}
|
|
38
|
+
}).then(function(res) {
|
|
39
|
+
if (res.data) {
|
|
40
|
+
var list = res.data.contacts;
|
|
41
|
+
// let list2 = list.slice(1);
|
|
42
|
+
var list2 = list;
|
|
43
|
+
setContactsList(function(contactsList) {
|
|
44
|
+
if (contactsList.length > 0 && roomId != "") {
|
|
45
|
+
//查找当前聊天室的未读消息
|
|
46
|
+
var message = 0;
|
|
47
|
+
var messageList = contactsList.filter(function(item) {
|
|
48
|
+
return item.id == roomId;
|
|
49
|
+
});
|
|
50
|
+
if (messageList.length > 0) {
|
|
51
|
+
// console.log(messageList,'messagemessagemessage');
|
|
52
|
+
message = messageList[0].unreadCount;
|
|
53
|
+
}
|
|
54
|
+
var new_message = 0;
|
|
55
|
+
if (list.length > 0) {
|
|
56
|
+
var new_message_list = list.filter(function(item) {
|
|
57
|
+
return item.id == roomId;
|
|
58
|
+
});
|
|
59
|
+
if (new_message_list.length > 0) {
|
|
60
|
+
console.log(new_message_list, "new_messagenew_messagenew_messagenew_message");
|
|
61
|
+
new_message = new_message_list[0].unreadCount;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// console.log(message,new_message,'lsdlcksdcmsdlkc')
|
|
65
|
+
//存在新消息
|
|
66
|
+
if (message != new_message) {
|
|
67
|
+
console.log("有新消息");
|
|
68
|
+
switchChatRoom(roomId, "renew");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
list2 = list2.map(function(item, index) {
|
|
72
|
+
// if(contactsList[index] != undefined){
|
|
73
|
+
return _object_spread({}, item, contactsList[index] || "");
|
|
74
|
+
// }else{
|
|
75
|
+
// return item
|
|
76
|
+
// }
|
|
77
|
+
});
|
|
78
|
+
return list2;
|
|
79
|
+
});
|
|
80
|
+
console.log(list2, "list2list2list2list2");
|
|
81
|
+
// setAi(res.data.contacts[0]);
|
|
82
|
+
getUserInfo(list2);
|
|
83
|
+
//切换到有聊天的窗口
|
|
84
|
+
list2.forEach(function(ele) {
|
|
85
|
+
console.log(ele);
|
|
86
|
+
if (ele.unreadCount > 0) {
|
|
87
|
+
switchChatRoom(ele.roomId, "");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
saveContactsList(list);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
//删除聊天室
|
|
96
|
+
var deleteRoom = function(roomId) {
|
|
97
|
+
http.delete("".concat(urllocation, "/chat-service/public/v1.0/rooms/").concat(roomId), {
|
|
98
|
+
headers: {
|
|
99
|
+
"x-module-id": userData.modules.find(function(ele) {
|
|
100
|
+
return ele.short == "IntelligentCustomerService";
|
|
101
|
+
}).id,
|
|
102
|
+
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
103
|
+
}
|
|
104
|
+
}).then(function(res) {
|
|
105
|
+
console.log(res, "sdcsdcsdc");
|
|
106
|
+
// roomsList();
|
|
107
|
+
roomsListTimer();
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
//获取老师的信息等
|
|
111
|
+
var getUserInfo = function(list2) {
|
|
112
|
+
list2.map(function(item, i) {
|
|
113
|
+
if (!item.name && !item.headImg && item.sender != "AI") {
|
|
114
|
+
getUserName(item.sender).then(function(res) {
|
|
115
|
+
if (res.data) {
|
|
116
|
+
var list;
|
|
117
|
+
setContactsList(function(contactsList) {
|
|
118
|
+
list = contactsList.map(function(item, index) {
|
|
119
|
+
if (item.sender == res.data.uid) {
|
|
120
|
+
return _object_spread({}, item, res.data);
|
|
121
|
+
} else {
|
|
122
|
+
return item;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return list;
|
|
126
|
+
});
|
|
127
|
+
saveContactsList(list);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
var getUserName = function(uid) {
|
|
134
|
+
return http.get("".concat(urllocation, "/chat-service/public/v1.0/userinfo"), {
|
|
135
|
+
params: {
|
|
136
|
+
uid: uid
|
|
137
|
+
},
|
|
138
|
+
headers: {
|
|
139
|
+
"x-module-id": userData.modules.find(function(ele) {
|
|
140
|
+
return ele.short == "TeacherAnswer";
|
|
141
|
+
}).id,
|
|
142
|
+
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
// //获取当前时间
|
|
147
|
+
// const getDataTime = (time: string | number | Date) => {
|
|
148
|
+
// let currentDate;
|
|
149
|
+
// if (time != undefined && time != -1) {
|
|
150
|
+
// currentDate = new Date(time);
|
|
151
|
+
// } else {
|
|
152
|
+
// currentDate = new Date();
|
|
153
|
+
// }
|
|
154
|
+
// const currentYear = currentDate.getFullYear();
|
|
155
|
+
// const currentMonth = currentDate.getMonth() + 1; // 月份从0开始,所以要加1
|
|
156
|
+
// const currentDay = currentDate.getDate();
|
|
157
|
+
// const hour = currentDate.getHours();
|
|
158
|
+
// const minute = currentDate.getMinutes();
|
|
159
|
+
// const second = currentDate.getSeconds();
|
|
160
|
+
// let dataTime =
|
|
161
|
+
// currentYear +
|
|
162
|
+
// "-" +
|
|
163
|
+
// currentMonth +
|
|
164
|
+
// "-" +
|
|
165
|
+
// currentDay +
|
|
166
|
+
// " " +
|
|
167
|
+
// hour +
|
|
168
|
+
// ":" +
|
|
169
|
+
// minute +
|
|
170
|
+
// ":" +
|
|
171
|
+
// second;
|
|
172
|
+
// return dataTime;
|
|
173
|
+
// };
|
|
174
|
+
return type == 2 || type == 4 ? //联系人展开
|
|
175
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
176
|
+
className: styles.teacher_layout_modal,
|
|
177
|
+
children: [
|
|
178
|
+
/*#__PURE__*/ _jsx("div", {
|
|
179
|
+
className: styles.top,
|
|
180
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
181
|
+
className: "".concat(styles.ai, " ").concat(contactsList.length > 0 && contactsList[0].roomId != undefined && roomId != "" && contactsList[0].roomId == roomId ? styles.active : ""),
|
|
182
|
+
onClick: function() {
|
|
183
|
+
switchChatRoom(contactsList[0].roomId, "");
|
|
184
|
+
},
|
|
185
|
+
children: [
|
|
186
|
+
/*#__PURE__*/ _jsx(CustomAiIcon, {}),
|
|
187
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
188
|
+
className: styles.user_info,
|
|
189
|
+
children: [
|
|
190
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
191
|
+
className: styles.message,
|
|
192
|
+
children: [
|
|
193
|
+
"AI助手",
|
|
194
|
+
/*#__PURE__*/ _jsx("span", {
|
|
195
|
+
className: styles.time,
|
|
196
|
+
children: contactsList.length > 0 && getDataTime(contactsList[0].createdAt)
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
}),
|
|
200
|
+
/*#__PURE__*/ _jsx("p", {
|
|
201
|
+
className: styles.con,
|
|
202
|
+
children: contactsList.length > 0 && contactsList[0].lastMsg
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
})
|
|
208
|
+
}),
|
|
209
|
+
/*#__PURE__*/ _jsx("div", {
|
|
210
|
+
className: styles.bottom,
|
|
211
|
+
children: contactsList.map(function(item, index) {
|
|
212
|
+
if (index != 0) {
|
|
213
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
214
|
+
className: "".concat(styles.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? styles.active : ""),
|
|
215
|
+
onClick: function() {
|
|
216
|
+
switchChatRoom(item.roomId, "");
|
|
217
|
+
},
|
|
218
|
+
children: [
|
|
219
|
+
/*#__PURE__*/ _jsx("img", {
|
|
220
|
+
src: item.headImg
|
|
221
|
+
}),
|
|
222
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
223
|
+
className: styles.user_info,
|
|
224
|
+
children: [
|
|
225
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
226
|
+
className: styles.message,
|
|
227
|
+
children: [
|
|
228
|
+
item.name,
|
|
229
|
+
item.unreadCount != undefined && item.unreadCount > 0 && /*#__PURE__*/ _jsx("span", {
|
|
230
|
+
className: styles.num,
|
|
231
|
+
children: item.unreadCount
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ _jsx("span", {
|
|
234
|
+
className: styles.time,
|
|
235
|
+
children: getDataTime(item.createdAt)
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
/*#__PURE__*/ _jsx("p", {
|
|
240
|
+
className: styles.con,
|
|
241
|
+
children: item.lastMsg
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
}, item.roomId);
|
|
247
|
+
} else {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
}) : /*#__PURE__*/ _jsxs("div", {
|
|
254
|
+
className: "".concat(styles.teacher_layout, " ").concat(type == 3 ? styles.teacher_layout_newlabo : ""),
|
|
255
|
+
style: {
|
|
256
|
+
left: type == 3 ? document.getElementById("box").offsetWidth + 10 + "px" : "auto"
|
|
257
|
+
},
|
|
258
|
+
children: [
|
|
259
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
260
|
+
className: styles.top,
|
|
261
|
+
children: [
|
|
262
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
263
|
+
className: "".concat(styles.ai, " ").concat(styles.shrink),
|
|
264
|
+
onClick: function() {
|
|
265
|
+
onClose();
|
|
266
|
+
},
|
|
267
|
+
children: [
|
|
268
|
+
/*#__PURE__*/ _jsx(CustomRetract, {}),
|
|
269
|
+
/*#__PURE__*/ _jsx("p", {
|
|
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 ? styles.active : ""),
|
|
276
|
+
onClick: function() {
|
|
277
|
+
switchChatRoom(contactsList[0].roomId, "");
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
/*#__PURE__*/ _jsx(CustomAiIcon, {}),
|
|
281
|
+
/*#__PURE__*/ _jsx("p", {
|
|
282
|
+
children: "AI助手"
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
})
|
|
286
|
+
]
|
|
287
|
+
}),
|
|
288
|
+
/*#__PURE__*/ _jsx("div", {
|
|
289
|
+
className: styles.bottom,
|
|
290
|
+
children: contactsList.map(function(item, index) {
|
|
291
|
+
if (index != 0) {
|
|
292
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
293
|
+
className: "".concat(styles.ai, " ").concat(item.roomId != undefined && roomId != "" && item.roomId == roomId ? styles.active : ""),
|
|
294
|
+
onClick: function() {
|
|
295
|
+
switchChatRoom(item.roomId, "");
|
|
296
|
+
},
|
|
297
|
+
children: [
|
|
298
|
+
/*#__PURE__*/ _jsx("img", {
|
|
299
|
+
src: item.headImg
|
|
300
|
+
}),
|
|
301
|
+
/*#__PURE__*/ _jsx("p", {
|
|
302
|
+
children: item.name
|
|
303
|
+
}),
|
|
304
|
+
item.unreadCount != undefined && item.unreadCount > 0 && /*#__PURE__*/ _jsx("span", {
|
|
305
|
+
className: styles.num,
|
|
306
|
+
children: item.unreadCount
|
|
307
|
+
}),
|
|
308
|
+
/*#__PURE__*/ _jsx("span", {
|
|
309
|
+
className: styles.delete,
|
|
310
|
+
onClick: function(e) {
|
|
311
|
+
e.stopPropagation();
|
|
312
|
+
deleteRoom(item.roomId);
|
|
313
|
+
},
|
|
314
|
+
children: /*#__PURE__*/ _jsx(CloseOutlined, {})
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
}, item.roomId);
|
|
318
|
+
} else {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
export default ContactsList;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
@import "../../theme/variable.less";
|
|
2
|
+
//联系人列表
|
|
3
|
+
.teacher_layout {
|
|
4
|
+
position: fixed;
|
|
5
|
+
right: 568px;
|
|
6
|
+
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
background: rgba(255, 255, 255, 0.5);
|
|
9
|
+
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.05);
|
|
10
|
+
backdrop-filter: blur(7.5px);
|
|
11
|
+
width: 80px;
|
|
12
|
+
.top > div,
|
|
13
|
+
.bottom > div {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
padding: 8px;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
margin: 8px 0;
|
|
20
|
+
max-width: 60px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
position: relative;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: #f5f5f5;
|
|
26
|
+
.delete {
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
p {
|
|
31
|
+
max-width: 60px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
color: @color-text-Secondary-Tr;
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
padding-top: 12px;
|
|
39
|
+
}
|
|
40
|
+
img {
|
|
41
|
+
width: 32px;
|
|
42
|
+
height: 32px;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
}
|
|
45
|
+
.num {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
border-radius: 26px;
|
|
50
|
+
background-color: #f4523b;
|
|
51
|
+
color: #fff;
|
|
52
|
+
padding: 2px 5px;
|
|
53
|
+
border-radius: 25px;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
line-height: 1.2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.delete {
|
|
59
|
+
font-size: 18px;
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: -2px;
|
|
62
|
+
right: 0;
|
|
63
|
+
color: rgba(0, 0, 0, 0.65);
|
|
64
|
+
font-size: 14px;
|
|
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;
|
|
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
|
+
}
|
|
119
|
+
.teacher_layout_modal {
|
|
120
|
+
width: 328px;
|
|
121
|
+
height: 100%;
|
|
122
|
+
background-color: #fff;
|
|
123
|
+
position: absolute;
|
|
124
|
+
border-top: 1px solid @color-border-secondary;
|
|
125
|
+
.top,
|
|
126
|
+
.bottom {
|
|
127
|
+
.ai {
|
|
128
|
+
border-bottom: 1px solid @color-border-secondary;
|
|
129
|
+
padding: 16px;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
img {
|
|
134
|
+
width: 32px;
|
|
135
|
+
height: 32px;
|
|
136
|
+
border-radius: 50%;
|
|
137
|
+
margin-right: 12px;
|
|
138
|
+
}
|
|
139
|
+
& > span {
|
|
140
|
+
margin-right: 12px;
|
|
141
|
+
}
|
|
142
|
+
.user_info {
|
|
143
|
+
width: 252px;
|
|
144
|
+
.message {
|
|
145
|
+
color: #000;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
line-height: 1;
|
|
148
|
+
padding-right: 10px;
|
|
149
|
+
.num {
|
|
150
|
+
margin-left: 12px;
|
|
151
|
+
border-radius: 26px;
|
|
152
|
+
background-color: #f4523b;
|
|
153
|
+
color: #fff;
|
|
154
|
+
padding: 2px 5px;
|
|
155
|
+
border-radius: 25px;
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
line-height: 1.2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.time {
|
|
161
|
+
font-size: 12px;
|
|
162
|
+
color: @color-text-quaternary-Tr;
|
|
163
|
+
float: right;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.con {
|
|
167
|
+
color: @color-text-quaternary-Tr;
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
line-height: 1.5;
|
|
170
|
+
margin-top: 8px;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
text-overflow: ellipsis;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
.active {
|
|
178
|
+
background: var(--color-background-primary-weak, #fff4f0);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:global {
|
|
183
|
+
.anticon {
|
|
184
|
+
vertical-align: 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -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 };
|