bhd-components 0.6.5 → 0.6.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/{8bda9e2e.esm.es5.production.js → 0acf50ef.esm.es5.production.js} +1 -1
- package/dist/{d4259367.esm.es5.development.js → 4fa3313f.esm.es5.development.js} +1402 -1140
- package/dist/index.esm.es5.development.css +864 -732
- package/dist/index.esm.es5.development.js +945 -780
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/contactsList.d.ts +1 -1
- package/es2017/customerService/contactsList.js +11 -145
- package/es2017/customerService/function.js +20 -13
- package/es2017/customerService/historyFun.js +334 -154
- package/es2017/customerService/index.js +567 -437
- package/es2017/customerService/index.module.less +169 -65
- package/es2017/customerService/index2.module.less +170 -65
- package/es2017/icons/components/custom-expand.d.ts +4 -0
- package/es2017/icons/components/custom-expand.js +22 -0
- package/es2017/icons/components/index.d.ts +1 -0
- package/es2017/icons/components/index.js +1 -0
- package/esm/customerService/contactsList.d.ts +1 -1
- package/esm/customerService/contactsList.js +11 -158
- package/esm/customerService/function.js +20 -13
- package/esm/customerService/historyFun.js +338 -167
- package/esm/customerService/index.js +557 -445
- package/esm/customerService/index.module.less +169 -65
- package/esm/customerService/index2.module.less +170 -65
- package/esm/icons/components/custom-expand.d.ts +4 -0
- package/esm/icons/components/custom-expand.js +24 -0
- package/esm/icons/components/index.d.ts +1 -0
- package/esm/icons/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,99 +1,74 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
2
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
4
|
import React, { useEffect, useState, useRef } from "react";
|
|
5
5
|
import styles from "./index.module.less";
|
|
6
6
|
import "highlight.js/styles/default.css";
|
|
7
7
|
import { Input } from "antd";
|
|
8
|
-
import { CustomClose } from "../icons/index";
|
|
8
|
+
import { CustomClose, CustomExpand, CustomAiIcon } from "../icons/index";
|
|
9
9
|
import { SearchOutlined } from "@ant-design/icons";
|
|
10
10
|
import { getDataTime } from "./function"; //录音使用文件
|
|
11
11
|
const HistoryFun = (props)=>{
|
|
12
12
|
let { type , roomId , userData , http , urllocation , onClose , loadSpecifiedData } = props;
|
|
13
13
|
const [keyWordProblem, setKeyWordProblem] = useState(""); //搜索内容
|
|
14
|
-
const [keyHistoryMessageList, setKeyHistoryMessageList] = useState([]); //搜索的历史记录
|
|
15
14
|
const [showLoadingState, setShowLoadingState] = useState(1); //1,初始状态,2、无数据 ,3、不显示图片
|
|
16
15
|
const [pageNum, setPageNum] = useState(1);
|
|
17
16
|
const [pageCount, setPageCount] = useState(0);
|
|
18
|
-
const [
|
|
17
|
+
const [maxPageSize, setMaxPageSize] = useState(10);
|
|
18
|
+
const [totalData, setTotalData] = useState([]); //总数据
|
|
19
19
|
const timer = useRef(null); //文本框输入时
|
|
20
|
-
const objName = useRef([]);
|
|
21
|
-
// useEffect(() => {
|
|
22
|
-
// function handleScroll() {
|
|
23
|
-
// const container = document.getElementById('history_list');
|
|
24
|
-
// const scrollTop = container.scrollTop;
|
|
25
|
-
// const clientHeight = container.clientHeight;
|
|
26
|
-
// const scrollHeight = container.scrollHeight;
|
|
27
|
-
// // console.log(scrollTop,clientHeight,scrollHeight,'333dfkvmdfv')
|
|
28
|
-
// // if((clientHeight + scrollTop + 10) >= scrollHeight && pageCount > pageNum && pageCount > 0){
|
|
29
|
-
// // // console.log(11111111,pageNumHistory)
|
|
30
|
-
// // let number = pageNum + 1;
|
|
31
|
-
// // console.log('到底部了22222',number)
|
|
32
|
-
// // setPageNum((pageNum) => {
|
|
33
|
-
// // return pageNum + 1;
|
|
34
|
-
// // });
|
|
35
|
-
// // getKeyHistoryMessage(keyWordProblem,number);
|
|
36
|
-
// // }
|
|
37
|
-
// }
|
|
38
|
-
// const content = document.getElementById('history_list');
|
|
39
|
-
// if (content) {
|
|
40
|
-
// content.addEventListener("scroll", handleScroll);
|
|
41
|
-
// }
|
|
42
|
-
// return () => {
|
|
43
|
-
// const content = document.getElementById('history_list');
|
|
44
|
-
// if (content) {
|
|
45
|
-
// content.removeEventListener("scroll", handleScroll);
|
|
46
|
-
// }
|
|
47
|
-
// };
|
|
48
|
-
// }, [keyHistoryMessageList]);
|
|
49
20
|
useEffect(()=>{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
21
|
+
function handleScroll() {
|
|
22
|
+
const container = document.getElementById("history_list");
|
|
23
|
+
const scrollTop = container.scrollTop;
|
|
24
|
+
const clientHeight = container.clientHeight;
|
|
25
|
+
const scrollHeight = container.scrollHeight;
|
|
26
|
+
// console.log(pageCount, pageNum, "333dfkvmdfv");
|
|
27
|
+
if (clientHeight + scrollTop + 10 >= scrollHeight && pageCount > pageNum && pageCount > 0) {
|
|
28
|
+
// console.log("到底部了22222", number);
|
|
29
|
+
setPageNum((page)=>{
|
|
30
|
+
return page + 1;
|
|
59
31
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
32
|
+
// console.log(pageNum,444455556666)
|
|
33
|
+
getList(keyWordProblem, pageNum + 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const content = document.getElementById("history_list");
|
|
37
|
+
if (content) {
|
|
38
|
+
content.addEventListener("scroll", handleScroll);
|
|
39
|
+
}
|
|
40
|
+
return ()=>{
|
|
41
|
+
const content = document.getElementById("history_list");
|
|
42
|
+
if (content) {
|
|
43
|
+
content.removeEventListener("scroll", handleScroll);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
63
46
|
}, [
|
|
64
|
-
|
|
47
|
+
pageCount,
|
|
48
|
+
pageNum
|
|
65
49
|
]);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (roomId == "") return;
|
|
69
|
-
setLoad(false);
|
|
70
|
-
setKeyHistoryMessageList([]);
|
|
71
|
-
return http.get(`${urllocation}/chat-service/public/v1.0/history-messages`, {
|
|
50
|
+
const getList = (val, pageNum)=>{
|
|
51
|
+
return http.get(`${urllocation}/chat-service/public/v1.0/history-messages-total`, {
|
|
72
52
|
params: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
maxPageSize: 1000,
|
|
77
|
-
direction: "desc"
|
|
78
|
-
},
|
|
79
|
-
headers: {
|
|
80
|
-
"x-module-id": userData.modules.find((ele)=>ele.short == "IntelligentCustomerService").id,
|
|
81
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
53
|
+
message: val,
|
|
54
|
+
page: pageNum,
|
|
55
|
+
maxPageSize: maxPageSize
|
|
82
56
|
}
|
|
83
57
|
}).then((res)=>{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
setPageCount(Math.ceil(total / maxPageSize));
|
|
58
|
+
console.log(res, 7777779999);
|
|
59
|
+
let data = res.data;
|
|
60
|
+
if (data.total > 0) {
|
|
88
61
|
setShowLoadingState(3);
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
62
|
+
let list = data.messageHistories;
|
|
63
|
+
setPageCount(Math.ceil(data.total / maxPageSize));
|
|
64
|
+
// setTotalData(totalData.concat(list));
|
|
65
|
+
setTotalData((list1)=>{
|
|
66
|
+
let new_list = list1;
|
|
67
|
+
new_list = new_list.concat(list);
|
|
68
|
+
return new_list;
|
|
93
69
|
});
|
|
94
|
-
getUserName(
|
|
70
|
+
getUserName(list);
|
|
95
71
|
} else {
|
|
96
|
-
// setKeyHistoryMessageList([]);
|
|
97
72
|
setShowLoadingState(2);
|
|
98
73
|
}
|
|
99
74
|
}).catch((res)=>{});
|
|
@@ -105,11 +80,7 @@ const HistoryFun = (props)=>{
|
|
|
105
80
|
params: {
|
|
106
81
|
roomId: roomId,
|
|
107
82
|
page: 1,
|
|
108
|
-
maxPageSize:
|
|
109
|
-
},
|
|
110
|
-
headers: {
|
|
111
|
-
"x-module-id": userData.modules.find((ele)=>ele.short == "IntelligentCustomerService").id,
|
|
112
|
-
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
83
|
+
maxPageSize: 99999999
|
|
113
84
|
}
|
|
114
85
|
});
|
|
115
86
|
};
|
|
@@ -135,50 +106,158 @@ const HistoryFun = (props)=>{
|
|
|
135
106
|
}
|
|
136
107
|
});
|
|
137
108
|
const pageNumber = findPageNumber(30, Math.ceil(total / 30), number);
|
|
138
|
-
|
|
139
|
-
// roomId, pageNumber, id,
|
|
140
|
-
// "第几页第几页第几页第几页第几页第几页"
|
|
141
|
-
// );
|
|
109
|
+
console.log(roomId, pageNumber, id, receiver, "第几页第几页第几页第几页第几页第几页");
|
|
142
110
|
loadSpecifiedData(roomId, pageNumber, id, receiver);
|
|
143
111
|
onClose();
|
|
144
112
|
setKeyWordProblem("");
|
|
145
|
-
|
|
113
|
+
setTotalData([]);
|
|
114
|
+
// setKeyHistoryMessageList([]);
|
|
146
115
|
}
|
|
147
116
|
});
|
|
148
117
|
};
|
|
149
118
|
const getUserName = (dataList)=>{
|
|
150
119
|
try {
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
userName(
|
|
120
|
+
let list = dataList;
|
|
121
|
+
let ids = [];
|
|
122
|
+
list = list.map((item)=>{
|
|
123
|
+
if (item.member != "AI") {
|
|
124
|
+
ids.push(item.member);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
if (ids.length > 0) {
|
|
128
|
+
userName(ids.join(",")).then((res)=>{
|
|
160
129
|
if (res.data) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
130
|
+
let nameList = res.data;
|
|
131
|
+
setTotalData((list1)=>{
|
|
132
|
+
let list = list1;
|
|
133
|
+
list = list.map((item)=>{
|
|
134
|
+
let name = nameList.filter((v)=>v.uid == item.member);
|
|
135
|
+
if (name.length > 0) {
|
|
136
|
+
return _object_spread({}, item, name[0]);
|
|
137
|
+
} else {
|
|
138
|
+
return item;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return list;
|
|
164
142
|
});
|
|
165
|
-
console.log(objName, 'kdfvdfdfvjkdfnv');
|
|
166
|
-
if (obj.length == filterList.length) {
|
|
167
|
-
objName.current = obj;
|
|
168
|
-
setLoad(true);
|
|
169
|
-
}
|
|
170
143
|
}
|
|
171
144
|
});
|
|
172
|
-
}
|
|
145
|
+
}
|
|
146
|
+
// let objName: { id: string; name: String; }[] = [];//[{id:'用户id',name:'用户名字‘}]
|
|
147
|
+
// let obj: any[] = [];
|
|
148
|
+
// //去重
|
|
149
|
+
// let res = new Map();
|
|
150
|
+
// let filterList = dataList.filter(
|
|
151
|
+
// (a: { receiver: string }) =>
|
|
152
|
+
// !res.has(a.receiver) && res.set(a.receiver, 1)
|
|
153
|
+
// );
|
|
154
|
+
// filterList = filterList.filter(
|
|
155
|
+
// (item) => item.receiver != userData.mid && item.receiver != "AI"
|
|
156
|
+
// );
|
|
157
|
+
// console.log(filterList, "wefwekfjwef");
|
|
158
|
+
// filterList.map((item)=>{
|
|
159
|
+
// userName(item.receiver).then((res: { data: { name: String } }) => {
|
|
160
|
+
// if (res.data) {
|
|
161
|
+
// obj.push({id:item.receiver,name:res.data.name,});
|
|
162
|
+
// console.log(objName,'kdfvdfdfvjkdfnv');
|
|
163
|
+
// if(obj.length == filterList.length){
|
|
164
|
+
// objName.current = obj;
|
|
165
|
+
// setLoad(true)
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
168
|
+
// });
|
|
169
|
+
// })
|
|
173
170
|
} catch (error) {}
|
|
174
171
|
};
|
|
172
|
+
//显示详情
|
|
173
|
+
const showDetails = (roomId, show)=>{
|
|
174
|
+
//展开
|
|
175
|
+
if (show === true || show === false) {
|
|
176
|
+
setTotalData((list)=>{
|
|
177
|
+
console.log(list, 33333);
|
|
178
|
+
let new_list = list;
|
|
179
|
+
new_list = new_list.map((item)=>{
|
|
180
|
+
if (roomId == item.roomId) {
|
|
181
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
182
|
+
show: !show
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
186
|
+
show: item.show == undefined ? undefined : false
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
return new_list;
|
|
191
|
+
});
|
|
192
|
+
} else {
|
|
193
|
+
return http.get(`${urllocation}/chat-service/public/v1.0/history-messages`, {
|
|
194
|
+
params: {
|
|
195
|
+
roomId: roomId,
|
|
196
|
+
message: keyWordProblem,
|
|
197
|
+
page: 1,
|
|
198
|
+
maxPageSize: 20,
|
|
199
|
+
direction: "desc"
|
|
200
|
+
}
|
|
201
|
+
}).then((res)=>{
|
|
202
|
+
if (res.data.messages.length > 0) {
|
|
203
|
+
setTotalData((list)=>{
|
|
204
|
+
let new_list = list;
|
|
205
|
+
new_list = new_list.map((item)=>{
|
|
206
|
+
if (item.roomId == roomId) {
|
|
207
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
208
|
+
detailsList: res.data.messages,
|
|
209
|
+
pageCount: Math.ceil(res.data.total / 20),
|
|
210
|
+
show: true,
|
|
211
|
+
pageNum: 1
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
return item;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return new_list;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
//加载更多
|
|
224
|
+
const loadMore = (pageNum, roomId)=>{
|
|
225
|
+
return http.get(`${urllocation}/chat-service/public/v1.0/history-messages`, {
|
|
226
|
+
params: {
|
|
227
|
+
roomId: roomId,
|
|
228
|
+
message: keyWordProblem,
|
|
229
|
+
page: pageNum,
|
|
230
|
+
maxPageSize: 20,
|
|
231
|
+
direction: "desc"
|
|
232
|
+
}
|
|
233
|
+
}).then((res)=>{
|
|
234
|
+
if (res.data.messages.length > 0) {
|
|
235
|
+
setTotalData((list)=>{
|
|
236
|
+
let new_list = list;
|
|
237
|
+
new_list = new_list.map((item)=>{
|
|
238
|
+
if (item.roomId == roomId) {
|
|
239
|
+
return _object_spread_props(_object_spread({}, item), {
|
|
240
|
+
detailsList: item.detailsList.concat(res.data.messages),
|
|
241
|
+
pageCount: Math.ceil(res.data.total / 20),
|
|
242
|
+
show: true,
|
|
243
|
+
pageNum: pageNum
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
return item;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return new_list;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
};
|
|
175
254
|
const userName = (uid)=>{
|
|
176
255
|
return http.get(`${urllocation}/chat-service/public/v1.0/userinfo`, {
|
|
177
256
|
params: {
|
|
178
257
|
uid: uid
|
|
179
258
|
},
|
|
180
259
|
headers: {
|
|
181
|
-
"x-module-id": userData.modules.find((ele)=>ele.short == "
|
|
260
|
+
"x-module-id": userData.modules.find((ele)=>ele.short == "IntelligentCustomerService").id,
|
|
182
261
|
"x-auth-jwt": window.localStorage.getItem("usertoken") || ""
|
|
183
262
|
}
|
|
184
263
|
});
|
|
@@ -196,6 +275,7 @@ const HistoryFun = (props)=>{
|
|
|
196
275
|
}),
|
|
197
276
|
/*#__PURE__*/ _jsx("span", {
|
|
198
277
|
onClick: ()=>{
|
|
278
|
+
loadSpecifiedData();
|
|
199
279
|
onClose();
|
|
200
280
|
},
|
|
201
281
|
children: /*#__PURE__*/ _jsx(CustomClose, {})
|
|
@@ -215,11 +295,11 @@ const HistoryFun = (props)=>{
|
|
|
215
295
|
clearTimeout(timer.current);
|
|
216
296
|
timer.current = setTimeout(()=>{
|
|
217
297
|
if (val != "") {
|
|
218
|
-
|
|
298
|
+
setTotalData([]);
|
|
299
|
+
getList(val, 1);
|
|
219
300
|
} else {
|
|
220
301
|
setShowLoadingState(1);
|
|
221
|
-
|
|
222
|
-
setLoad(false);
|
|
302
|
+
setTotalData([]);
|
|
223
303
|
}
|
|
224
304
|
}, 1000);
|
|
225
305
|
}
|
|
@@ -229,8 +309,7 @@ const HistoryFun = (props)=>{
|
|
|
229
309
|
onClick: ()=>{
|
|
230
310
|
setShowLoadingState(1);
|
|
231
311
|
setKeyWordProblem("");
|
|
232
|
-
|
|
233
|
-
setLoad(false);
|
|
312
|
+
setTotalData([]);
|
|
234
313
|
},
|
|
235
314
|
children: /*#__PURE__*/ _jsx(CustomClose, {})
|
|
236
315
|
})
|
|
@@ -262,56 +341,157 @@ const HistoryFun = (props)=>{
|
|
|
262
341
|
})
|
|
263
342
|
]
|
|
264
343
|
}),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
344
|
+
/*#__PURE__*/ _jsx("div", {
|
|
345
|
+
className: styles.list_item,
|
|
346
|
+
children: totalData.map((item)=>{
|
|
347
|
+
let span = "";
|
|
348
|
+
let time = "";
|
|
349
|
+
if (item.count == 1) {
|
|
350
|
+
let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
351
|
+
//搜索内容是否有特殊字符
|
|
352
|
+
if (reg.test(keyWordProblem)) {
|
|
353
|
+
span = item.message.replaceAll(keyWordProblem, (e)=>{
|
|
354
|
+
return `<span class=${styles.sign}>${e}</span>`;
|
|
355
|
+
});
|
|
356
|
+
} else {
|
|
357
|
+
span = item.message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
358
|
+
// console.log(i,'skdcnsdjk')
|
|
359
|
+
return `<span class=${styles.sign}>${i}</span>`;
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
let currentTime = getDataTime(-1, 1); //当前时间
|
|
363
|
+
let createdAt = getDataTime(item.createdAt, 1);
|
|
364
|
+
if (currentTime == createdAt) {
|
|
365
|
+
time = getDataTime(item.createdAt, 2);
|
|
366
|
+
} else {
|
|
367
|
+
time = getDataTime(item.createdAt);
|
|
368
|
+
}
|
|
276
369
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
370
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
371
|
+
children: [
|
|
372
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
373
|
+
className: styles.list_summary,
|
|
374
|
+
id: item.roomId,
|
|
375
|
+
onClick: ()=>{
|
|
376
|
+
if (item.count == 1) {
|
|
377
|
+
calculationData(item.roomId, item.id, item.member);
|
|
378
|
+
} else {
|
|
379
|
+
showDetails(item.roomId, item.show);
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
children: [
|
|
383
|
+
/*#__PURE__*/ _jsx("div", {
|
|
384
|
+
className: styles.head_img,
|
|
385
|
+
children: item.member == "AI" ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
|
|
386
|
+
src: item.headImg
|
|
387
|
+
})
|
|
388
|
+
}),
|
|
389
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
390
|
+
className: styles.list_desc,
|
|
391
|
+
children: [
|
|
392
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
393
|
+
className: styles.name,
|
|
394
|
+
children: [
|
|
395
|
+
item.member == "AI" ? "AI助手" : item.name,
|
|
396
|
+
item.count == 1 ? /*#__PURE__*/ _jsx("span", {
|
|
397
|
+
className: styles.time,
|
|
398
|
+
children: time
|
|
399
|
+
}) : ""
|
|
400
|
+
]
|
|
401
|
+
}),
|
|
402
|
+
item.count == 1 ? /*#__PURE__*/ _jsx("p", {
|
|
403
|
+
className: styles.decs,
|
|
404
|
+
style: {
|
|
405
|
+
width: "calc(100% - 36px)"
|
|
406
|
+
},
|
|
407
|
+
dangerouslySetInnerHTML: {
|
|
408
|
+
__html: span
|
|
409
|
+
}
|
|
410
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
411
|
+
className: styles.decs,
|
|
412
|
+
children: `${item.count}条相关聊天记录`
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
}),
|
|
416
|
+
item.count != 1 ? /*#__PURE__*/ _jsx("div", {
|
|
417
|
+
className: `${styles.open} ${item.show ? styles.active : ''}`,
|
|
418
|
+
children: /*#__PURE__*/ _jsx(CustomExpand, {})
|
|
419
|
+
}) : ""
|
|
420
|
+
]
|
|
421
|
+
}),
|
|
422
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
423
|
+
className: styles.list_detail,
|
|
424
|
+
children: [
|
|
425
|
+
item.show && item.detailsList && item.detailsList.map((list)=>{
|
|
426
|
+
// console.log(list,item,'dklfvmdflkvmdfklv')
|
|
427
|
+
let name = "";
|
|
428
|
+
if (list.sender == 'AI') {
|
|
429
|
+
name = 'AI助手';
|
|
430
|
+
} else if (list.sender == item.member) {
|
|
431
|
+
name = item.name;
|
|
432
|
+
} else {
|
|
433
|
+
name = userData.real_name;
|
|
434
|
+
}
|
|
435
|
+
let time = "";
|
|
436
|
+
let currentTime = getDataTime(-1, 1); //当前时间
|
|
437
|
+
let updatedAt = getDataTime(list.updatedAt, 1);
|
|
438
|
+
if (currentTime == updatedAt) {
|
|
439
|
+
time = getDataTime(list.updatedAt, 2);
|
|
440
|
+
} else {
|
|
441
|
+
time = getDataTime(list.updatedAt);
|
|
442
|
+
}
|
|
443
|
+
let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
444
|
+
let span = '';
|
|
445
|
+
//搜索内容是否有特殊字符
|
|
446
|
+
if (reg.test(keyWordProblem)) {
|
|
447
|
+
span = list.message.replaceAll(keyWordProblem, (e)=>{
|
|
448
|
+
return `<span class=${styles.sign}>${e}</span>`;
|
|
449
|
+
});
|
|
450
|
+
} else {
|
|
451
|
+
span = list.message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
452
|
+
// console.log(i,'skdcnsdjk')
|
|
453
|
+
return `<span class=${styles.sign}>${i}</span>`;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
457
|
+
className: styles.list,
|
|
458
|
+
onClick: ()=>{
|
|
459
|
+
calculationData(item.roomId, list.id, list.receiver);
|
|
460
|
+
},
|
|
461
|
+
children: [
|
|
462
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
463
|
+
className: styles.name,
|
|
464
|
+
children: [
|
|
465
|
+
/*#__PURE__*/ _jsx("p", {
|
|
466
|
+
children: name
|
|
467
|
+
}),
|
|
468
|
+
/*#__PURE__*/ _jsx("span", {
|
|
469
|
+
className: styles.time,
|
|
470
|
+
children: time
|
|
471
|
+
})
|
|
472
|
+
]
|
|
473
|
+
}),
|
|
474
|
+
/*#__PURE__*/ _jsx("div", {
|
|
475
|
+
className: styles.con,
|
|
476
|
+
dangerouslySetInnerHTML: {
|
|
477
|
+
__html: span
|
|
478
|
+
}
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
}, list.id);
|
|
482
|
+
}),
|
|
483
|
+
item.show && item.pageCount > 1 && item.pageCount > item.pageNum && /*#__PURE__*/ _jsx("div", {
|
|
484
|
+
className: `${styles.list} ${styles.list_more}`,
|
|
485
|
+
onClick: ()=>{
|
|
486
|
+
loadMore(item.pageNum + 1, item.roomId);
|
|
487
|
+
},
|
|
488
|
+
children: "点击加载更多"
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
})
|
|
492
|
+
]
|
|
493
|
+
});
|
|
494
|
+
})
|
|
315
495
|
})
|
|
316
496
|
]
|
|
317
497
|
})
|