bhd-components 0.7.15 → 0.7.17
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/{f6061320.esm.es5.production.js → 1728c440.esm.es5.production.js} +1 -1
- package/dist/{954539dd.esm.es5.development.js → ca9b7f2c.esm.es5.development.js} +1 -1
- package/dist/index.esm.es5.development.js +87 -135
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/index.js +83 -131
- package/esm/customerService/index.js +84 -132
- package/package.json +1 -1
|
@@ -120868,7 +120868,7 @@ function requireD () {
|
|
|
120868
120868
|
+ 'pragma private protected public pure ref return scope shared static struct '
|
|
120869
120869
|
+ 'super switch synchronized template this throw try typedef typeid typeof union '
|
|
120870
120870
|
+ 'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 '
|
|
120871
|
-
+ '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ "0.7.
|
|
120871
|
+
+ '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ "0.7.17"',
|
|
120872
120872
|
built_in:
|
|
120873
120873
|
'bool cdouble cent cfloat char creal dchar delegate double dstring float function '
|
|
120874
120874
|
+ 'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar '
|
|
@@ -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 './ca9b7f2c.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 './ca9b7f2c.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';
|
|
@@ -4150,7 +4150,7 @@ var CustomerService = function(props) {
|
|
|
4150
4150
|
var _useState3 = _sliced_to_array(useState([]), 2), historyMessageList = _useState3[0], setHistoryMessageList = _useState3[1]; //历史消息
|
|
4151
4151
|
var _useState4 = _sliced_to_array(useState(""), 2), keyWord = _useState4[0], setKeyWord = _useState4[1]; //搜索内容
|
|
4152
4152
|
var _useState5 = _sliced_to_array(useState([]), 2), questionsList = _useState5[0], setQuestionsList = _useState5[1]; //问题列表
|
|
4153
|
-
var _useState6 = _sliced_to_array(useState([]), 2)
|
|
4153
|
+
var _useState6 = _sliced_to_array(useState([]), 2); _useState6[0]; var setHotQuestionsList = _useState6[1]; //热门问题
|
|
4154
4154
|
// const [videoHotQuestionsList, setVideoHotQuestionsList] = useState([]); //热门问题
|
|
4155
4155
|
var _useState7 = _sliced_to_array(useState(false), 2), greetingMessage = _useState7[0], setGreetingMessage = _useState7[1]; //聊天记录列表是否请求完成
|
|
4156
4156
|
var _useState8 = _sliced_to_array(useState(1), 2), pageNum = _useState8[0], setPageNum = _useState8[1]; //页码
|
|
@@ -4207,10 +4207,10 @@ var CustomerService = function(props) {
|
|
|
4207
4207
|
}
|
|
4208
4208
|
});
|
|
4209
4209
|
useEffect(function() {
|
|
4210
|
-
if
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
}
|
|
4210
|
+
// if(config && config.type == 'video'){
|
|
4211
|
+
// //获取热门推荐
|
|
4212
|
+
// videoPageQuestiionsList(1);
|
|
4213
|
+
// }
|
|
4214
4214
|
setShowType(initShowType);
|
|
4215
4215
|
}, [
|
|
4216
4216
|
initShowType
|
|
@@ -4448,48 +4448,48 @@ var CustomerService = function(props) {
|
|
|
4448
4448
|
],
|
|
4449
4449
|
"maximum": 3
|
|
4450
4450
|
}).then(function(res) {
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4451
|
+
try {
|
|
4452
|
+
var data = res.data.questions;
|
|
4453
|
+
var questionsList = null;
|
|
4454
|
+
if (data.length > 0) {
|
|
4455
|
+
questionsList = data.map(function(item, index) {
|
|
4456
4456
|
return {
|
|
4457
4457
|
key: "messageSource",
|
|
4458
4458
|
value: item.id,
|
|
4459
4459
|
question: item.question,
|
|
4460
4460
|
answer: item.answer
|
|
4461
4461
|
};
|
|
4462
|
-
} else {
|
|
4463
|
-
return null;
|
|
4464
|
-
}
|
|
4465
|
-
});
|
|
4466
|
-
}
|
|
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
4462
|
});
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4463
|
+
}
|
|
4464
|
+
console.log("dflkvmdfklvdf欢迎语", data);
|
|
4465
|
+
var obj = {
|
|
4466
|
+
roomId: roomId,
|
|
4467
|
+
sender: "AI",
|
|
4468
|
+
recevier: mid,
|
|
4469
|
+
message: "Hi,我是智能学习助手,你遇到了什么问题?",
|
|
4470
|
+
extraInfos: questionsList == null ? null : questionsList
|
|
4471
|
+
};
|
|
4472
|
+
if (pageNumHistory <= 1) {
|
|
4473
|
+
console.log("欢迎语");
|
|
4474
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
4475
|
+
var newHistoryMessageList = historyMessageList.filter(function(e) {
|
|
4476
|
+
return e.id != "123456_date";
|
|
4477
|
+
});
|
|
4478
|
+
newHistoryMessageList.push(_object_spread_props(_object_spread({}, obj), {
|
|
4479
|
+
id: "123456_date",
|
|
4480
|
+
upvoted: false,
|
|
4481
|
+
downvoted: false,
|
|
4482
|
+
quotedMessage: "",
|
|
4483
|
+
createdAt: getDataTime(-1),
|
|
4484
|
+
extraInfo: obj.extraInfos != null ? JSON.stringify(obj.extraInfos) : null
|
|
4485
|
+
}));
|
|
4486
|
+
return newHistoryMessageList;
|
|
4487
|
+
});
|
|
4488
|
+
scrollToBottom();
|
|
4489
|
+
}
|
|
4490
|
+
return;
|
|
4491
|
+
} catch (error) {}
|
|
4492
|
+
});
|
|
4493
4493
|
}
|
|
4494
4494
|
} else {
|
|
4495
4495
|
var obj = {
|
|
@@ -4523,70 +4523,54 @@ var CustomerService = function(props) {
|
|
|
4523
4523
|
}
|
|
4524
4524
|
}
|
|
4525
4525
|
};
|
|
4526
|
-
|
|
4526
|
+
//无ai权限时,发送热门问题
|
|
4527
|
+
var getAssociativeProblem = function() {
|
|
4528
|
+
http.get("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions"), {
|
|
4529
|
+
params: {
|
|
4530
|
+
page: 1,
|
|
4531
|
+
maxPageSize: 5
|
|
4532
|
+
}
|
|
4533
|
+
}).then(function(res) {
|
|
4534
|
+
setFinished(true);
|
|
4535
|
+
if (res.data.total > 0) {
|
|
4536
|
+
var questionsList = res.data.questions.map(function(item) {
|
|
4537
|
+
return {
|
|
4538
|
+
key: "messageSource",
|
|
4539
|
+
value: item.id,
|
|
4540
|
+
question: item.question,
|
|
4541
|
+
answer: item.answer
|
|
4542
|
+
};
|
|
4543
|
+
});
|
|
4544
|
+
var obj = {
|
|
4545
|
+
roomId: roomId,
|
|
4546
|
+
sender: "AI",
|
|
4547
|
+
recevier: mid,
|
|
4548
|
+
message: "猜你想问:",
|
|
4549
|
+
extraInfos: questionsList
|
|
4550
|
+
};
|
|
4551
|
+
if (pageNumHistory <= 1) {
|
|
4552
|
+
setHistoryMessageList(function(historyMessageList) {
|
|
4553
|
+
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
4554
|
+
id: "p" + new Date().getTime(),
|
|
4555
|
+
upvoted: false,
|
|
4556
|
+
downvoted: false,
|
|
4557
|
+
quotedMessage: "",
|
|
4558
|
+
createdAt: getDataTime(-1),
|
|
4559
|
+
extraInfo: JSON.stringify(obj.extraInfos)
|
|
4560
|
+
}));
|
|
4561
|
+
return newHistoryMessageList;
|
|
4562
|
+
});
|
|
4563
|
+
scrollToBottom();
|
|
4564
|
+
}
|
|
4565
|
+
return;
|
|
4566
|
+
}
|
|
4567
|
+
});
|
|
4568
|
+
};
|
|
4569
|
+
//AI窗口,type:1发送打招呼信息欢迎语 2点赞消息 3踩消息 4没有AI客服权限,5,发送超过10万字消息 6, 没有AI客服权限,发送最热的问题
|
|
4527
4570
|
var sendGreetingMessage = function(type) {
|
|
4528
|
-
var questionsList = [];
|
|
4529
4571
|
var obj = {};
|
|
4530
4572
|
if (type == 1) {
|
|
4531
4573
|
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
|
-
// }
|
|
4590
4574
|
return;
|
|
4591
4575
|
} else if (type == 2) {
|
|
4592
4576
|
obj = {
|
|
@@ -4647,35 +4631,7 @@ var CustomerService = function(props) {
|
|
|
4647
4631
|
]
|
|
4648
4632
|
};
|
|
4649
4633
|
} else if (type == 6) {
|
|
4650
|
-
|
|
4651
|
-
return {
|
|
4652
|
-
key: "messageSource",
|
|
4653
|
-
value: item.id,
|
|
4654
|
-
question: item.question,
|
|
4655
|
-
answer: item.answer
|
|
4656
|
-
};
|
|
4657
|
-
});
|
|
4658
|
-
obj = {
|
|
4659
|
-
roomId: roomId,
|
|
4660
|
-
sender: "AI",
|
|
4661
|
-
recevier: mid,
|
|
4662
|
-
message: "猜你想问:",
|
|
4663
|
-
extraInfos: questionsList
|
|
4664
|
-
};
|
|
4665
|
-
if (pageNumHistory <= 1) {
|
|
4666
|
-
setHistoryMessageList(function(historyMessageList) {
|
|
4667
|
-
var newHistoryMessageList = historyMessageList.concat(_object_spread_props(_object_spread({}, obj), {
|
|
4668
|
-
id: "p" + new Date().getTime(),
|
|
4669
|
-
upvoted: false,
|
|
4670
|
-
downvoted: false,
|
|
4671
|
-
quotedMessage: "",
|
|
4672
|
-
createdAt: getDataTime(-1),
|
|
4673
|
-
extraInfo: JSON.stringify(obj.extraInfos)
|
|
4674
|
-
}));
|
|
4675
|
-
return newHistoryMessageList;
|
|
4676
|
-
});
|
|
4677
|
-
scrollToBottom();
|
|
4678
|
-
}
|
|
4634
|
+
getAssociativeProblem();
|
|
4679
4635
|
return;
|
|
4680
4636
|
}
|
|
4681
4637
|
setKeyWord("");
|
|
@@ -4901,10 +4857,6 @@ var CustomerService = function(props) {
|
|
|
4901
4857
|
scrollToBottom();
|
|
4902
4858
|
}
|
|
4903
4859
|
console.log(type, "接受答案77777");
|
|
4904
|
-
//获取下面的推荐问题
|
|
4905
|
-
// if(type == 2){
|
|
4906
|
-
// videoPageQuestiionsList(2);
|
|
4907
|
-
// }
|
|
4908
4860
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/history-messages"), obj).then(function(res) {
|
|
4909
4861
|
if (res.data.id) {
|
|
4910
4862
|
if (pageNumHistory <= 1) {
|