bhd-components 0.10.35 → 0.10.37
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/index.esm.es5.development.js +268 -146
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +93 -93
- package/dist/vendor.esm.es5.production.js +12 -12
- package/es2017/customerService/function.js +6 -3
- package/es2017/customerService/index.js +94 -50
- package/es2017/utils/Date.js +5 -1
- package/esm/customerService/function.js +6 -3
- package/esm/customerService/index.js +256 -137
- package/esm/utils/Date.js +4 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as
|
|
1
|
+
import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as __generator, v as MinusOutlined, w as PlusOutlined, L as LeftOutlined, R as RightOutlined, x as Input, y as SearchOutlined, B as Spin, D as CloseOutlined, X, E as I, H, F as html2canvas$1, G as r, J as Remarkable, K as Drawer, N as HighlightJS, O as cn, Z as ZoomInOutlined, Q as DatePicker, U as Button, V as l, W as Upload, Y as Popover, $ as DoubleRightOutlined, a0 as CloseCircleFilled, a1 as Divider, a2 as fetchEventSource } from './vendor.esm.es5.development.js';
|
|
2
2
|
export { a3 as Affix, a4 as Alert, a5 as Anchor, a as AntdMessage, A as App, a6 as AutoComplete, a7 as Avatar, a9 as BackTop, aa as Badge, ab as Breadcrumb, U as Button, ac as Calendar, ad as Card, ae as Carousel, af as Cascader, ag as Checkbox, ah as Col, ai as Collapse, Q as DatePicker, aj as Descriptions, a1 as Divider, K as Drawer, ak as Dropdown, al as Empty, a8 as FloatButton, am as Form, an as Grid, ao as Image, x as Input, ap as InputNumber, aq as Layout, ar as List, as as Mentions, at as Menu, M as Modal, au as Popconfirm, Y as Popover, av as Progress, aS as QRCode, aw as Radio, ax as Rate, ay as Result, az as Row, aA as Segmented, k as Select, aB as Skeleton, aC as Slider, aD as Space, B as Spin, aE as Statistic, aF as Steps, aG as Switch, aH as Tabs, aI as Tag, aK as TimePicker, aL as Timeline, T as Tooltip, aM as Tour, aN as Transfer, aO as Tree, aP as TreeSelect, aQ as Typography, W as Upload, aR as Watermark, aU as en_US, b as notification, aJ as theme, aT as version, z as zh_CN } from './vendor.esm.es5.development.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback, useMemo } from 'react';
|
|
@@ -2872,9 +2872,12 @@ var delegate = function(element, eventType, selector, callback) {
|
|
|
2872
2872
|
};
|
|
2873
2873
|
var formatDate = function(dateStr) {
|
|
2874
2874
|
var today = new Date();
|
|
2875
|
+
today.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
|
|
2875
2876
|
var date = new Date(dateStr);
|
|
2877
|
+
var cloneDate = new Date(dateStr);
|
|
2878
|
+
cloneDate.setHours(0, 0, 0, 0); // 将时间部分设为0,只比较日期
|
|
2876
2879
|
var isSameDay = today.getFullYear() === date.getFullYear() && today.getMonth() === date.getMonth() && today.getDate() === date.getDate();
|
|
2877
|
-
var dayDiff = Math.ceil((today -
|
|
2880
|
+
var dayDiff = Math.ceil((today - cloneDate) / (1000 * 60 * 60 * 24)); // 计算天数差
|
|
2878
2881
|
// 判断当前的日期 是否于传入的日期为同一天 同一天则显示时间 不是同一天则判断是否超过一周
|
|
2879
2882
|
// console.log(dayDiff,'dayDiffdayDiff',today,'___',date);
|
|
2880
2883
|
if (isSameDay) {
|
|
@@ -2882,7 +2885,7 @@ var formatDate = function(dateStr) {
|
|
|
2882
2885
|
return date.toLocaleTimeString("zh-CN", {
|
|
2883
2886
|
hour12: false
|
|
2884
2887
|
}).substring(0, 5);
|
|
2885
|
-
} else if (dayDiff
|
|
2888
|
+
} else if (dayDiff < 7) {
|
|
2886
2889
|
// 一周内
|
|
2887
2890
|
return date.toLocaleString("zh-CN", {
|
|
2888
2891
|
weekday: "short"
|
|
@@ -2937,7 +2940,7 @@ var removeMermaidBlockComments = function(markdownContent) {
|
|
|
2937
2940
|
var commentRegex = /(".*?"|'.*?')|(\/\*[\s\S]*?\*\/)|(\/\/.*?$)/gm;
|
|
2938
2941
|
var cleanContent = content.replace(commentRegex, function(m, stringPart) {
|
|
2939
2942
|
return stringPart || "";
|
|
2940
|
-
}).replace(/<br>/g, "");
|
|
2943
|
+
}).replace(/<br>/g, "").replace(/\\n/g, "");
|
|
2941
2944
|
// 拼接回完整代码块(保留 ```mermaid 和 ``` 标识)
|
|
2942
2945
|
return "".concat(prefix).concat(cleanContent).concat(suffix);
|
|
2943
2946
|
});
|
|
@@ -4072,6 +4075,10 @@ var TeacherList$1 = TeacherList;
|
|
|
4072
4075
|
|
|
4073
4076
|
var parseDate = function(dateStr) {
|
|
4074
4077
|
var date = new Date(dateStr); // 创建一个日期对象,表示当前时间
|
|
4078
|
+
// @ts-ignore
|
|
4079
|
+
if (date == "Invalid Date") {
|
|
4080
|
+
date = new Date();
|
|
4081
|
+
}
|
|
4075
4082
|
var year = date.getFullYear().toString(); // 获取年份
|
|
4076
4083
|
var month = String(date.getMonth() + 1).padStart(2, "0"); // 获取月份,并补齐两位数
|
|
4077
4084
|
var day = String(date.getDate()).padStart(2, "0"); // 获取日期,并补齐两位数
|
|
@@ -8959,100 +8966,176 @@ var CustomerService = function(props) {
|
|
|
8959
8966
|
});
|
|
8960
8967
|
};
|
|
8961
8968
|
//AI窗口,type:1发送打招呼信息欢迎语 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
8962
|
-
var sendGreetingMessage = function(
|
|
8963
|
-
var
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
return
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
{
|
|
8990
|
-
key: "messageSource",
|
|
8991
|
-
value: "knowledgebase"
|
|
8992
|
-
}
|
|
8993
|
-
]
|
|
8994
|
-
};
|
|
8995
|
-
} else if (type == 4) {
|
|
8996
|
-
obj = {
|
|
8997
|
-
roomId: roomId,
|
|
8998
|
-
sender: mid,
|
|
8999
|
-
recevier: "AI",
|
|
9000
|
-
message: keyWord,
|
|
9001
|
-
createdAt: getDataTime(-1),
|
|
9002
|
-
quotedMessage: citationContent.content,
|
|
9003
|
-
extraInfos: [
|
|
9004
|
-
{
|
|
9005
|
-
key: "messageSource",
|
|
9006
|
-
value: "knowledgebase"
|
|
9007
|
-
}
|
|
9008
|
-
]
|
|
9009
|
-
};
|
|
9010
|
-
} else if (type == 5) {
|
|
9011
|
-
obj = {
|
|
9012
|
-
roomId: roomId,
|
|
9013
|
-
sender: "AI",
|
|
9014
|
-
recevier: mid,
|
|
9015
|
-
message: "抱歉!您今日的提问量已经达到最大限额,请您明日再来提问。",
|
|
9016
|
-
createdAt: getDataTime(-1),
|
|
9017
|
-
quotedMessage: citationContent.content,
|
|
9018
|
-
extraInfos: [
|
|
9019
|
-
{
|
|
9020
|
-
key: "messageSource",
|
|
9021
|
-
value: "knowledgebase"
|
|
9022
|
-
}
|
|
9023
|
-
]
|
|
9024
|
-
};
|
|
9025
|
-
} else if (type == 6) {
|
|
9026
|
-
getAssociativeProblem();
|
|
9027
|
-
return;
|
|
9028
|
-
}
|
|
9029
|
-
setKeyWord("");
|
|
9030
|
-
setQuestionsList([]);
|
|
9031
|
-
setCitationContent({});
|
|
9032
|
-
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
9033
|
-
if (res.data.id) {
|
|
9034
|
-
if (pageNumHistory <= 1) {
|
|
9035
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
9036
|
-
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
9037
|
-
id: res.data.id,
|
|
9038
|
-
upvoted: false,
|
|
9039
|
-
downvoted: false,
|
|
9040
|
-
quotedMessage: "",
|
|
8969
|
+
var sendGreetingMessage = function() {
|
|
8970
|
+
var _ref = _async_to_generator(function(type) {
|
|
8971
|
+
var message, obj, imageUrl, base64;
|
|
8972
|
+
var _arguments = arguments;
|
|
8973
|
+
return __generator(this, function(_state) {
|
|
8974
|
+
switch(_state.label){
|
|
8975
|
+
case 0:
|
|
8976
|
+
message = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : "";
|
|
8977
|
+
obj = {};
|
|
8978
|
+
if (!(type == 1)) return [
|
|
8979
|
+
3,
|
|
8980
|
+
1
|
|
8981
|
+
];
|
|
8982
|
+
sendWelcomMessage();
|
|
8983
|
+
return [
|
|
8984
|
+
2
|
|
8985
|
+
];
|
|
8986
|
+
case 1:
|
|
8987
|
+
if (!(type == 2)) return [
|
|
8988
|
+
3,
|
|
8989
|
+
2
|
|
8990
|
+
];
|
|
8991
|
+
obj = {
|
|
8992
|
+
roomId: roomId,
|
|
8993
|
+
sender: "AI",
|
|
8994
|
+
recevier: mid,
|
|
8995
|
+
message: "您的点赞是我最大的鼓励!",
|
|
9041
8996
|
createdAt: getDataTime(-1),
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
8997
|
+
extraInfos: [
|
|
8998
|
+
{
|
|
8999
|
+
key: "messageSource",
|
|
9000
|
+
value: "knowledgebase"
|
|
9001
|
+
}
|
|
9002
|
+
]
|
|
9003
|
+
};
|
|
9004
|
+
return [
|
|
9005
|
+
3,
|
|
9006
|
+
7
|
|
9007
|
+
];
|
|
9008
|
+
case 2:
|
|
9009
|
+
if (!(type == 3)) return [
|
|
9010
|
+
3,
|
|
9011
|
+
3
|
|
9012
|
+
];
|
|
9013
|
+
obj = {
|
|
9014
|
+
roomId: roomId,
|
|
9015
|
+
sender: "AI",
|
|
9016
|
+
recevier: mid,
|
|
9017
|
+
message: "谢谢您的反馈,我会努力改进的!",
|
|
9018
|
+
createdAt: getDataTime(-1),
|
|
9019
|
+
extraInfos: [
|
|
9020
|
+
{
|
|
9021
|
+
key: "messageSource",
|
|
9022
|
+
value: "knowledgebase"
|
|
9023
|
+
}
|
|
9024
|
+
]
|
|
9025
|
+
};
|
|
9026
|
+
return [
|
|
9027
|
+
3,
|
|
9028
|
+
7
|
|
9029
|
+
];
|
|
9030
|
+
case 3:
|
|
9031
|
+
if (!(type == 4)) return [
|
|
9032
|
+
3,
|
|
9033
|
+
6
|
|
9034
|
+
];
|
|
9035
|
+
obj = {
|
|
9036
|
+
roomId: roomId,
|
|
9037
|
+
sender: mid,
|
|
9038
|
+
recevier: "AI",
|
|
9039
|
+
message: message ? message : keyWord,
|
|
9040
|
+
createdAt: getDataTime(-1),
|
|
9041
|
+
quotedMessage: citationContent.content,
|
|
9042
|
+
extraInfos: [
|
|
9043
|
+
{
|
|
9044
|
+
key: "messageSource",
|
|
9045
|
+
value: "knowledgebase"
|
|
9046
|
+
}
|
|
9047
|
+
]
|
|
9048
|
+
};
|
|
9049
|
+
imageUrl = "";
|
|
9050
|
+
if (!citationContent.imageUrl) return [
|
|
9051
|
+
3,
|
|
9052
|
+
5
|
|
9053
|
+
];
|
|
9054
|
+
return [
|
|
9055
|
+
4,
|
|
9056
|
+
urlToBase64(citationContent.imageUrl)
|
|
9057
|
+
];
|
|
9058
|
+
case 4:
|
|
9059
|
+
base64 = _state.sent();
|
|
9060
|
+
imageUrl = base64;
|
|
9061
|
+
_state.label = 5;
|
|
9062
|
+
case 5:
|
|
9063
|
+
if (screenshotBese64) {
|
|
9064
|
+
imageUrl = screenshotBese64;
|
|
9065
|
+
}
|
|
9066
|
+
console.log("imageUrl", imageUrl);
|
|
9067
|
+
if (imageUrl) {
|
|
9068
|
+
obj.image = imageUrl;
|
|
9069
|
+
obj.extraInfos.push({
|
|
9070
|
+
key: "imageUrl",
|
|
9071
|
+
value: imageUrl
|
|
9072
|
+
});
|
|
9073
|
+
}
|
|
9074
|
+
return [
|
|
9075
|
+
3,
|
|
9076
|
+
7
|
|
9077
|
+
];
|
|
9078
|
+
case 6:
|
|
9079
|
+
if (type == 5) {
|
|
9080
|
+
obj = {
|
|
9081
|
+
roomId: roomId,
|
|
9082
|
+
sender: "AI",
|
|
9083
|
+
recevier: mid,
|
|
9084
|
+
message: "抱歉!您今日的提问量已经达到最大限额,请您明日再来提问。",
|
|
9085
|
+
createdAt: getDataTime(-1),
|
|
9086
|
+
quotedMessage: citationContent.content,
|
|
9087
|
+
extraInfos: [
|
|
9088
|
+
{
|
|
9089
|
+
key: "messageSource",
|
|
9090
|
+
value: "knowledgebase"
|
|
9091
|
+
}
|
|
9092
|
+
]
|
|
9093
|
+
};
|
|
9094
|
+
} else if (type == 6) {
|
|
9095
|
+
getAssociativeProblem();
|
|
9096
|
+
return [
|
|
9097
|
+
2
|
|
9098
|
+
];
|
|
9099
|
+
}
|
|
9100
|
+
_state.label = 7;
|
|
9101
|
+
case 7:
|
|
9102
|
+
setKeyWord("");
|
|
9103
|
+
setQuestionsList([]);
|
|
9104
|
+
setCitationContent({});
|
|
9105
|
+
setScreenshotBese64("");
|
|
9106
|
+
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
9107
|
+
if (res.data.id) {
|
|
9108
|
+
if (pageNumHistory <= 1) {
|
|
9109
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
9110
|
+
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
9111
|
+
id: res.data.id,
|
|
9112
|
+
upvoted: false,
|
|
9113
|
+
downvoted: false,
|
|
9114
|
+
quotedMessage: "",
|
|
9115
|
+
createdAt: getDataTime(-1),
|
|
9116
|
+
extraInfo: JSON.stringify(obj.extraInfos)
|
|
9117
|
+
}));
|
|
9118
|
+
return newHistoryMessageList;
|
|
9119
|
+
});
|
|
9120
|
+
}
|
|
9121
|
+
scrollToBottom();
|
|
9122
|
+
if (type == 4) {
|
|
9123
|
+
sendGreetingMessage(6);
|
|
9124
|
+
}
|
|
9125
|
+
}
|
|
9126
|
+
}).catch(function(err) {
|
|
9127
|
+
console.log(err);
|
|
9128
|
+
});
|
|
9129
|
+
return [
|
|
9130
|
+
2
|
|
9131
|
+
];
|
|
9050
9132
|
}
|
|
9051
|
-
}
|
|
9052
|
-
}).catch(function(err) {
|
|
9053
|
-
console.log(err);
|
|
9133
|
+
});
|
|
9054
9134
|
});
|
|
9055
|
-
|
|
9135
|
+
return function sendGreetingMessage(type) {
|
|
9136
|
+
return _ref.apply(this, arguments);
|
|
9137
|
+
};
|
|
9138
|
+
}();
|
|
9056
9139
|
//消息发送给老师type == 1,召唤老师时发送,type == 2,在老师聊天窗口聊天
|
|
9057
9140
|
var sendToTeacher = function() {
|
|
9058
9141
|
var _ref = _async_to_generator(function(type) {
|
|
@@ -9432,7 +9515,7 @@ var CustomerService = function(props) {
|
|
|
9432
9515
|
roomId: roomId,
|
|
9433
9516
|
sender: "AI",
|
|
9434
9517
|
recevier: mid,
|
|
9435
|
-
message: "
|
|
9518
|
+
message: "正在思考...",
|
|
9436
9519
|
id: "123456",
|
|
9437
9520
|
createdAt: getDataTime(-1),
|
|
9438
9521
|
extraInfo: null
|
|
@@ -9446,7 +9529,7 @@ var CustomerService = function(props) {
|
|
|
9446
9529
|
roomId: roomId,
|
|
9447
9530
|
sender: "AI",
|
|
9448
9531
|
recevier: mid,
|
|
9449
|
-
message: "
|
|
9532
|
+
message: "正在思考...",
|
|
9450
9533
|
id: "123456",
|
|
9451
9534
|
createdAt: getDataTime(-1),
|
|
9452
9535
|
extraInfo: null
|
|
@@ -10555,6 +10638,12 @@ var CustomerService = function(props) {
|
|
|
10555
10638
|
var message = item.message;
|
|
10556
10639
|
var li;
|
|
10557
10640
|
// 是否需要显示日期
|
|
10641
|
+
// 判断是否第一项:
|
|
10642
|
+
// 如果是第一项显示日期+时间;
|
|
10643
|
+
//
|
|
10644
|
+
// 如果不是第一项:
|
|
10645
|
+
// 先判断是否跨天;如果跨天:就显示日期+时间;
|
|
10646
|
+
// 如果不跨天:判断是否超过10分钟,超过10分钟判断是否是当天,如果当天显示时间,不是当天就显示日期+时间;没超过10分钟不显示
|
|
10558
10647
|
var itemIndex = historyMessageList.findIndex(function(ite) {
|
|
10559
10648
|
return ite.id === item.id;
|
|
10560
10649
|
});
|
|
@@ -10566,16 +10655,30 @@ var CustomerService = function(props) {
|
|
|
10566
10655
|
} else {
|
|
10567
10656
|
//非第一项 与上一项进行对比
|
|
10568
10657
|
var beforeTime = historyMessageList[itemIndex - 1].createdAt;
|
|
10569
|
-
//判断与上一条数据 是否跨天
|
|
10570
10658
|
var beforeTimeObj = parseDate(beforeTime);
|
|
10659
|
+
// 上一条的日期
|
|
10571
10660
|
var beforeTimeStr = "".concat(beforeTimeObj.year, "-").concat(beforeTimeObj.month, "-").concat(beforeTimeObj.day);
|
|
10661
|
+
// 当前这条的日期
|
|
10572
10662
|
var curTimeStr = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day);
|
|
10663
|
+
var now = new Date();
|
|
10664
|
+
// 当天的日期
|
|
10665
|
+
var nowTimeStr = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, "0"), "-").concat(String(now.getDate()).padStart(2, "0"));
|
|
10666
|
+
//判断与上一条数据 是否跨天
|
|
10573
10667
|
if (beforeTimeStr !== curTimeStr) {
|
|
10668
|
+
// 跨天
|
|
10669
|
+
// 显示日期+时间
|
|
10574
10670
|
time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
10575
10671
|
} else {
|
|
10576
10672
|
//没有跨天 判断是否相隔超过10分钟
|
|
10577
10673
|
if (new Date(item.createdAt).valueOf() - new Date(beforeTime).valueOf() > 10 * 60 * 1000) {
|
|
10578
|
-
|
|
10674
|
+
//判断是否当天
|
|
10675
|
+
if (curTimeStr === nowTimeStr) {
|
|
10676
|
+
// 当天,显示时间
|
|
10677
|
+
time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
10678
|
+
} else {
|
|
10679
|
+
// 非当天,显示日期+时间
|
|
10680
|
+
time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
10681
|
+
}
|
|
10579
10682
|
}
|
|
10580
10683
|
}
|
|
10581
10684
|
}
|
|
@@ -10584,7 +10687,9 @@ var CustomerService = function(props) {
|
|
|
10584
10687
|
// let code = message.split("```");
|
|
10585
10688
|
// code = code[1];
|
|
10586
10689
|
// console.log(code,888888888);
|
|
10587
|
-
|
|
10690
|
+
if (finishedRef.current || i != historyMessageList.length - 1) {
|
|
10691
|
+
message = removeMermaidBlockComments(message);
|
|
10692
|
+
}
|
|
10588
10693
|
message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
|
|
10589
10694
|
if (lastId == item.id && keyWordProblem != "") {
|
|
10590
10695
|
//点击历史记录时,找到关键字,防止关键字和标签名重复
|
|
@@ -10684,17 +10789,23 @@ var CustomerService = function(props) {
|
|
|
10684
10789
|
},
|
|
10685
10790
|
className: styles.content_child
|
|
10686
10791
|
}),
|
|
10687
|
-
!item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)
|
|
10792
|
+
!item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo).find(function(x) {
|
|
10793
|
+
return x.key == "imageUrl";
|
|
10794
|
+
}) && /*#__PURE__*/ jsxs("p", {
|
|
10688
10795
|
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
10689
10796
|
children: [
|
|
10690
10797
|
/*#__PURE__*/ jsx("img", {
|
|
10691
|
-
src: JSON.parse(item.extraInfo)
|
|
10798
|
+
src: JSON.parse(item.extraInfo).find(function(x) {
|
|
10799
|
+
return x.key == "imageUrl";
|
|
10800
|
+
}).value
|
|
10692
10801
|
}),
|
|
10693
10802
|
/*#__PURE__*/ jsx("div", {
|
|
10694
10803
|
className: styles.mask_zoom,
|
|
10695
10804
|
children: /*#__PURE__*/ jsx(ZoomInOutlined, {
|
|
10696
10805
|
onClick: function() {
|
|
10697
|
-
setViewBase64(JSON.parse(item.extraInfo)
|
|
10806
|
+
setViewBase64(JSON.parse(item.extraInfo).find(function(x) {
|
|
10807
|
+
return x.key == "imageUrl";
|
|
10808
|
+
}).value);
|
|
10698
10809
|
setVisible(true);
|
|
10699
10810
|
}
|
|
10700
10811
|
})
|
|
@@ -10772,11 +10883,7 @@ var CustomerService = function(props) {
|
|
|
10772
10883
|
// console.log(chatWindow,'chatWindowchatWindow')
|
|
10773
10884
|
//是否在智能客服窗口
|
|
10774
10885
|
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
10775
|
-
|
|
10776
|
-
if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
10777
|
-
//使用AI头像
|
|
10778
|
-
header = 1;
|
|
10779
|
-
}
|
|
10886
|
+
if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") ;
|
|
10780
10887
|
li = /*#__PURE__*/ jsxs(Fragment, {
|
|
10781
10888
|
children: [
|
|
10782
10889
|
dataTime ? /*#__PURE__*/ jsx("li", {
|
|
@@ -10792,7 +10899,10 @@ var CustomerService = function(props) {
|
|
|
10792
10899
|
style: {
|
|
10793
10900
|
marginRight: "12px"
|
|
10794
10901
|
},
|
|
10795
|
-
children: isAiChatWindow ? item.extraInfo == null || header == 1
|
|
10902
|
+
children: isAiChatWindow ? // item.extraInfo == null || header == 1
|
|
10903
|
+
userData.modules.some(function(item) {
|
|
10904
|
+
return item.short == "AIservice";
|
|
10905
|
+
}) ? /*#__PURE__*/ jsx(CustomAiIcon$1, {}) : /*#__PURE__*/ jsx("img", {
|
|
10796
10906
|
src: knowledge_icon
|
|
10797
10907
|
}) : /*#__PURE__*/ jsx("img", {
|
|
10798
10908
|
src: headImg
|
|
@@ -10898,17 +11008,23 @@ var CustomerService = function(props) {
|
|
|
10898
11008
|
})
|
|
10899
11009
|
]
|
|
10900
11010
|
}),
|
|
10901
|
-
!item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)
|
|
11011
|
+
!item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo).find(function(x) {
|
|
11012
|
+
return x.key == "imageUrl";
|
|
11013
|
+
}) && /*#__PURE__*/ jsxs("p", {
|
|
10902
11014
|
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
10903
11015
|
children: [
|
|
10904
11016
|
/*#__PURE__*/ jsx("img", {
|
|
10905
|
-
src: JSON.parse(item.extraInfo)
|
|
11017
|
+
src: JSON.parse(item.extraInfo).find(function(x) {
|
|
11018
|
+
return x.key == "imageUrl";
|
|
11019
|
+
}).value
|
|
10906
11020
|
}),
|
|
10907
11021
|
/*#__PURE__*/ jsx("div", {
|
|
10908
11022
|
className: styles.mask_zoom,
|
|
10909
11023
|
children: /*#__PURE__*/ jsx(ZoomInOutlined, {
|
|
10910
11024
|
onClick: function() {
|
|
10911
|
-
setViewBase64(JSON.parse(item.extraInfo)
|
|
11025
|
+
setViewBase64(JSON.parse(item.extraInfo).find(function(x) {
|
|
11026
|
+
return x.key == "imageUrl";
|
|
11027
|
+
}).value);
|
|
10912
11028
|
setVisible(true);
|
|
10913
11029
|
}
|
|
10914
11030
|
})
|
|
@@ -11535,44 +11651,50 @@ var CustomerService = function(props) {
|
|
|
11535
11651
|
};
|
|
11536
11652
|
//发送截图信息
|
|
11537
11653
|
var sendScreenshotData = function(message) {
|
|
11538
|
-
if (
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11654
|
+
if (userData.modules.some(function(item) {
|
|
11655
|
+
return item.short == "AIservice";
|
|
11656
|
+
})) {
|
|
11657
|
+
if (contactsList.length > 0 && contactsList[0].roomId == roomId) {
|
|
11658
|
+
setKeyWord("");
|
|
11659
|
+
setCitationContent({});
|
|
11660
|
+
setBottomRecommendationQuestions([]);
|
|
11661
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
11662
|
+
var newHistoryMessageList = historyMessageList.concat({
|
|
11663
|
+
id: "p" + new Date().getTime(),
|
|
11664
|
+
roomId: roomId,
|
|
11665
|
+
sender: mid,
|
|
11666
|
+
recevier: "AI",
|
|
11667
|
+
message: message,
|
|
11668
|
+
createdAt: getDataTime(-1),
|
|
11669
|
+
extraInfo: JSON.stringify([
|
|
11670
|
+
{
|
|
11671
|
+
key: "imageUrl",
|
|
11672
|
+
value: screenshotBese64
|
|
11673
|
+
}
|
|
11674
|
+
])
|
|
11675
|
+
});
|
|
11676
|
+
return newHistoryMessageList;
|
|
11677
|
+
});
|
|
11678
|
+
//ai窗口
|
|
11679
|
+
aiSendQuestions(3, {
|
|
11680
|
+
//相关数据
|
|
11545
11681
|
roomId: roomId,
|
|
11546
|
-
sender: mid,
|
|
11547
|
-
recevier: "AI",
|
|
11548
11682
|
message: message,
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
}
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
//相关数据
|
|
11562
|
-
roomId: roomId,
|
|
11563
|
-
message: message,
|
|
11564
|
-
image: screenshotBese64,
|
|
11565
|
-
quotedMessage: citationContent.content || "",
|
|
11566
|
-
regenerate: citationContent.content != "" ? false : true,
|
|
11567
|
-
generateUpvoteOrDownvoteMessage: false
|
|
11568
|
-
}, 1);
|
|
11569
|
-
setScreenshotBese64("");
|
|
11683
|
+
image: screenshotBese64,
|
|
11684
|
+
quotedMessage: citationContent.content || "",
|
|
11685
|
+
regenerate: citationContent.content != "" ? false : true,
|
|
11686
|
+
generateUpvoteOrDownvoteMessage: false
|
|
11687
|
+
}, 1);
|
|
11688
|
+
setScreenshotBese64("");
|
|
11689
|
+
} else {
|
|
11690
|
+
//老师窗口
|
|
11691
|
+
sendToTeacher(3, message);
|
|
11692
|
+
}
|
|
11693
|
+
scrollToBottom();
|
|
11694
|
+
resettingBottomHei();
|
|
11570
11695
|
} else {
|
|
11571
|
-
|
|
11572
|
-
sendToTeacher(3, message);
|
|
11696
|
+
sendGreetingMessage(4, message);
|
|
11573
11697
|
}
|
|
11574
|
-
scrollToBottom();
|
|
11575
|
-
resettingBottomHei();
|
|
11576
11698
|
};
|
|
11577
11699
|
//渲染底部按钮
|
|
11578
11700
|
var renderBottomAnt = function() {
|