bhd-components 0.7.13 → 0.7.15
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/{75d9e8b4.esm.es5.development.js → 954539dd.esm.es5.development.js} +1 -1
- package/dist/{1c455680.esm.es5.production.js → f6061320.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.css +1032 -1018
- package/dist/index.esm.es5.development.js +156 -48
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/index.js +152 -44
- package/es2017/customerService/index2.module.less +38 -27
- package/esm/customerService/index.js +154 -46
- package/esm/customerService/index2.module.less +38 -27
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, X, y as I, H, A as Remarkable, D as Drawer, B as HighlightJS, Z as ZoomInOutlined, F as _to_consumable_array } from './
|
|
2
|
-
export { G as Affix, J as Alert, K as Anchor, aF as App, N as AutoComplete, O as Avatar, U as BackTop, V as Badge, W as Breadcrumb, Y as Button, $ as Calendar, a0 as Card, a1 as Carousel, a2 as Cascader, a3 as Checkbox, a4 as Col, a5 as Collapse, a6 as DatePicker, a7 as Descriptions, a8 as Divider, D as Drawer, a9 as Dropdown, aa as Empty, Q as FloatButton, ab as Form, ac as Grid, ad as Image, v as Input, ae as InputNumber, af as Layout, ag as List, ah as Mentions, ai as Menu, M as Modal, ak as Popconfirm, al as Popover, am as Progress, aM as QRCode, an as Radio, ao as Rate, ap as Result, aq as Row, ar as Segmented, g as Select, as as Skeleton, at as Slider, au as Space, av as Spin, aw as Statistic, ax as Steps, ay as Switch, az as Tabs, aA as Tag, aC as TimePicker, aD as Timeline, T as Tooltip, aE as Tour, aG as Transfer, aH as Tree, aI as TreeSelect, aJ as Typography, aK as Upload, aL as Watermark, aO as en_US, aj as notification, aB as theme, aN as version, z as zh_CN } from './
|
|
1
|
+
import { z as zhCN, C as ConfigProvider, _ as _extends, a as _object_destructuring_empty, j as jsx, b as _object_spread_props, S as StyleProvider, t as transform, c as _object_spread, d as _sliced_to_array, T as Tooltip, e as Table$2, I as Icon, f as jsxs, m as message, E as ExclamationCircleFilled, P as Pagination, g as Select, h as CaretDownOutlined, M as Modal, i as _inherits, k as _create_super, l as _create_class, n as _class_call_check, o as _define_property, p as _assert_this_initialized, q as _async_to_generator, L as LeftOutlined, R as RightOutlined, r as MinusOutlined, s as PlusOutlined, u as __generator, v as Input, w as SearchOutlined, x as CloseOutlined, X, y as I, H, A as Remarkable, D as Drawer, B as HighlightJS, Z as ZoomInOutlined, F as _to_consumable_array } from './954539dd.esm.es5.development.js';
|
|
2
|
+
export { G as Affix, J as Alert, K as Anchor, aF as App, N as AutoComplete, O as Avatar, U as BackTop, V as Badge, W as Breadcrumb, Y as Button, $ as Calendar, a0 as Card, a1 as Carousel, a2 as Cascader, a3 as Checkbox, a4 as Col, a5 as Collapse, a6 as DatePicker, a7 as Descriptions, a8 as Divider, D as Drawer, a9 as Dropdown, aa as Empty, Q as FloatButton, ab as Form, ac as Grid, ad as Image, v as Input, ae as InputNumber, af as Layout, ag as List, ah as Mentions, ai as Menu, M as Modal, ak as Popconfirm, al as Popover, am as Progress, aM as QRCode, an as Radio, ao as Rate, ap as Result, aq as Row, ar as Segmented, g as Select, as as Skeleton, at as Slider, au as Space, av as Spin, aw as Statistic, ax as Steps, ay as Switch, az as Tabs, aA as Tag, aC as TimePicker, aD as Timeline, T as Tooltip, aE as Tour, aG as Transfer, aH as Tree, aI as TreeSelect, aJ as Typography, aK as Upload, aL as Watermark, aO as en_US, aj as notification, aB as theme, aN as version, z as zh_CN } from './954539dd.esm.es5.development.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
5
5
|
import { Fragment } from 'react/jsx-runtime';
|
|
@@ -4422,48 +4422,81 @@ var CustomerService = function(props) {
|
|
|
4422
4422
|
} catch (error) {}
|
|
4423
4423
|
}, 3000);
|
|
4424
4424
|
};
|
|
4425
|
-
|
|
4426
|
-
var
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4425
|
+
//发送欢迎语,视频页面
|
|
4426
|
+
var sendWelcomMessage = function() {
|
|
4427
|
+
if (config && config.type == "video") {
|
|
4428
|
+
var params = config.params;
|
|
4429
|
+
var videoId = params.videoId;
|
|
4430
|
+
var watchTime = params.videoProgress;
|
|
4431
|
+
var courseId = getQuery("yc_id");
|
|
4432
|
+
var sectionId = params.VideoBriefSummaryId;
|
|
4433
|
+
// let courseId="20899",
|
|
4434
|
+
// sectionId= "462347",
|
|
4435
|
+
// videoId= "29715",
|
|
4436
|
+
// watchTime= 677
|
|
4437
|
+
if (videoId && courseId && sectionId) {
|
|
4438
|
+
http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
|
|
4439
|
+
"recommendedQuestions": [],
|
|
4440
|
+
"contexts": [
|
|
4441
|
+
{
|
|
4442
|
+
"type": "VIDEO",
|
|
4443
|
+
"courseId": courseId,
|
|
4444
|
+
"sectionId": sectionId,
|
|
4445
|
+
"videoId": videoId,
|
|
4446
|
+
"watchTime": watchTime
|
|
4447
|
+
}
|
|
4448
|
+
],
|
|
4449
|
+
"maximum": 3
|
|
4450
|
+
}).then(function(res) {
|
|
4451
|
+
var data = res.data.questions;
|
|
4452
|
+
var questionsList = null;
|
|
4453
|
+
if (data.length > 0) {
|
|
4454
|
+
questionsList = data.map(function(item, index) {
|
|
4455
|
+
if (index < 3) {
|
|
4456
|
+
return {
|
|
4457
|
+
key: "messageSource",
|
|
4458
|
+
value: item.id,
|
|
4459
|
+
question: item.question,
|
|
4460
|
+
answer: item.answer
|
|
4461
|
+
};
|
|
4462
|
+
} else {
|
|
4463
|
+
return null;
|
|
4464
|
+
}
|
|
4465
|
+
});
|
|
4442
4466
|
}
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4467
|
+
var obj = {
|
|
4468
|
+
roomId: roomId,
|
|
4469
|
+
sender: "AI",
|
|
4470
|
+
recevier: mid,
|
|
4471
|
+
message: "Hi,我是智能学习助手,你遇到了什么问题?",
|
|
4472
|
+
extraInfos: questionsList.length > 0 ? questionsList : null
|
|
4473
|
+
};
|
|
4474
|
+
if (pageNumHistory <= 1) {
|
|
4475
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
4476
|
+
var newHistoryMessageList = historyMessageList.filter(function(e) {
|
|
4477
|
+
return e.id != "123456_date";
|
|
4478
|
+
});
|
|
4479
|
+
newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
|
|
4480
|
+
id: "123456_date",
|
|
4481
|
+
upvoted: false,
|
|
4482
|
+
downvoted: false,
|
|
4483
|
+
quotedMessage: "",
|
|
4484
|
+
createdAt: getDataTime(-1),
|
|
4485
|
+
extraInfo: JSON.stringify(obj.extraInfos)
|
|
4486
|
+
}));
|
|
4487
|
+
return newHistoryMessageList;
|
|
4488
|
+
});
|
|
4489
|
+
scrollToBottom();
|
|
4455
4490
|
}
|
|
4456
|
-
|
|
4491
|
+
return;
|
|
4492
|
+
}).catch(function() {});
|
|
4457
4493
|
}
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
});
|
|
4461
|
-
obj = {
|
|
4494
|
+
} else {
|
|
4495
|
+
var obj = {
|
|
4462
4496
|
roomId: roomId,
|
|
4463
4497
|
sender: "AI",
|
|
4464
4498
|
recevier: mid,
|
|
4465
|
-
message: "Hi,我是智能学习助手,你遇到了什么问题?"
|
|
4466
|
-
extraInfos: questionsList
|
|
4499
|
+
message: "Hi,我是智能学习助手,你遇到了什么问题?"
|
|
4467
4500
|
};
|
|
4468
4501
|
if (pageNumHistory <= 1) {
|
|
4469
4502
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -4476,12 +4509,84 @@ var CustomerService = function(props) {
|
|
|
4476
4509
|
downvoted: false,
|
|
4477
4510
|
quotedMessage: "",
|
|
4478
4511
|
createdAt: getDataTime(-1),
|
|
4479
|
-
extraInfo: JSON.stringify(obj.extraInfos)
|
|
4512
|
+
// extraInfo: JSON.stringify(obj.extraInfos),
|
|
4513
|
+
extraInfo: JSON.stringify([
|
|
4514
|
+
{
|
|
4515
|
+
key: "messageSource",
|
|
4516
|
+
value: "knowledgebase"
|
|
4517
|
+
}
|
|
4518
|
+
])
|
|
4480
4519
|
}));
|
|
4481
4520
|
return newHistoryMessageList;
|
|
4482
4521
|
});
|
|
4483
4522
|
scrollToBottom();
|
|
4484
4523
|
}
|
|
4524
|
+
}
|
|
4525
|
+
};
|
|
4526
|
+
//AI窗口,type:1发送打招呼信息 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
4527
|
+
var sendGreetingMessage = function(type) {
|
|
4528
|
+
var questionsList = [];
|
|
4529
|
+
var obj = {};
|
|
4530
|
+
if (type == 1) {
|
|
4531
|
+
sendWelcomMessage();
|
|
4532
|
+
// console.log(hotQuestionsList,newHotQuestionsList.current,'33322221111');
|
|
4533
|
+
// if(newHotQuestionsList.current.length > 0){
|
|
4534
|
+
// questionsList = newHotQuestionsList.current.map((item, index) => {
|
|
4535
|
+
// if (index < 3) {
|
|
4536
|
+
// return {
|
|
4537
|
+
// key: "messageSource",
|
|
4538
|
+
// value: item.id,
|
|
4539
|
+
// question: item.question,
|
|
4540
|
+
// answer: item.answer,
|
|
4541
|
+
// };
|
|
4542
|
+
// } else {
|
|
4543
|
+
// return null;
|
|
4544
|
+
// }
|
|
4545
|
+
// });
|
|
4546
|
+
// }else{
|
|
4547
|
+
// questionsList = hotQuestionsList.map((item, index) => {
|
|
4548
|
+
// if (index < 3) {
|
|
4549
|
+
// return {
|
|
4550
|
+
// key: "messageSource",
|
|
4551
|
+
// value: item.id,
|
|
4552
|
+
// question: item.question,
|
|
4553
|
+
// answer: item.answer,
|
|
4554
|
+
// };
|
|
4555
|
+
// } else {
|
|
4556
|
+
// return null;
|
|
4557
|
+
// }
|
|
4558
|
+
// });
|
|
4559
|
+
// }
|
|
4560
|
+
// questionsList = questionsList.filter((i) => i != null);
|
|
4561
|
+
// obj = {
|
|
4562
|
+
// roomId: roomId,
|
|
4563
|
+
// sender: "AI",
|
|
4564
|
+
// recevier: mid,
|
|
4565
|
+
// message: `Hi,我是智能学习助手,你遇到了什么问题?`,
|
|
4566
|
+
// extraInfos: questionsList,
|
|
4567
|
+
// };
|
|
4568
|
+
// if(pageNumHistory <= 1){
|
|
4569
|
+
// setHistoryMessageList((historyMessageList) => {
|
|
4570
|
+
// let newHistoryMessageList = historyMessageList.filter(e=>e.id!='123456_date');
|
|
4571
|
+
// newHistoryMessageList.push({
|
|
4572
|
+
// ...obj,
|
|
4573
|
+
// id: '123456_date',
|
|
4574
|
+
// upvoted: false,
|
|
4575
|
+
// downvoted: false,
|
|
4576
|
+
// quotedMessage: "",
|
|
4577
|
+
// createdAt: getDataTime(-1),
|
|
4578
|
+
// extraInfo: JSON.stringify(obj.extraInfos),
|
|
4579
|
+
// // extraInfo: JSON.stringify([
|
|
4580
|
+
// // {
|
|
4581
|
+
// // key: "messageSource",
|
|
4582
|
+
// // value: "knowledgebase",
|
|
4583
|
+
// // },
|
|
4584
|
+
// // ]),
|
|
4585
|
+
// });
|
|
4586
|
+
// return newHistoryMessageList;
|
|
4587
|
+
// });
|
|
4588
|
+
// scrollToBottom();
|
|
4589
|
+
// }
|
|
4485
4590
|
return;
|
|
4486
4591
|
} else if (type == 2) {
|
|
4487
4592
|
obj = {
|
|
@@ -5101,7 +5206,7 @@ var CustomerService = function(props) {
|
|
|
5101
5206
|
} else {
|
|
5102
5207
|
var newHistoryMessageList2 = list1.map(function(item) {
|
|
5103
5208
|
message = item.message + obj.message;
|
|
5104
|
-
var extraInfo =
|
|
5209
|
+
var extraInfo = null;
|
|
5105
5210
|
// message = '抱歉,我暂时无法回答这样的问题。'
|
|
5106
5211
|
if (message == "抱歉,我暂时无法回答这样的问题。") {
|
|
5107
5212
|
extraInfo = videoHotQuestionsList.current.map(function(str, index) {
|
|
@@ -5499,12 +5604,15 @@ var CustomerService = function(props) {
|
|
|
5499
5604
|
var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
|
|
5500
5605
|
console.log(flag, props, 3333333);
|
|
5501
5606
|
if (config && config.type == "video" && config.params) {
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5607
|
+
var params = config.params;
|
|
5608
|
+
var videoId = params.videoId;
|
|
5609
|
+
var watchTime = params.videoProgress;
|
|
5610
|
+
var courseId = getQuery("yc_id");
|
|
5611
|
+
var sectionId = params.VideoBriefSummaryId;
|
|
5612
|
+
// let courseId="20899",
|
|
5613
|
+
// sectionId= "462347",
|
|
5614
|
+
// videoId= "29715",
|
|
5615
|
+
// watchTime= 677
|
|
5508
5616
|
if (videoId && courseId && sectionId) {
|
|
5509
5617
|
console.log(recommendeQuestionID.current, "recommendeQuestionID.current");
|
|
5510
5618
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
|
|
@@ -6124,7 +6232,7 @@ var CustomerService = function(props) {
|
|
|
6124
6232
|
//是否在智能客服窗口
|
|
6125
6233
|
isAiChatWindow = chatWindow.length > 0 && chatWindow[0].sender != undefined && chatWindow[0].sender == "AI" ? true : false;
|
|
6126
6234
|
var header = 2; //代表是ai头像
|
|
6127
|
-
if (isAiChatWindow && item.extraInfo
|
|
6235
|
+
if (isAiChatWindow && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "isVoteMessage") {
|
|
6128
6236
|
//使用AI头像
|
|
6129
6237
|
header = 1;
|
|
6130
6238
|
}
|
|
@@ -6188,7 +6296,7 @@ var CustomerService = function(props) {
|
|
|
6188
6296
|
})
|
|
6189
6297
|
]
|
|
6190
6298
|
}),
|
|
6191
|
-
item.extraInfo
|
|
6299
|
+
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "messageSource" && JSON.parse(item.extraInfo)[0].value != "knowledgebase" && /*#__PURE__*/ jsxs("ul", {
|
|
6192
6300
|
className: "".concat(styles.association_problem, " ").concat(item.message == "抱歉,我暂时无法回答这样的问题。" ? styles.association_problem_flag : ""),
|
|
6193
6301
|
children: [
|
|
6194
6302
|
item.message == "抱歉,我暂时无法回答这样的问题。" && /*#__PURE__*/ jsx("li", {
|