bhd-components 0.9.10 → 0.9.12
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 +1110 -1104
- package/dist/index.esm.es5.development.js +82 -29
- 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 +415 -415
- package/dist/vendor.esm.es5.production.js +2 -2
- package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +10 -5
- package/es2017/bhdAppLayout/index.module.less +1 -1
- package/es2017/bhdSelect/index.js +1 -1
- package/es2017/customerService/index.js +71 -24
- package/es2017/customerService/index.module.less +4 -0
- package/es2017/customerService/index2.module.less +3 -0
- package/esm/bhdAppLayout/components/BhdTableSimple/index.js +7 -2
- package/esm/bhdAppLayout/index.module.less +1 -1
- package/esm/bhdSelect/index.js +1 -1
- package/esm/customerService/index.js +71 -24
- package/esm/customerService/index.module.less +4 -0
- package/esm/customerService/index2.module.less +3 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
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 Icon, E as ExclamationCircleFilled, i as _to_consumable_array, P as Pagination$1, 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, L as LeftOutlined, R as RightOutlined, u as MinusOutlined, v as PlusOutlined, w as __generator, x as Input, y as SearchOutlined, B as CloseOutlined, X, D as I, H, F as html2canvas$1, G as Remarkable, J as Drawer, K as HighlightJS, Z as ZoomInOutlined, N as DatePicker, O as Button } from './vendor.esm.es5.development.js';
|
|
2
2
|
export { Q as Affix, U as Alert, V as Anchor, a as AntdMessage, A as App, W as AutoComplete, Y as Avatar, a0 as BackTop, a1 as Badge, a2 as Breadcrumb, O as Button, a3 as Calendar, a4 as Card, a5 as Carousel, a6 as Cascader, a7 as Checkbox, a8 as Col, a9 as Collapse, N as DatePicker, aa as Descriptions, ab as Divider, J as Drawer, ac as Dropdown, ad as Empty, $ as FloatButton, ae as Form, af as Grid, ag as Image, x as Input, ah as InputNumber, ai as Layout, aj as List, ak as Mentions, al as Menu, M as Modal, am as Popconfirm, an as Popover, ao as Progress, aN as QRCode, ap as Radio, aq as Rate, ar as Result, as as Row, at as Segmented, k as Select, au as Skeleton, av as Slider, aw as Space, ax as Spin, ay as Statistic, az as Steps, aA as Switch, aB as Tabs, aC as Tag, aE as TimePicker, aF as Timeline, T as Tooltip, aG as Tour, aH as Transfer, aI as Tree, aJ as TreeSelect, aK as Typography, aL as Upload, aM as Watermark, aP as en_US, b as notification, aD as theme, aO as version, z as zh_CN } from './vendor.esm.es5.development.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
4
|
+
import React__default, { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
5
5
|
import { Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { render } from 'react-dom';
|
|
7
7
|
|
|
@@ -507,8 +507,13 @@ var i18Conversion$1 = i18Conversion;
|
|
|
507
507
|
var className = props.className; props.locale; props.borderBottom; var rowSelection = props.rowSelection, ajaxErr = props.ajaxErr, dataSource = props.dataSource, _props_kind = props.kind, kind = _props_kind === void 0 ? "simple" : _props_kind, loading = props.loading, _props_notDataText = props.notDataText, notDataText = _props_notDataText === void 0 ? i18Conversion$1("noData") : _props_notDataText;
|
|
508
508
|
var tableRef = useRef(null);
|
|
509
509
|
var renderTableText = function() {
|
|
510
|
-
var minHeight =
|
|
511
|
-
|
|
510
|
+
var minHeight = tableRef.current ? tableRef.current.offsetHeight - 42 - 32 : 0;
|
|
511
|
+
if (props.scroll && props.scroll.y) {
|
|
512
|
+
if (String(props.scroll.y).includes("calc")) {
|
|
513
|
+
minHeight = props.scroll.y.replace(/\)/, "");
|
|
514
|
+
minHeight = minHeight + " - 42px)";
|
|
515
|
+
}
|
|
516
|
+
}
|
|
512
517
|
var width = tableRef.current ? tableRef.current.offsetWidth - 42 : 0;
|
|
513
518
|
if (ajaxErr) {
|
|
514
519
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -2270,7 +2275,7 @@ var BhdSelect = function(props) {
|
|
|
2270
2275
|
value: filterValue
|
|
2271
2276
|
})
|
|
2272
2277
|
}),
|
|
2273
|
-
menu
|
|
2278
|
+
dropdownRender ? dropdownRender(menu) : menu
|
|
2274
2279
|
]
|
|
2275
2280
|
});
|
|
2276
2281
|
} else {
|
|
@@ -2391,7 +2396,7 @@ var BhdSelect = function(props) {
|
|
|
2391
2396
|
BhdSelect.Option = Select.Option;
|
|
2392
2397
|
var BhdSelect$1 = BhdSelect;
|
|
2393
2398
|
|
|
2394
|
-
var modules_63b47c51$2 = {"bhd_app_layout":"
|
|
2399
|
+
var modules_63b47c51$2 = {"bhd_app_layout":"index_module_bhd_app_layout__6a2d2320","bhd_app_layout_header":"index_module_bhd_app_layout_header__6a2d2320","bhd_app_layout_main":"index_module_bhd_app_layout_main__6a2d2320","bhd_app_layout_main_filter":"index_module_bhd_app_layout_main_filter__6a2d2320","bhd_app_layout_main_filter_title":"index_module_bhd_app_layout_main_filter_title__6a2d2320","bhd_app_layout_main_filter_ul":"index_module_bhd_app_layout_main_filter_ul__6a2d2320","bhd_app_layout_main_filter_show_value":"index_module_bhd_app_layout_main_filter_show_value__6a2d2320","bhd_app_layout_main_filter_clear":"index_module_bhd_app_layout_main_filter_clear__6a2d2320","bhd_app_layout_main_table":"index_module_bhd_app_layout_main_table__6a2d2320","bhd_app_layout_footer":"index_module_bhd_app_layout_footer__6a2d2320"};
|
|
2395
2400
|
|
|
2396
2401
|
function BhdAppLayout(props) {
|
|
2397
2402
|
var _filterRef_current, _filterRef, _headRef_current, _headRef, _otherHeadRef_current, _otherHeadRef, _otherContentRef_current, _otherContentRef, _filterConfig, _filterConfig1, _footerConfig;
|
|
@@ -2515,7 +2520,7 @@ function BhdAppLayout(props) {
|
|
|
2515
2520
|
});
|
|
2516
2521
|
}
|
|
2517
2522
|
|
|
2518
|
-
var modules_63b47c51$1 = {"service_ChatWindow_Drawer":"
|
|
2523
|
+
var modules_63b47c51$1 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__4297734b","ChatWindow_Modal":"index_module_ChatWindow_Modal__4297734b","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__4297734b","header_wrap":"index_module_header_wrap__4297734b","top":"index_module_top__4297734b","user":"index_module_user__4297734b","count":"index_module_count__4297734b","operate":"index_module_operate__4297734b","line":"index_module_line__4297734b","popover_main":"index_module_popover_main__4297734b","popover":"index_module_popover__4297734b","header_wrap_newlabo":"index_module_header_wrap_newlabo__4297734b","Drawer_main":"index_module_Drawer_main__4297734b","loading":"index_module_loading__4297734b","message_con":"index_module_message_con__4297734b","left":"index_module_left__4297734b","head_sculpture":"index_module_head_sculpture__4297734b","main_content":"index_module_main_content__4297734b","right":"index_module_right__4297734b","main":"index_module_main__4297734b","main_content_flag":"index_module_main_content_flag__4297734b","operate_modal":"index_module_operate_modal__4297734b","operate_modal_bottom":"index_module_operate_modal_bottom__4297734b","active":"index_module_active__4297734b","stop_generate":"index_module_stop_generate__4297734b","icon":"index_module_icon__4297734b","find_teacher":"index_module_find_teacher__4297734b","stop_findTeacher":"index_module_stop_findTeacher__4297734b","content":"index_module_content__4297734b","content_child":"index_module_content_child__4297734b","find_teacher_con":"index_module_find_teacher_con__4297734b","sign":"index_module_sign__4297734b","ask_question":"index_module_ask_question__4297734b","bottom":"index_module_bottom__4297734b","association_problem":"index_module_association_problem__4297734b","association_problem_flag":"index_module_association_problem_flag__4297734b","related_issues_flag":"index_module_related_issues_flag__4297734b","img_con":"index_module_img_con__4297734b","mask_zoom":"index_module_mask_zoom__4297734b","img_con2":"index_module_img_con2__4297734b","copyCode":"index_module_copyCode__4297734b","time":"index_module_time__4297734b","citation_content":"index_module_citation_content__4297734b","text_exceed":"index_module_text_exceed__4297734b","popover_content":"index_module_popover_content__4297734b","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__4297734b","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__4297734b","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__4297734b","issues_list_teacherList":"index_module_issues_list_teacherList__4297734b","item":"index_module_item__4297734b","issues_list":"index_module_issues_list__4297734b","issues_list_flag":"index_module_issues_list_flag__4297734b","Drawer_buttom":"index_module_Drawer_buttom__4297734b","input_wrap":"index_module_input_wrap__4297734b","input":"index_module_input__4297734b","picture_layout":"index_module_picture_layout__4297734b","icon_close":"index_module_icon_close__4297734b","icon_zoom":"index_module_icon_zoom__4297734b","anticon":"index_module_anticon__4297734b","no_AI":"index_module_no_AI__4297734b","screenshot":"index_module_screenshot__4297734b","disabled":"index_module_disabled__4297734b","content_main":"index_module_content_main__4297734b","content_con":"index_module_content_con__4297734b","delete_quote":"index_module_delete_quote__4297734b","sending":"index_module_sending__4297734b","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__4297734b","main_list":"index_module_main_list__4297734b","chat_content":"index_module_chat_content__4297734b","popover_main_content":"index_module_popover_main_content__4297734b","popover_main_content_name":"index_module_popover_main_content_name__4297734b","teacher_layout":"index_module_teacher_layout__4297734b","delete":"index_module_delete__4297734b","num":"index_module_num__4297734b","shrink":"index_module_shrink__4297734b","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__4297734b","teacher_layout_modal":"index_module_teacher_layout_modal__4297734b","ai":"index_module_ai__4297734b","user_info":"index_module_user_info__4297734b","message":"index_module_message__4297734b","con":"index_module_con__4297734b","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__4297734b","history_list":"index_module_history_list__4297734b","search_layout":"index_module_search_layout__4297734b","mymove":"index_module_mymove__4297734b","title":"index_module_title__4297734b","search_top":"index_module_search_top__4297734b","list_item":"index_module_list_item__4297734b","list_summary":"index_module_list_summary__4297734b","head_img":"index_module_head_img__4297734b","list_desc":"index_module_list_desc__4297734b","name":"index_module_name__4297734b","decs":"index_module_decs__4297734b","open":"index_module_open__4297734b","list_summary_active":"index_module_list_summary_active__4297734b","list_detail":"index_module_list_detail__4297734b","list":"index_module_list__4297734b","list_more":"index_module_list_more__4297734b","no_data":"index_module_no_data__4297734b","history_list_broadside":"index_module_history_list_broadside__4297734b","teacher_list":"index_module_teacher_list__4297734b","screenshot_Modal":"index_module_screenshot_Modal__4297734b","ReactCrop":"index_module_ReactCrop__4297734b","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__4297734b"};
|
|
2519
2524
|
|
|
2520
2525
|
//消息已读
|
|
2521
2526
|
var readMessage = function(roomId, urllocation, userData, http) {
|
|
@@ -7861,6 +7866,25 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7861
7866
|
|
|
7862
7867
|
var styles = modules_63b47c51$1;
|
|
7863
7868
|
var TextArea = Input.TextArea;
|
|
7869
|
+
/*
|
|
7870
|
+
自定义remarkable的text解析规则
|
|
7871
|
+
*/ var HTML_ESCAPE_TEST_RE = /[&<>"]/;
|
|
7872
|
+
var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
|
|
7873
|
+
var HTML_REPLACEMENTS = {
|
|
7874
|
+
"&": "&",
|
|
7875
|
+
"<": "<",
|
|
7876
|
+
">": ">",
|
|
7877
|
+
'"': """
|
|
7878
|
+
};
|
|
7879
|
+
function replaceUnsafeChar(ch) {
|
|
7880
|
+
return HTML_REPLACEMENTS[ch];
|
|
7881
|
+
}
|
|
7882
|
+
function escapeHtml(str) {
|
|
7883
|
+
if (HTML_ESCAPE_TEST_RE.test(str)) {
|
|
7884
|
+
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
|
|
7885
|
+
}
|
|
7886
|
+
return str;
|
|
7887
|
+
}
|
|
7864
7888
|
var CustomerService = function(props) {
|
|
7865
7889
|
var userData = props.userData, http = props.http, urllocation = props.urllocation, onCancel = props.onCancel, serverName = props.serverName, fetchEventSource = props.fetchEventSource, initShowType = props.initShowType, onEvent = props.onEvent, stepIds = props.stepIds, stepId = props.stepId, screenshotAreaId = props.screenshotAreaId, config = props.config;
|
|
7866
7890
|
// const { bese64String, startRecord, stopRecord } = useMediaRecorder(); //语音转文字
|
|
@@ -7916,6 +7940,7 @@ var CustomerService = function(props) {
|
|
|
7916
7940
|
var newHotQuestionsList = useRef([]); //视频热门问题
|
|
7917
7941
|
var newShowType = useRef(false);
|
|
7918
7942
|
var mid = props.userData.mid;
|
|
7943
|
+
var renderAiAnswerTimer = useRef(null);
|
|
7919
7944
|
var remarkable = new Remarkable({
|
|
7920
7945
|
highlight: function highlight(str, lang) {
|
|
7921
7946
|
if (lang && HighlightJS.getLanguage(lang)) {
|
|
@@ -7929,6 +7954,26 @@ var CustomerService = function(props) {
|
|
|
7929
7954
|
return ""; // use external default escaping
|
|
7930
7955
|
}
|
|
7931
7956
|
});
|
|
7957
|
+
var remarkReplaceKey = function(message, keyWordProblem) {
|
|
7958
|
+
var newRemarkable = new Remarkable({
|
|
7959
|
+
highlight: function highlight(str, lang) {
|
|
7960
|
+
if (lang && HighlightJS.getLanguage(lang)) {
|
|
7961
|
+
try {
|
|
7962
|
+
return HighlightJS.highlight(lang, str).value;
|
|
7963
|
+
} catch (err) {}
|
|
7964
|
+
}
|
|
7965
|
+
try {
|
|
7966
|
+
return HighlightJS.highlightAuto(str).value;
|
|
7967
|
+
} catch (err) {}
|
|
7968
|
+
return ""; // use external default escaping
|
|
7969
|
+
}
|
|
7970
|
+
});
|
|
7971
|
+
newRemarkable.renderer.rules.text = function(tokens, idx) {
|
|
7972
|
+
var text = escapeHtml(tokens[idx].content);
|
|
7973
|
+
return text.replace(keyWordProblem, '<span class="'.concat(styles.sign, '">').concat(keyWordProblem, "</span>"));
|
|
7974
|
+
};
|
|
7975
|
+
return newRemarkable.render(message);
|
|
7976
|
+
};
|
|
7932
7977
|
var _useState33 //1是 screenShotPlugin 2是html2canvas
|
|
7933
7978
|
= _sliced_to_array(useState(0), 2), screenShotType = _useState33[0], setScreenShotType = _useState33[1];
|
|
7934
7979
|
var screenShotPlugin = useRef();
|
|
@@ -8176,6 +8221,7 @@ var CustomerService = function(props) {
|
|
|
8176
8221
|
clearTimeout(timer.current);
|
|
8177
8222
|
clearTimeout(roomMessage.current);
|
|
8178
8223
|
clearTimeout(chatRoomList.current);
|
|
8224
|
+
clearTimeout(renderAiAnswerTimer.current);
|
|
8179
8225
|
};
|
|
8180
8226
|
}, []);
|
|
8181
8227
|
useEffect(function() {
|
|
@@ -8971,11 +9017,14 @@ var CustomerService = function(props) {
|
|
|
8971
9017
|
},
|
|
8972
9018
|
onmessage: function(event) {
|
|
8973
9019
|
//识别的内容
|
|
8974
|
-
console.log("eventSource msg: ", event.data);
|
|
9020
|
+
// console.log("eventSource msg: ", event.data);
|
|
8975
9021
|
var msg = JSON.parse(event.data);
|
|
8976
9022
|
if (msg.message) {
|
|
8977
9023
|
content = content + msg.message;
|
|
8978
|
-
|
|
9024
|
+
// isPosition.current = true;
|
|
9025
|
+
renderAiAnswerTimer.current = setTimeout(function() {
|
|
9026
|
+
renderAiAnswer(msg, id, type);
|
|
9027
|
+
}, 100);
|
|
8979
9028
|
}
|
|
8980
9029
|
if (msg.finished) {
|
|
8981
9030
|
setFinished(true); //发送结束
|
|
@@ -9005,11 +9054,7 @@ var CustomerService = function(props) {
|
|
|
9005
9054
|
};
|
|
9006
9055
|
//渲染AI回答
|
|
9007
9056
|
var renderAiAnswer = function(msg, message_id, type) {
|
|
9008
|
-
console.log(
|
|
9009
|
-
msg: msg,
|
|
9010
|
-
message_id: message_id,
|
|
9011
|
-
type: type
|
|
9012
|
-
});
|
|
9057
|
+
// console.log('renderAiAnswer',{msg,message_id,type})
|
|
9013
9058
|
// console.log(pageNumHistory,5555555);
|
|
9014
9059
|
// console.log(aiSendQuestions().abort(),'slkdsdsdsd')
|
|
9015
9060
|
if (pageNumHistory > 1) return;
|
|
@@ -9030,10 +9075,7 @@ var CustomerService = function(props) {
|
|
|
9030
9075
|
var list = prevHistoryMessageList.filter(function(item) {
|
|
9031
9076
|
return item.id == id;
|
|
9032
9077
|
});
|
|
9033
|
-
console.log(
|
|
9034
|
-
list1: list1,
|
|
9035
|
-
list: list
|
|
9036
|
-
});
|
|
9078
|
+
// console.log('renderAiAnswer',{list1,list})
|
|
9037
9079
|
var message = "";
|
|
9038
9080
|
if (list.length == 0) {
|
|
9039
9081
|
message = obj.message;
|
|
@@ -9082,10 +9124,15 @@ var CustomerService = function(props) {
|
|
|
9082
9124
|
return newHistoryMessageList2;
|
|
9083
9125
|
}
|
|
9084
9126
|
});
|
|
9085
|
-
|
|
9086
|
-
if (
|
|
9087
|
-
|
|
9127
|
+
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
9128
|
+
if (container) {
|
|
9129
|
+
container.scrollTop = container.scrollHeight;
|
|
9088
9130
|
}
|
|
9131
|
+
// console.log('historyMessageList',historyMessageList)
|
|
9132
|
+
// if(isPosition.current){
|
|
9133
|
+
// console.log('mmmmmmmmmmmmm打印一下',)
|
|
9134
|
+
// scrollToBottom();
|
|
9135
|
+
// }
|
|
9089
9136
|
};
|
|
9090
9137
|
//问题记录到实验报告中
|
|
9091
9138
|
var testLabQuestion = function(title, content, teachId) {
|
|
@@ -9602,8 +9649,11 @@ var CustomerService = function(props) {
|
|
|
9602
9649
|
var scrollToBottom = function() {
|
|
9603
9650
|
setTimeout(function() {
|
|
9604
9651
|
var container = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
9652
|
+
console.log("滚到底部", container, showType);
|
|
9605
9653
|
if (container) {
|
|
9654
|
+
console.log("最好的最好的最好的", container.scrollHeight);
|
|
9606
9655
|
container.scrollTop = container.scrollHeight;
|
|
9656
|
+
//container.scrollTop = new Date().getTime()
|
|
9607
9657
|
}
|
|
9608
9658
|
}, 100);
|
|
9609
9659
|
};
|
|
@@ -9914,14 +9964,15 @@ var CustomerService = function(props) {
|
|
|
9914
9964
|
// console.log(code,888888888);
|
|
9915
9965
|
if (lastId == item.id && keyWordProblem != "") {
|
|
9916
9966
|
//点击历史记录时,找到关键字,防止关键字和标签名重复
|
|
9917
|
-
|
|
9918
|
-
message = message.replaceAll(keyWordProblem,
|
|
9919
|
-
|
|
9920
|
-
});
|
|
9921
|
-
message = remarkable.render(message);
|
|
9922
|
-
message = message.replaceAll(key_sign,
|
|
9923
|
-
|
|
9924
|
-
});
|
|
9967
|
+
// let key_sign = 'sign_'+new Date().getTime();+'sign';
|
|
9968
|
+
// message = message.replaceAll(keyWordProblem, (e:any) => {
|
|
9969
|
+
// return key_sign;
|
|
9970
|
+
// });
|
|
9971
|
+
// message = remarkable.render(message);
|
|
9972
|
+
// message = message.replaceAll(key_sign, (e:any) => {
|
|
9973
|
+
// return `<span class=${styles.sign}>${keyWordProblem}</span>`;
|
|
9974
|
+
// });
|
|
9975
|
+
message = remarkReplaceKey(message, keyWordProblem);
|
|
9925
9976
|
} else {
|
|
9926
9977
|
message = remarkable.render(message);
|
|
9927
9978
|
}
|
|
@@ -10297,7 +10348,9 @@ var CustomerService = function(props) {
|
|
|
10297
10348
|
]
|
|
10298
10349
|
});
|
|
10299
10350
|
}
|
|
10300
|
-
return
|
|
10351
|
+
return /*#__PURE__*/ jsx(React__default.Fragment, {
|
|
10352
|
+
children: li
|
|
10353
|
+
}, item.id);
|
|
10301
10354
|
})
|
|
10302
10355
|
});
|
|
10303
10356
|
// } else {
|