bhd-components 0.9.6 → 0.9.8

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.
@@ -59,10 +59,10 @@ var config = {
59
59
  var config$1 = config;
60
60
 
61
61
  var Modal = {};
62
- var message = {};
62
+ var message$1 = {};
63
63
  function BhdTipModal$2() {
64
64
  var staticFunction = App.useApp();
65
- message = _object_spread({}, AntdMessage, staticFunction.message);
65
+ message$1 = _object_spread({}, AntdMessage, staticFunction.message);
66
66
  Modal = _object_spread({}, Modal$1, staticFunction.modal);
67
67
  _object_spread({}, AntdNotification, staticFunction.notification);
68
68
  return null;
@@ -211,6 +211,7 @@ var Table = function(props) {
211
211
  var timerRef = useRef({
212
212
  timer: null
213
213
  });
214
+ var scrollObjectRef = useRef(null);
214
215
  var _props_defaultWidthRang = props.defaultWidthRang, defaultWidthRang = _props_defaultWidthRang === void 0 ? [
215
216
  180,
216
217
  240,
@@ -233,7 +234,7 @@ var Table = function(props) {
233
234
  }
234
235
  var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
235
236
  setColumns(selfColumns);
236
- var obj = scrollObject ? scrollObject : {};
237
+ var obj = scrollObjectRef.current ? scrollObjectRef.current : {};
237
238
  obj = _object_spread_props(_object_spread({}, obj), {
238
239
  x: tableWidth
239
240
  });
@@ -386,6 +387,11 @@ var Table = function(props) {
386
387
  }, [
387
388
  props.scroll
388
389
  ]);
390
+ useEffect(function() {
391
+ scrollObjectRef.current = scrollObject;
392
+ }, [
393
+ scrollObject
394
+ ]);
389
395
  var config = _object_spread_props(_object_spread({
390
396
  bordered: false
391
397
  }, props), {
@@ -1154,37 +1160,37 @@ var BhdMessage = _object_spread_props(_object_spread({}, AntdMessage), {
1154
1160
  customSuccess: function(config) {
1155
1161
  var className = modules_63b47c51$9.customSuccess;
1156
1162
  if (typeof config === "string") {
1157
- return message.success({
1163
+ return message$1.success({
1158
1164
  content: config,
1159
1165
  className: className
1160
1166
  });
1161
1167
  }
1162
- return message.success(_object_spread_props(_object_spread({}, config), {
1168
+ return message$1.success(_object_spread_props(_object_spread({}, config), {
1163
1169
  className: "".concat(className, " ").concat(config.className || "")
1164
1170
  }));
1165
1171
  },
1166
1172
  customWarning: function(config) {
1167
1173
  var className = modules_63b47c51$9.customWarning;
1168
1174
  if (typeof config === "string") {
1169
- return message.warning({
1175
+ return message$1.warning({
1170
1176
  content: config,
1171
1177
  className: className
1172
1178
  });
1173
1179
  }
1174
- return message.warning(_object_spread_props(_object_spread({}, config), {
1180
+ return message$1.warning(_object_spread_props(_object_spread({}, config), {
1175
1181
  className: "".concat(className, " ").concat(config.className || "")
1176
1182
  }));
1177
1183
  },
1178
1184
  customError: function(config) {
1179
1185
  var className = modules_63b47c51$9.customError;
1180
1186
  if (typeof config === "string") {
1181
- return message.error({
1187
+ return message$1.error({
1182
1188
  content: config,
1183
1189
  className: className,
1184
1190
  icon: /*#__PURE__*/ jsx(ExclamationCircleFilled, {})
1185
1191
  });
1186
1192
  }
1187
- return message.error(_object_spread_props(_object_spread({}, config), {
1193
+ return message$1.error(_object_spread_props(_object_spread({}, config), {
1188
1194
  className: "".concat(className, " ").concat(config.className || ""),
1189
1195
  icon: config.icon || /*#__PURE__*/ jsx(ExclamationCircleFilled, {})
1190
1196
  }));
@@ -1193,58 +1199,58 @@ var BhdMessage = _object_spread_props(_object_spread({}, AntdMessage), {
1193
1199
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1194
1200
  arg[_key] = arguments[_key];
1195
1201
  }
1196
- return (_message = message).open.apply(_message, _to_consumable_array(arg));
1202
+ return (_message = message$1).open.apply(_message, _to_consumable_array(arg));
1197
1203
  },
1198
1204
  destroy: function() {
1199
1205
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1200
1206
  arg[_key] = arguments[_key];
1201
1207
  }
1202
- return (_message1 = message).destroy.apply(_message1, _to_consumable_array(arg));
1208
+ return (_message1 = message$1).destroy.apply(_message1, _to_consumable_array(arg));
1203
1209
  },
1204
1210
  error: function() {
1205
1211
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1206
1212
  arg[_key] = arguments[_key];
1207
1213
  }
1208
- return (_message2 = message).error.apply(_message2, _to_consumable_array(arg));
1214
+ return (_message2 = message$1).error.apply(_message2, _to_consumable_array(arg));
1209
1215
  },
1210
1216
  info: function() {
1211
1217
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1212
1218
  arg[_key] = arguments[_key];
1213
1219
  }
1214
- return (_message3 = message).info.apply(_message3, _to_consumable_array(arg));
1220
+ return (_message3 = message$1).info.apply(_message3, _to_consumable_array(arg));
1215
1221
  },
1216
1222
  loading: function() {
1217
1223
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1218
1224
  arg[_key] = arguments[_key];
1219
1225
  }
1220
- return (_message4 = message).loading.apply(_message4, _to_consumable_array(arg));
1226
+ return (_message4 = message$1).loading.apply(_message4, _to_consumable_array(arg));
1221
1227
  },
1222
1228
  success: function() {
1223
1229
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1224
1230
  arg[_key] = arguments[_key];
1225
1231
  }
1226
- return (_message5 = message).success.apply(_message5, _to_consumable_array(arg));
1232
+ return (_message5 = message$1).success.apply(_message5, _to_consumable_array(arg));
1227
1233
  },
1228
1234
  useMessage: function() {
1229
1235
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1230
1236
  arg[_key] = arguments[_key];
1231
1237
  }
1232
- return (_message6 = message).useMessage.apply(_message6, _to_consumable_array(arg));
1238
+ return (_message6 = message$1).useMessage.apply(_message6, _to_consumable_array(arg));
1233
1239
  },
1234
1240
  warning: function() {
1235
1241
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1236
1242
  arg[_key] = arguments[_key];
1237
1243
  }
1238
- return (_message7 = message).warning.apply(_message7, _to_consumable_array(arg));
1244
+ return (_message7 = message$1).warning.apply(_message7, _to_consumable_array(arg));
1239
1245
  },
1240
1246
  _InternalPanelDoNotUseOrYouWillBeFired: function() {
1241
1247
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
1242
1248
  arg[_key] = arguments[_key];
1243
1249
  }
1244
- return (_message8 = message)._InternalPanelDoNotUseOrYouWillBeFired.apply(_message8, _to_consumable_array(arg));
1250
+ return (_message8 = message$1)._InternalPanelDoNotUseOrYouWillBeFired.apply(_message8, _to_consumable_array(arg));
1245
1251
  }
1246
1252
  });
1247
- var BhdMessage$1 = BhdMessage;
1253
+ var message = BhdMessage;
1248
1254
 
1249
1255
  var modules_63b47c51$8 = {"pagination":"index_module_pagination__db6ba815"};
1250
1256
 
@@ -2406,8 +2412,11 @@ function BhdAppLayout(props) {
2406
2412
  var otherHeadRef = useRef(null);
2407
2413
  var otherContentRef = useRef(null);
2408
2414
  var filterRef = useRef(null);
2409
- useLayoutEffect(function() {
2410
- windowChange();
2415
+ useEffect(function() {
2416
+ window.addEventListener("resize", windowChange);
2417
+ return function() {
2418
+ window.removeEventListener("resize", windowChange);
2419
+ };
2411
2420
  }, []);
2412
2421
  useLayoutEffect(function() {
2413
2422
  windowChange();
@@ -2418,7 +2427,7 @@ function BhdAppLayout(props) {
2418
2427
  (_otherContentRef = otherContentRef) === null || _otherContentRef === void 0 ? void 0 : (_otherContentRef_current = _otherContentRef.current) === null || _otherContentRef_current === void 0 ? void 0 : _otherContentRef_current.offsetHeight
2419
2428
  ]);
2420
2429
  return /*#__PURE__*/ jsxs("div", {
2421
- className: "".concat(modules_63b47c51$2.bhd_app_layout, " ").concat(modules_63b47c51$2.className, " ").concat(className || ""),
2430
+ className: "".concat(modules_63b47c51$2.bhd_app_layout, " ").concat(className || ""),
2422
2431
  children: [
2423
2432
  /*#__PURE__*/ jsx("header", {
2424
2433
  ref: headRef,
@@ -2503,7 +2512,7 @@ function BhdAppLayout(props) {
2503
2512
  });
2504
2513
  }
2505
2514
 
2506
- var modules_63b47c51$1 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__afe72fcd","ChatWindow_Modal":"index_module_ChatWindow_Modal__afe72fcd","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__afe72fcd","header_wrap":"index_module_header_wrap__afe72fcd","top":"index_module_top__afe72fcd","user":"index_module_user__afe72fcd","count":"index_module_count__afe72fcd","operate":"index_module_operate__afe72fcd","line":"index_module_line__afe72fcd","popover_main":"index_module_popover_main__afe72fcd","popover":"index_module_popover__afe72fcd","header_wrap_newlabo":"index_module_header_wrap_newlabo__afe72fcd","Drawer_main":"index_module_Drawer_main__afe72fcd","loading":"index_module_loading__afe72fcd","message_con":"index_module_message_con__afe72fcd","left":"index_module_left__afe72fcd","head_sculpture":"index_module_head_sculpture__afe72fcd","main_content":"index_module_main_content__afe72fcd","right":"index_module_right__afe72fcd","main":"index_module_main__afe72fcd","main_content_flag":"index_module_main_content_flag__afe72fcd","operate_modal":"index_module_operate_modal__afe72fcd","operate_modal_bottom":"index_module_operate_modal_bottom__afe72fcd","active":"index_module_active__afe72fcd","stop_generate":"index_module_stop_generate__afe72fcd","icon":"index_module_icon__afe72fcd","find_teacher":"index_module_find_teacher__afe72fcd","stop_findTeacher":"index_module_stop_findTeacher__afe72fcd","content":"index_module_content__afe72fcd","content_child":"index_module_content_child__afe72fcd","find_teacher_con":"index_module_find_teacher_con__afe72fcd","sign":"index_module_sign__afe72fcd","ask_question":"index_module_ask_question__afe72fcd","association_problem":"index_module_association_problem__afe72fcd","association_problem_flag":"index_module_association_problem_flag__afe72fcd","related_issues_flag":"index_module_related_issues_flag__afe72fcd","img_con":"index_module_img_con__afe72fcd","mask_zoom":"index_module_mask_zoom__afe72fcd","img_con2":"index_module_img_con2__afe72fcd","copyCode":"index_module_copyCode__afe72fcd","time":"index_module_time__afe72fcd","citation_content":"index_module_citation_content__afe72fcd","text_exceed":"index_module_text_exceed__afe72fcd","popover_content":"index_module_popover_content__afe72fcd","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__afe72fcd","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__afe72fcd","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__afe72fcd","issues_list_teacherList":"index_module_issues_list_teacherList__afe72fcd","item":"index_module_item__afe72fcd","issues_list":"index_module_issues_list__afe72fcd","issues_list_flag":"index_module_issues_list_flag__afe72fcd","Drawer_buttom":"index_module_Drawer_buttom__afe72fcd","input_wrap":"index_module_input_wrap__afe72fcd","input":"index_module_input__afe72fcd","picture_layout":"index_module_picture_layout__afe72fcd","icon_close":"index_module_icon_close__afe72fcd","icon_zoom":"index_module_icon_zoom__afe72fcd","anticon":"index_module_anticon__afe72fcd","no_AI":"index_module_no_AI__afe72fcd","screenshot":"index_module_screenshot__afe72fcd","disabled":"index_module_disabled__afe72fcd","content_main":"index_module_content_main__afe72fcd","content_con":"index_module_content_con__afe72fcd","delete_quote":"index_module_delete_quote__afe72fcd","sending":"index_module_sending__afe72fcd","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__afe72fcd","main_list":"index_module_main_list__afe72fcd","chat_content":"index_module_chat_content__afe72fcd","popover_main_content":"index_module_popover_main_content__afe72fcd","popover_main_content_name":"index_module_popover_main_content_name__afe72fcd","teacher_layout":"index_module_teacher_layout__afe72fcd","bottom":"index_module_bottom__afe72fcd","delete":"index_module_delete__afe72fcd","num":"index_module_num__afe72fcd","shrink":"index_module_shrink__afe72fcd","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__afe72fcd","teacher_layout_modal":"index_module_teacher_layout_modal__afe72fcd","ai":"index_module_ai__afe72fcd","user_info":"index_module_user_info__afe72fcd","message":"index_module_message__afe72fcd","con":"index_module_con__afe72fcd","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__afe72fcd","history_list":"index_module_history_list__afe72fcd","search_layout":"index_module_search_layout__afe72fcd","mymove":"index_module_mymove__afe72fcd","title":"index_module_title__afe72fcd","search_top":"index_module_search_top__afe72fcd","list_item":"index_module_list_item__afe72fcd","list_summary":"index_module_list_summary__afe72fcd","head_img":"index_module_head_img__afe72fcd","list_desc":"index_module_list_desc__afe72fcd","name":"index_module_name__afe72fcd","decs":"index_module_decs__afe72fcd","open":"index_module_open__afe72fcd","list_summary_active":"index_module_list_summary_active__afe72fcd","list_detail":"index_module_list_detail__afe72fcd","list":"index_module_list__afe72fcd","list_more":"index_module_list_more__afe72fcd","no_data":"index_module_no_data__afe72fcd","history_list_broadside":"index_module_history_list_broadside__afe72fcd","teacher_list":"index_module_teacher_list__afe72fcd","screenshot_Modal":"index_module_screenshot_Modal__afe72fcd","ReactCrop":"index_module_ReactCrop__afe72fcd","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__afe72fcd"};
2515
+ var modules_63b47c51$1 = {"service_ChatWindow_Drawer":"index_module_service_ChatWindow_Drawer__344883f9","ChatWindow_Modal":"index_module_ChatWindow_Modal__344883f9","ChatWindow_Drawer":"index_module_ChatWindow_Drawer__344883f9","header_wrap":"index_module_header_wrap__344883f9","top":"index_module_top__344883f9","user":"index_module_user__344883f9","count":"index_module_count__344883f9","operate":"index_module_operate__344883f9","line":"index_module_line__344883f9","popover_main":"index_module_popover_main__344883f9","popover":"index_module_popover__344883f9","header_wrap_newlabo":"index_module_header_wrap_newlabo__344883f9","Drawer_main":"index_module_Drawer_main__344883f9","loading":"index_module_loading__344883f9","message_con":"index_module_message_con__344883f9","left":"index_module_left__344883f9","head_sculpture":"index_module_head_sculpture__344883f9","main_content":"index_module_main_content__344883f9","right":"index_module_right__344883f9","main":"index_module_main__344883f9","main_content_flag":"index_module_main_content_flag__344883f9","operate_modal":"index_module_operate_modal__344883f9","operate_modal_bottom":"index_module_operate_modal_bottom__344883f9","active":"index_module_active__344883f9","stop_generate":"index_module_stop_generate__344883f9","icon":"index_module_icon__344883f9","find_teacher":"index_module_find_teacher__344883f9","stop_findTeacher":"index_module_stop_findTeacher__344883f9","content":"index_module_content__344883f9","content_child":"index_module_content_child__344883f9","find_teacher_con":"index_module_find_teacher_con__344883f9","sign":"index_module_sign__344883f9","ask_question":"index_module_ask_question__344883f9","bottom":"index_module_bottom__344883f9","association_problem":"index_module_association_problem__344883f9","association_problem_flag":"index_module_association_problem_flag__344883f9","related_issues_flag":"index_module_related_issues_flag__344883f9","img_con":"index_module_img_con__344883f9","mask_zoom":"index_module_mask_zoom__344883f9","img_con2":"index_module_img_con2__344883f9","copyCode":"index_module_copyCode__344883f9","time":"index_module_time__344883f9","citation_content":"index_module_citation_content__344883f9","text_exceed":"index_module_text_exceed__344883f9","popover_content":"index_module_popover_content__344883f9","Drawer_main_newlabo":"index_module_Drawer_main_newlabo__344883f9","Drawer_main_newlabo_no_pic":"index_module_Drawer_main_newlabo_no_pic__344883f9","Drawer_buttom_Issues_List":"index_module_Drawer_buttom_Issues_List__344883f9","issues_list_teacherList":"index_module_issues_list_teacherList__344883f9","item":"index_module_item__344883f9","issues_list":"index_module_issues_list__344883f9","issues_list_flag":"index_module_issues_list_flag__344883f9","Drawer_buttom":"index_module_Drawer_buttom__344883f9","input_wrap":"index_module_input_wrap__344883f9","input":"index_module_input__344883f9","picture_layout":"index_module_picture_layout__344883f9","icon_close":"index_module_icon_close__344883f9","icon_zoom":"index_module_icon_zoom__344883f9","anticon":"index_module_anticon__344883f9","no_AI":"index_module_no_AI__344883f9","screenshot":"index_module_screenshot__344883f9","disabled":"index_module_disabled__344883f9","content_main":"index_module_content_main__344883f9","content_con":"index_module_content_con__344883f9","delete_quote":"index_module_delete_quote__344883f9","sending":"index_module_sending__344883f9","Drawer_buttom_Issues_List_newlabo":"index_module_Drawer_buttom_Issues_List_newlabo__344883f9","main_list":"index_module_main_list__344883f9","chat_content":"index_module_chat_content__344883f9","popover_main_content":"index_module_popover_main_content__344883f9","popover_main_content_name":"index_module_popover_main_content_name__344883f9","teacher_layout":"index_module_teacher_layout__344883f9","delete":"index_module_delete__344883f9","num":"index_module_num__344883f9","shrink":"index_module_shrink__344883f9","teacher_layout_newlabo":"index_module_teacher_layout_newlabo__344883f9","teacher_layout_modal":"index_module_teacher_layout_modal__344883f9","ai":"index_module_ai__344883f9","user_info":"index_module_user_info__344883f9","message":"index_module_message__344883f9","con":"index_module_con__344883f9","teacher_layout_modal_newlabo":"index_module_teacher_layout_modal_newlabo__344883f9","history_list":"index_module_history_list__344883f9","search_layout":"index_module_search_layout__344883f9","mymove":"index_module_mymove__344883f9","title":"index_module_title__344883f9","search_top":"index_module_search_top__344883f9","list_item":"index_module_list_item__344883f9","list_summary":"index_module_list_summary__344883f9","head_img":"index_module_head_img__344883f9","list_desc":"index_module_list_desc__344883f9","name":"index_module_name__344883f9","decs":"index_module_decs__344883f9","open":"index_module_open__344883f9","list_summary_active":"index_module_list_summary_active__344883f9","list_detail":"index_module_list_detail__344883f9","list":"index_module_list__344883f9","list_more":"index_module_list_more__344883f9","no_data":"index_module_no_data__344883f9","history_list_broadside":"index_module_history_list_broadside__344883f9","teacher_list":"index_module_teacher_list__344883f9","screenshot_Modal":"index_module_screenshot_Modal__344883f9","ReactCrop":"index_module_ReactCrop__344883f9","screenshot_Modal_btn":"index_module_screenshot_Modal_btn__344883f9"};
2507
2516
 
2508
2517
  //消息已读
2509
2518
  var readMessage = function(roomId, urllocation, userData, http) {
@@ -6793,7 +6802,7 @@ var ScreenShot = /*#__PURE__*/ function() {
6793
6802
  // 开始捕捉屏幕
6794
6803
  _define_property(this, "startCapture", function() {
6795
6804
  var _ref = _async_to_generator(function(cancelCallback) {
6796
- var captureStream, mediaWidth, mediaHeight, displayConfig, err;
6805
+ var captureStream, mediaWidth, mediaHeight, displayConfig, _captureStream_getVideoTracks, track, displaySurface, err;
6797
6806
  return __generator(this, function(_state) {
6798
6807
  switch(_state.label){
6799
6808
  case 0:
@@ -6826,6 +6835,10 @@ var ScreenShot = /*#__PURE__*/ function() {
6826
6835
  width: mediaWidth,
6827
6836
  height: mediaHeight
6828
6837
  }, displayConfig),
6838
+ systemAudio: "exclude",
6839
+ surfaceSwitching: "exclude",
6840
+ monitorTypeSurfaces: "exclude",
6841
+ selfBrowserSurface: "include",
6829
6842
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
6830
6843
  // @ts-ignore
6831
6844
  // 当前标签页默认true true:不需要选择 false:需要自己选择
@@ -6836,6 +6849,18 @@ var ScreenShot = /*#__PURE__*/ function() {
6836
6849
  // console.log("开始捕捉屏幕", { mediaWidth, mediaHeight });
6837
6850
  // 捕获屏幕
6838
6851
  captureStream = _state.sent();
6852
+ _captureStream_getVideoTracks = _sliced_to_array(captureStream.getVideoTracks(), 1), track = _captureStream_getVideoTracks[0];
6853
+ displaySurface = track.getSettings().displaySurface;
6854
+ // console.log('displaySurface',displaySurface)
6855
+ // console.log('track',track)
6856
+ if (displaySurface && displaySurface !== "window") {
6857
+ track.stop();
6858
+ throw {
6859
+ code: -2,
6860
+ msg: "请选择窗口的内容",
6861
+ errorInfo: "请选择窗口的内容"
6862
+ };
6863
+ }
6839
6864
  // 将MediaStream输出至video标签
6840
6865
  _this1.videoController.srcObject = captureStream;
6841
6866
  // 储存屏幕流数据
@@ -6846,16 +6871,17 @@ var ScreenShot = /*#__PURE__*/ function() {
6846
6871
  ];
6847
6872
  case 3:
6848
6873
  err = _state.sent();
6874
+ console.log("catchcatchcatch", err);
6849
6875
  if (cancelCallback != null) {
6850
- cancelCallback({
6876
+ cancelCallback(_object_spread({
6851
6877
  code: -1,
6852
6878
  msg: "浏览器不支持webrtc或者用户未授权",
6853
- errorInfo: err
6854
- });
6879
+ errorInfo: typeof err === "string" ? err : err.errorInfo
6880
+ }, err));
6855
6881
  }
6856
6882
  // 销毁截图组件
6857
6883
  _this1.data.destroyDOM();
6858
- throw "浏览器不支持webrtc或者用户未授权( ".concat(err, " )");
6884
+ throw "浏览器不支持webrtc或者用户未授权( ".concat(typeof err === "string" ? err : err.errorInfo, " )");
6859
6885
  case 4:
6860
6886
  return [
6861
6887
  2,
@@ -7902,6 +7928,7 @@ var CustomerService = function(props) {
7902
7928
  });
7903
7929
  var _useState33 //1是 screenShotPlugin 2是html2canvas
7904
7930
  = _sliced_to_array(useState(0), 2), screenShotType = _useState33[0], setScreenShotType = _useState33[1];
7931
+ var screenShotPlugin = useRef();
7905
7932
  useEffect(function() {
7906
7933
  // if(config && config.type == 'video'){
7907
7934
  // //获取热门推荐
@@ -7921,7 +7948,7 @@ var CustomerService = function(props) {
7921
7948
  setScreenShotType(1);
7922
7949
  console.log("看看变了没有1213133");
7923
7950
  console.log("截图方式:【screenShotPlugin】", ScreenShot);
7924
- var plugin = new ScreenShot({
7951
+ screenShotPlugin.current = new ScreenShot({
7925
7952
  clickCutFullScreen: true,
7926
7953
  enableWebRtc: true,
7927
7954
  loadCrossImg: true,
@@ -7949,13 +7976,14 @@ var CustomerService = function(props) {
7949
7976
  // base64
7950
7977
  // );
7951
7978
  setImgBese64(base64);
7979
+ window.addEventListener("resize", cancelScreenshot);
7952
7980
  },
7953
7981
  triggerCallback: function() {
7954
7982
  // 截图组件加载完毕调用此方法来完成框选区域的截图
7955
- plugin.completeScreenshot();
7983
+ screenShotPlugin.current.completeScreenshot();
7956
7984
  },
7957
7985
  cancelCallback: function(err) {
7958
- if (err.code === -1) {
7986
+ if (err.code === -1 || err.code === -2) {
7959
7987
  console.log(err);
7960
7988
  newShowType.current = false;
7961
7989
  if (saveShowType != -1) {
@@ -7964,7 +7992,9 @@ var CustomerService = function(props) {
7964
7992
  setShowType(1);
7965
7993
  }
7966
7994
  setShowScreenshot(false);
7967
- onCancel();
7995
+ if (err.code === -2) {
7996
+ message.customError(err.msg);
7997
+ }
7968
7998
  }
7969
7999
  }
7970
8000
  });
@@ -8026,6 +8056,19 @@ var CustomerService = function(props) {
8026
8056
  console.log(error);
8027
8057
  }
8028
8058
  }
8059
+ function cancelScreenshot() {
8060
+ console.log("cancelScreenshotcancelScreenshotcancelScreenshot");
8061
+ newShowType.current = false;
8062
+ if (saveShowType != -1) {
8063
+ setShowType(saveShowType);
8064
+ } else {
8065
+ setShowType(1);
8066
+ }
8067
+ setShowScreenshot(false);
8068
+ if (screenShotPlugin.current) {
8069
+ screenShotPlugin.current.destroyComponents();
8070
+ }
8071
+ }
8029
8072
  //|| showScreenshot
8030
8073
  if (showType == 5 || showScreenshot) {
8031
8074
  console.log("bbbbbbbbbbbbbb");
@@ -8092,6 +8135,7 @@ var CustomerService = function(props) {
8092
8135
  content.removeEventListener("scroll", handleScroll);
8093
8136
  }
8094
8137
  window.removeEventListener("resize", handlerHtml2canvas);
8138
+ window.removeEventListener("resize", cancelScreenshot);
8095
8139
  };
8096
8140
  }, [
8097
8141
  historyMessageList,
@@ -8496,6 +8540,9 @@ var CustomerService = function(props) {
8496
8540
  message: type == 2 ? keyWord : message,
8497
8541
  quotedMessage: citationContent.content || ""
8498
8542
  };
8543
+ if (citationContent.imageUrl) {
8544
+ obj.image = citationContent.imageUrl;
8545
+ }
8499
8546
  if (screenshotBese64) {
8500
8547
  obj.image = screenshotBese64;
8501
8548
  setScreenshotBese64("");
@@ -8544,121 +8591,142 @@ var CustomerService = function(props) {
8544
8591
  });
8545
8592
  };
8546
8593
  //发送知识库问题 item,flag == 1 是获取问候信息的答案,flag == 2 是普通消息,flag == 3 是针对视频页面点击底部推荐问题
8547
- var sendMessage = function(item, flag) {
8548
- var type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
8549
- console.log(item, flag, 888888888);
8550
- var questions = [];
8551
- if (item && flag) {
8552
- questions = [
8553
- item
8554
- ];
8555
- }
8556
- //点击知识库的问题,或者是点击问候消息
8557
- if (questions.length > 0) {
8558
- questions = questions[0];
8559
- //知识库联想的问题没有答案
8560
- if (!questions.answer && userData.modules.some(function(item) {
8561
- return item.short == "AIservice";
8562
- })) {
8563
- var sendData = {
8564
- //相关数据
8565
- roomId: roomId,
8566
- message: questions.question,
8567
- quotedMessage: "",
8568
- regenerate: true,
8569
- generateUpvoteOrDownvoteMessage: false
8570
- };
8571
- if (pageNumHistory <= 1) {
8572
- setHistoryMessageList(function(historyMessageList) {
8573
- var newHistoryMessageList = historyMessageList.concat({
8594
+ var sendMessage = function() {
8595
+ var _ref = _async_to_generator(function(item, flag) {
8596
+ var type, questions, sendData, obj, sendData1, imageUrl;
8597
+ var _arguments = arguments;
8598
+ return __generator(this, function(_state) {
8599
+ type = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : "";
8600
+ console.log(item, flag, 888888888);
8601
+ questions = [];
8602
+ if (item && flag) {
8603
+ questions = [
8604
+ item
8605
+ ];
8606
+ }
8607
+ //点击知识库的问题,或者是点击问候消息
8608
+ if (questions.length > 0) {
8609
+ questions = questions[0];
8610
+ //知识库联想的问题没有答案
8611
+ if (!questions.answer && userData.modules.some(function(item) {
8612
+ return item.short == "AIservice";
8613
+ })) {
8614
+ sendData = {
8615
+ //相关数据
8574
8616
  roomId: roomId,
8575
- sender: mid,
8576
- recevier: "AI",
8577
8617
  message: questions.question,
8578
8618
  quotedMessage: "",
8579
- id: "p" + new Date().getTime(),
8580
- upvoted: false,
8581
- downvoted: false,
8582
- createdAt: getDataTime(-1),
8583
- extraInfo: JSON.stringify([])
8584
- });
8585
- return newHistoryMessageList;
8586
- });
8587
- }
8588
- setFinished(false);
8589
- aiSendQuestions(3, sendData, 1);
8590
- return;
8591
- }
8592
- console.log(questions, "知识库内容11111");
8593
- //向知识库发送问题 type 1,发送问题 2 发送答案 obj 需要的参数
8594
- var obj = {
8595
- roomId: roomId,
8596
- sender: mid,
8597
- recevier: "AI",
8598
- message: questions.question,
8599
- extraInfos: [
8600
- {
8601
- key: "questionId",
8602
- value: flag == 1 ? questions.value : questions.id
8619
+ regenerate: true,
8620
+ generateUpvoteOrDownvoteMessage: false
8621
+ };
8622
+ if (pageNumHistory <= 1) {
8623
+ setHistoryMessageList(function(historyMessageList) {
8624
+ var newHistoryMessageList = historyMessageList.concat({
8625
+ roomId: roomId,
8626
+ sender: mid,
8627
+ recevier: "AI",
8628
+ message: questions.question,
8629
+ quotedMessage: "",
8630
+ id: "p" + new Date().getTime(),
8631
+ upvoted: false,
8632
+ downvoted: false,
8633
+ createdAt: getDataTime(-1),
8634
+ extraInfo: JSON.stringify([])
8635
+ });
8636
+ return newHistoryMessageList;
8637
+ });
8638
+ }
8639
+ setFinished(false);
8640
+ aiSendQuestions(3, sendData, 1);
8641
+ return [
8642
+ 2
8643
+ ];
8603
8644
  }
8604
- ]
8605
- };
8606
- //发送问题 1 类型,发送问题需要的参数,问题的答案id等
8607
- sendingExistingIssues(1, obj, {
8608
- key: "questionId",
8609
- value: flag == 1 ? questions.value : questions.id,
8610
- answer: questions.answer
8611
- }, type);
8612
- setKeyWord("");
8613
- setQuestionsList([]);
8614
- setCitationContent({});
8615
- } else if (userData.modules.some(function(item) {
8616
- return item.short == "AIservice";
8617
- })) {
8618
- var sendData1 = {
8619
- //相关数据
8620
- roomId: roomId,
8621
- message: keyWord,
8622
- quotedMessage: citationContent.content || "",
8623
- regenerate: citationContent.content != "" ? false : true,
8624
- generateUpvoteOrDownvoteMessage: false
8625
- };
8626
- var imageUrl = "";
8627
- if (screenshotBese64) {
8628
- sendData1.image = screenshotBese64;
8629
- imageUrl = screenshotBese64;
8630
- }
8631
- if (pageNumHistory <= 1) {
8632
- setHistoryMessageList(function(historyMessageList) {
8633
- var newHistoryMessageList = historyMessageList.concat({
8645
+ console.log(questions, "知识库内容11111");
8646
+ obj = {
8634
8647
  roomId: roomId,
8635
8648
  sender: mid,
8636
8649
  recevier: "AI",
8637
- message: keyWord,
8638
- quotedMessage: citationContent.content,
8639
- id: "p" + new Date().getTime(),
8640
- upvoted: false,
8641
- downvoted: false,
8642
- createdAt: getDataTime(-1),
8643
- extraInfo: imageUrl ? JSON.stringify([
8650
+ message: questions.question,
8651
+ extraInfos: [
8644
8652
  {
8645
- key: "imageUrl",
8646
- value: imageUrl
8653
+ key: "questionId",
8654
+ value: flag == 1 ? questions.value : questions.id
8647
8655
  }
8648
- ]) : JSON.stringify([])
8649
- });
8650
- return newHistoryMessageList;
8651
- });
8652
- }
8653
- setFinished(false);
8654
- aiSendQuestions(3, sendData1, 1);
8655
- setScreenshotBese64("");
8656
- //存在AI客服
8657
- } else {
8658
- //不存在AI客服
8659
- sendGreetingMessage(4);
8660
- }
8661
- };
8656
+ ]
8657
+ };
8658
+ //发送问题 1 类型,发送问题需要的参数,问题的答案id等
8659
+ sendingExistingIssues(1, obj, {
8660
+ key: "questionId",
8661
+ value: flag == 1 ? questions.value : questions.id,
8662
+ answer: questions.answer
8663
+ }, type);
8664
+ setKeyWord("");
8665
+ setQuestionsList([]);
8666
+ setCitationContent({});
8667
+ } else if (userData.modules.some(function(item) {
8668
+ return item.short == "AIservice";
8669
+ })) {
8670
+ console.log("citationContent", citationContent);
8671
+ sendData1 = {
8672
+ //相关数据
8673
+ roomId: roomId,
8674
+ message: keyWord,
8675
+ quotedMessage: citationContent.content || "",
8676
+ regenerate: citationContent.content != "" ? false : true,
8677
+ generateUpvoteOrDownvoteMessage: false
8678
+ };
8679
+ imageUrl = "";
8680
+ if (citationContent.imageUrl) {
8681
+ // let base64:string=await urlToBase64(citationContent.imageUrl) as string
8682
+ console.log("citationContent.imageUrl", citationContent.imageUrl);
8683
+ sendData1.image = citationContent.imageUrl;
8684
+ imageUrl = citationContent.imageUrl;
8685
+ }
8686
+ if (screenshotBese64) {
8687
+ console.log("screenshotBese64", screenshotBese64);
8688
+ sendData1.image = screenshotBese64;
8689
+ imageUrl = screenshotBese64;
8690
+ }
8691
+ if (pageNumHistory <= 1) {
8692
+ setHistoryMessageList(function(historyMessageList) {
8693
+ var newHistoryMessageList = historyMessageList.concat({
8694
+ roomId: roomId,
8695
+ sender: mid,
8696
+ recevier: "AI",
8697
+ message: keyWord,
8698
+ quotedMessage: citationContent.content,
8699
+ id: "p" + new Date().getTime(),
8700
+ upvoted: false,
8701
+ downvoted: false,
8702
+ createdAt: getDataTime(-1),
8703
+ extraInfo: imageUrl ? JSON.stringify([
8704
+ {
8705
+ key: "imageUrl",
8706
+ value: imageUrl
8707
+ }
8708
+ ]) : JSON.stringify([])
8709
+ });
8710
+ return newHistoryMessageList;
8711
+ });
8712
+ }
8713
+ setFinished(false);
8714
+ aiSendQuestions(3, sendData1, 1);
8715
+ setScreenshotBese64("");
8716
+ //存在AI客服
8717
+ } else {
8718
+ //不存在AI客服
8719
+ sendGreetingMessage(4);
8720
+ }
8721
+ return [
8722
+ 2
8723
+ ];
8724
+ });
8725
+ });
8726
+ return function sendMessage(item, flag) {
8727
+ return _ref.apply(this, arguments);
8728
+ };
8729
+ }();
8662
8730
  //向知识库发送问题 或答案 type:1 发送问题 2 接受答案
8663
8731
  var sendingExistingIssues = function(type, obj, questions, problemType) {
8664
8732
  if (pageNumHistory <= 1) {
@@ -8900,7 +8968,7 @@ var CustomerService = function(props) {
8900
8968
  },
8901
8969
  onmessage: function(event) {
8902
8970
  //识别的内容
8903
- // console.log("eventSource msg: ", event.data);
8971
+ console.log("eventSource msg: ", event.data);
8904
8972
  var msg = JSON.parse(event.data);
8905
8973
  if (msg.message) {
8906
8974
  content = content + msg.message;
@@ -8934,13 +9002,18 @@ var CustomerService = function(props) {
8934
9002
  };
8935
9003
  //渲染AI回答
8936
9004
  var renderAiAnswer = function(msg, message_id, type) {
9005
+ console.log("renderAiAnswer", {
9006
+ msg: msg,
9007
+ message_id: message_id,
9008
+ type: type
9009
+ });
8937
9010
  // console.log(pageNumHistory,5555555);
8938
9011
  // console.log(aiSendQuestions().abort(),'slkdsdsdsd')
8939
9012
  if (pageNumHistory > 1) return;
8940
9013
  var obj = msg;
8941
9014
  var id = msg.messageId;
8942
- setHistoryMessageList(function(historyMessageList) {
8943
- var list1 = historyMessageList;
9015
+ setHistoryMessageList(function(prevHistoryMessageList) {
9016
+ var list1 = prevHistoryMessageList;
8944
9017
  //删除临时数据
8945
9018
  list1 = list1.filter(function(item) {
8946
9019
  return item.id != "123456";
@@ -8951,9 +9024,13 @@ var CustomerService = function(props) {
8951
9024
  return item.id != message_id;
8952
9025
  });
8953
9026
  }
8954
- var list = historyMessageList.filter(function(item) {
9027
+ var list = prevHistoryMessageList.filter(function(item) {
8955
9028
  return item.id == id;
8956
9029
  });
9030
+ console.log("renderAiAnswer", {
9031
+ list1: list1,
9032
+ list: list
9033
+ });
8957
9034
  var message = "";
8958
9035
  if (list.length == 0) {
8959
9036
  message = obj.message;
@@ -9002,6 +9079,7 @@ var CustomerService = function(props) {
9002
9079
  return newHistoryMessageList2;
9003
9080
  }
9004
9081
  });
9082
+ console.log("historyMessageList", historyMessageList);
9005
9083
  if (isPosition.current) {
9006
9084
  scrollToBottom();
9007
9085
  }
@@ -9881,7 +9959,7 @@ var CustomerService = function(props) {
9881
9959
  setCitationContent({
9882
9960
  content: item.message,
9883
9961
  id: item.id,
9884
- imageUrl: item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
9962
+ imageUrl: !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
9885
9963
  });
9886
9964
  resettingBottomHei();
9887
9965
  onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
@@ -9928,7 +10006,7 @@ var CustomerService = function(props) {
9928
10006
  },
9929
10007
  className: styles.content_child
9930
10008
  }),
9931
- item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
10009
+ !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
9932
10010
  className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
9933
10011
  children: [
9934
10012
  /*#__PURE__*/ jsx("img", {
@@ -9950,22 +10028,41 @@ var CustomerService = function(props) {
9950
10028
  ]
9951
10029
  }),
9952
10030
  //引用消息
9953
- item.quotedMessage && /*#__PURE__*/ jsx("div", {
10031
+ item.quotedMessage && /*#__PURE__*/ jsxs("div", {
9954
10032
  className: styles.citation_content,
9955
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
9956
- overlayClassName: styles.popover_main_content,
9957
- title: item.quotedMessage,
9958
- placement: "leftTop",
9959
- children: /*#__PURE__*/ jsxs("p", {
9960
- className: styles.text_exceed,
10033
+ children: [
10034
+ getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10035
+ overlayClassName: styles.popover_main_content,
10036
+ title: item.quotedMessage,
10037
+ placement: "leftTop",
10038
+ children: /*#__PURE__*/ jsxs("p", {
10039
+ className: styles.text_exceed,
10040
+ children: [
10041
+ item.quotedMessage,
10042
+ /*#__PURE__*/ jsx(RightOutlined, {})
10043
+ ]
10044
+ })
10045
+ }) : /*#__PURE__*/ jsx("p", {
10046
+ children: item.quotedMessage
10047
+ }),
10048
+ item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
10049
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
9961
10050
  children: [
9962
- item.quotedMessage,
9963
- /*#__PURE__*/ jsx(RightOutlined, {})
10051
+ /*#__PURE__*/ jsx("img", {
10052
+ src: JSON.parse(item.extraInfo)[0].value
10053
+ }),
10054
+ /*#__PURE__*/ jsx("div", {
10055
+ className: styles.mask_zoom,
10056
+ children: /*#__PURE__*/ jsx(ZoomInOutlined, {
10057
+ onClick: function() {
10058
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
10059
+ setVisible(true);
10060
+ }
10061
+ })
10062
+ })
9964
10063
  ]
9965
10064
  })
9966
- }) : /*#__PURE__*/ jsx("p", {
9967
- children: item.quotedMessage
9968
- })
10065
+ ]
9969
10066
  })
9970
10067
  ]
9971
10068
  })
@@ -10010,7 +10107,7 @@ var CustomerService = function(props) {
10010
10107
  }) : "",
10011
10108
  /*#__PURE__*/ jsxs("li", {
10012
10109
  className: styles.right,
10013
- id: lastId == item.id ? "li_flag" : "",
10110
+ id: lastId == item.id ? "li_flag" : item.id,
10014
10111
  children: [
10015
10112
  (showType == 2 || showType == 4) && /*#__PURE__*/ jsx("div", {
10016
10113
  className: styles.head_sculpture,
@@ -10030,9 +10127,34 @@ var CustomerService = function(props) {
10030
10127
  children: [
10031
10128
  /*#__PURE__*/ jsxs("div", {
10032
10129
  className: styles.main_content_flag,
10130
+ onMouseEnter: function() {
10131
+ var dom = document.getElementById(item.id);
10132
+ if (dom) {
10133
+ var con_h = document.getElementById("chat_content").clientHeight - 24; //滚动区域的高度
10134
+ var rectY = dom.getBoundingClientRect().y - 48;
10135
+ var h = dom.clientHeight; //当前元素高度
10136
+ var topDom = dom.getElementsByClassName("operate_modal_showtop")[0];
10137
+ var bottomDom = dom.getElementsByClassName("operate_modal_showbottom")[0];
10138
+ if (topDom && bottomDom) {
10139
+ // console.log(h,dom.getBoundingClientRect().y,rectY)
10140
+ if (rectY > 0) {
10141
+ topDom.style.cssText = "";
10142
+ bottomDom.style.cssText = "visibility: hidden;";
10143
+ // 上下都能显示时,显示到下边
10144
+ if (h < con_h - rectY) {
10145
+ topDom.style.cssText = "visibility: hidden;";
10146
+ bottomDom.style.cssText = "";
10147
+ }
10148
+ } else {
10149
+ topDom.style.cssText = "visibility: hidden;";
10150
+ bottomDom.style.cssText = "";
10151
+ }
10152
+ }
10153
+ }
10154
+ },
10033
10155
  children: [
10034
10156
  /*#__PURE__*/ jsx("div", {
10035
- className: styles.operate_modal,
10157
+ className: "".concat(styles.operate_modal, " operate_modal_showtop"),
10036
10158
  children: // 不是最后一行,
10037
10159
  historyMessageList.length - 1 != i && renderOperateBtn(item, isAiChatWindow, i)
10038
10160
  }),
@@ -10112,26 +10234,50 @@ var CustomerService = function(props) {
10112
10234
  //findTeacher//是否在召唤老师过程中,是否是最后一条消息
10113
10235
  !item.findTeacher && historyMessageList.length - 1 == i && item.id != "123456" && item.id != "123456_date" && renderLastOperateBtn(item, isAiChatWindow, i)
10114
10236
  ]
10237
+ }),
10238
+ historyMessageList.length - 1 !== i && /*#__PURE__*/ jsx("div", {
10239
+ className: "".concat(styles.operate_modal, " ").concat(styles.bottom, " operate_modal_showbottom"),
10240
+ children: // 不是最后一行,
10241
+ renderOperateBtn(item, isAiChatWindow, i)
10115
10242
  })
10116
10243
  ]
10117
10244
  }),
10118
10245
  //引用消息
10119
- item.quotedMessage && /*#__PURE__*/ jsx("div", {
10246
+ item.quotedMessage && /*#__PURE__*/ jsxs("div", {
10120
10247
  className: styles.citation_content,
10121
- children: getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10122
- overlayClassName: styles.popover_main_content,
10123
- title: item.quotedMessage,
10124
- placement: "rightTop",
10125
- children: /*#__PURE__*/ jsxs("p", {
10126
- className: styles.text_exceed,
10248
+ children: [
10249
+ getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ jsx(Tooltip, {
10250
+ overlayClassName: styles.popover_main_content,
10251
+ title: item.quotedMessage,
10252
+ placement: "rightTop",
10253
+ children: /*#__PURE__*/ jsxs("p", {
10254
+ className: styles.text_exceed,
10255
+ children: [
10256
+ item.quotedMessage,
10257
+ /*#__PURE__*/ jsx(RightOutlined, {})
10258
+ ]
10259
+ })
10260
+ }) : /*#__PURE__*/ jsx("p", {
10261
+ children: item.quotedMessage
10262
+ }),
10263
+ item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ jsxs("p", {
10264
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
10127
10265
  children: [
10128
- item.quotedMessage,
10129
- /*#__PURE__*/ jsx(RightOutlined, {})
10266
+ /*#__PURE__*/ jsx("img", {
10267
+ src: JSON.parse(item.extraInfo)[0].value
10268
+ }),
10269
+ /*#__PURE__*/ jsx("div", {
10270
+ className: styles.mask_zoom,
10271
+ children: /*#__PURE__*/ jsx(ZoomInOutlined, {
10272
+ onClick: function() {
10273
+ setViewBase64(JSON.parse(item.extraInfo)[0].value);
10274
+ setVisible(true);
10275
+ }
10276
+ })
10277
+ })
10130
10278
  ]
10131
10279
  })
10132
- }) : /*#__PURE__*/ jsx("p", {
10133
- children: item.quotedMessage
10134
- })
10280
+ ]
10135
10281
  })
10136
10282
  ]
10137
10283
  })
@@ -10184,6 +10330,7 @@ var CustomerService = function(props) {
10184
10330
  onClick: function() {
10185
10331
  setCitationContent({
10186
10332
  content: item.message,
10333
+ imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
10187
10334
  id: item.id
10188
10335
  });
10189
10336
  resettingBottomHei();
@@ -10384,6 +10531,7 @@ var CustomerService = function(props) {
10384
10531
  onClick: function() {
10385
10532
  setCitationContent({
10386
10533
  content: item.message,
10534
+ imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
10387
10535
  id: item.id
10388
10536
  });
10389
10537
  resettingBottomHei();
@@ -10480,10 +10628,7 @@ var CustomerService = function(props) {
10480
10628
  };
10481
10629
  //保存粘贴的图片
10482
10630
  var handleFilePaste = function(e) {
10483
- e.preventDefault();
10484
- var items = e.clipboardData.items;
10485
- // console.log(e,items,3333333)
10486
- for(var i = 0; i < items.length; i++){
10631
+ var _loop = function(i) {
10487
10632
  var item = items[i];
10488
10633
  if (item.kind === "file") {
10489
10634
  var file = item.getAsFile();
@@ -10505,8 +10650,27 @@ var CustomerService = function(props) {
10505
10650
  var pastedText = clipboardData.getData("text");
10506
10651
  var con = keyWord + pastedText;
10507
10652
  setKeyWord(con);
10653
+ if (con == "") {
10654
+ setQuestionsList([]);
10655
+ clearTimeout(timer.current);
10656
+ } else {
10657
+ clearTimeout(timer.current);
10658
+ timer.current = setTimeout(function() {
10659
+ if (config && config.type == "video") {
10660
+ getQuestiionsList(String(con), 3);
10661
+ } else {
10662
+ getQuestiionsList(String(con), 2);
10663
+ }
10664
+ }, 1000);
10665
+ }
10666
+ setBottomRecommendationQuestions([]);
10667
+ resettingBottomHei();
10508
10668
  }
10509
- }
10669
+ };
10670
+ e.preventDefault();
10671
+ var items = e.clipboardData.items;
10672
+ // console.log(e,items,3333333)
10673
+ for(var i = 0; i < items.length; i++)_loop(i);
10510
10674
  };
10511
10675
  //发送截图信息
10512
10676
  var sendScreenshotData = function(message) {
@@ -10692,13 +10856,24 @@ var CustomerService = function(props) {
10692
10856
  citationContent.content && /*#__PURE__*/ jsxs("div", {
10693
10857
  className: styles.content_main,
10694
10858
  children: [
10695
- /*#__PURE__*/ jsx("div", {
10859
+ /*#__PURE__*/ jsxs("div", {
10696
10860
  className: styles.content_con,
10697
- children: /*#__PURE__*/ jsx("p", {
10698
- children: /*#__PURE__*/ jsx("span", {
10699
- children: citationContent.content
10861
+ children: [
10862
+ /*#__PURE__*/ jsx("p", {
10863
+ children: /*#__PURE__*/ jsx("span", {
10864
+ children: citationContent.content
10865
+ })
10866
+ }),
10867
+ citationContent.imageUrl && /*#__PURE__*/ jsx("p", {
10868
+ children: /*#__PURE__*/ jsx("img", {
10869
+ src: citationContent.imageUrl,
10870
+ onClick: function() {
10871
+ setViewBase64(citationContent.imageUrl);
10872
+ setVisible(true);
10873
+ }
10874
+ })
10700
10875
  })
10701
- })
10876
+ ]
10702
10877
  }),
10703
10878
  /*#__PURE__*/ jsx("i", {
10704
10879
  className: styles.delete_quote,
@@ -12173,4 +12348,4 @@ var BhdDatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
12173
12348
  });
12174
12349
  var BhdDatePicker$1 = BhdDatePicker;
12175
12350
 
12176
- export { BhdAppLayout, BhdDatePicker$1 as BhdDatePicker, BhdSelect$1 as BhdSelect, BhdTableSelect$1 as BhdTableSelect, BhdTableSimple$1 as BhdTableSimple, BhdTipModal$1 as BhdTipModal, CustomerService$1 as CustomerService, Pagination, Provider$1 as Provider, Table$1 as Table, TextTootip$1 as TextTootip, TitleBar$1 as TitleBar, ViewImage$1 as ViewImage, BhdMessage$1 as message };
12351
+ export { BhdAppLayout, BhdDatePicker$1 as BhdDatePicker, BhdSelect$1 as BhdSelect, BhdTableSelect$1 as BhdTableSelect, BhdTableSimple$1 as BhdTableSimple, BhdTipModal$1 as BhdTipModal, CustomerService$1 as CustomerService, Pagination, Provider$1 as Provider, Table$1 as Table, TextTootip$1 as TextTootip, TitleBar$1 as TitleBar, ViewImage$1 as ViewImage, message };