bhd-components 0.7.3 → 0.7.5
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/{0650d749.esm.es5.development.js → 40717e9e.esm.es5.development.js} +9435 -1276
- package/dist/6b2db3d5.esm.es5.production.js +485 -0
- package/dist/index.esm.es5.development.css +11898 -896
- package/dist/index.esm.es5.development.js +1832 -651
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.esm.es5.development.css +2 -1
- package/dist/vendor.esm.es5.production.esm.es5.production.css +1 -1
- package/es2017/customerService/contactsList.js +2 -2
- package/es2017/customerService/function.d.ts +6 -1
- package/es2017/customerService/function.js +64 -15
- package/es2017/customerService/index.d.ts +3 -0
- package/es2017/customerService/index.js +589 -252
- package/es2017/customerService/index.module.less +596 -109
- package/es2017/customerService/index2.module.less +586 -109
- package/es2017/customerService/screenshotTool.d.ts +9 -0
- package/es2017/customerService/screenshotTool.js +127 -0
- package/es2017/icons/components/custom-knowledge_content.d.ts +4 -0
- package/es2017/icons/components/custom-knowledge_content.js +24 -0
- package/es2017/icons/components/custom-screenshot.d.ts +4 -0
- package/es2017/icons/components/custom-screenshot.js +25 -0
- package/es2017/icons/components/custom-video-abstraction.d.ts +4 -0
- package/es2017/icons/components/custom-video-abstraction.js +22 -0
- package/es2017/icons/components/custom-wenhao_round.d.ts +4 -0
- package/es2017/icons/components/custom-wenhao_round.js +22 -0
- package/es2017/icons/components/index.d.ts +4 -0
- package/es2017/icons/components/index.js +4 -0
- package/esm/customerService/contactsList.js +6 -2
- package/esm/customerService/function.d.ts +6 -1
- package/esm/customerService/function.js +65 -15
- package/esm/customerService/index.d.ts +3 -0
- package/esm/customerService/index.js +594 -283
- package/esm/customerService/index.module.less +596 -109
- package/esm/customerService/index2.module.less +586 -109
- package/esm/customerService/screenshotTool.d.ts +9 -0
- package/esm/customerService/screenshotTool.js +128 -0
- package/esm/icons/components/custom-knowledge_content.d.ts +4 -0
- package/esm/icons/components/custom-knowledge_content.js +26 -0
- package/esm/icons/components/custom-screenshot.d.ts +4 -0
- package/esm/icons/components/custom-screenshot.js +27 -0
- package/esm/icons/components/custom-video-abstraction.d.ts +4 -0
- package/esm/icons/components/custom-video-abstraction.js +24 -0
- package/esm/icons/components/custom-wenhao_round.d.ts +4 -0
- package/esm/icons/components/custom-wenhao_round.js +24 -0
- package/esm/icons/components/index.d.ts +4 -0
- package/esm/icons/components/index.js +4 -0
- package/package.json +3 -1
- package/dist/24d37cb8.esm.es5.production.js +0 -468
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "react-image-crop/dist/ReactCrop.css";
|
|
3
|
+
interface data {
|
|
4
|
+
imgBese64: string;
|
|
5
|
+
saveScreenshotBese64: (bese64: string) => void;
|
|
6
|
+
cancelScreenshot: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ScreenshotTool: import("react").ForwardRefExoticComponent<data & import("react").RefAttributes<unknown>>;
|
|
9
|
+
export default ScreenshotTool;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, forwardRef } from "react";
|
|
3
|
+
import ReactCrop, { centerCrop, makeAspectCrop } from "react-image-crop";
|
|
4
|
+
import { CloseOutlined } from "@ant-design/icons";
|
|
5
|
+
import { CustomDuihao } from "../icons/index";
|
|
6
|
+
import "react-image-crop/dist/ReactCrop.css";
|
|
7
|
+
import styles from "./index.module.less";
|
|
8
|
+
const ScreenshotTool = /*#__PURE__*/ forwardRef((props)=>{
|
|
9
|
+
let { imgBese64 , saveScreenshotBese64 , cancelScreenshot } = props;
|
|
10
|
+
const [crop, setCrop] = useState();
|
|
11
|
+
const [completedCrop, setCompletedCrop] = useState();
|
|
12
|
+
const imgRef = useRef(null);
|
|
13
|
+
const [aspect, setAspect] = useState(16 / 9);
|
|
14
|
+
const [btnPosition, setBtnPosition] = useState({
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0
|
|
17
|
+
});
|
|
18
|
+
const [showBtn, setShowBtn] = useState(false);
|
|
19
|
+
function centerAspectCrop(mediaWidth, mediaHeight, aspect) {
|
|
20
|
+
return centerCrop(makeAspectCrop({
|
|
21
|
+
unit: '%',
|
|
22
|
+
width: 30
|
|
23
|
+
}, aspect, mediaWidth, mediaHeight), mediaWidth, mediaHeight);
|
|
24
|
+
}
|
|
25
|
+
function onImageLoad(e) {
|
|
26
|
+
if (aspect) {
|
|
27
|
+
// console.log(aspect,e,'dlvkdfmvlkdfmvdfkl');
|
|
28
|
+
// const { width, height } = e.currentTarget
|
|
29
|
+
const width = 100;
|
|
30
|
+
const height = 100 * (9 / 16);
|
|
31
|
+
// let x = $(".ReactCrop__crop-selection")[0].offsetLeft;
|
|
32
|
+
// let y = $(".ReactCrop__crop-selection")[0].offsetTop;
|
|
33
|
+
// console.log(width,height);
|
|
34
|
+
setCrop(centerAspectCrop(width, height, aspect));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function saveImage() {
|
|
38
|
+
// 创建一个新的canvas元素
|
|
39
|
+
var canvas = document.createElement('canvas');
|
|
40
|
+
var context = canvas.getContext('2d');
|
|
41
|
+
// 加载要操作的图片
|
|
42
|
+
var image = new Image();
|
|
43
|
+
image.src = imgBese64; // 将'your_image_url'替换为你自己的图片URL
|
|
44
|
+
// 等待图片加载完成后再进行操作
|
|
45
|
+
image.onload = function() {
|
|
46
|
+
var x = completedCrop.x; // 起始点x坐标
|
|
47
|
+
var y = completedCrop.y; // 起始点y坐标
|
|
48
|
+
var width = completedCrop.width; // 需要裁剪的区域宽度
|
|
49
|
+
var height = completedCrop.height; // 需要裁剪的区域高度
|
|
50
|
+
// 设置canvas大小与裁剪区域相同
|
|
51
|
+
canvas.width = width;
|
|
52
|
+
canvas.height = height;
|
|
53
|
+
// 清空画布
|
|
54
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
55
|
+
// 将裁剪区域从原图上复制到canvas上
|
|
56
|
+
context.drawImage(image, x, y, width, height, 0, 0, width, height);
|
|
57
|
+
// 获取裁剪后的图片数据(Base64格式)
|
|
58
|
+
var croppedDataUrl = canvas.toDataURL();
|
|
59
|
+
// // 输出裁剪后的图片链接或者其他操作
|
|
60
|
+
// console.log(croppedDataUrl);
|
|
61
|
+
saveScreenshotBese64(croppedDataUrl);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const savePosition = (e)=>{
|
|
65
|
+
// console.log(e,'位置位置');
|
|
66
|
+
let x = e.x;
|
|
67
|
+
let y = e.y;
|
|
68
|
+
let h = e.height;
|
|
69
|
+
let w = e.width;
|
|
70
|
+
let top = y + h + 8;
|
|
71
|
+
let left = x + w - 88;
|
|
72
|
+
if (top + 42 > window.innerHeight) {
|
|
73
|
+
top = top - 50;
|
|
74
|
+
}
|
|
75
|
+
setBtnPosition({
|
|
76
|
+
top,
|
|
77
|
+
left
|
|
78
|
+
});
|
|
79
|
+
setShowBtn(true);
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
82
|
+
className: styles.screenshot_Modal,
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ _jsx(ReactCrop, {
|
|
85
|
+
className: styles.ReactCrop,
|
|
86
|
+
crop: crop,
|
|
87
|
+
onChange: (_, percentCrop)=>{
|
|
88
|
+
setShowBtn(false);
|
|
89
|
+
setCrop(percentCrop);
|
|
90
|
+
},
|
|
91
|
+
onComplete: (c)=>{
|
|
92
|
+
setCompletedCrop(c);
|
|
93
|
+
savePosition(c);
|
|
94
|
+
// console.log(c,'剪裁222');
|
|
95
|
+
},
|
|
96
|
+
// aspect={aspect}
|
|
97
|
+
// minWidth={400}
|
|
98
|
+
minHeight: 100,
|
|
99
|
+
minWidth: 100,
|
|
100
|
+
children: /*#__PURE__*/ _jsx("img", {
|
|
101
|
+
// ref={imgRef}
|
|
102
|
+
alt: "Crop me",
|
|
103
|
+
src: imgBese64,
|
|
104
|
+
onLoad: onImageLoad
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
showBtn && /*#__PURE__*/ _jsxs("div", {
|
|
108
|
+
className: styles.screenshot_Modal_btn,
|
|
109
|
+
style: {
|
|
110
|
+
top: btnPosition.top,
|
|
111
|
+
left: btnPosition.left
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
/*#__PURE__*/ _jsx("span", {
|
|
115
|
+
onClick: cancelScreenshot,
|
|
116
|
+
children: /*#__PURE__*/ _jsx(CloseOutlined, {})
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ _jsx("span", {
|
|
119
|
+
onClick: saveImage,
|
|
120
|
+
children: /*#__PURE__*/ _jsx(CustomDuihao, {})
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
export default ScreenshotTool;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import Icon from "@ant-design/icons";
|
|
6
|
+
const CustomKnowledgeContentSvg = ()=>/*#__PURE__*/ _jsx("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "1em",
|
|
9
|
+
height: "1em",
|
|
10
|
+
viewBox: "0 0 20 21",
|
|
11
|
+
fill: "none",
|
|
12
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
13
|
+
"fill-rule": "evenodd",
|
|
14
|
+
"clip-rule": "evenodd",
|
|
15
|
+
d: "M5.84749 13.2072H4.83518C3.82333 13.2072 3 12.3843 3 11.372V5.33518C3 4.32286 3.82348 3.5 4.83518 3.5H13.5332C14.545 3.5 15.3684 4.32286 15.3684 5.33518V6.51944C15.3684 6.8091 15.134 7.04342 14.8444 7.04342C14.5547 7.04342 14.3204 6.8091 14.3204 6.51944V5.33518C14.3204 4.90124 13.9673 4.54811 13.5333 4.54811H4.83518C4.40124 4.54811 4.04811 4.90124 4.04811 5.33518V11.372C4.04811 11.806 4.40124 12.1591 4.83518 12.1591H5.84749C6.13715 12.1591 6.37147 12.3934 6.37147 12.6831C6.37147 12.9727 6.13715 13.2072 5.84749 13.2072ZM5.84749 15.7292H5.17048C4.88082 15.7292 4.6465 15.4949 4.6465 15.2053C4.6465 14.9156 4.88082 14.6813 5.17048 14.6813H5.84749C6.13715 14.6813 6.37147 14.9156 6.37147 15.2053C6.37147 15.4949 6.13715 15.7292 5.84749 15.7292ZM15.1454 17.5H9.49389C8.49126 17.5 7.67606 16.6842 7.67606 15.6822V10.0302C7.67606 9.02818 8.49126 8.21236 9.49389 8.21236H15.1454C16.148 8.21236 16.9632 9.02818 16.9632 10.0302V15.6822C16.9632 16.6842 16.1479 17.5 15.1454 17.5ZM9.49389 9.26047C9.06964 9.26047 8.72418 9.60546 8.72418 10.0302V15.6822C8.72418 16.1069 9.06964 16.4519 9.49389 16.4519H15.1454C15.5697 16.4519 15.9151 16.1069 15.9151 15.6822V10.0302C15.9151 9.60546 15.5697 9.26047 15.1454 9.26047H9.49389ZM10.4263 12.1622H14.3665C14.6561 12.1622 14.8904 11.9279 14.8904 11.6382C14.8904 11.3486 14.6561 11.1143 14.3665 11.1143H10.4263C10.1366 11.1143 9.90233 11.3486 9.90233 11.6382C9.90233 11.9279 10.1366 12.1622 10.4263 12.1622ZM10.4263 14.5992H12.3967C12.6864 14.5992 12.9207 14.3649 12.9207 14.0752C12.9207 13.7856 12.6864 13.5513 12.3967 13.5513H10.4263C10.1366 13.5513 9.90233 13.7856 9.90233 14.0752C9.90233 14.3649 10.1366 14.5992 10.4263 14.5992Z",
|
|
16
|
+
fill: "black"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
const CustomKnowledgeContent = (props)=>{
|
|
20
|
+
return /*#__PURE__*/ _jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
21
|
+
component: CustomKnowledgeContentSvg
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
export default CustomKnowledgeContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import Icon from "@ant-design/icons";
|
|
6
|
+
const CustomScreenshotSvg = ()=>/*#__PURE__*/ _jsx("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "1em",
|
|
9
|
+
height: "1em",
|
|
10
|
+
viewBox: "0 0 20 21",
|
|
11
|
+
fill: "none",
|
|
12
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
13
|
+
"stroke-linejoin": "round",
|
|
14
|
+
"stroke-linecap": "round",
|
|
15
|
+
"stroke-opacity": "0.65",
|
|
16
|
+
stroke: "black",
|
|
17
|
+
d: "M16.4246 3.5C10 11.6732 6.72188 15.7722 6.09704 16.397C5.1598 17.3343 3.64019 17.3343 2.70293 16.397M17.297 16.397C16.3597 17.3343 14.8401 17.3343 13.9028 16.397C13.278 15.7722 9.99992 11.6784 3.6002 3.5M4.4 17.1C5.72548 17.1 6.8 16.0255 6.8 14.7C6.8 13.3745 5.72548 12.3 4.4 12.3C3.07452 12.3 2 13.3745 2 14.7C2 16.0255 3.07452 17.1 4.4 17.1ZM15.6 17.1C16.9255 17.1 18 16.0255 18 14.7C18 13.3745 16.9255 12.3 15.6 12.3C14.2745 12.3 13.2 13.3745 13.2 14.7C13.2 16.0255 14.2745 17.1 15.6 17.1Z"
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
const CustomScreenshot = (props)=>{
|
|
21
|
+
return /*#__PURE__*/ _jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
22
|
+
component: CustomScreenshotSvg
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
export default CustomScreenshot;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import Icon from "@ant-design/icons";
|
|
6
|
+
const CustomVideoAbstractioSvg = ()=>/*#__PURE__*/ _jsx("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "1em",
|
|
9
|
+
height: "1em",
|
|
10
|
+
viewBox: "2 2 15 15",
|
|
11
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
12
|
+
"fill-rule": "evenodd",
|
|
13
|
+
"clip-rule": "evenodd",
|
|
14
|
+
d: "M15.484 14.4596H16.4878C16.7707 14.4596 17 14.689 17 14.9718C17 15.2547 16.7707 15.484 16.4878 15.484H15.4841V16.4878C15.4841 16.7707 15.2547 17 14.9719 17C14.689 17 14.4597 16.7707 14.4597 16.4878V15.4841H6.10315C5.22798 15.4841 4.51596 14.7721 4.51596 13.8969V5.54035H3.5122C3.22931 5.54035 3 5.31104 3 5.02816C3 4.74527 3.22931 4.51596 3.5122 4.51596H4.51596V3.5122C4.51596 3.22931 4.74527 3 5.02816 3C5.31104 3 5.54035 3.22931 5.54035 3.5122V4.51594H13.8968C14.772 4.51594 15.484 5.22796 15.484 6.10313V14.4596ZM5.54033 13.8968C5.54033 14.2072 5.79281 14.4596 6.10313 14.4596L14.4596 14.4597V6.10315C14.4596 5.79283 14.2072 5.54035 13.8968 5.54035H5.54033V13.8968ZM12.0612 9.26349L12.0792 9.27706C12.2647 9.41739 12.3711 9.63128 12.3711 9.86392C12.3711 10.0966 12.2647 10.3105 12.0792 10.4508L12.0612 10.4644L12.0422 10.4763L9.44869 12.1015C9.32278 12.1894 9.17637 12.2343 9.02881 12.2343C8.91722 12.2343 8.80497 12.2087 8.70027 12.1566C8.44855 12.0314 8.29215 11.7789 8.29215 11.4977V8.2301C8.29215 7.94896 8.44853 7.6965 8.70025 7.57128C8.94343 7.45034 9.22754 7.47194 9.44871 7.62638L12.0612 9.26349ZM9.31655 8.75247V10.9754L11.0903 9.86395L9.31655 8.75247Z"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
const CustomVideoAbstractio = (props)=>{
|
|
18
|
+
return /*#__PURE__*/ _jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
19
|
+
component: CustomVideoAbstractioSvg
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
export default CustomVideoAbstractio;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import Icon from "@ant-design/icons";
|
|
6
|
+
const CustomWenhaoRoundSvg = ()=>/*#__PURE__*/ _jsx("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "1em",
|
|
9
|
+
height: "1em",
|
|
10
|
+
viewBox: "0 0 20 21",
|
|
11
|
+
fill: "none",
|
|
12
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
13
|
+
d: "M16.006 14.0975C15.9343 14.2169 15.8182 14.3029 15.6831 14.3367C15.548 14.3704 15.405 14.3491 15.2856 14.2775C15.1662 14.2058 15.0802 14.0896 15.0464 13.9545C15.0127 13.8194 15.034 13.6765 15.1056 13.5571C15.6599 12.6338 15.9519 11.5769 15.95 10.5C15.95 7.21385 13.2861 4.55 10 4.55C6.71385 4.55 4.05 7.21385 4.05 10.5C4.05 13.7861 6.71385 16.45 10 16.45C11.0767 16.4519 12.1335 16.1601 13.0567 15.606C13.1158 15.5705 13.1814 15.547 13.2496 15.5369C13.3178 15.5267 13.3873 15.5301 13.4542 15.5468C13.521 15.5635 13.584 15.5933 13.6394 15.6343C13.6948 15.6754 13.7415 15.7269 13.777 15.786C13.8125 15.8452 13.836 15.9107 13.8461 15.9789C13.8563 16.0471 13.8529 16.1166 13.8362 16.1835C13.8194 16.2504 13.7897 16.3133 13.7487 16.3687C13.7076 16.4241 13.6561 16.4709 13.5969 16.5063C12.5106 17.1584 11.267 17.5019 10 17.5C6.13407 17.5 3 14.3659 3 10.5C3 6.63407 6.13407 3.5 10 3.5C13.8659 3.5 17 6.63407 17 10.5C17 11.7845 16.653 13.0195 16.006 14.0975ZM12.275 9.275C12.275 10.3561 11.5085 11.2577 10.4835 11.4912V12.075C10.4835 12.2142 10.4282 12.3478 10.3298 12.4462C10.2313 12.5447 10.0978 12.6 9.95852 12.6C9.81928 12.6 9.68575 12.5447 9.58729 12.4462C9.48883 12.3478 9.43352 12.2142 9.43352 12.075V11.025C9.43352 10.8858 9.48883 10.7522 9.58729 10.6538C9.68575 10.5553 9.81928 10.5 9.95852 10.5C10.6606 10.5 11.225 9.94875 11.225 9.275C11.225 8.60125 10.6606 8.05 9.95852 8.05C9.51927 8.05 9.12045 8.26735 8.88927 8.61805C8.82978 8.7082 8.78275 8.80597 8.74945 8.90872C8.70481 9.03893 8.61081 9.1464 8.48771 9.20798C8.36461 9.26956 8.22224 9.28034 8.09127 9.23798C7.9603 9.19563 7.85121 9.10353 7.78748 8.98152C7.72375 8.85952 7.71049 8.71736 7.75055 8.58567C7.81285 8.39282 7.90105 8.20942 8.0127 8.04037C8.4369 7.39637 9.1642 7 9.9587 7C11.235 7 12.275 8.0157 12.275 9.275ZM10 14.175C9.86076 14.175 9.72722 14.1197 9.62876 14.0212C9.53031 13.9228 9.475 13.7892 9.475 13.65C9.475 13.5108 9.53031 13.3772 9.62876 13.2788C9.72722 13.1803 9.86076 13.125 10 13.125C10.1392 13.125 10.2728 13.1803 10.3712 13.2788C10.4697 13.3772 10.525 13.5108 10.525 13.65C10.525 13.7892 10.4697 13.9228 10.3712 14.0212C10.2728 14.1197 10.1392 14.175 10 14.175Z",
|
|
14
|
+
fill: "black"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
const CustomWenhaoRound = (props)=>{
|
|
18
|
+
return /*#__PURE__*/ _jsx(Icon, _object_spread_props(_object_spread({}, props), {
|
|
19
|
+
component: CustomWenhaoRoundSvg
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
export default CustomWenhaoRound;
|
|
@@ -18,3 +18,7 @@ export { default as CustomDuihao } from "./custom-duihao";
|
|
|
18
18
|
export { default as CustomRoundClose } from "./custom-round_close";
|
|
19
19
|
export { default as CustomAiIcon } from "./custom-ai_icon";
|
|
20
20
|
export { default as CustomExpand } from "./custom-expand";
|
|
21
|
+
export { default as CustomScreenshot } from "./custom-screenshot";
|
|
22
|
+
export { default as CustomVideoAbstractio } from "./custom-video-abstraction";
|
|
23
|
+
export { default as CustomKnowledgeContent } from "./custom-knowledge_content";
|
|
24
|
+
export { default as CustomWenhaoRound } from "./custom-wenhao_round";
|
|
@@ -18,3 +18,7 @@ export { default as CustomDuihao } from "./custom-duihao";
|
|
|
18
18
|
export { default as CustomRoundClose } from "./custom-round_close";
|
|
19
19
|
export { default as CustomAiIcon } from "./custom-ai_icon";
|
|
20
20
|
export { default as CustomExpand } from "./custom-expand";
|
|
21
|
+
export { default as CustomScreenshot } from "./custom-screenshot";
|
|
22
|
+
export { default as CustomVideoAbstractio } from "./custom-video-abstraction";
|
|
23
|
+
export { default as CustomKnowledgeContent } from "./custom-knowledge_content";
|
|
24
|
+
export { default as CustomWenhaoRound } from "./custom-wenhao_round";
|
|
@@ -40,7 +40,9 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
40
40
|
/*#__PURE__*/ _jsxs("p", {
|
|
41
41
|
className: styles.message,
|
|
42
42
|
children: [
|
|
43
|
-
|
|
43
|
+
userData.modules.some(function(ele) {
|
|
44
|
+
return ele.short == "AIservice";
|
|
45
|
+
}) ? "AI助手" : "智能问答",
|
|
44
46
|
/*#__PURE__*/ _jsx("span", {
|
|
45
47
|
className: styles.time,
|
|
46
48
|
children: contactsList.length > 0 && contactsList[0].createdAt != undefined && getDataTime(contactsList[0].createdAt)
|
|
@@ -148,7 +150,9 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
148
150
|
children: [
|
|
149
151
|
/*#__PURE__*/ _jsx(CustomAiIcon, {}),
|
|
150
152
|
/*#__PURE__*/ _jsx("p", {
|
|
151
|
-
children:
|
|
153
|
+
children: userData.modules.some(function(ele) {
|
|
154
|
+
return ele.short == "AIservice";
|
|
155
|
+
}) ? "AI助手" : "智能问答"
|
|
152
156
|
})
|
|
153
157
|
]
|
|
154
158
|
})
|
|
@@ -13,5 +13,10 @@ declare const readMessage: (roomId: number | string, urllocation: any, userData:
|
|
|
13
13
|
declare const getByteLen: (val: string) => number;
|
|
14
14
|
declare const serverUrl: () => string;
|
|
15
15
|
declare const copyText: (text: string) => boolean;
|
|
16
|
+
declare const resetStyles: () => void;
|
|
16
17
|
declare const getDataTime: (time: string | number | Date, type?: number) => string;
|
|
17
|
-
|
|
18
|
+
declare const getQuery: (name: string) => string;
|
|
19
|
+
declare const findParent: (e: any, className: string) => any;
|
|
20
|
+
declare const delegate: (element: any, eventType: string, selector: string, callback: any) => void;
|
|
21
|
+
declare const getBase64Image: (src: any) => Promise<unknown>;
|
|
22
|
+
export { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, resetStyles, findParent, delegate, getBase64Image };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//消息已读
|
|
2
|
+
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
2
3
|
var readMessage = function(roomId, urllocation, userData, http) {
|
|
3
4
|
http.patch("".concat(urllocation, "/chat-service/public/v1.0/history-messages:read"), {
|
|
4
5
|
roomId: roomId
|
|
@@ -34,20 +35,6 @@ var serverUrl = function() {
|
|
|
34
35
|
};
|
|
35
36
|
//复制内容
|
|
36
37
|
var copyText = function(text) {
|
|
37
|
-
// // text是复制文本
|
|
38
|
-
// // 创建input元素
|
|
39
|
-
// const el = document.createElement("textarea");
|
|
40
|
-
// // 给input元素赋值需要复制的文本
|
|
41
|
-
// el.setAttribute("value", text);
|
|
42
|
-
// // 将input元素插入页面
|
|
43
|
-
// document.body.appendChild(el);
|
|
44
|
-
// // 选中input元素的文本
|
|
45
|
-
// el.select();
|
|
46
|
-
// // 复制内容到剪贴板
|
|
47
|
-
// document.execCommand("copy");
|
|
48
|
-
// // 删除input元素
|
|
49
|
-
// document.body.removeChild(el);
|
|
50
|
-
// return true;
|
|
51
38
|
var tempInput = document.createElement("textarea");
|
|
52
39
|
document.body.appendChild(tempInput);
|
|
53
40
|
tempInput.value = text;
|
|
@@ -56,6 +43,18 @@ var copyText = function(text) {
|
|
|
56
43
|
document.body.removeChild(tempInput);
|
|
57
44
|
return true;
|
|
58
45
|
};
|
|
46
|
+
//初始化样式
|
|
47
|
+
var resetStyles = function() {
|
|
48
|
+
var dom_list = document.getElementsByClassName("copy_success");
|
|
49
|
+
for(var i = 0; i < dom_list.length; i++){
|
|
50
|
+
dom_list[i].classList.remove("copy_success");
|
|
51
|
+
}
|
|
52
|
+
var dom_list2 = document.getElementsByClassName("copyCodeFun");
|
|
53
|
+
for(var i = 0; i < dom_list2.length; i++){
|
|
54
|
+
var p = dom_list2[i].getElementsByClassName("copyCode");
|
|
55
|
+
p[0].innerText = "复制代码";
|
|
56
|
+
}
|
|
57
|
+
};
|
|
59
58
|
//获取当前时间
|
|
60
59
|
var getDataTime = function(time) {
|
|
61
60
|
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1;
|
|
@@ -87,4 +86,55 @@ var getDataTime = function(time) {
|
|
|
87
86
|
return "";
|
|
88
87
|
}
|
|
89
88
|
};
|
|
90
|
-
|
|
89
|
+
var getQuery = function(name) {
|
|
90
|
+
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
|
91
|
+
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(window.location.href);
|
|
92
|
+
return results == null ? "" : decodeURIComponent(results[1]);
|
|
93
|
+
};
|
|
94
|
+
var findParent = function(e, className) {
|
|
95
|
+
while(e && !e.classList.contains(className)){
|
|
96
|
+
e = e.parentElement;
|
|
97
|
+
}
|
|
98
|
+
return e;
|
|
99
|
+
};
|
|
100
|
+
// 事件委托函数封装
|
|
101
|
+
var delegate = function(element, eventType, selector, callback) {
|
|
102
|
+
if (!_instanceof(element, HTMLElement)) {
|
|
103
|
+
throw new Error("第一个参数必须是一个HTMLElement");
|
|
104
|
+
}
|
|
105
|
+
if (typeof eventType !== "string") {
|
|
106
|
+
throw new Error("第二个参数必须是字符串");
|
|
107
|
+
}
|
|
108
|
+
if (typeof selector !== "string") {
|
|
109
|
+
throw new Error("第三个参数必须是字符串");
|
|
110
|
+
}
|
|
111
|
+
if (typeof callback !== "function") {
|
|
112
|
+
throw new Error("第四个参数必须是一个函数");
|
|
113
|
+
}
|
|
114
|
+
element.addEventListener(eventType, function(event) {
|
|
115
|
+
var possibleTargets = element.querySelectorAll(selector);
|
|
116
|
+
for(var i = 0; i < possibleTargets.length; i++){
|
|
117
|
+
if (possibleTargets[i] === event.target || possibleTargets[i].contains(event.target)) {
|
|
118
|
+
callback.call(possibleTargets[i], event, possibleTargets[i]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var getBase64Image = function(src) {
|
|
124
|
+
return new Promise(function(resolve) {
|
|
125
|
+
var img = new Image();
|
|
126
|
+
img.crossOrigin = "";
|
|
127
|
+
img.src = src;
|
|
128
|
+
img.onload = function() {
|
|
129
|
+
var canvas = document.createElement("canvas");
|
|
130
|
+
canvas.width = img.width;
|
|
131
|
+
canvas.height = img.height;
|
|
132
|
+
var ctx = canvas.getContext("2d");
|
|
133
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(img, 0, 0, img.width, img.height);
|
|
134
|
+
var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase();
|
|
135
|
+
var dataURL = canvas.toDataURL("image/" + ext);
|
|
136
|
+
resolve(dataURL);
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
export { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, resetStyles, findParent, delegate, getBase64Image };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "highlight.js/styles/default.css";
|
|
3
3
|
interface Service {
|
|
4
|
+
type: string;
|
|
5
|
+
params: any;
|
|
4
6
|
userData: any;
|
|
5
7
|
http?: any;
|
|
6
8
|
urllocation?: string;
|
|
@@ -11,6 +13,7 @@ interface Service {
|
|
|
11
13
|
stepIds?: string;
|
|
12
14
|
stepId?: string | number;
|
|
13
15
|
onEvent: (a: string, b: string, c: string) => {};
|
|
16
|
+
config: any;
|
|
14
17
|
}
|
|
15
18
|
declare const CustomerService: (props: Service) => JSX.Element;
|
|
16
19
|
export default CustomerService;
|