bhd-components 0.9.2 → 0.9.4

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.
Files changed (87) hide show
  1. package/README.md +1 -1
  2. package/dist/index.esm.es5.development.css +456 -364
  3. package/dist/index.esm.es5.development.js +414 -323
  4. package/dist/index.esm.es5.production.css +1 -1
  5. package/dist/index.esm.es5.production.js +1 -1
  6. package/dist/vendor.esm.es5.development.css +119 -0
  7. package/dist/{a5565b8a.esm.es5.development.js → vendor.esm.es5.development.js} +8247 -6856
  8. package/dist/vendor.esm.es5.production.css +11 -0
  9. package/dist/vendor.esm.es5.production.js +485 -0
  10. package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +1 -1
  11. package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +2 -2
  12. package/es2017/bhdAppLayout/index.js +16 -16
  13. package/es2017/bhdDatePicker/index.d.ts +1 -2
  14. package/es2017/bhdDatePicker/index.js +311 -254
  15. package/es2017/bhdDatePicker/index.module.less +106 -9
  16. package/es2017/bhdSelect/index.js +4 -4
  17. package/es2017/bhdTipModal/index.js +6 -6
  18. package/es2017/customerService/contactsList.d.ts +2 -2
  19. package/es2017/customerService/contactsList.js +2 -2
  20. package/es2017/customerService/function.js +2 -1
  21. package/es2017/customerService/historyFun.d.ts +2 -2
  22. package/es2017/customerService/historyFun.js +2 -2
  23. package/es2017/customerService/index.d.ts +2 -2
  24. package/es2017/customerService/index.js +5 -5
  25. package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +1 -1
  26. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +1 -1
  27. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
  28. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
  29. package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
  30. package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
  31. package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +2 -2
  32. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +6 -5
  33. package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
  34. package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +1 -1
  35. package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
  36. package/es2017/customerService/js-screen-shot/main.js +38 -35
  37. package/es2017/customerService/screenshotTool.d.ts +2 -2
  38. package/es2017/customerService/screenshotTool.js +2 -2
  39. package/es2017/customerService/teacherList.d.ts +2 -2
  40. package/es2017/customerService/teacherList.js +2 -2
  41. package/es2017/i18n/en_US.js +16 -1
  42. package/es2017/i18n/zh_CN.js +16 -1
  43. package/es2017/icons/index.js +2 -2
  44. package/es2017/index.js +14 -14
  45. package/es2017/provider/index.js +2 -2
  46. package/es2017/table/index.js +4 -4
  47. package/es2017/tableSelect/index.js +3 -3
  48. package/es2017/textTootip/index.js +1 -1
  49. package/es2017/titleBar/index.js +3 -3
  50. package/es2017/viewImage/index.js +13 -13
  51. package/esm/bhdAppLayout/index.js +15 -15
  52. package/esm/bhdDatePicker/index.d.ts +1 -2
  53. package/esm/bhdDatePicker/index.js +312 -255
  54. package/esm/bhdDatePicker/index.module.less +106 -9
  55. package/esm/bhdSelect/index.js +1 -1
  56. package/esm/bhdTipModal/index.js +1 -1
  57. package/esm/customerService/contactsList.d.ts +2 -2
  58. package/esm/customerService/contactsList.js +1 -1
  59. package/esm/customerService/function.js +2 -1
  60. package/esm/customerService/historyFun.d.ts +2 -2
  61. package/esm/customerService/historyFun.js +1 -1
  62. package/esm/customerService/index.d.ts +2 -2
  63. package/esm/customerService/index.js +1 -1
  64. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
  65. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
  66. package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
  67. package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
  68. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +5 -4
  69. package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
  70. package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
  71. package/esm/customerService/js-screen-shot/main.js +31 -28
  72. package/esm/customerService/screenshotTool.d.ts +2 -2
  73. package/esm/customerService/screenshotTool.js +1 -1
  74. package/esm/customerService/teacherList.d.ts +2 -2
  75. package/esm/customerService/teacherList.js +1 -1
  76. package/esm/i18n/en_US.js +16 -1
  77. package/esm/i18n/zh_CN.js +16 -1
  78. package/esm/icons/index.js +1 -1
  79. package/esm/index.js +14 -14
  80. package/esm/tableSelect/index.js +1 -1
  81. package/esm/viewImage/index.js +3 -3
  82. package/package.json +1 -1
  83. package/dist/deb6cc9b.esm.es5.production.js +0 -485
  84. package/dist/vendor.esm.es5.development.esm.es5.development.css +0 -119
  85. package/dist/vendor.esm.es5.production.esm.es5.production.css +0 -11
  86. package/es2017/customerService/screenShotPlugin.esm.js +0 -6515
  87. package/esm/customerService/screenShotPlugin.esm.js +0 -6516
@@ -255,6 +255,14 @@
255
255
  }
256
256
  }
257
257
 
258
+
259
+ // 多面板
260
+ .bhd-picker-panels {
261
+ & .bhd-picker-panel {
262
+ border: none;
263
+ }
264
+ }
265
+
258
266
  // 设置底部区域
259
267
  .bhd-picker-footer {
260
268
  padding: 12px 16px;
@@ -267,12 +275,14 @@
267
275
  border-top: 1px solid @color-background-fillsecondary-Tr !important;
268
276
  line-height: 30px !important;
269
277
  align-items: center;
270
- flex-direction: row-reverse;
271
- justify-content: flex-start;
272
278
 
273
279
  & .bhd-picker-footer-extra {
274
280
  padding: 0;
275
281
  line-height: 30px;
282
+ width: 100%;
283
+ display: flex;
284
+ flex-direction: column;
285
+ gap: 16px;
276
286
 
277
287
  &:not(:last-child) {
278
288
  border-bottom: none;
@@ -285,6 +295,16 @@
285
295
  height: 30px;
286
296
  gap: 10px;
287
297
  align-items: center;
298
+ justify-content: flex-end;
299
+ width: 100%;
300
+ & > li {
301
+ line-height: 30px;
302
+ height: 30px;
303
+ margin: 0;
304
+ &.bhd-picker-ok {
305
+ font-size: 0;
306
+ }
307
+ }
288
308
 
289
309
  & .bhd-picker-now {
290
310
  color: @color-background-primary-base;
@@ -294,6 +314,22 @@
294
314
  }
295
315
  }
296
316
 
317
+ // 自己扩展
318
+ & .bhddatepicker-picker-footer-extra-extend {
319
+ position: relative;
320
+ padding-bottom: 8px;
321
+ &::after {
322
+ content: "";
323
+ width: calc(100% + 100px);
324
+ height: 0px;
325
+ border-bottom: 1px solid @color-background-fillsecondary-Tr;
326
+ // background-color: @color-background-fillsecondary-Tr;
327
+ position: absolute;
328
+ left: -50px;
329
+ bottom: 0;
330
+ }
331
+ }
332
+
297
333
  // 今天按钮
298
334
  .bhd-picker-today-btn {
299
335
  font-size: 14px;
@@ -331,10 +367,9 @@
331
367
  & .bhd-btn-primary {
332
368
  height: 30px;
333
369
  padding: 0 16px;
334
- // line-height: 30px;
370
+ line-height: 30px;
335
371
  border: none;
336
372
  box-shadow: none;
337
- line-height: 21px;
338
373
 
339
374
  &:disabled,
340
375
  &.disabled {
@@ -349,18 +384,24 @@
349
384
 
350
385
  // 隐藏默认的当前
351
386
  & > a {
352
- display: none;
387
+ // display: none;
353
388
  }
354
389
  // & > .bhd-picker-ranges {
355
390
  // display: none;
356
391
  // }
392
+
393
+ & > a.bhd-picker-today-btn {
394
+ position: absolute;
395
+ right: 91px;
396
+ }
357
397
  }
358
398
 
359
- // 默认
399
+ // 默认颜色
360
400
  .bhd-picker-cell-in-view {
361
401
  color: @color-text-Secondary-Tr;
362
402
  }
363
403
 
404
+ //禁用后的今天
364
405
  .bhd-picker-cell-disabled.bhd-picker-cell-today
365
406
  .bhd-picker-cell-inner::before {
366
407
  border-color: @color-background-primary-base !important;
@@ -370,6 +411,43 @@
370
411
  color: @color-text-quaternary-Tr !important;
371
412
  }
372
413
  }
414
+
415
+ &.showTime {
416
+ :global {
417
+ .bhd-picker-footer {
418
+ justify-content: flex-end;
419
+ .bhd-picker-footer-extra {
420
+ width: auto;
421
+ }
422
+ .bhd-picker-ranges {
423
+ width: auto;
424
+ }
425
+ }
426
+ }
427
+ &.showExtraFooter {
428
+ :global {
429
+ .bhd-picker-footer {
430
+ justify-content: flex-start;
431
+ flex-direction: column;
432
+ .bhd-picker-footer-extra {
433
+ width: 100% !important;
434
+ }
435
+ .bhd-picker-ranges {
436
+ width: 100% !important;
437
+ &.showPresets {
438
+ position: absolute;
439
+ width: auto !important;
440
+ bottom: 12px;
441
+ right: 100px;
442
+ &.showNow {
443
+ right: 128px;
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+ }
373
451
  }
374
452
 
375
453
  // 单选
@@ -701,12 +779,22 @@
701
779
  // 隐藏底部
702
780
  .bhd-picker-footer {
703
781
  display: none !important;
782
+ .bhd-picker-ranges {
783
+ display: none !important;
784
+ }
785
+ .bhddatepicker-picker-footer-extra-extend {
786
+ padding-bottom: 0;
787
+ &::after {
788
+ display: none;
789
+ }
790
+ }
704
791
  }
705
792
 
706
793
  // 头部位置变更
707
794
  .bhd-picker-header {
708
795
  position: relative;
709
- .bhd-picker-header-prev-btn {
796
+ .bhd-picker-header-prev-btn,
797
+ .bhd-picker-header-super-prev-btn {
710
798
  position: absolute;
711
799
  right: 40px;
712
800
  border: none !important;
@@ -715,7 +803,8 @@
715
803
  position: absolute;
716
804
  left: 0;
717
805
  }
718
- .bhd-picker-header-next-btn {
806
+ .bhd-picker-header-next-btn,
807
+ .bhd-picker-header-super-next-btn {
719
808
  position: absolute;
720
809
  right: 0;
721
810
  border: none !important;
@@ -726,6 +815,14 @@
726
815
  color: @color-text-Secondary-Tr;
727
816
  }
728
817
  }
818
+
819
+ &.showExtraFooter {
820
+ :global {
821
+ .bhd-picker-footer {
822
+ display: flex !important;
823
+ }
824
+ }
825
+ }
729
826
  }
730
827
  }
731
828
 
@@ -762,7 +859,7 @@
762
859
  }
763
860
  tbody {
764
861
  tr {
765
- background-color: @color-background-elevated;
862
+ background-color: transparent;
766
863
  border: none !important;
767
864
  td {
768
865
  border: none !important;
@@ -3,11 +3,11 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
4
4
  import * as React from "react";
5
5
  import { useState, useEffect, useRef } from "react";
6
- import { CaretDownOutlined, CustomArrow } from "../icons/index";
6
+ import { CaretDownOutlined, CustomArrow } from "../icons";
7
7
  import { Select, Input } from "antd";
8
8
  import styles from "./index.module.less";
9
9
  const Search = Input.Search;
10
- const RenderDrop = ({ menu , bhdDropdownRef , mask , initHeight })=>{
10
+ const RenderDrop = ({ menu, bhdDropdownRef, mask, initHeight })=>{
11
11
  useEffect(()=>{
12
12
  if (mask) {
13
13
  let parent = bhdDropdownRef.current.parentNode.parentNode.parentNode;
@@ -19,7 +19,7 @@ const RenderDrop = ({ menu , bhdDropdownRef , mask , initHeight })=>{
19
19
  return menu;
20
20
  };
21
21
  const BhdSelect = (props)=>{
22
- let { mask =false , popupClassName ="" , suffixIcon , className ="" , optionClassName ="" , children , showSearch , dropdownRender , search_placeholder , select_title , search_label ="label" , options , arrowType ="default" , searchClassName ="" , useType ="" , listHeight =0 } = props;
22
+ let { mask = false, popupClassName = "", suffixIcon, className = "", optionClassName = "", children, showSearch, dropdownRender, search_placeholder, select_title, search_label = "label", options, arrowType = "default", searchClassName = "", useType = "", listHeight = 0 } = props;
23
23
  const bhdDropdownRef = useRef(null);
24
24
  const bhdSelectRef = useRef(null);
25
25
  const [clientY, setclientY] = useState(0); //下拉列表距离顶部的高度
@@ -160,7 +160,7 @@ const BhdSelect = (props)=>{
160
160
  },
161
161
  children: /*#__PURE__*/ _jsx(Search, {
162
162
  placeholder: search_placeholder ? search_placeholder : "请输入",
163
- onChange: ({ target: { value } })=>{
163
+ onChange: ({ target: { value } })=>{
164
164
  setFilterValue(value);
165
165
  },
166
166
  className: `${styles.search} ${searchClassName || ""}`,
@@ -3,10 +3,10 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
4
  import * as React from "react";
5
5
  import { Modal } from "./modal";
6
- import { Confirm, Success, Info } from "../images/index";
6
+ import { Confirm, Success, Info } from "../images";
7
7
  import styles from "./index.module.less";
8
8
  const initConFirmModal = (obj)=>{
9
- let { title , content , cancelBtn =true , okText ="确定" , keyboard =false , cancelText ="取消" , autoFocusButton =null } = obj;
9
+ let { title, content, cancelBtn = true, okText = "确定", keyboard = false, cancelText = "取消", autoFocusButton = null } = obj;
10
10
  return _object_spread_props(_object_spread({
11
11
  centered: true,
12
12
  okText,
@@ -43,7 +43,7 @@ const initConFirmModal = (obj)=>{
43
43
  });
44
44
  };
45
45
  const initSuccessModal = (obj)=>{
46
- let { title , content , cancelBtn =true , keyboard =false , otherContent , okText ="确定" , cancelText ="取消" , autoFocusButton =null } = obj;
46
+ let { title, content, cancelBtn = true, keyboard = false, otherContent, okText = "确定", cancelText = "取消", autoFocusButton = null } = obj;
47
47
  return _object_spread_props(_object_spread({
48
48
  centered: true,
49
49
  okText,
@@ -81,7 +81,7 @@ const initSuccessModal = (obj)=>{
81
81
  });
82
82
  };
83
83
  const initCustomModal = (obj)=>{
84
- let { title , content , keyboard =false , okText ="确定" , cancelText ="取消" , cancelBtn =true , okBtn =false , autoFocusButton =null } = obj;
84
+ let { title, content, keyboard = false, okText = "确定", cancelText = "取消", cancelBtn = true, okBtn = false, autoFocusButton = null } = obj;
85
85
  return _object_spread_props(_object_spread({
86
86
  centered: true,
87
87
  okText,
@@ -107,7 +107,7 @@ const initCustomModal = (obj)=>{
107
107
  });
108
108
  };
109
109
  const initInfoModal = (obj)=>{
110
- let { title , content , cancelBtn =false , keyboard =false , okText ="确定" , cancelText ="取消" , autoFocusButton =null } = obj;
110
+ let { title, content, cancelBtn = false, keyboard = false, okText = "确定", cancelText = "取消", autoFocusButton = null } = obj;
111
111
  return _object_spread_props(_object_spread({
112
112
  centered: true,
113
113
  okText,
@@ -144,7 +144,7 @@ const initInfoModal = (obj)=>{
144
144
  });
145
145
  };
146
146
  const initWarnModal = (obj)=>{
147
- let { title , content , cancelBtn =false , keyboard =false , okText ="确定" , cancelText ="取消" , autoFocusButton =null } = obj;
147
+ let { title, content, cancelBtn = false, keyboard = false, okText = "确定", cancelText = "取消", autoFocusButton = null } = obj;
148
148
  return _object_spread_props(_object_spread({
149
149
  centered: true,
150
150
  okText,
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  interface data {
3
3
  type: number;
4
4
  roomId: string;
@@ -10,5 +10,5 @@ interface data {
10
10
  contactsList: any;
11
11
  ref: any;
12
12
  }
13
- declare const ContactsList: import("react").ForwardRefExoticComponent<Omit<data, "ref"> & import("react").RefAttributes<unknown>>;
13
+ declare const ContactsList: React.ForwardRefExoticComponent<Omit<data, "ref"> & React.RefAttributes<unknown>>;
14
14
  export default ContactsList;
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
2
2
  import React, { forwardRef } from "react";
3
3
  import styles from "./index.module.less";
4
4
  import { Tooltip } from "antd";
5
- import { CustomAiIcon, CustomRetract } from "../icons/index";
5
+ import { CustomAiIcon, CustomRetract } from "../icons";
6
6
  import { CloseOutlined } from "@ant-design/icons";
7
7
  import { getByteLen, formatDate } from "./function"; //录音使用文件
8
8
  const ContactsList = /*#__PURE__*/ forwardRef((props, ref)=>{
9
- let { type , roomId , userData , http , urllocation , onClose , switchChatRoom , contactsList } = props;
9
+ let { type, roomId, userData, http, urllocation, onClose, switchChatRoom, contactsList } = props;
10
10
  //删除聊天室
11
11
  const deleteRoom = (roomId)=>{
12
12
  http.delete(`${urllocation}/chat-service/public/v1.0/rooms/${roomId}`, {}).then((res)=>{
@@ -122,11 +122,12 @@ const getBase64Image = (src)=>{
122
122
  img.crossOrigin = '';
123
123
  img.src = src;
124
124
  img.onload = function() {
125
+ var _ctx;
125
126
  const canvas = document.createElement('canvas');
126
127
  canvas.width = img.width;
127
128
  canvas.height = img.height;
128
129
  const ctx = canvas.getContext('2d');
129
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(img, 0, 0, img.width, img.height);
130
+ (_ctx = ctx) === null || _ctx === void 0 ? void 0 : _ctx.drawImage(img, 0, 0, img.width, img.height);
130
131
  const ext = img.src.substring(img.src.lastIndexOf('.') + 1).toLowerCase();
131
132
  const dataURL = canvas.toDataURL('image/' + ext);
132
133
  resolve(dataURL);
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import "highlight.js/styles/github.css";
3
3
  interface data {
4
4
  type: number;
@@ -9,5 +9,5 @@ interface data {
9
9
  onClose: any;
10
10
  loadSpecifiedData: any;
11
11
  }
12
- declare const HistoryFun: (props: data) => JSX.Element;
12
+ declare const HistoryFun: (props: data) => React.JSX.Element;
13
13
  export default HistoryFun;
@@ -6,11 +6,11 @@ import styles from "./index.module.less";
6
6
  //import "highlight.js/styles/default.css";
7
7
  import "highlight.js/styles/github.css";
8
8
  import { Input } from "antd";
9
- import { CustomClose, CustomExpand, CustomAiIcon } from "../icons/index";
9
+ import { CustomClose, CustomExpand, CustomAiIcon } from "../icons";
10
10
  import { SearchOutlined } from "@ant-design/icons";
11
11
  import { formatDate } from "./function"; //录音使用文件
12
12
  const HistoryFun = (props)=>{
13
- let { type , roomId , userData , http , urllocation , onClose , loadSpecifiedData } = props;
13
+ let { type, roomId, userData, http, urllocation, onClose, loadSpecifiedData } = props;
14
14
  const [keyWordProblem, setKeyWordProblem] = useState(""); //搜索内容
15
15
  const [showLoadingState, setShowLoadingState] = useState(1); //1,初始状态,2、无数据 ,3、不显示图片
16
16
  const [pageNum, setPageNum] = useState(1);
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import "highlight.js/styles/github.css";
3
3
  interface Service {
4
4
  type: string;
@@ -16,5 +16,5 @@ interface Service {
16
16
  config: any;
17
17
  screenshotAreaId: string;
18
18
  }
19
- declare const CustomerService: (props: Service) => JSX.Element;
19
+ declare const CustomerService: (props: Service) => React.JSX.Element;
20
20
  export default CustomerService;
@@ -10,7 +10,7 @@ let styles = cssStyle;
10
10
  if (false) {
11
11
  styles = cssStyleOnline;
12
12
  }
13
- import { CustomAiIcon, CustomRecord, CustomFullScreen, CustomExitFullScreen, CustomReloading, CustomCopy, CustomLike, CustomDislike, CustomQuote, CustomSending, CustomContacts, CustomDuihao, CustomRoundClose, CustomScreenshot, CustomKnowledgeContent, CustomWenhaoRound } from "../icons/index";
13
+ import { CustomAiIcon, CustomRecord, CustomFullScreen, CustomExitFullScreen, CustomReloading, CustomCopy, CustomLike, CustomDislike, CustomQuote, CustomSending, CustomContacts, CustomDuihao, CustomRoundClose, CustomScreenshot, CustomKnowledgeContent, CustomWenhaoRound } from "../icons";
14
14
  import { CloseOutlined, RightOutlined, ZoomInOutlined } from "@ant-design/icons";
15
15
  import HistoryFun from "./historyFun";
16
16
  import ContactsList from "./contactsList";
@@ -22,7 +22,7 @@ import hljs from "highlight.js";
22
22
  import "highlight.js/styles/github.css";
23
23
  import { render } from "react-dom";
24
24
  import Provider from "../provider";
25
- const { TextArea } = Input;
25
+ const { TextArea } = Input;
26
26
  // import './html2canvas.test.js';
27
27
  import knowledge_icon from "./images/knowledge_icon.png";
28
28
  // import { useMediaRecorder } from "./useMediaRecorder"; //录音使用文件
@@ -31,7 +31,7 @@ import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, re
31
31
  // const screenShot = require('./screenShotPlugin.esm')
32
32
  import ScreenShot from "./js-screen-shot/main";
33
33
  const CustomerService = (props)=>{
34
- let { userData , http , urllocation , onCancel , serverName , fetchEventSource , initShowType , onEvent , stepIds , stepId , screenshotAreaId , config } = props;
34
+ let { userData, http, urllocation, onCancel, serverName, fetchEventSource, initShowType, onEvent, stepIds, stepId, screenshotAreaId, config } = props;
35
35
  // const { bese64String, startRecord, stopRecord } = useMediaRecorder(); //语音转文字
36
36
  // const [voiceRecordingStatus, setVoiceRecordingStatus] = useState(3); //语音录制状态 3,语音识别完成 2,录制中, 1,录制结束
37
37
  const [copyTextOBJ, setCopyTextObj] = useState([]); //复制的消息id
@@ -140,7 +140,7 @@ const CustomerService = (props)=>{
140
140
  hiddenScrollBar: {
141
141
  state: true
142
142
  },
143
- completeCallback: ({ base64 })=>{
143
+ completeCallback: ({ base64 })=>{
144
144
  // console.log(
145
145
  // "截图组件加载完毕调用此方法来完成框选区域的截图",
146
146
  // base64
@@ -1476,7 +1476,7 @@ const CustomerService = (props)=>{
1476
1476
  maxPageSize: 5
1477
1477
  };
1478
1478
  } else if (flag == 3) {
1479
- let { params: { VideoBriefSummaryId } } = config;
1479
+ let { params: { VideoBriefSummaryId } } = config;
1480
1480
  data = {
1481
1481
  page: 1,
1482
1482
  maxPageSize: 4,
@@ -10,7 +10,7 @@ import PlugInParameters from "../main-entrance/PlugInParameters";
10
10
  const plugInParameters = new PlugInParameters();
11
11
  const screenShotCanvas = (_data_getScreenShotContainer = data.getScreenShotContainer()) === null || _data_getScreenShotContainer === void 0 ? void 0 : _data_getScreenShotContainer.getContext("2d");
12
12
  // 获取裁剪区域位置信息
13
- const { startX , startY , width , height } = data.getCutOutBoxPosition();
13
+ const { startX, startY, width, height } = data.getCutOutBoxPosition();
14
14
  let base64 = "";
15
15
  if (screenShotCanvas) {
16
16
  if (isSave) {
@@ -5,7 +5,7 @@
5
5
  * @private
6
6
  */ export function saveBorderArrInfo(borderSize, positionInfo) {
7
7
  // 获取裁剪框位置信息
8
- const { startX , startY , width , height } = positionInfo;
8
+ const { startX, startY, width, height } = positionInfo;
9
9
  const halfBorderSize = borderSize / 2;
10
10
  const borderArr = [];
11
11
  // 移动, n北s南e东w西
@@ -14,8 +14,9 @@ export function saveCanvasToBase64(context, startX, startY, width, height, quali
14
14
  // 将图片放进canvas中
15
15
  imgContext.putImageData(img, 0, 0);
16
16
  if (writeBase64) {
17
- // 将图片自动添加至剪贴板中
18
- canvas === null || canvas === void 0 ? void 0 : canvas.toBlob((blob)=>{
17
+ var // 将图片自动添加至剪贴板中
18
+ _canvas;
19
+ (_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toBlob((blob)=>{
19
20
  var _navigator_clipboard;
20
21
  if (blob == null) return;
21
22
  const Clipboard = window.ClipboardItem;
@@ -12,13 +12,14 @@ export function saveCanvasToImage(context, startX, startY, width, height) {
12
12
  // 获取裁剪框区域画布
13
13
  const imgContext = getCanvas2dCtx(canvas, width, height);
14
14
  if (imgContext) {
15
+ var _plugInParameters;
15
16
  // 将图片放进裁剪框内
16
17
  imgContext.putImageData(img, 0, 0);
17
18
  const a = document.createElement("a");
18
19
  // 获取图片
19
20
  a.href = canvas.toDataURL("png");
20
21
  // 获取用户传入的文件名
21
- const imgName = (plugInParameters === null || plugInParameters === void 0 ? void 0 : plugInParameters.getSaveImgTitle()) || new Date().getTime();
22
+ const imgName = ((_plugInParameters = plugInParameters) === null || _plugInParameters === void 0 ? void 0 : _plugInParameters.getSaveImgTitle()) || new Date().getTime();
22
23
  // 下载图片
23
24
  a.download = `${imgName}.png`;
24
25
  a.click();
@@ -10,8 +10,8 @@
10
10
  * @private
11
11
  */
12
12
  export declare function zoomCutOutBoxPosition(currentX: number, currentY: number, startX: number, startY: number, width: number, height: number, option: number): {
13
- tempStartX: any;
14
- tempStartY: any;
15
- tempWidth: any;
13
+ tempStartX: number;
14
+ tempStartY: number;
15
+ tempWidth: number;
16
16
  tempHeight: number;
17
17
  };
@@ -215,6 +215,7 @@ class CreateDom {
215
215
  }
216
216
  }
217
217
  constructor(options){
218
+ var _options, _options1, _options2;
218
219
  // 截图区域canvas容器
219
220
  _define_property(this, "screenShotController", void 0);
220
221
  // 截图工具栏容器
@@ -256,8 +257,8 @@ class CreateDom {
256
257
  this.optionController = document.createElement("div");
257
258
  // this.cutBoxSizeContainer = document.createElement("div");
258
259
  this.textInputController = document.createElement("div");
259
- this.completeCallback = options === null || options === void 0 ? void 0 : options.completeCallback;
260
- this.closeCallback = options === null || options === void 0 ? void 0 : options.closeCallback;
260
+ this.completeCallback = (_options = options) === null || _options === void 0 ? void 0 : _options.completeCallback;
261
+ this.closeCallback = (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.closeCallback;
261
262
  this.hiddenIcoArr = [];
262
263
  this.optionController.addEventListener("click", (evt)=>{
263
264
  const target = evt.target;
@@ -275,7 +276,7 @@ class CreateDom {
275
276
  };
276
277
  }
277
278
  // 筛选需要隐藏的图标
278
- if (options === null || options === void 0 ? void 0 : options.hiddenToolIco) {
279
+ if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.hiddenToolIco) {
279
280
  for(const iconKey in options.hiddenToolIco){
280
281
  if (options.hiddenToolIco[iconKey]) {
281
282
  this.filterHideIcon(iconKey);
@@ -84,7 +84,7 @@ class InitData {
84
84
  setScreenShotPosition(left, top) {
85
85
  this.getScreenShotContainer();
86
86
  if (screenShotController == null) return;
87
- const { left: rLeft , top: rTop } = getToolRelativePosition(left, top);
87
+ const { left: rLeft, top: rTop } = getToolRelativePosition(left, top);
88
88
  screenShotController.style.left = rLeft + "px";
89
89
  screenShotController.style.top = rTop + "px";
90
90
  }
@@ -194,7 +194,7 @@ class InitData {
194
194
  // 设置截图工具位置信息
195
195
  setToolInfo(left, top) {
196
196
  toolController = document.getElementById("toolPanel");
197
- const { left: rLeft , top: rTop } = getToolRelativePosition(left, top);
197
+ const { left: rLeft, top: rTop } = getToolRelativePosition(left, top);
198
198
  toolController.style.left = rLeft + "px";
199
199
  let sscTop = 0;
200
200
  if (screenShotController) {
@@ -12,9 +12,10 @@ import PlugInParameters from "../main-entrance/PlugInParameters";
12
12
  * @param drawBorders
13
13
  * @private
14
14
  */ export function drawCutOutBox(mouseX, mouseY, width, height, context, borderSize, controller, imageController, drawBorders = true) {
15
+ var _controller, _controller1, _controller2, _controller3;
15
16
  // 获取画布宽高
16
- const canvasWidth = controller === null || controller === void 0 ? void 0 : controller.width;
17
- const canvasHeight = controller === null || controller === void 0 ? void 0 : controller.height;
17
+ const canvasWidth = (_controller = controller) === null || _controller === void 0 ? void 0 : _controller.width;
18
+ const canvasHeight = (_controller1 = controller) === null || _controller1 === void 0 ? void 0 : _controller1.height;
18
19
  const dpr = window.devicePixelRatio || 1;
19
20
  const data = new PlugInParameters();
20
21
  // 画布、图片不存在则return
@@ -58,9 +59,9 @@ import PlugInParameters from "../main-entrance/PlugInParameters";
58
59
  context.save();
59
60
  context.globalCompositeOperation = "destination-over";
60
61
  // 图片尺寸使用canvas容器的css中的尺寸
61
- let { imgWidth , imgHeight } = {
62
- imgWidth: parseInt(controller === null || controller === void 0 ? void 0 : controller.style.width),
63
- imgHeight: parseInt(controller === null || controller === void 0 ? void 0 : controller.style.height)
62
+ let { imgWidth, imgHeight } = {
63
+ imgWidth: parseInt((_controller2 = controller) === null || _controller2 === void 0 ? void 0 : _controller2.style.width),
64
+ imgHeight: parseInt((_controller3 = controller) === null || _controller3 === void 0 ? void 0 : _controller3.style.height)
64
65
  };
65
66
  // 用户有传入截图dom绘制时使用其dom的尺寸
66
67
  const screenShotDom = data.getScreenShotDom();
@@ -1,61 +1,62 @@
1
1
  import PlugInParameters from "../main-entrance/PlugInParameters";
2
2
  // 为插件的全局参数设置数据
3
3
  export function setPlugInParameters(options) {
4
+ var _options, _options1, _options2, _options3, _options4, _options5, _options6, _options7, _options8, _options9, _options10, _options11, _options12, _options13, _options14;
4
5
  const plugInParameters = new PlugInParameters();
5
6
  // webrtc启用状态, 默认为true,如果设置了false则修改默认值
6
- if ((options === null || options === void 0 ? void 0 : options.enableWebRtc) === false) {
7
+ if (((_options = options) === null || _options === void 0 ? void 0 : _options.enableWebRtc) === false) {
7
8
  plugInParameters.setWebRtcStatus(false);
8
9
  plugInParameters.setInitStatus(false);
9
10
  }
10
11
  // 读取并设置参数中的视频流数据
11
- if ((options === null || options === void 0 ? void 0 : options.screenFlow) instanceof MediaStream) {
12
+ if (((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.screenFlow) instanceof MediaStream) {
12
13
  plugInParameters.setScreenFlow(options.screenFlow);
13
14
  }
14
15
  // 读取参数中的画布宽高, 两者都存在时才设置
15
- if ((options === null || options === void 0 ? void 0 : options.canvasWidth) && (options === null || options === void 0 ? void 0 : options.canvasHeight)) {
16
+ if (((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.canvasWidth) && ((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.canvasHeight)) {
16
17
  plugInParameters.setCanvasSize(options.canvasWidth, options.canvasHeight);
17
18
  }
18
19
  // 读取参数设置默认展示截屏数据的状态,默认为false,如果设置了true才修改
19
- if ((options === null || options === void 0 ? void 0 : options.showScreenData) === true) {
20
+ if (((_options4 = options) === null || _options4 === void 0 ? void 0 : _options4.showScreenData) === true) {
20
21
  plugInParameters.setShowScreenDataStatus(true);
21
22
  }
22
- if ((options === null || options === void 0 ? void 0 : options.maskColor) && typeof options.maskColor === "object") {
23
+ if (((_options5 = options) === null || _options5 === void 0 ? void 0 : _options5.maskColor) && typeof options.maskColor === "object") {
23
24
  plugInParameters.setMaskColor(options.maskColor);
24
25
  }
25
26
  // 调用者关闭了剪切板写入,则修改全局变量(默认为true)
26
- if ((options === null || options === void 0 ? void 0 : options.writeBase64) === false) {
27
+ if (((_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.writeBase64) === false) {
27
28
  plugInParameters.setWriteImgState(options.writeBase64);
28
29
  }
29
30
  // 调用者传入了截图dom
30
- if (options === null || options === void 0 ? void 0 : options.screenShotDom) {
31
+ if ((_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.screenShotDom) {
31
32
  plugInParameters.setScreenShotDom(options.screenShotDom);
32
33
  }
33
34
  // 调用者传入了裁剪区域边框像素点颜色信息
34
- if (options === null || options === void 0 ? void 0 : options.cutBoxBdColor) {
35
+ if ((_options8 = options) === null || _options8 === void 0 ? void 0 : _options8.cutBoxBdColor) {
35
36
  plugInParameters.setCutBoxBdColor(options.cutBoxBdColor);
36
37
  }
37
38
  // 调用者传入了保存截图回调
38
- if (options === null || options === void 0 ? void 0 : options.saveCallback) {
39
+ if ((_options9 = options) === null || _options9 === void 0 ? void 0 : _options9.saveCallback) {
39
40
  plugInParameters.setSaveCallback(options.saveCallback);
40
41
  }
41
42
  // 设置最大撤销次数
42
- if (options === null || options === void 0 ? void 0 : options.maxUndoNum) {
43
+ if ((_options10 = options) === null || _options10 === void 0 ? void 0 : _options10.maxUndoNum) {
43
44
  plugInParameters.setMaxUndoNum(options.maxUndoNum);
44
45
  }
45
46
  // 箭头绘制工具是否使用等比例绘制方式
46
- if (options === null || options === void 0 ? void 0 : options.useRatioArrow) {
47
+ if ((_options11 = options) === null || _options11 === void 0 ? void 0 : _options11.useRatioArrow) {
47
48
  plugInParameters.setRatioArrow(options.useRatioArrow);
48
49
  }
49
50
  // 设置图片自适应开启状态
50
- if (options === null || options === void 0 ? void 0 : options.imgAutoFit) {
51
+ if ((_options12 = options) === null || _options12 === void 0 ? void 0 : _options12.imgAutoFit) {
51
52
  plugInParameters.setImgAutoFit(options.imgAutoFit);
52
53
  }
53
54
  // 设置图片保存时的文件名称
54
- if (options === null || options === void 0 ? void 0 : options.saveImgTitle) {
55
+ if ((_options13 = options) === null || _options13 === void 0 ? void 0 : _options13.saveImgTitle) {
55
56
  plugInParameters.setSaveImgTitle(options.saveImgTitle);
56
57
  }
57
58
  // 确认截图时,是否需要销毁dom
58
- if ((options === null || options === void 0 ? void 0 : options.destroyContainer) === false) {
59
+ if (((_options14 = options) === null || _options14 === void 0 ? void 0 : _options14.destroyContainer) === false) {
59
60
  plugInParameters.setDestroyContainerState(options.destroyContainer);
60
61
  }
61
62
  }
@@ -70,7 +70,7 @@ export function toolClickEvent(toolName, index, mouseEvent, completeCallback, cl
70
70
  if (textInputController != null && data.getTextStatus() || textInputController != null && toolName !== "text") {
71
71
  const text = textInputController.innerText;
72
72
  if (text && text !== "") {
73
- const { positionX , positionY , color , size } = data.getTextInfo();
73
+ const { positionX, positionY, color, size } = data.getTextInfo();
74
74
  drawText(text, positionX, positionY, color, size, screenShotCanvas);
75
75
  // 添加历史记录
76
76
  addHistory();