bhd-components 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{d4259367.esm.es5.development.js → 869a16fb.esm.es5.development.js} +1402 -1140
- package/dist/{8bda9e2e.esm.es5.production.js → c220442c.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.css +864 -732
- package/dist/index.esm.es5.development.js +757 -671
- 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 +1 -1
- package/es2017/customerService/historyFun.js +325 -154
- package/es2017/customerService/index.js +412 -341
- package/es2017/customerService/index.module.less +169 -65
- package/es2017/customerService/index2.module.less +170 -65
- package/es2017/icons/components/custom-expand.d.ts +4 -0
- package/es2017/icons/components/custom-expand.js +22 -0
- package/es2017/icons/components/index.d.ts +1 -0
- package/es2017/icons/components/index.js +1 -0
- package/esm/customerService/contactsList.d.ts +1 -1
- package/esm/customerService/contactsList.js +11 -158
- package/esm/customerService/function.js +1 -1
- package/esm/customerService/historyFun.js +329 -167
- package/esm/customerService/index.js +397 -348
- package/esm/customerService/index.module.less +169 -65
- package/esm/customerService/index2.module.less +170 -65
- package/esm/icons/components/custom-expand.d.ts +4 -0
- package/esm/icons/components/custom-expand.js +24 -0
- package/esm/icons/components/index.d.ts +1 -0
- package/esm/icons/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,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
|
});
|
|
@@ -215,11 +294,11 @@ const HistoryFun = (props)=>{
|
|
|
215
294
|
clearTimeout(timer.current);
|
|
216
295
|
timer.current = setTimeout(()=>{
|
|
217
296
|
if (val != "") {
|
|
218
|
-
|
|
297
|
+
setTotalData([]);
|
|
298
|
+
getList(val, 1);
|
|
219
299
|
} else {
|
|
220
300
|
setShowLoadingState(1);
|
|
221
|
-
|
|
222
|
-
setLoad(false);
|
|
301
|
+
setTotalData([]);
|
|
223
302
|
}
|
|
224
303
|
}, 1000);
|
|
225
304
|
}
|
|
@@ -229,8 +308,7 @@ const HistoryFun = (props)=>{
|
|
|
229
308
|
onClick: ()=>{
|
|
230
309
|
setShowLoadingState(1);
|
|
231
310
|
setKeyWordProblem("");
|
|
232
|
-
|
|
233
|
-
setLoad(false);
|
|
311
|
+
setTotalData([]);
|
|
234
312
|
},
|
|
235
313
|
children: /*#__PURE__*/ _jsx(CustomClose, {})
|
|
236
314
|
})
|
|
@@ -262,56 +340,149 @@ const HistoryFun = (props)=>{
|
|
|
262
340
|
})
|
|
263
341
|
]
|
|
264
342
|
}),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
343
|
+
/*#__PURE__*/ _jsx("div", {
|
|
344
|
+
className: styles.list_item,
|
|
345
|
+
children: totalData.map((item)=>{
|
|
346
|
+
let span = "";
|
|
347
|
+
let time = "";
|
|
348
|
+
if (item.count == 1) {
|
|
349
|
+
// span = item.message.replaceAll(keyWordProblem, () => {
|
|
350
|
+
// return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
351
|
+
// });
|
|
352
|
+
span = item.message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
353
|
+
// console.log(i,'skdcnsdjk')
|
|
354
|
+
return `<span class=${styles.sign}>${i}</span>`;
|
|
355
|
+
});
|
|
356
|
+
let currentTime = getDataTime(-1, 1); //当前时间
|
|
357
|
+
let createdAt = getDataTime(item.createdAt, 1);
|
|
358
|
+
if (currentTime == createdAt) {
|
|
359
|
+
time = getDataTime(item.createdAt, 2);
|
|
360
|
+
} else {
|
|
361
|
+
time = getDataTime(item.createdAt);
|
|
362
|
+
}
|
|
276
363
|
}
|
|
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
|
-
|
|
364
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
365
|
+
children: [
|
|
366
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
367
|
+
className: styles.list_summary,
|
|
368
|
+
id: item.roomId,
|
|
369
|
+
onClick: ()=>{
|
|
370
|
+
if (item.count == 1) {
|
|
371
|
+
calculationData(item.roomId, item.id, item.member);
|
|
372
|
+
} else {
|
|
373
|
+
showDetails(item.roomId, item.show);
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
children: [
|
|
377
|
+
/*#__PURE__*/ _jsx("div", {
|
|
378
|
+
className: styles.head_img,
|
|
379
|
+
children: item.member == "AI" ? /*#__PURE__*/ _jsx(CustomAiIcon, {}) : /*#__PURE__*/ _jsx("img", {
|
|
380
|
+
src: item.headImg
|
|
381
|
+
})
|
|
382
|
+
}),
|
|
383
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
384
|
+
className: styles.list_desc,
|
|
385
|
+
children: [
|
|
386
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
387
|
+
className: styles.name,
|
|
388
|
+
children: [
|
|
389
|
+
item.member == "AI" ? "AI助手" : item.name,
|
|
390
|
+
item.count == 1 ? /*#__PURE__*/ _jsx("span", {
|
|
391
|
+
className: styles.time,
|
|
392
|
+
children: time
|
|
393
|
+
}) : ""
|
|
394
|
+
]
|
|
395
|
+
}),
|
|
396
|
+
item.count == 1 ? /*#__PURE__*/ _jsx("p", {
|
|
397
|
+
className: styles.decs,
|
|
398
|
+
style: {
|
|
399
|
+
width: "calc(100% - 36px)"
|
|
400
|
+
},
|
|
401
|
+
dangerouslySetInnerHTML: {
|
|
402
|
+
__html: span
|
|
403
|
+
}
|
|
404
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
405
|
+
className: styles.decs,
|
|
406
|
+
children: `${item.count}条相关聊天记录`
|
|
407
|
+
})
|
|
408
|
+
]
|
|
409
|
+
}),
|
|
410
|
+
item.count != 1 ? /*#__PURE__*/ _jsx("div", {
|
|
411
|
+
className: `${styles.open} ${item.show ? styles.active : ''}`,
|
|
412
|
+
children: /*#__PURE__*/ _jsx(CustomExpand, {})
|
|
413
|
+
}) : ""
|
|
414
|
+
]
|
|
415
|
+
}),
|
|
416
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
417
|
+
className: styles.list_detail,
|
|
418
|
+
children: [
|
|
419
|
+
item.show && item.detailsList && item.detailsList.map((list)=>{
|
|
420
|
+
// console.log(list,item,'dklfvmdflkvmdfklv')
|
|
421
|
+
let name = "";
|
|
422
|
+
if (list.sender == 'AI') {
|
|
423
|
+
name = 'AI助手';
|
|
424
|
+
} else if (list.sender == item.member) {
|
|
425
|
+
name = item.name;
|
|
426
|
+
} else {
|
|
427
|
+
name = userData.real_name;
|
|
428
|
+
}
|
|
429
|
+
let time = "";
|
|
430
|
+
let currentTime = getDataTime(-1, 1); //当前时间
|
|
431
|
+
let updatedAt = getDataTime(list.updatedAt, 1);
|
|
432
|
+
if (currentTime == updatedAt) {
|
|
433
|
+
time = getDataTime(list.updatedAt, 2);
|
|
434
|
+
} else {
|
|
435
|
+
time = getDataTime(list.updatedAt);
|
|
436
|
+
}
|
|
437
|
+
// let span = list.message.replace(
|
|
438
|
+
// /keyWordProblem/gi,
|
|
439
|
+
// () => {
|
|
440
|
+
// return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
441
|
+
// }
|
|
442
|
+
// );
|
|
443
|
+
let span = list.message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
444
|
+
// console.log(i,'skdcnsdjk')
|
|
445
|
+
return `<span class=${styles.sign}>${i}</span>`;
|
|
446
|
+
});
|
|
447
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
448
|
+
className: styles.list,
|
|
449
|
+
onClick: ()=>{
|
|
450
|
+
calculationData(item.roomId, list.id, list.receiver);
|
|
451
|
+
},
|
|
452
|
+
children: [
|
|
453
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
454
|
+
className: styles.name,
|
|
455
|
+
children: [
|
|
456
|
+
/*#__PURE__*/ _jsx("p", {
|
|
457
|
+
children: name
|
|
458
|
+
}),
|
|
459
|
+
/*#__PURE__*/ _jsx("span", {
|
|
460
|
+
className: styles.time,
|
|
461
|
+
children: time
|
|
462
|
+
})
|
|
463
|
+
]
|
|
464
|
+
}),
|
|
465
|
+
/*#__PURE__*/ _jsx("div", {
|
|
466
|
+
className: styles.con,
|
|
467
|
+
dangerouslySetInnerHTML: {
|
|
468
|
+
__html: span
|
|
469
|
+
}
|
|
470
|
+
})
|
|
471
|
+
]
|
|
472
|
+
}, list.id);
|
|
473
|
+
}),
|
|
474
|
+
item.show && item.pageCount > 1 && item.pageCount > item.pageNum && /*#__PURE__*/ _jsx("div", {
|
|
475
|
+
className: `${styles.list} ${styles.list_more}`,
|
|
476
|
+
onClick: ()=>{
|
|
477
|
+
loadMore(item.pageNum + 1, item.roomId);
|
|
478
|
+
},
|
|
479
|
+
children: "点击加载更多"
|
|
480
|
+
})
|
|
481
|
+
]
|
|
482
|
+
})
|
|
483
|
+
]
|
|
484
|
+
});
|
|
485
|
+
})
|
|
315
486
|
})
|
|
316
487
|
]
|
|
317
488
|
})
|