bhd-components 0.9.6 → 0.9.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/README.md +1 -1
- package/dist/index.esm.es5.development.css +1247 -1011
- package/dist/index.esm.es5.development.js +349 -180
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +1 -6
- package/dist/vendor.esm.es5.production.js +3 -3
- package/es2017/bhdAppLayout/index.js +7 -4
- package/es2017/customerService/index.js +178 -42
- package/es2017/customerService/index.module.less +101 -1
- package/es2017/customerService/index2.module.less +99 -1
- package/es2017/customerService/js-screen-shot/main.js +21 -4
- package/esm/bhdAppLayout/index.js +7 -4
- package/esm/customerService/index.js +304 -152
- package/esm/customerService/index.module.less +101 -1
- package/esm/customerService/index2.module.less +99 -1
- package/esm/customerService/js-screen-shot/main.js +23 -5
- package/package.json +1 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
1
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
4
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
4
5
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
6
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
5
7
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
|
|
6
8
|
import React, { useEffect, useState, useRef } from "react";
|
|
7
9
|
import { Modal, Drawer, Input, Tooltip } from "antd";
|
|
10
|
+
import message from "../message";
|
|
8
11
|
import ViewImage from "../viewImage";
|
|
9
12
|
import cssStyle from "./index.module.less";
|
|
10
13
|
import cssStyleOnline from "./index2.module.less";
|
|
@@ -102,6 +105,7 @@ var CustomerService = function(props) {
|
|
|
102
105
|
});
|
|
103
106
|
var _useState33 //1是 screenShotPlugin 2是html2canvas
|
|
104
107
|
= _sliced_to_array(useState(0), 2), screenShotType = _useState33[0], setScreenShotType = _useState33[1];
|
|
108
|
+
var screenShotPlugin = useRef();
|
|
105
109
|
useEffect(function() {
|
|
106
110
|
// if(config && config.type == 'video'){
|
|
107
111
|
// //获取热门推荐
|
|
@@ -121,7 +125,7 @@ var CustomerService = function(props) {
|
|
|
121
125
|
setScreenShotType(1);
|
|
122
126
|
console.log("看看变了没有1213133");
|
|
123
127
|
console.log("截图方式:【screenShotPlugin】", ScreenShot);
|
|
124
|
-
|
|
128
|
+
screenShotPlugin.current = new ScreenShot({
|
|
125
129
|
clickCutFullScreen: true,
|
|
126
130
|
enableWebRtc: true,
|
|
127
131
|
loadCrossImg: true,
|
|
@@ -149,13 +153,14 @@ var CustomerService = function(props) {
|
|
|
149
153
|
// base64
|
|
150
154
|
// );
|
|
151
155
|
setImgBese64(base64);
|
|
156
|
+
window.addEventListener("resize", cancelScreenshot);
|
|
152
157
|
},
|
|
153
158
|
triggerCallback: function() {
|
|
154
159
|
// 截图组件加载完毕调用此方法来完成框选区域的截图
|
|
155
|
-
|
|
160
|
+
screenShotPlugin.current.completeScreenshot();
|
|
156
161
|
},
|
|
157
162
|
cancelCallback: function(err) {
|
|
158
|
-
if (err.code === -1) {
|
|
163
|
+
if (err.code === -1 || err.code === -2) {
|
|
159
164
|
console.log(err);
|
|
160
165
|
newShowType.current = false;
|
|
161
166
|
if (saveShowType != -1) {
|
|
@@ -164,7 +169,9 @@ var CustomerService = function(props) {
|
|
|
164
169
|
setShowType(1);
|
|
165
170
|
}
|
|
166
171
|
setShowScreenshot(false);
|
|
167
|
-
|
|
172
|
+
if (err.code === -2) {
|
|
173
|
+
message.customError(err.msg);
|
|
174
|
+
}
|
|
168
175
|
}
|
|
169
176
|
}
|
|
170
177
|
});
|
|
@@ -226,6 +233,19 @@ var CustomerService = function(props) {
|
|
|
226
233
|
console.log(error);
|
|
227
234
|
}
|
|
228
235
|
};
|
|
236
|
+
var cancelScreenshot = function cancelScreenshot() {
|
|
237
|
+
console.log("cancelScreenshotcancelScreenshotcancelScreenshot");
|
|
238
|
+
newShowType.current = false;
|
|
239
|
+
if (saveShowType != -1) {
|
|
240
|
+
setShowType(saveShowType);
|
|
241
|
+
} else {
|
|
242
|
+
setShowType(1);
|
|
243
|
+
}
|
|
244
|
+
setShowScreenshot(false);
|
|
245
|
+
if (screenShotPlugin.current) {
|
|
246
|
+
screenShotPlugin.current.destroyComponents();
|
|
247
|
+
}
|
|
248
|
+
};
|
|
229
249
|
var handleScroll = function handleScroll() {
|
|
230
250
|
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
231
251
|
var scrollTop = container.scrollTop;
|
|
@@ -292,6 +312,7 @@ var CustomerService = function(props) {
|
|
|
292
312
|
content.removeEventListener("scroll", handleScroll);
|
|
293
313
|
}
|
|
294
314
|
window.removeEventListener("resize", handlerHtml2canvas);
|
|
315
|
+
window.removeEventListener("resize", cancelScreenshot);
|
|
295
316
|
};
|
|
296
317
|
}, [
|
|
297
318
|
historyMessageList,
|
|
@@ -696,6 +717,9 @@ var CustomerService = function(props) {
|
|
|
696
717
|
message: type == 2 ? keyWord : message,
|
|
697
718
|
quotedMessage: citationContent.content || ""
|
|
698
719
|
};
|
|
720
|
+
if (citationContent.imageUrl) {
|
|
721
|
+
obj.image = citationContent.imageUrl;
|
|
722
|
+
}
|
|
699
723
|
if (screenshotBese64) {
|
|
700
724
|
obj.image = screenshotBese64;
|
|
701
725
|
setScreenshotBese64("");
|
|
@@ -744,121 +768,142 @@ var CustomerService = function(props) {
|
|
|
744
768
|
});
|
|
745
769
|
};
|
|
746
770
|
//发送知识库问题 item,flag == 1 是获取问候信息的答案,flag == 2 是普通消息,flag == 3 是针对视频页面点击底部推荐问题
|
|
747
|
-
var sendMessage = function(
|
|
748
|
-
var
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
item
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
generateUpvoteOrDownvoteMessage: false
|
|
770
|
-
};
|
|
771
|
-
if (pageNumHistory <= 1) {
|
|
772
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
773
|
-
var newHistoryMessageList = historyMessageList.concat({
|
|
771
|
+
var sendMessage = function() {
|
|
772
|
+
var _ref = _async_to_generator(function(item, flag) {
|
|
773
|
+
var type, questions, sendData, obj, sendData1, imageUrl;
|
|
774
|
+
var _arguments = arguments;
|
|
775
|
+
return _ts_generator(this, function(_state) {
|
|
776
|
+
type = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : "";
|
|
777
|
+
console.log(item, flag, 888888888);
|
|
778
|
+
questions = [];
|
|
779
|
+
if (item && flag) {
|
|
780
|
+
questions = [
|
|
781
|
+
item
|
|
782
|
+
];
|
|
783
|
+
}
|
|
784
|
+
//点击知识库的问题,或者是点击问候消息
|
|
785
|
+
if (questions.length > 0) {
|
|
786
|
+
questions = questions[0];
|
|
787
|
+
//知识库联想的问题没有答案
|
|
788
|
+
if (!questions.answer && userData.modules.some(function(item) {
|
|
789
|
+
return item.short == "AIservice";
|
|
790
|
+
})) {
|
|
791
|
+
sendData = {
|
|
792
|
+
//相关数据
|
|
774
793
|
roomId: roomId,
|
|
775
|
-
sender: mid,
|
|
776
|
-
recevier: "AI",
|
|
777
794
|
message: questions.question,
|
|
778
795
|
quotedMessage: "",
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
796
|
+
regenerate: true,
|
|
797
|
+
generateUpvoteOrDownvoteMessage: false
|
|
798
|
+
};
|
|
799
|
+
if (pageNumHistory <= 1) {
|
|
800
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
801
|
+
var newHistoryMessageList = historyMessageList.concat({
|
|
802
|
+
roomId: roomId,
|
|
803
|
+
sender: mid,
|
|
804
|
+
recevier: "AI",
|
|
805
|
+
message: questions.question,
|
|
806
|
+
quotedMessage: "",
|
|
807
|
+
id: "p" + new Date().getTime(),
|
|
808
|
+
upvoted: false,
|
|
809
|
+
downvoted: false,
|
|
810
|
+
createdAt: getDataTime(-1),
|
|
811
|
+
extraInfo: JSON.stringify([])
|
|
812
|
+
});
|
|
813
|
+
return newHistoryMessageList;
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
setFinished(false);
|
|
817
|
+
aiSendQuestions(3, sendData, 1);
|
|
818
|
+
return [
|
|
819
|
+
2
|
|
820
|
+
];
|
|
803
821
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
//发送问题 1 类型,发送问题需要的参数,问题的答案id等
|
|
807
|
-
sendingExistingIssues(1, obj, {
|
|
808
|
-
key: "questionId",
|
|
809
|
-
value: flag == 1 ? questions.value : questions.id,
|
|
810
|
-
answer: questions.answer
|
|
811
|
-
}, type);
|
|
812
|
-
setKeyWord("");
|
|
813
|
-
setQuestionsList([]);
|
|
814
|
-
setCitationContent({});
|
|
815
|
-
} else if (userData.modules.some(function(item) {
|
|
816
|
-
return item.short == "AIservice";
|
|
817
|
-
})) {
|
|
818
|
-
var sendData1 = {
|
|
819
|
-
//相关数据
|
|
820
|
-
roomId: roomId,
|
|
821
|
-
message: keyWord,
|
|
822
|
-
quotedMessage: citationContent.content || "",
|
|
823
|
-
regenerate: citationContent.content != "" ? false : true,
|
|
824
|
-
generateUpvoteOrDownvoteMessage: false
|
|
825
|
-
};
|
|
826
|
-
var imageUrl = "";
|
|
827
|
-
if (screenshotBese64) {
|
|
828
|
-
sendData1.image = screenshotBese64;
|
|
829
|
-
imageUrl = screenshotBese64;
|
|
830
|
-
}
|
|
831
|
-
if (pageNumHistory <= 1) {
|
|
832
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
833
|
-
var newHistoryMessageList = historyMessageList.concat({
|
|
822
|
+
console.log(questions, "知识库内容11111");
|
|
823
|
+
obj = {
|
|
834
824
|
roomId: roomId,
|
|
835
825
|
sender: mid,
|
|
836
826
|
recevier: "AI",
|
|
837
|
-
message:
|
|
838
|
-
|
|
839
|
-
id: "p" + new Date().getTime(),
|
|
840
|
-
upvoted: false,
|
|
841
|
-
downvoted: false,
|
|
842
|
-
createdAt: getDataTime(-1),
|
|
843
|
-
extraInfo: imageUrl ? JSON.stringify([
|
|
827
|
+
message: questions.question,
|
|
828
|
+
extraInfos: [
|
|
844
829
|
{
|
|
845
|
-
key: "
|
|
846
|
-
value:
|
|
830
|
+
key: "questionId",
|
|
831
|
+
value: flag == 1 ? questions.value : questions.id
|
|
847
832
|
}
|
|
848
|
-
]
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
833
|
+
]
|
|
834
|
+
};
|
|
835
|
+
//发送问题 1 类型,发送问题需要的参数,问题的答案id等
|
|
836
|
+
sendingExistingIssues(1, obj, {
|
|
837
|
+
key: "questionId",
|
|
838
|
+
value: flag == 1 ? questions.value : questions.id,
|
|
839
|
+
answer: questions.answer
|
|
840
|
+
}, type);
|
|
841
|
+
setKeyWord("");
|
|
842
|
+
setQuestionsList([]);
|
|
843
|
+
setCitationContent({});
|
|
844
|
+
} else if (userData.modules.some(function(item) {
|
|
845
|
+
return item.short == "AIservice";
|
|
846
|
+
})) {
|
|
847
|
+
console.log("citationContent", citationContent);
|
|
848
|
+
sendData1 = {
|
|
849
|
+
//相关数据
|
|
850
|
+
roomId: roomId,
|
|
851
|
+
message: keyWord,
|
|
852
|
+
quotedMessage: citationContent.content || "",
|
|
853
|
+
regenerate: citationContent.content != "" ? false : true,
|
|
854
|
+
generateUpvoteOrDownvoteMessage: false
|
|
855
|
+
};
|
|
856
|
+
imageUrl = "";
|
|
857
|
+
if (citationContent.imageUrl) {
|
|
858
|
+
// let base64:string=await urlToBase64(citationContent.imageUrl) as string
|
|
859
|
+
console.log("citationContent.imageUrl", citationContent.imageUrl);
|
|
860
|
+
sendData1.image = citationContent.imageUrl;
|
|
861
|
+
imageUrl = citationContent.imageUrl;
|
|
862
|
+
}
|
|
863
|
+
if (screenshotBese64) {
|
|
864
|
+
console.log("screenshotBese64", screenshotBese64);
|
|
865
|
+
sendData1.image = screenshotBese64;
|
|
866
|
+
imageUrl = screenshotBese64;
|
|
867
|
+
}
|
|
868
|
+
if (pageNumHistory <= 1) {
|
|
869
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
870
|
+
var newHistoryMessageList = historyMessageList.concat({
|
|
871
|
+
roomId: roomId,
|
|
872
|
+
sender: mid,
|
|
873
|
+
recevier: "AI",
|
|
874
|
+
message: keyWord,
|
|
875
|
+
quotedMessage: citationContent.content,
|
|
876
|
+
id: "p" + new Date().getTime(),
|
|
877
|
+
upvoted: false,
|
|
878
|
+
downvoted: false,
|
|
879
|
+
createdAt: getDataTime(-1),
|
|
880
|
+
extraInfo: imageUrl ? JSON.stringify([
|
|
881
|
+
{
|
|
882
|
+
key: "imageUrl",
|
|
883
|
+
value: imageUrl
|
|
884
|
+
}
|
|
885
|
+
]) : JSON.stringify([])
|
|
886
|
+
});
|
|
887
|
+
return newHistoryMessageList;
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
setFinished(false);
|
|
891
|
+
aiSendQuestions(3, sendData1, 1);
|
|
892
|
+
setScreenshotBese64("");
|
|
893
|
+
//存在AI客服
|
|
894
|
+
} else {
|
|
895
|
+
//不存在AI客服
|
|
896
|
+
sendGreetingMessage(4);
|
|
897
|
+
}
|
|
898
|
+
return [
|
|
899
|
+
2
|
|
900
|
+
];
|
|
901
|
+
});
|
|
902
|
+
});
|
|
903
|
+
return function sendMessage(item, flag) {
|
|
904
|
+
return _ref.apply(this, arguments);
|
|
905
|
+
};
|
|
906
|
+
}();
|
|
862
907
|
//向知识库发送问题 或答案 type:1 发送问题 2 接受答案
|
|
863
908
|
var sendingExistingIssues = function(type, obj, questions, problemType) {
|
|
864
909
|
if (pageNumHistory <= 1) {
|
|
@@ -1102,7 +1147,7 @@ var CustomerService = function(props) {
|
|
|
1102
1147
|
},
|
|
1103
1148
|
onmessage: function onmessage(event) {
|
|
1104
1149
|
//识别的内容
|
|
1105
|
-
|
|
1150
|
+
console.log("eventSource msg: ", event.data);
|
|
1106
1151
|
var msg = JSON.parse(event.data);
|
|
1107
1152
|
if (msg.message) {
|
|
1108
1153
|
content = content + msg.message;
|
|
@@ -1136,13 +1181,18 @@ var CustomerService = function(props) {
|
|
|
1136
1181
|
};
|
|
1137
1182
|
//渲染AI回答
|
|
1138
1183
|
var renderAiAnswer = function(msg, message_id, type) {
|
|
1184
|
+
console.log("renderAiAnswer", {
|
|
1185
|
+
msg: msg,
|
|
1186
|
+
message_id: message_id,
|
|
1187
|
+
type: type
|
|
1188
|
+
});
|
|
1139
1189
|
// console.log(pageNumHistory,5555555);
|
|
1140
1190
|
// console.log(aiSendQuestions().abort(),'slkdsdsdsd')
|
|
1141
1191
|
if (pageNumHistory > 1) return;
|
|
1142
1192
|
var obj = msg;
|
|
1143
1193
|
var id = msg.messageId;
|
|
1144
|
-
setHistoryMessageList(function(
|
|
1145
|
-
var list1 =
|
|
1194
|
+
setHistoryMessageList(function(prevHistoryMessageList) {
|
|
1195
|
+
var list1 = prevHistoryMessageList;
|
|
1146
1196
|
//删除临时数据
|
|
1147
1197
|
list1 = list1.filter(function(item) {
|
|
1148
1198
|
return item.id != "123456";
|
|
@@ -1153,9 +1203,13 @@ var CustomerService = function(props) {
|
|
|
1153
1203
|
return item.id != message_id;
|
|
1154
1204
|
});
|
|
1155
1205
|
}
|
|
1156
|
-
var list =
|
|
1206
|
+
var list = prevHistoryMessageList.filter(function(item) {
|
|
1157
1207
|
return item.id == id;
|
|
1158
1208
|
});
|
|
1209
|
+
console.log("renderAiAnswer", {
|
|
1210
|
+
list1: list1,
|
|
1211
|
+
list: list
|
|
1212
|
+
});
|
|
1159
1213
|
var message = "";
|
|
1160
1214
|
if (list.length == 0) {
|
|
1161
1215
|
message = obj.message;
|
|
@@ -1204,6 +1258,7 @@ var CustomerService = function(props) {
|
|
|
1204
1258
|
return newHistoryMessageList2;
|
|
1205
1259
|
}
|
|
1206
1260
|
});
|
|
1261
|
+
console.log("historyMessageList", historyMessageList);
|
|
1207
1262
|
if (isPosition.current) {
|
|
1208
1263
|
scrollToBottom();
|
|
1209
1264
|
}
|
|
@@ -2084,7 +2139,7 @@ var CustomerService = function(props) {
|
|
|
2084
2139
|
setCitationContent({
|
|
2085
2140
|
content: item.message,
|
|
2086
2141
|
id: item.id,
|
|
2087
|
-
imageUrl: item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
|
|
2142
|
+
imageUrl: !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
|
|
2088
2143
|
});
|
|
2089
2144
|
resettingBottomHei();
|
|
2090
2145
|
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
@@ -2131,7 +2186,7 @@ var CustomerService = function(props) {
|
|
|
2131
2186
|
},
|
|
2132
2187
|
className: styles.content_child
|
|
2133
2188
|
}),
|
|
2134
|
-
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2189
|
+
!item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2135
2190
|
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
2136
2191
|
children: [
|
|
2137
2192
|
/*#__PURE__*/ _jsx("img", {
|
|
@@ -2153,22 +2208,41 @@ var CustomerService = function(props) {
|
|
|
2153
2208
|
]
|
|
2154
2209
|
}),
|
|
2155
2210
|
//引用消息
|
|
2156
|
-
item.quotedMessage && /*#__PURE__*/
|
|
2211
|
+
item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
|
|
2157
2212
|
className: styles.citation_content,
|
|
2158
|
-
children:
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2213
|
+
children: [
|
|
2214
|
+
getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
2215
|
+
overlayClassName: styles.popover_main_content,
|
|
2216
|
+
title: item.quotedMessage,
|
|
2217
|
+
placement: "leftTop",
|
|
2218
|
+
children: /*#__PURE__*/ _jsxs("p", {
|
|
2219
|
+
className: styles.text_exceed,
|
|
2220
|
+
children: [
|
|
2221
|
+
item.quotedMessage,
|
|
2222
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
2223
|
+
]
|
|
2224
|
+
})
|
|
2225
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
2226
|
+
children: item.quotedMessage
|
|
2227
|
+
}),
|
|
2228
|
+
item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2229
|
+
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
2164
2230
|
children: [
|
|
2165
|
-
|
|
2166
|
-
|
|
2231
|
+
/*#__PURE__*/ _jsx("img", {
|
|
2232
|
+
src: JSON.parse(item.extraInfo)[0].value
|
|
2233
|
+
}),
|
|
2234
|
+
/*#__PURE__*/ _jsx("div", {
|
|
2235
|
+
className: styles.mask_zoom,
|
|
2236
|
+
children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
|
|
2237
|
+
onClick: function() {
|
|
2238
|
+
setViewBase64(JSON.parse(item.extraInfo)[0].value);
|
|
2239
|
+
setVisible(true);
|
|
2240
|
+
}
|
|
2241
|
+
})
|
|
2242
|
+
})
|
|
2167
2243
|
]
|
|
2168
2244
|
})
|
|
2169
|
-
|
|
2170
|
-
children: item.quotedMessage
|
|
2171
|
-
})
|
|
2245
|
+
]
|
|
2172
2246
|
})
|
|
2173
2247
|
]
|
|
2174
2248
|
})
|
|
@@ -2213,7 +2287,7 @@ var CustomerService = function(props) {
|
|
|
2213
2287
|
}) : "",
|
|
2214
2288
|
/*#__PURE__*/ _jsxs("li", {
|
|
2215
2289
|
className: styles.right,
|
|
2216
|
-
id: lastId == item.id ? "li_flag" :
|
|
2290
|
+
id: lastId == item.id ? "li_flag" : item.id,
|
|
2217
2291
|
children: [
|
|
2218
2292
|
(showType == 2 || showType == 4) && /*#__PURE__*/ _jsx("div", {
|
|
2219
2293
|
className: styles.head_sculpture,
|
|
@@ -2233,9 +2307,34 @@ var CustomerService = function(props) {
|
|
|
2233
2307
|
children: [
|
|
2234
2308
|
/*#__PURE__*/ _jsxs("div", {
|
|
2235
2309
|
className: styles.main_content_flag,
|
|
2310
|
+
onMouseEnter: function() {
|
|
2311
|
+
var dom = document.getElementById(item.id);
|
|
2312
|
+
if (dom) {
|
|
2313
|
+
var con_h = document.getElementById("chat_content").clientHeight - 24; //滚动区域的高度
|
|
2314
|
+
var rectY = dom.getBoundingClientRect().y - 48;
|
|
2315
|
+
var h = dom.clientHeight; //当前元素高度
|
|
2316
|
+
var topDom = dom.getElementsByClassName("operate_modal_showtop")[0];
|
|
2317
|
+
var bottomDom = dom.getElementsByClassName("operate_modal_showbottom")[0];
|
|
2318
|
+
if (topDom && bottomDom) {
|
|
2319
|
+
// console.log(h,dom.getBoundingClientRect().y,rectY)
|
|
2320
|
+
if (rectY > 0) {
|
|
2321
|
+
topDom.style.cssText = "";
|
|
2322
|
+
bottomDom.style.cssText = "visibility: hidden;";
|
|
2323
|
+
// 上下都能显示时,显示到下边
|
|
2324
|
+
if (h < con_h - rectY) {
|
|
2325
|
+
topDom.style.cssText = "visibility: hidden;";
|
|
2326
|
+
bottomDom.style.cssText = "";
|
|
2327
|
+
}
|
|
2328
|
+
} else {
|
|
2329
|
+
topDom.style.cssText = "visibility: hidden;";
|
|
2330
|
+
bottomDom.style.cssText = "";
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
},
|
|
2236
2335
|
children: [
|
|
2237
2336
|
/*#__PURE__*/ _jsx("div", {
|
|
2238
|
-
className: styles.operate_modal,
|
|
2337
|
+
className: "".concat(styles.operate_modal, " operate_modal_showtop"),
|
|
2239
2338
|
children: // 不是最后一行,
|
|
2240
2339
|
historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
|
|
2241
2340
|
}),
|
|
@@ -2315,26 +2414,50 @@ var CustomerService = function(props) {
|
|
|
2315
2414
|
//findTeacher//是否在召唤老师过程中,是否是最后一条消息
|
|
2316
2415
|
!item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i)
|
|
2317
2416
|
]
|
|
2417
|
+
}),
|
|
2418
|
+
historyMessageList.length - 1 !== i && /*#__PURE__*/ _jsx("div", {
|
|
2419
|
+
className: "".concat(styles.operate_modal, " ").concat(styles.bottom, " operate_modal_showbottom"),
|
|
2420
|
+
children: // 不是最后一行,
|
|
2421
|
+
renderOperateBtn(item, isAiChatWindow, i)
|
|
2318
2422
|
})
|
|
2319
2423
|
]
|
|
2320
2424
|
}),
|
|
2321
2425
|
//引用消息
|
|
2322
|
-
item.quotedMessage && /*#__PURE__*/
|
|
2426
|
+
item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
|
|
2323
2427
|
className: styles.citation_content,
|
|
2324
|
-
children:
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2428
|
+
children: [
|
|
2429
|
+
getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
2430
|
+
overlayClassName: styles.popover_main_content,
|
|
2431
|
+
title: item.quotedMessage,
|
|
2432
|
+
placement: "rightTop",
|
|
2433
|
+
children: /*#__PURE__*/ _jsxs("p", {
|
|
2434
|
+
className: styles.text_exceed,
|
|
2435
|
+
children: [
|
|
2436
|
+
item.quotedMessage,
|
|
2437
|
+
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
2438
|
+
]
|
|
2439
|
+
})
|
|
2440
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
2441
|
+
children: item.quotedMessage
|
|
2442
|
+
}),
|
|
2443
|
+
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2444
|
+
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
2330
2445
|
children: [
|
|
2331
|
-
|
|
2332
|
-
|
|
2446
|
+
/*#__PURE__*/ _jsx("img", {
|
|
2447
|
+
src: JSON.parse(item.extraInfo)[0].value
|
|
2448
|
+
}),
|
|
2449
|
+
/*#__PURE__*/ _jsx("div", {
|
|
2450
|
+
className: styles.mask_zoom,
|
|
2451
|
+
children: /*#__PURE__*/ _jsx(ZoomInOutlined, {
|
|
2452
|
+
onClick: function() {
|
|
2453
|
+
setViewBase64(JSON.parse(item.extraInfo)[0].value);
|
|
2454
|
+
setVisible(true);
|
|
2455
|
+
}
|
|
2456
|
+
})
|
|
2457
|
+
})
|
|
2333
2458
|
]
|
|
2334
2459
|
})
|
|
2335
|
-
|
|
2336
|
-
children: item.quotedMessage
|
|
2337
|
-
})
|
|
2460
|
+
]
|
|
2338
2461
|
})
|
|
2339
2462
|
]
|
|
2340
2463
|
})
|
|
@@ -2387,6 +2510,7 @@ var CustomerService = function(props) {
|
|
|
2387
2510
|
onClick: function() {
|
|
2388
2511
|
setCitationContent({
|
|
2389
2512
|
content: item.message,
|
|
2513
|
+
imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
|
|
2390
2514
|
id: item.id
|
|
2391
2515
|
});
|
|
2392
2516
|
resettingBottomHei();
|
|
@@ -2589,6 +2713,7 @@ var CustomerService = function(props) {
|
|
|
2589
2713
|
onClick: function() {
|
|
2590
2714
|
setCitationContent({
|
|
2591
2715
|
content: item.message,
|
|
2716
|
+
imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
|
|
2592
2717
|
id: item.id
|
|
2593
2718
|
});
|
|
2594
2719
|
resettingBottomHei();
|
|
@@ -2685,10 +2810,7 @@ var CustomerService = function(props) {
|
|
|
2685
2810
|
};
|
|
2686
2811
|
//保存粘贴的图片
|
|
2687
2812
|
var handleFilePaste = function(e) {
|
|
2688
|
-
|
|
2689
|
-
var items = e.clipboardData.items;
|
|
2690
|
-
// console.log(e,items,3333333)
|
|
2691
|
-
for(var i = 0; i < items.length; i++){
|
|
2813
|
+
var _loop = function(i) {
|
|
2692
2814
|
var item = items[i];
|
|
2693
2815
|
if (item.kind === "file") {
|
|
2694
2816
|
var file = item.getAsFile();
|
|
@@ -2710,8 +2832,27 @@ var CustomerService = function(props) {
|
|
|
2710
2832
|
var pastedText = clipboardData.getData("text");
|
|
2711
2833
|
var con = keyWord + pastedText;
|
|
2712
2834
|
setKeyWord(con);
|
|
2835
|
+
if (con == "") {
|
|
2836
|
+
setQuestionsList([]);
|
|
2837
|
+
clearTimeout(timer.current);
|
|
2838
|
+
} else {
|
|
2839
|
+
clearTimeout(timer.current);
|
|
2840
|
+
timer.current = setTimeout(function() {
|
|
2841
|
+
if (config && config.type == "video") {
|
|
2842
|
+
getQuestiionsList(String(con), 3);
|
|
2843
|
+
} else {
|
|
2844
|
+
getQuestiionsList(String(con), 2);
|
|
2845
|
+
}
|
|
2846
|
+
}, 1000);
|
|
2847
|
+
}
|
|
2848
|
+
setBottomRecommendationQuestions([]);
|
|
2849
|
+
resettingBottomHei();
|
|
2713
2850
|
}
|
|
2714
|
-
}
|
|
2851
|
+
};
|
|
2852
|
+
e.preventDefault();
|
|
2853
|
+
var items = e.clipboardData.items;
|
|
2854
|
+
// console.log(e,items,3333333)
|
|
2855
|
+
for(var i = 0; i < items.length; i++)_loop(i);
|
|
2715
2856
|
};
|
|
2716
2857
|
//发送截图信息
|
|
2717
2858
|
var sendScreenshotData = function(message) {
|
|
@@ -2897,13 +3038,24 @@ var CustomerService = function(props) {
|
|
|
2897
3038
|
citationContent.content && /*#__PURE__*/ _jsxs("div", {
|
|
2898
3039
|
className: styles.content_main,
|
|
2899
3040
|
children: [
|
|
2900
|
-
/*#__PURE__*/
|
|
3041
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
2901
3042
|
className: styles.content_con,
|
|
2902
|
-
children:
|
|
2903
|
-
|
|
2904
|
-
children:
|
|
3043
|
+
children: [
|
|
3044
|
+
/*#__PURE__*/ _jsx("p", {
|
|
3045
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
3046
|
+
children: citationContent.content
|
|
3047
|
+
})
|
|
3048
|
+
}),
|
|
3049
|
+
citationContent.imageUrl && /*#__PURE__*/ _jsx("p", {
|
|
3050
|
+
children: /*#__PURE__*/ _jsx("img", {
|
|
3051
|
+
src: citationContent.imageUrl,
|
|
3052
|
+
onClick: function() {
|
|
3053
|
+
setViewBase64(citationContent.imageUrl);
|
|
3054
|
+
setVisible(true);
|
|
3055
|
+
}
|
|
3056
|
+
})
|
|
2905
3057
|
})
|
|
2906
|
-
|
|
3058
|
+
]
|
|
2907
3059
|
}),
|
|
2908
3060
|
/*#__PURE__*/ _jsx("i", {
|
|
2909
3061
|
className: styles.delete_quote,
|