bhd-components 0.7.21 → 0.7.22
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/README.md +1 -1
- package/dist/{13653d98.esm.es5.production.js → cf6d2143.esm.es5.production.js} +1 -1
- package/dist/{49e31ffd.esm.es5.development.js → fcb57c77.esm.es5.development.js} +1 -1
- package/dist/index.esm.es5.development.css +500 -495
- package/dist/index.esm.es5.development.js +122 -41
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/historyFun.js +14 -5
- package/es2017/customerService/index.js +36 -14
- package/es2017/customerService/index.module.less +4 -0
- package/es2017/customerService/teacherList.js +62 -19
- package/esm/customerService/historyFun.js +14 -5
- package/esm/customerService/index.js +38 -14
- package/esm/customerService/index.module.less +4 -0
- package/esm/customerService/teacherList.js +68 -19
- package/package.json +1 -1
|
@@ -348,15 +348,19 @@ const HistoryFun = (props)=>{
|
|
|
348
348
|
let span = "";
|
|
349
349
|
let time = "";
|
|
350
350
|
if (item.count == 1) {
|
|
351
|
+
let message = item.message;
|
|
352
|
+
let position_i = message.indexOf(keyWordProblem);
|
|
353
|
+
if (position_i > 30) {
|
|
354
|
+
message = message.substring(position_i - 15);
|
|
355
|
+
}
|
|
351
356
|
let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
352
357
|
//搜索内容是否有特殊字符
|
|
353
358
|
if (reg.test(keyWordProblem)) {
|
|
354
|
-
span =
|
|
359
|
+
span = message.replaceAll(keyWordProblem, (e)=>{
|
|
355
360
|
return `<span class=${styles.sign}>${e}</span>`;
|
|
356
361
|
});
|
|
357
362
|
} else {
|
|
358
|
-
span =
|
|
359
|
-
// console.log(i,'skdcnsdjk')
|
|
363
|
+
span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
360
364
|
return `<span class=${styles.sign}>${i}</span>`;
|
|
361
365
|
});
|
|
362
366
|
}
|
|
@@ -430,13 +434,18 @@ const HistoryFun = (props)=>{
|
|
|
430
434
|
let time = formatDate(list.updatedAt);
|
|
431
435
|
let reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
432
436
|
let span = '';
|
|
437
|
+
let message = list.message;
|
|
438
|
+
let position_i = message.indexOf(keyWordProblem);
|
|
439
|
+
if (position_i > 30) {
|
|
440
|
+
message = message.substring(position_i - 15);
|
|
441
|
+
}
|
|
433
442
|
//搜索内容是否有特殊字符
|
|
434
443
|
if (reg.test(keyWordProblem)) {
|
|
435
|
-
span =
|
|
444
|
+
span = message.replaceAll(keyWordProblem, (e)=>{
|
|
436
445
|
return `<span class=${styles.sign}>${e}</span>`;
|
|
437
446
|
});
|
|
438
447
|
} else {
|
|
439
|
-
span =
|
|
448
|
+
span = message.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
440
449
|
// console.log(i,'skdcnsdjk')
|
|
441
450
|
return `<span class=${styles.sign}>${i}</span>`;
|
|
442
451
|
});
|
|
@@ -126,6 +126,7 @@ const CustomerService = (props)=>{
|
|
|
126
126
|
console.log(canvas, 99999);
|
|
127
127
|
// var base64URL = canvas.toDataURL('image/jpeg')
|
|
128
128
|
let base64URL = canvas.toDataURL("image/jpg", 1.0);
|
|
129
|
+
console.log(base64URL);
|
|
129
130
|
setImgBese64(base64URL);
|
|
130
131
|
});
|
|
131
132
|
} catch (error) {
|
|
@@ -797,11 +798,9 @@ const CustomerService = (props)=>{
|
|
|
797
798
|
ctrl.current = new AbortController();
|
|
798
799
|
clearTimeout(receiveMessageTimer.current);
|
|
799
800
|
receiveMessageTimer.current = setTimeout(()=>{
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
// );
|
|
804
|
-
// });
|
|
801
|
+
setHistoryMessageList((historyMessageList)=>{
|
|
802
|
+
return historyMessageList.filter((item)=>item.id != "123456");
|
|
803
|
+
});
|
|
805
804
|
setFinished(true);
|
|
806
805
|
ctrl.current.abort();
|
|
807
806
|
setHistoryMessageList((historyMessageList)=>{
|
|
@@ -809,7 +808,7 @@ const CustomerService = (props)=>{
|
|
|
809
808
|
roomId: roomId,
|
|
810
809
|
sender: "AI",
|
|
811
810
|
recevier: mid,
|
|
812
|
-
message: "
|
|
811
|
+
message: "AI助手繁忙,请稍后再提问或",
|
|
813
812
|
id: "123456",
|
|
814
813
|
createdAt: getDataTime(-1),
|
|
815
814
|
extraInfo: null
|
|
@@ -1194,11 +1193,9 @@ const CustomerService = (props)=>{
|
|
|
1194
1193
|
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
1195
1194
|
sendToTeacher(1);
|
|
1196
1195
|
}
|
|
1197
|
-
// if(flag == 1){
|
|
1198
1196
|
setTimeout(()=>{
|
|
1199
1197
|
setKeyWordProblem('');
|
|
1200
1198
|
}, 3100);
|
|
1201
|
-
// }
|
|
1202
1199
|
} else {
|
|
1203
1200
|
setPageCount(0);
|
|
1204
1201
|
setBottomLoading(false);
|
|
@@ -1870,18 +1867,22 @@ const CustomerService = (props)=>{
|
|
|
1870
1867
|
// code = code[1];
|
|
1871
1868
|
// console.log(code,888888888);
|
|
1872
1869
|
if (lastId == item.id && keyWordProblem != '') {
|
|
1873
|
-
|
|
1870
|
+
//点击历史记录时,找到关键字,防止关键字和标签名重复
|
|
1871
|
+
let key_sign = 'sign_' + new Date().getTime();
|
|
1872
|
+
+'sign';
|
|
1874
1873
|
message = message.replaceAll(keyWordProblem, (e)=>{
|
|
1875
|
-
return
|
|
1874
|
+
return key_sign;
|
|
1875
|
+
});
|
|
1876
|
+
message = remarkable.render(message);
|
|
1877
|
+
message = message.replaceAll(key_sign, (e)=>{
|
|
1878
|
+
return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
1876
1879
|
});
|
|
1877
1880
|
} else {
|
|
1878
1881
|
message = remarkable.render(message);
|
|
1879
1882
|
}
|
|
1880
1883
|
let position = 0;
|
|
1881
1884
|
message = message.replaceAll(new RegExp(`<pre`, 'ig'), (i, index)=>{
|
|
1882
|
-
//copyText(${item.message,2,position})
|
|
1883
1885
|
position++;
|
|
1884
|
-
// console.log(i,index,onClick={copyText} ,'skdcnsdjk')
|
|
1885
1886
|
let text = `<p class='${styles.copyCode} copyCodeFun' data-id=${item.id} data-position=${position}>
|
|
1886
1887
|
<span class='${styles.icon} copy' >
|
|
1887
1888
|
<svg
|
|
@@ -2099,12 +2100,33 @@ const CustomerService = (props)=>{
|
|
|
2099
2100
|
/*#__PURE__*/ _jsxs("div", {
|
|
2100
2101
|
className: styles.content,
|
|
2101
2102
|
children: [
|
|
2102
|
-
/*#__PURE__*/ _jsx("p", {
|
|
2103
|
+
item.message != 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsx("p", {
|
|
2103
2104
|
dangerouslySetInnerHTML: {
|
|
2104
2105
|
__html: message
|
|
2105
2106
|
},
|
|
2106
2107
|
className: styles.content_child
|
|
2107
2108
|
}),
|
|
2109
|
+
item.message == 'AI助手繁忙,请稍后再提问或' && /*#__PURE__*/ _jsxs("p", {
|
|
2110
|
+
children: [
|
|
2111
|
+
"AI助手繁忙,请稍后再提问或",
|
|
2112
|
+
/*#__PURE__*/ _jsx("span", {
|
|
2113
|
+
className: styles.find_teacher_con,
|
|
2114
|
+
onClick: ()=>{
|
|
2115
|
+
let extraInfo = historyMessageList[i - 1].extraInfo;
|
|
2116
|
+
let url = '';
|
|
2117
|
+
if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
|
|
2118
|
+
url = JSON.parse(extraInfo)[0].value;
|
|
2119
|
+
}
|
|
2120
|
+
setProblem({
|
|
2121
|
+
question: historyMessageList[i - 1].message,
|
|
2122
|
+
url
|
|
2123
|
+
});
|
|
2124
|
+
setShowTeacherList(true);
|
|
2125
|
+
},
|
|
2126
|
+
children: "召唤老师回答"
|
|
2127
|
+
})
|
|
2128
|
+
]
|
|
2129
|
+
}),
|
|
2108
2130
|
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2109
2131
|
className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
|
|
2110
2132
|
children: [
|
|
@@ -2941,7 +2963,7 @@ const CustomerService = (props)=>{
|
|
|
2941
2963
|
mask: false,
|
|
2942
2964
|
rootClassName: styles.service_ChatWindow_Drawer,
|
|
2943
2965
|
children: [
|
|
2944
|
-
showType == 1 && /*#__PURE__*/ _jsx("div", {
|
|
2966
|
+
showType == 1 && !showScreenshot && /*#__PURE__*/ _jsx("div", {
|
|
2945
2967
|
style: {
|
|
2946
2968
|
display: `${showContacts && roomId != "" ? "block" : "none"}`
|
|
2947
2969
|
},
|
|
@@ -10,8 +10,35 @@ const TeacherList = (props)=>{
|
|
|
10
10
|
const [keyWordProblem, setKeyWordProblem] = useState(""); //搜索内容
|
|
11
11
|
const [showLoadingState, setShowLoadingState] = useState(1); //1,初始状态,2、无数据 ,3、不显示图片
|
|
12
12
|
const [totalData, setTotalData] = useState([]); //总数据
|
|
13
|
-
const [teacher_list, setTeacher_list] = useState([]); //老师列表,有头像
|
|
13
|
+
// const [teacher_list, setTeacher_list] = useState([]); //老师列表,有头像
|
|
14
|
+
const teacher_list = useRef([]); //老师列表,有头像
|
|
14
15
|
const timer = useRef(null); //文本框输入时
|
|
16
|
+
const page = useRef(1);
|
|
17
|
+
const loading = useRef(true);
|
|
18
|
+
const sliderRef = useRef(null);
|
|
19
|
+
useEffect(()=>{
|
|
20
|
+
const handleScroll = (e)=>{
|
|
21
|
+
// 处理滚轮事件的逻辑
|
|
22
|
+
const container = document.getElementById("teacher_list");
|
|
23
|
+
const scrollTop = container.scrollTop;
|
|
24
|
+
const clientHeight = container.clientHeight;
|
|
25
|
+
const scrollHeight = container.scrollHeight;
|
|
26
|
+
if (scrollTop + clientHeight + 60 >= scrollHeight && loading.current) {
|
|
27
|
+
loading.current = false;
|
|
28
|
+
// console.log('加载下一页');
|
|
29
|
+
page.current = page.current + 1;
|
|
30
|
+
getList(keyWordProblem);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
// 添加滚轮事件监听器
|
|
34
|
+
sliderRef.current.addEventListener('wheel', handleScroll);
|
|
35
|
+
// 清除滚轮事件监听器
|
|
36
|
+
return ()=>{
|
|
37
|
+
sliderRef.current.removeEventListener('wheel', handleScroll);
|
|
38
|
+
};
|
|
39
|
+
}, [
|
|
40
|
+
keyWordProblem
|
|
41
|
+
]);
|
|
15
42
|
useEffect(()=>{
|
|
16
43
|
getList("");
|
|
17
44
|
return ()=>{
|
|
@@ -19,17 +46,30 @@ const TeacherList = (props)=>{
|
|
|
19
46
|
};
|
|
20
47
|
}, []);
|
|
21
48
|
const getList = (val)=>{
|
|
49
|
+
if (page.current == 1) {
|
|
50
|
+
setTotalData([]);
|
|
51
|
+
}
|
|
22
52
|
http.get(`${urllocation}/chat-service/public/v1.0/teachers`, {
|
|
23
53
|
params: {
|
|
24
|
-
name: val
|
|
54
|
+
name: val,
|
|
55
|
+
page: page.current,
|
|
56
|
+
maxPageSize: 20
|
|
25
57
|
}
|
|
26
58
|
}).then((res)=>{
|
|
27
59
|
console.log(res);
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
if (res.data.total > 0) {
|
|
61
|
+
loading.current = true;
|
|
30
62
|
setShowLoadingState(3);
|
|
31
|
-
|
|
63
|
+
let data = new Map();
|
|
64
|
+
setTotalData((totalData)=>{
|
|
65
|
+
return totalData.concat(res.data.teachers).filter((a)=>!data.has(a.uid) && data.set(a.uid, 1));
|
|
66
|
+
});
|
|
32
67
|
getUserName(res.data.teachers);
|
|
68
|
+
} else {
|
|
69
|
+
loading.current = false;
|
|
70
|
+
if (page.current == 1) {
|
|
71
|
+
setShowLoadingState(2);
|
|
72
|
+
}
|
|
33
73
|
}
|
|
34
74
|
});
|
|
35
75
|
};
|
|
@@ -38,7 +78,7 @@ const TeacherList = (props)=>{
|
|
|
38
78
|
let list = dataList;
|
|
39
79
|
let ids = [];
|
|
40
80
|
list = list.map((item)=>{
|
|
41
|
-
if (!item.headImg && teacher_list.filter((v)=>v.uid == item.uid).length <= 0) {
|
|
81
|
+
if (!item.headImg && teacher_list.current.filter((v)=>v.uid == item.uid).length <= 0) {
|
|
42
82
|
ids.push(item.uid);
|
|
43
83
|
}
|
|
44
84
|
});
|
|
@@ -53,16 +93,23 @@ const TeacherList = (props)=>{
|
|
|
53
93
|
if (name.length > 0) {
|
|
54
94
|
return _object_spread({}, item, name[0]);
|
|
55
95
|
} else {
|
|
56
|
-
|
|
96
|
+
let nameList = teacher_list.current;
|
|
97
|
+
let name = nameList.filter((v)=>v.uid == item.uid);
|
|
98
|
+
if (name.length > 0) {
|
|
99
|
+
return _object_spread({}, item, name[0]);
|
|
100
|
+
} else {
|
|
101
|
+
return item;
|
|
102
|
+
}
|
|
57
103
|
}
|
|
58
104
|
});
|
|
59
|
-
|
|
105
|
+
let data = new Map();
|
|
106
|
+
teacher_list.current = teacher_list.current.concat(list).filter((a)=>!data.has(a.uid) && data.set(a.uid, 1));
|
|
60
107
|
return list;
|
|
61
108
|
});
|
|
62
109
|
}
|
|
63
110
|
});
|
|
64
111
|
} else {
|
|
65
|
-
let nameList = teacher_list;
|
|
112
|
+
let nameList = teacher_list.current;
|
|
66
113
|
setTotalData((list1)=>{
|
|
67
114
|
let list = list1;
|
|
68
115
|
list = list.map((item)=>{
|
|
@@ -73,7 +120,6 @@ const TeacherList = (props)=>{
|
|
|
73
120
|
return item;
|
|
74
121
|
}
|
|
75
122
|
});
|
|
76
|
-
setTeacher_list(list);
|
|
77
123
|
return list;
|
|
78
124
|
});
|
|
79
125
|
}
|
|
@@ -122,13 +168,9 @@ const TeacherList = (props)=>{
|
|
|
122
168
|
setKeyWordProblem(val);
|
|
123
169
|
clearTimeout(timer.current);
|
|
124
170
|
timer.current = setTimeout(()=>{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
} else {
|
|
129
|
-
setShowLoadingState(1);
|
|
130
|
-
setTotalData([]);
|
|
131
|
-
}
|
|
171
|
+
page.current = 1;
|
|
172
|
+
setTotalData([]);
|
|
173
|
+
getList(val);
|
|
132
174
|
}, 1000);
|
|
133
175
|
}
|
|
134
176
|
}),
|
|
@@ -145,7 +187,7 @@ const TeacherList = (props)=>{
|
|
|
145
187
|
}),
|
|
146
188
|
/*#__PURE__*/ _jsxs("div", {
|
|
147
189
|
className: styles.main_list,
|
|
148
|
-
id: "
|
|
190
|
+
id: "teacher_list",
|
|
149
191
|
children: [
|
|
150
192
|
showLoadingState == 1 && /*#__PURE__*/ _jsxs("div", {
|
|
151
193
|
className: styles.no_data,
|
|
@@ -165,12 +207,13 @@ const TeacherList = (props)=>{
|
|
|
165
207
|
src: "/new_yun/images/aiService/no_data.png"
|
|
166
208
|
}),
|
|
167
209
|
/*#__PURE__*/ _jsx("p", {
|
|
168
|
-
children: "
|
|
210
|
+
children: "未搜索到老师"
|
|
169
211
|
})
|
|
170
212
|
]
|
|
171
213
|
}),
|
|
172
214
|
/*#__PURE__*/ _jsx("div", {
|
|
173
215
|
className: styles.list_item,
|
|
216
|
+
ref: sliderRef,
|
|
174
217
|
children: totalData.map((item)=>{
|
|
175
218
|
let span = item.name.replaceAll(new RegExp(keyWordProblem, "ig"), (i)=>{
|
|
176
219
|
return `<span class=${styles.sign}>${i}</span>`;
|
|
@@ -353,15 +353,19 @@ var HistoryFun = function(props) {
|
|
|
353
353
|
var span = "";
|
|
354
354
|
var time = "";
|
|
355
355
|
if (item.count == 1) {
|
|
356
|
+
var message = item.message;
|
|
357
|
+
var position_i = message.indexOf(keyWordProblem);
|
|
358
|
+
if (position_i > 30) {
|
|
359
|
+
message = message.substring(position_i - 15);
|
|
360
|
+
}
|
|
356
361
|
var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
357
362
|
//搜索内容是否有特殊字符
|
|
358
363
|
if (reg.test(keyWordProblem)) {
|
|
359
|
-
span =
|
|
364
|
+
span = message.replaceAll(keyWordProblem, function(e) {
|
|
360
365
|
return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
|
|
361
366
|
});
|
|
362
367
|
} else {
|
|
363
|
-
span =
|
|
364
|
-
// console.log(i,'skdcnsdjk')
|
|
368
|
+
span = message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
|
|
365
369
|
return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
|
|
366
370
|
});
|
|
367
371
|
}
|
|
@@ -435,13 +439,18 @@ var HistoryFun = function(props) {
|
|
|
435
439
|
var time = formatDate(list.updatedAt);
|
|
436
440
|
var reg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
|
|
437
441
|
var span = "";
|
|
442
|
+
var message = list.message;
|
|
443
|
+
var position_i = message.indexOf(keyWordProblem);
|
|
444
|
+
if (position_i > 30) {
|
|
445
|
+
message = message.substring(position_i - 15);
|
|
446
|
+
}
|
|
438
447
|
//搜索内容是否有特殊字符
|
|
439
448
|
if (reg.test(keyWordProblem)) {
|
|
440
|
-
span =
|
|
449
|
+
span = message.replaceAll(keyWordProblem, function(e) {
|
|
441
450
|
return "<span class=".concat(styles.sign, ">").concat(e, "</span>");
|
|
442
451
|
});
|
|
443
452
|
} else {
|
|
444
|
-
span =
|
|
453
|
+
span = message.replaceAll(new RegExp(keyWordProblem, "ig"), function(i) {
|
|
445
454
|
// console.log(i,'skdcnsdjk')
|
|
446
455
|
return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
|
|
447
456
|
});
|
|
@@ -174,6 +174,7 @@ var CustomerService = function(props) {
|
|
|
174
174
|
console.log(canvas, 99999);
|
|
175
175
|
// var base64URL = canvas.toDataURL('image/jpeg')
|
|
176
176
|
var base64URL = canvas.toDataURL("image/jpg", 1.0);
|
|
177
|
+
console.log(base64URL);
|
|
177
178
|
setImgBese64(base64URL);
|
|
178
179
|
});
|
|
179
180
|
} catch (error) {
|
|
@@ -819,11 +820,11 @@ var CustomerService = function(props) {
|
|
|
819
820
|
ctrl.current = new AbortController();
|
|
820
821
|
clearTimeout(receiveMessageTimer.current);
|
|
821
822
|
receiveMessageTimer.current = setTimeout(function() {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
823
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
824
|
+
return historyMessageList.filter(function(item) {
|
|
825
|
+
return item.id != "123456";
|
|
826
|
+
});
|
|
827
|
+
});
|
|
827
828
|
setFinished(true);
|
|
828
829
|
ctrl.current.abort();
|
|
829
830
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -831,7 +832,7 @@ var CustomerService = function(props) {
|
|
|
831
832
|
roomId: roomId,
|
|
832
833
|
sender: "AI",
|
|
833
834
|
recevier: mid,
|
|
834
|
-
message: "
|
|
835
|
+
message: "AI助手繁忙,请稍后再提问或",
|
|
835
836
|
id: "123456",
|
|
836
837
|
createdAt: getDataTime(-1),
|
|
837
838
|
extraInfo: null
|
|
@@ -1229,11 +1230,9 @@ var CustomerService = function(props) {
|
|
|
1229
1230
|
if (problem != undefined && problem.user != undefined && problem.question != undefined) {
|
|
1230
1231
|
sendToTeacher(1);
|
|
1231
1232
|
}
|
|
1232
|
-
// if(flag == 1){
|
|
1233
1233
|
setTimeout(function() {
|
|
1234
1234
|
setKeyWordProblem("");
|
|
1235
1235
|
}, 3100);
|
|
1236
|
-
// }
|
|
1237
1236
|
} else {
|
|
1238
1237
|
setPageCount(0);
|
|
1239
1238
|
setBottomLoading(false);
|
|
@@ -1922,18 +1921,22 @@ var CustomerService = function(props) {
|
|
|
1922
1921
|
// code = code[1];
|
|
1923
1922
|
// console.log(code,888888888);
|
|
1924
1923
|
if (lastId == item.id && keyWordProblem != "") {
|
|
1925
|
-
|
|
1924
|
+
//点击历史记录时,找到关键字,防止关键字和标签名重复
|
|
1925
|
+
var key_sign = "sign_" + new Date().getTime();
|
|
1926
|
+
+"sign";
|
|
1926
1927
|
message = message.replaceAll(keyWordProblem, function(e) {
|
|
1927
|
-
return
|
|
1928
|
+
return key_sign;
|
|
1929
|
+
});
|
|
1930
|
+
message = remarkable.render(message);
|
|
1931
|
+
message = message.replaceAll(key_sign, function(e) {
|
|
1932
|
+
return "<span class=".concat(styles.sign, ">").concat(keyWordProblem, "</span>");
|
|
1928
1933
|
});
|
|
1929
1934
|
} else {
|
|
1930
1935
|
message = remarkable.render(message);
|
|
1931
1936
|
}
|
|
1932
1937
|
var position = 0;
|
|
1933
1938
|
message = message.replaceAll(new RegExp("<pre", "ig"), function(i, index) {
|
|
1934
|
-
//copyText(${item.message,2,position})
|
|
1935
1939
|
position++;
|
|
1936
|
-
// console.log(i,index,onClick={copyText} ,'skdcnsdjk')
|
|
1937
1940
|
var text = "<p class='".concat(styles.copyCode, " copyCodeFun' data-id=").concat(item.id, " data-position=").concat(position, ">\n <span class='").concat(styles.icon, ' copy\' >\n <svg\n width="1em"\n height="1em"\n viewBox="0 0 14 14"\n shape-rendering="geometricPrecision"\n fill="currentColor"\n xmlns="http://www.w3.org/2000/svg"\n >\n <g clip-path="url(#clip0_518_8403)">\n <path\n d="M6.16666 1.66666H13.1667C13.4761 1.66666 13.7728 1.78957 13.9916 2.00837C14.2104 2.22716 14.3333 2.5239 14.3333 2.83332V9.83332C14.3333 10.1427 14.2104 10.4395 13.9916 10.6583C13.7728 10.8771 13.4761 11 13.1667 11H6.16666C5.85724 11 5.5605 10.8771 5.34171 10.6583C5.12291 10.4395 5 10.1427 5 9.83332V2.83332C5 2.5239 5.12291 2.22716 5.34171 2.00837C5.5605 1.78957 5.85724 1.66666 6.16666 1.66666ZM6.16666 2.66666C6.12246 2.66666 6.08007 2.68422 6.04881 2.71547C6.01756 2.74673 6 2.78912 6 2.83332V9.83332C6 9.85521 6.00431 9.87688 6.01268 9.8971C6.02106 9.91732 6.03334 9.9357 6.04881 9.95117C6.06429 9.96665 6.08266 9.97893 6.10288 9.9873C6.1231 9.99568 6.14478 9.99999 6.16666 9.99999H13.1667C13.2109 9.99999 13.2533 9.98243 13.2845 9.95117C13.3158 9.91992 13.3333 9.87753 13.3333 9.83332V2.83332C13.3333 2.78912 13.3158 2.74673 13.2845 2.71547C13.2533 2.68422 13.2109 2.66666 13.1667 2.66666H6.16666ZM10 12C10 11.8674 10.0527 11.7402 10.1464 11.6464C10.2402 11.5527 10.3674 11.5 10.5 11.5C10.6326 11.5 10.7598 11.5527 10.8536 11.6464C10.9473 11.7402 11 11.8674 11 12V13.1667C11 13.4761 10.8771 13.7728 10.6583 13.9916C10.4395 14.2104 10.1427 14.3333 9.83333 14.3333H2.83333C2.52391 14.3333 2.22717 14.2104 2.00837 13.9916C1.78958 13.7728 1.66666 13.4761 1.66666 13.1667V6.16666C1.66666 5.85724 1.78958 5.56049 2.00837 5.3417C2.22717 5.12291 2.52391 4.99999 2.83333 4.99999H4C4.13261 4.99999 4.25978 5.05267 4.35355 5.14644C4.44732 5.2402 4.5 5.36738 4.5 5.49999C4.5 5.6326 4.44732 5.75978 4.35355 5.85354C4.25978 5.94731 4.13261 5.99999 4 5.99999H2.83333C2.78913 5.99999 2.74674 6.01755 2.71548 6.04881C2.68422 6.08006 2.66666 6.12245 2.66666 6.16666V13.1667C2.66666 13.2109 2.68422 13.2533 2.71548 13.2845C2.74674 13.3158 2.78913 13.3333 2.83333 13.3333H9.83333C9.87753 13.3333 9.91993 13.3158 9.95118 13.2845C9.98244 13.2533 10 13.2109 10 13.1667V12Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_518_8403">\n <rect width="16" height="16" />\n </clipPath>\n </defs>\n </svg>\n </span>\n <span class=\'').concat(styles.icon, ' copy_success_flag\'>\n <svg\n width="1em"\n height="1em"\n shape-rendering="geometricPrecision"\n fill="currentColor"\n viewBox="0 0 12 7"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M11.2242 0.375687C11.4586 0.610002 11.4586 0.989901 11.2242 1.22422L4.82424 7.62422C4.58992 7.85853 4.21003 7.85853 3.97571 7.62422L0.775712 4.42422C0.541397 4.1899 0.541397 3.81 0.775712 3.57569C1.01003 3.34137 1.38993 3.34137 1.62424 3.57569L4.39998 6.35142L10.3757 0.375687C10.61 0.141373 10.9899 0.141373 11.2242 0.375687Z" />\n </svg>\n </span><span class="copyCode">复制代码</span></p><pre');
|
|
1938
1941
|
return text;
|
|
1939
1942
|
});
|
|
@@ -2126,12 +2129,33 @@ var CustomerService = function(props) {
|
|
|
2126
2129
|
/*#__PURE__*/ _jsxs("div", {
|
|
2127
2130
|
className: styles.content,
|
|
2128
2131
|
children: [
|
|
2129
|
-
/*#__PURE__*/ _jsx("p", {
|
|
2132
|
+
item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
|
|
2130
2133
|
dangerouslySetInnerHTML: {
|
|
2131
2134
|
__html: message
|
|
2132
2135
|
},
|
|
2133
2136
|
className: styles.content_child
|
|
2134
2137
|
}),
|
|
2138
|
+
item.message == "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsxs("p", {
|
|
2139
|
+
children: [
|
|
2140
|
+
"AI助手繁忙,请稍后再提问或",
|
|
2141
|
+
/*#__PURE__*/ _jsx("span", {
|
|
2142
|
+
className: styles.find_teacher_con,
|
|
2143
|
+
onClick: function() {
|
|
2144
|
+
var extraInfo = historyMessageList[i - 1].extraInfo;
|
|
2145
|
+
var url = "";
|
|
2146
|
+
if (extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value) {
|
|
2147
|
+
url = JSON.parse(extraInfo)[0].value;
|
|
2148
|
+
}
|
|
2149
|
+
setProblem({
|
|
2150
|
+
question: historyMessageList[i - 1].message,
|
|
2151
|
+
url: url
|
|
2152
|
+
});
|
|
2153
|
+
setShowTeacherList(true);
|
|
2154
|
+
},
|
|
2155
|
+
children: "召唤老师回答"
|
|
2156
|
+
})
|
|
2157
|
+
]
|
|
2158
|
+
}),
|
|
2135
2159
|
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2136
2160
|
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
2137
2161
|
children: [
|
|
@@ -3000,7 +3024,7 @@ var CustomerService = function(props) {
|
|
|
3000
3024
|
mask: false,
|
|
3001
3025
|
rootClassName: styles.service_ChatWindow_Drawer,
|
|
3002
3026
|
children: [
|
|
3003
|
-
showType == 1 && /*#__PURE__*/ _jsx("div", {
|
|
3027
|
+
showType == 1 && !showScreenshot && /*#__PURE__*/ _jsx("div", {
|
|
3004
3028
|
style: {
|
|
3005
3029
|
display: "".concat(showContacts && roomId != "" ? "block" : "none")
|
|
3006
3030
|
},
|