@myun/gimi-chat 0.0.4 → 0.0.6
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/dist/components/ai-chat-dialogue/index.js +182 -136
- package/dist/components/ai-chat-dialogue/index.module.css +230 -0
- package/dist/components/ai-correction/index.js +38 -25
- package/dist/components/ai-loading/index.js +13 -9
- package/dist/components/ai-loading/index.module.css +11 -0
- package/dist/components/answer-item/index.js +136 -114
- package/dist/components/answer-item/index.module.css +266 -0
- package/dist/components/ask-card/index.js +43 -34
- package/dist/components/ask-card/index.module.css +122 -0
- package/dist/components/chat-input/index.js +136 -115
- package/dist/components/chat-input/index.module.css +42 -0
- package/dist/components/chat-voice/VoiceCommunication.js +23 -21
- package/dist/components/chat-voice/VoiceRecord.js +24 -21
- package/dist/components/conversation-delete/index.js +10 -8
- package/dist/components/dots-loading/index.js +11 -8
- package/dist/components/dots-loading/index.module.css +41 -0
- package/dist/components/empty/index.js +13 -8
- package/dist/components/empty/index.module.css +24 -0
- package/dist/components/excel-components/ExcelCard.js +7 -3
- package/dist/components/excel-components/ExcelExcuting.js +61 -44
- package/dist/components/excel-components/ExcelFailCard.js +16 -11
- package/dist/components/excel-components/ExcelSuccessCard.js +3 -2
- package/dist/components/excel-components/index.module.css +212 -0
- package/dist/components/excel-components/styles.module.css +178 -0
- package/dist/components/file-card/fileCardSidebar.js +24 -17
- package/dist/components/file-card/index.js +69 -50
- package/dist/components/file-card/index.module.css +139 -0
- package/dist/components/file-preview/index.js +39 -34
- package/dist/components/file-preview/index.module.css +83 -0
- package/dist/components/file-upload/index.js +10 -7
- package/dist/components/file-upload/uploadV1.js +33 -27
- package/dist/components/gimi-sidebar/index.js +21 -14
- package/dist/components/gimi-sidebar/index.module.css +118 -0
- package/dist/components/header/index.js +19 -12
- package/dist/components/header/index.module.css +19 -0
- package/dist/components/iconfont-com/index.js +2 -1
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +29 -23
- package/dist/components/knowledge-trace/classList.js +38 -29
- package/dist/components/knowledge-trace/documentList.js +37 -28
- package/dist/components/knowledge-trace/index.js +29 -22
- package/dist/components/knowledge-trace/index.module.css +254 -0
- package/dist/components/knowledge-trace/videoList.js +47 -37
- package/dist/components/lottie-img/index.js +10 -8
- package/dist/components/message-actions/CopyButton.js +25 -22
- package/dist/components/message-actions/LikeButton.js +25 -22
- package/dist/components/message-actions/RegenerateButton.js +21 -18
- package/dist/components/message-actions/UnLikeButton.js +25 -22
- package/dist/components/message-actions/VoicePlay.js +25 -22
- package/dist/components/message-list/index.js +86 -76
- package/dist/components/message-list/index.module.css +261 -0
- package/dist/components/no-microphone-root/index.js +40 -30
- package/dist/components/no-microphone-root/index.module.css +48 -0
- package/dist/components/preset-agent-content/index.js +21 -16
- package/dist/components/preset-agent-content/index.module.css +46 -0
- package/dist/components/quoted-content/index.module.css +80 -0
- package/dist/components/reasoning-content/index.js +56 -43
- package/dist/components/reasoning-content/index.module.css +169 -0
- package/dist/components/reference-content/index.js +73 -64
- package/dist/components/reference-content/index.module.css +84 -0
- package/dist/components/templates/CommonChat.js +79 -65
- package/dist/components/templates/GimiChatComponent.js +13 -6
- package/dist/components/templates/demo/demo.js +104 -103
- package/dist/components/templates/index.module.css +109 -0
- package/dist/components/upload-list/index.js +57 -42
- package/dist/components/upload-list/index.module.css +119 -0
- package/dist/components/voice-bars/index.js +22 -19
- package/dist/components/voice-check-dialog/index.js +25 -18
- package/dist/components/voice-check-dialog/{index.module.scss → index.module.css} +2 -2
- package/dist/components/voice-recording/index.js +58 -43
- package/dist/components/voice-recording/index.module.css +41 -0
- package/dist/components/work-flow-content/demo.js +2 -1
- package/dist/components/work-flow-content/index.js +13 -10
- package/dist/components/work-flow-content/index.module.css +24 -0
- package/package.json +7 -6
- package/dist/components/ai-chat-dialogue/index.module.scss +0 -272
- package/dist/components/ai-loading/index.module.scss +0 -11
- package/dist/components/answer-item/index.module.scss +0 -295
- package/dist/components/ask-card/index.module.scss +0 -125
- package/dist/components/chat-input/index.module.scss +0 -44
- package/dist/components/dots-loading/index.module.scss +0 -45
- package/dist/components/empty/index.module.scss +0 -27
- package/dist/components/excel-components/index.module.scss +0 -210
- package/dist/components/excel-components/styles.module.scss +0 -186
- package/dist/components/file-card/index.module.scss +0 -139
- package/dist/components/file-preview/index.module.scss +0 -120
- package/dist/components/gimi-sidebar/index.module.scss +0 -136
- package/dist/components/header/index.module.scss +0 -26
- package/dist/components/knowledge-trace/index.module.scss +0 -262
- package/dist/components/message-list/index.module.scss +0 -304
- package/dist/components/no-microphone-root/index.module.scss +0 -42
- package/dist/components/preset-agent-content/index.module.scss +0 -48
- package/dist/components/quoted-content/index.module.scss +0 -76
- package/dist/components/reasoning-content/index.module.scss +0 -164
- package/dist/components/reference-content/index.module.scss +0 -73
- package/dist/components/templates/index.module.scss +0 -119
- package/dist/components/upload-list/index.module.scss +0 -119
- package/dist/components/voice-recording/index.module.scss +0 -41
- package/dist/components/work-flow-content/index.module.scss +0 -23
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.main {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: 10px;
|
|
6
|
+
padding: 10px 0px;
|
|
7
|
+
}
|
|
8
|
+
.main .all {
|
|
9
|
+
width: 78px;
|
|
10
|
+
border-radius: 12px;
|
|
11
|
+
border: 1px solid rgb(233, 235, 242);
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
font-family: PingFang SC;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
line-height: 14px;
|
|
19
|
+
letter-spacing: 0px;
|
|
20
|
+
color: rgb(46, 57, 76);
|
|
21
|
+
box-shadow: 0px 2px 16px 0px rgba(84, 105, 140, 0.1);
|
|
22
|
+
}
|
|
23
|
+
.main .all:hover {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.card {
|
|
28
|
+
box-shadow: 0px 2px 16px 0px rgba(84, 105, 140, 0.1);
|
|
29
|
+
background: rgb(255, 255, 255) !important;
|
|
30
|
+
}
|
|
31
|
+
.card:hover {
|
|
32
|
+
background: rgb(241, 247, 255) !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.file_main {
|
|
36
|
+
max-width: 328px;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
border-radius: 12px;
|
|
39
|
+
border: 1px solid rgb(233, 235, 242);
|
|
40
|
+
background: linear-gradient(90deg, #EAF2FF 0%, #FFFFFF 100%);
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 10px;
|
|
44
|
+
padding: 16px;
|
|
45
|
+
}
|
|
46
|
+
.file_main:hover {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
.file_main .icon {
|
|
50
|
+
display: flex;
|
|
51
|
+
width: 40px;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
}
|
|
56
|
+
.file_main .icon img {
|
|
57
|
+
width: 40px;
|
|
58
|
+
height: 36px;
|
|
59
|
+
object-fit: cover;
|
|
60
|
+
padding: 2px;
|
|
61
|
+
}
|
|
62
|
+
.file_main .left {
|
|
63
|
+
flex: 1;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
}
|
|
68
|
+
.file_main .left .iconName {
|
|
69
|
+
display: flex;
|
|
70
|
+
margin-bottom: 4px;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
}
|
|
74
|
+
.file_main .left .iconName .nameSize {
|
|
75
|
+
flex: 1 1 auto;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
.file_main .left .iconName .nameSize .type {
|
|
81
|
+
width: fit-content;
|
|
82
|
+
text-align: center;
|
|
83
|
+
color: var(---, #717f94);
|
|
84
|
+
font-family: "PingFang SC";
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
line-height: normal;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
height: 17px;
|
|
91
|
+
margin-right: 12px;
|
|
92
|
+
}
|
|
93
|
+
.file_main .left .iconName .nameSize .name {
|
|
94
|
+
flex: 1;
|
|
95
|
+
color: var(---, #2e394c);
|
|
96
|
+
font-family: "PingFang SC";
|
|
97
|
+
font-size: 16px;
|
|
98
|
+
width: fit-content;
|
|
99
|
+
max-width: 190px;
|
|
100
|
+
font-style: normal;
|
|
101
|
+
font-weight: 400;
|
|
102
|
+
line-height: normal;
|
|
103
|
+
overflow: hidden; /* 隐藏溢出内容 */
|
|
104
|
+
white-space: nowrap; /* 强制文本不换行 */
|
|
105
|
+
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
|
106
|
+
margin-bottom: 6px;
|
|
107
|
+
}
|
|
108
|
+
.file_main .right {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
width: fit-content;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
}
|
|
115
|
+
.file_main .right .text {
|
|
116
|
+
color: rgb(64, 134, 255);
|
|
117
|
+
text-align: right;
|
|
118
|
+
font-family: "PingFang SC";
|
|
119
|
+
font-size: 16px;
|
|
120
|
+
font-style: normal;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
line-height: normal;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.list {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 10px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.text {
|
|
132
|
+
font-family: PingFang SC;
|
|
133
|
+
font-weight: 400;
|
|
134
|
+
font-style: Regular;
|
|
135
|
+
font-size: 15px;
|
|
136
|
+
line-height: 180%;
|
|
137
|
+
letter-spacing: 0px;
|
|
138
|
+
color: rgb(46, 57, 76);
|
|
139
|
+
}
|
|
@@ -6,11 +6,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useAppSelector, useAppDispatch } from "../../store/hooks";
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import styles from "./index.module.
|
|
9
|
+
import styles from "./index.module.css";
|
|
10
10
|
import { Button } from '@douyinfe/semi-ui';
|
|
11
|
-
import { IconClose
|
|
11
|
+
import { IconClose } from '@douyinfe/semi-icons';
|
|
12
12
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
13
13
|
import EmptyShow from "../../components/empty";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
var OfficeFilePreviewPanel = function OfficeFilePreviewPanel() {
|
|
15
17
|
var _useAppSelector = useAppSelector(function (state) {
|
|
16
18
|
return state.gimiMenu.filePreviewState;
|
|
@@ -36,7 +38,7 @@ var OfficeFilePreviewPanel = function OfficeFilePreviewPanel() {
|
|
|
36
38
|
iframeLoaded = _useState8[0],
|
|
37
39
|
setIframeLoaded = _useState8[1]; // iframe 是否已加载
|
|
38
40
|
var panelRef = useRef(null);
|
|
39
|
-
var
|
|
41
|
+
var resizerRef = useRef(null);
|
|
40
42
|
var startXRef = useRef(0);
|
|
41
43
|
var startWidthRef = useRef(0);
|
|
42
44
|
var widthRef = useRef(600); // 用于在事件处理函数中访问最新的 width 值
|
|
@@ -189,41 +191,44 @@ var OfficeFilePreviewPanel = function OfficeFilePreviewPanel() {
|
|
|
189
191
|
}
|
|
190
192
|
};
|
|
191
193
|
}, [isDragging]);
|
|
192
|
-
return /*#__PURE__*/
|
|
194
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
193
195
|
ref: panelRef,
|
|
194
196
|
className: show ? styles.main : styles.mainHidden,
|
|
195
197
|
style: {
|
|
196
198
|
width: "".concat(width, "px")
|
|
197
|
-
}
|
|
198
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
className: styles.content
|
|
200
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
201
|
-
className: styles.header
|
|
202
|
-
}, /*#__PURE__*/React.createElement("span", null, filename || '文档预览'), /*#__PURE__*/React.createElement(Button, {
|
|
203
|
-
size: "small",
|
|
204
|
-
theme: "borderless",
|
|
205
|
-
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
206
|
-
onClick: handleClose
|
|
207
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
208
|
-
className: styles.iframeContainer
|
|
209
|
-
}, url && !iframeError ? /*#__PURE__*/React.createElement("iframe", {
|
|
210
|
-
key: url,
|
|
211
|
-
src: iframeSrc,
|
|
212
|
-
width: "100%",
|
|
213
|
-
height: "100%",
|
|
214
|
-
style: {
|
|
215
|
-
border: 0
|
|
216
199
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
200
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
201
|
+
className: styles.content,
|
|
202
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
203
|
+
className: styles.header,
|
|
204
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
205
|
+
children: filename || '文档预览'
|
|
206
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
207
|
+
size: "small",
|
|
208
|
+
theme: "borderless",
|
|
209
|
+
icon: /*#__PURE__*/_jsx(IconClose, {}),
|
|
210
|
+
onClick: handleClose
|
|
211
|
+
})]
|
|
212
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
213
|
+
className: styles.iframeContainer,
|
|
214
|
+
children: url && !iframeError ? /*#__PURE__*/_jsx("iframe", {
|
|
215
|
+
src: iframeSrc,
|
|
216
|
+
width: "100%",
|
|
217
|
+
height: "100%",
|
|
218
|
+
style: {
|
|
219
|
+
border: 0
|
|
220
|
+
},
|
|
221
|
+
onError: handleIframeError,
|
|
222
|
+
onLoad: handleIframeLoad
|
|
223
|
+
}, url) : /*#__PURE__*/_jsx(EmptyShow, {
|
|
224
|
+
title: iframeError ? '文档加载失败' : '暂无内容'
|
|
225
|
+
})
|
|
226
|
+
})]
|
|
227
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
228
|
+
ref: resizerRef,
|
|
229
|
+
className: styles.resizer,
|
|
230
|
+
onMouseDown: handleMouseDown
|
|
231
|
+
})]
|
|
232
|
+
});
|
|
228
233
|
};
|
|
229
234
|
export default OfficeFilePreviewPanel;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
height: 100%;
|
|
4
|
+
background: #ffffff;
|
|
5
|
+
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
transition: width 0.2s ease;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
.main.dragging {
|
|
13
|
+
transition: none;
|
|
14
|
+
}
|
|
15
|
+
.main.dragging .content {
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content {
|
|
20
|
+
flex: 1;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.resizer {
|
|
28
|
+
position: absolute;
|
|
29
|
+
left: 0;
|
|
30
|
+
top: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
width: 6px;
|
|
33
|
+
cursor: ew-resize;
|
|
34
|
+
z-index: 1001;
|
|
35
|
+
transition: all 0.2s ease;
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
.resizer:hover {
|
|
39
|
+
background: rgba(64, 134, 255, 0.2);
|
|
40
|
+
}
|
|
41
|
+
.resizer:active {
|
|
42
|
+
background: rgba(64, 134, 255, 0.4);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.header {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
padding: 16px 20px;
|
|
50
|
+
border-bottom: 1px solid #e8e8e8;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
background: #ffffff;
|
|
53
|
+
}
|
|
54
|
+
.header span {
|
|
55
|
+
font-family: "PingFang SC", sans-serif;
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
color: #2e394c;
|
|
59
|
+
line-height: 22px;
|
|
60
|
+
}
|
|
61
|
+
.header :global(.ant-btn) {
|
|
62
|
+
color: #8c8c8c;
|
|
63
|
+
}
|
|
64
|
+
.header :global(.ant-btn):hover {
|
|
65
|
+
color: #4086ff;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.iframeContainer {
|
|
69
|
+
flex: 1;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
position: relative;
|
|
72
|
+
background: #f5f5f5;
|
|
73
|
+
}
|
|
74
|
+
.iframeContainer iframe {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
border: none;
|
|
78
|
+
display: block;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.mainHidden {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
@@ -9,6 +9,7 @@ import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
|
9
9
|
import { setFileList } from "../../store/slices/gimiMenuSlice";
|
|
10
10
|
import { FileStatus } from "../../interfaces/fileInterface";
|
|
11
11
|
import { useGimiFileUpload } from "../../hooks/useFile";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
var DEFAULT_ACCEPT = '.xlsx,.txt';
|
|
13
14
|
var MAX_RETRY_COUNT = 3;
|
|
14
15
|
/** Redux FileItem → Semi Upload FileItem */
|
|
@@ -219,11 +220,12 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
219
220
|
retryUpload: retryUpload
|
|
220
221
|
};
|
|
221
222
|
});
|
|
222
|
-
var trigger = /*#__PURE__*/
|
|
223
|
-
icon: /*#__PURE__*/
|
|
224
|
-
type: "tertiary"
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
var trigger = /*#__PURE__*/_jsx(Button, {
|
|
224
|
+
icon: /*#__PURE__*/_jsx(IconPaperclip, {}),
|
|
225
|
+
type: "tertiary",
|
|
226
|
+
children: "\u70B9\u51FB\u4E0A\u4F20"
|
|
227
|
+
});
|
|
228
|
+
return /*#__PURE__*/_jsx(Upload, {
|
|
227
229
|
customRequest: customRequest,
|
|
228
230
|
action: "",
|
|
229
231
|
limit: limit,
|
|
@@ -232,7 +234,8 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
232
234
|
maxSize: maxSize * 1024,
|
|
233
235
|
disabled: disabled,
|
|
234
236
|
showUploadList: false,
|
|
235
|
-
fileList: transformFileItem(fileList || [])
|
|
236
|
-
|
|
237
|
+
fileList: transformFileItem(fileList || []),
|
|
238
|
+
children: children || trigger
|
|
239
|
+
});
|
|
237
240
|
});
|
|
238
241
|
export default FileUpload;
|
|
@@ -14,6 +14,8 @@ import { FileStatus } from "../../interfaces/fileInterface";
|
|
|
14
14
|
import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
15
15
|
import { setFileList } from "../../store/slices/gimiMenuSlice";
|
|
16
16
|
import { useGimiFileUpload } from "../../hooks/useFile";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
19
|
var defaultFileLimit = '.xlsx,.txt';
|
|
18
20
|
var transformFileItem = function transformFileItem(item) {
|
|
19
21
|
return item.map(function (file) {
|
|
@@ -138,10 +140,11 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
140
|
abortSSE();
|
|
139
141
|
};
|
|
140
142
|
}, [abortSSE]);
|
|
141
|
-
var defailtTrigger = /*#__PURE__*/
|
|
142
|
-
icon: /*#__PURE__*/
|
|
143
|
-
type: "tertiary"
|
|
144
|
-
|
|
143
|
+
var defailtTrigger = /*#__PURE__*/_jsx(Button, {
|
|
144
|
+
icon: /*#__PURE__*/_jsx(IconPaperclip, {}),
|
|
145
|
+
type: "tertiary",
|
|
146
|
+
children: "\u70B9\u51FB\u4E0A\u4F20"
|
|
147
|
+
});
|
|
145
148
|
var customRequest = /*#__PURE__*/function () {
|
|
146
149
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
147
150
|
var file, onSuccess, onError, controller, formData, rawFile, _response$result2, response, responseObj;
|
|
@@ -240,28 +243,31 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
240
243
|
return _ref.apply(this, arguments);
|
|
241
244
|
};
|
|
242
245
|
}();
|
|
243
|
-
return /*#__PURE__*/
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
246
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
247
|
+
children: /*#__PURE__*/_jsx(Upload, {
|
|
248
|
+
customRequest: customRequest,
|
|
249
|
+
headers: {
|
|
250
|
+
'Authorization': 'Bearer ' + token
|
|
251
|
+
},
|
|
252
|
+
maxSize: maxSize || 10 * 1024,
|
|
253
|
+
limit: limit || 1,
|
|
254
|
+
multiple: (limit || 1) > 1,
|
|
255
|
+
onExceed: function onExceed() {
|
|
256
|
+
return Toast.warning("\u5355\u6B21\u4EC5\u652F\u6301\u4E0A\u4F20".concat(limit || 1, "\u4E2A\u6587\u4EF6"));
|
|
257
|
+
},
|
|
258
|
+
onSizeError: function onSizeError() {
|
|
259
|
+
return Toast.warning("\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236");
|
|
260
|
+
},
|
|
261
|
+
onAcceptInvalid: function onAcceptInvalid() {
|
|
262
|
+
return Toast.warning("\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B");
|
|
263
|
+
},
|
|
264
|
+
accept: (accept === null || accept === void 0 ? void 0 : accept.join(',')) || defaultFileLimit,
|
|
265
|
+
fileList: transformFileItem(fileList || []),
|
|
266
|
+
disabled: disabled,
|
|
267
|
+
showUploadList: false,
|
|
268
|
+
onChange: onChange,
|
|
269
|
+
children: children || defailtTrigger
|
|
270
|
+
})
|
|
271
|
+
});
|
|
266
272
|
});
|
|
267
273
|
export default FileUpload;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import classNames from "classnames";
|
|
2
|
-
import styles from "./index.module.
|
|
2
|
+
import styles from "./index.module.css";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { IconClose } from "@douyinfe/semi-icons";
|
|
5
5
|
import { Button } from "@douyinfe/semi-ui";
|
|
6
6
|
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
9
|
var GimiSideBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8
10
|
var show = _ref.show,
|
|
9
11
|
handleClose = _ref.handleClose,
|
|
@@ -22,20 +24,25 @@ var GimiSideBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22
24
|
contentRef: contentRef
|
|
23
25
|
};
|
|
24
26
|
}, [sideBarRef]);
|
|
25
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
26
28
|
className: classNames(show ? isOverFlow ? styles.overflow_layout : styles.main : styles.closed, className),
|
|
27
29
|
ref: sideBarRef,
|
|
28
|
-
style: style
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
style: style,
|
|
31
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
32
|
+
className: styles.header,
|
|
33
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
34
|
+
children: title
|
|
35
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
36
|
+
size: "small",
|
|
37
|
+
theme: "borderless",
|
|
38
|
+
icon: /*#__PURE__*/_jsx(IconClose, {}),
|
|
39
|
+
onClick: handleClose
|
|
40
|
+
})]
|
|
41
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
42
|
+
className: styles.content,
|
|
43
|
+
ref: contentRef,
|
|
44
|
+
children: [render === null || render === void 0 ? void 0 : render(), children]
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
40
47
|
});
|
|
41
48
|
export default GimiSideBar;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.overflow_layout {
|
|
2
|
+
position: absolute;
|
|
3
|
+
right: 0;
|
|
4
|
+
z-index: 10;
|
|
5
|
+
height: 100%;
|
|
6
|
+
box-shadow: -1px 0 10px 0 rgb(233, 235, 242);
|
|
7
|
+
width: 300px;
|
|
8
|
+
display: flex;
|
|
9
|
+
background-color: white;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
padding: 0px 10px;
|
|
12
|
+
border-left: 1px solid #EEEEEE;
|
|
13
|
+
box-shadow: -1px 0 10px 0 rgb(233, 235, 242);
|
|
14
|
+
overflow: auto;
|
|
15
|
+
}
|
|
16
|
+
.overflow_layout .header {
|
|
17
|
+
display: flex;
|
|
18
|
+
height: 40px;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
font-family: "PingFang SC";
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
line-height: 100%;
|
|
27
|
+
letter-spacing: 0px;
|
|
28
|
+
}
|
|
29
|
+
.overflow_layout .content {
|
|
30
|
+
height: 100%;
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
padding-right: 10px;
|
|
33
|
+
}
|
|
34
|
+
.overflow_layout .content::-webkit-scrollbar {
|
|
35
|
+
width: 6px;
|
|
36
|
+
}
|
|
37
|
+
.overflow_layout .content::-webkit-scrollbar-track {
|
|
38
|
+
background: transparent;
|
|
39
|
+
}
|
|
40
|
+
.overflow_layout .content::-webkit-scrollbar-thumb {
|
|
41
|
+
background-color: #d9d9d9;
|
|
42
|
+
border-radius: 5px;
|
|
43
|
+
}
|
|
44
|
+
.overflow_layout .content::-webkit-scrollbar-thumb:hover {
|
|
45
|
+
background-color: #bfbfbf;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.main {
|
|
49
|
+
display: flex;
|
|
50
|
+
min-width: 300px;
|
|
51
|
+
background-color: white;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
padding: 10px;
|
|
54
|
+
border-left: 1px solid #EEEEEE;
|
|
55
|
+
height: 100%;
|
|
56
|
+
box-shadow: -1px 0 10px 0 rgb(233, 235, 242);
|
|
57
|
+
overflow: auto;
|
|
58
|
+
z-index: 3;
|
|
59
|
+
animation: slideInRight 0.3s ease-out forwards;
|
|
60
|
+
transform: translateX(0);
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
.main .header {
|
|
64
|
+
display: flex;
|
|
65
|
+
height: 40px;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
width: 100%;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
font-family: "PingFang SC";
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
line-height: 100%;
|
|
74
|
+
letter-spacing: 0px;
|
|
75
|
+
}
|
|
76
|
+
.main .content {
|
|
77
|
+
height: 100%;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
padding-right: 10px;
|
|
80
|
+
}
|
|
81
|
+
.main .content::-webkit-scrollbar {
|
|
82
|
+
width: 6px;
|
|
83
|
+
}
|
|
84
|
+
.main .content::-webkit-scrollbar-track {
|
|
85
|
+
background: transparent;
|
|
86
|
+
}
|
|
87
|
+
.main .content::-webkit-scrollbar-thumb {
|
|
88
|
+
background-color: #d9d9d9;
|
|
89
|
+
border-radius: 5px;
|
|
90
|
+
}
|
|
91
|
+
.main .content::-webkit-scrollbar-thumb:hover {
|
|
92
|
+
background-color: #bfbfbf;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.closed {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@keyframes slideInRight {
|
|
100
|
+
0% {
|
|
101
|
+
transform: translateX(100%);
|
|
102
|
+
opacity: 0;
|
|
103
|
+
}
|
|
104
|
+
100% {
|
|
105
|
+
transform: translateX(0);
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
@keyframes slideOutLeft {
|
|
110
|
+
0% {
|
|
111
|
+
transform: translateX(0);
|
|
112
|
+
opacity: 1;
|
|
113
|
+
}
|
|
114
|
+
100% {
|
|
115
|
+
transform: translateX(100%);
|
|
116
|
+
opacity: 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import styles from "./index.module.
|
|
2
|
+
import styles from "./index.module.css";
|
|
3
3
|
import aiLogo from "../../assets/image/ai-logo.png";
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
7
|
var Header = function Header(_ref) {
|
|
6
8
|
var _ref$title = _ref.title,
|
|
7
9
|
title = _ref$title === void 0 ? '' : _ref$title;
|
|
8
|
-
return /*#__PURE__*/
|
|
9
|
-
className: styles.header
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
return /*#__PURE__*/_jsx("div", {
|
|
11
|
+
className: styles.header,
|
|
12
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
13
|
+
className: styles.container,
|
|
14
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
15
|
+
className: styles.logo,
|
|
16
|
+
src: aiLogo,
|
|
17
|
+
alt: ""
|
|
18
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
19
|
+
className: classNames(styles.title, 'ellipse'),
|
|
20
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
21
|
+
children: title
|
|
22
|
+
})
|
|
23
|
+
})]
|
|
24
|
+
})
|
|
25
|
+
});
|
|
19
26
|
};
|
|
20
27
|
export default Header;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.header .container {
|
|
2
|
+
padding: 30px 30px 23px;
|
|
3
|
+
width: 800px;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
height: 86px;
|
|
7
|
+
margin: 0 auto;
|
|
8
|
+
}
|
|
9
|
+
.header .logo {
|
|
10
|
+
width: 18px;
|
|
11
|
+
height: 18px;
|
|
12
|
+
margin-right: 8px;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
margin-top: 5px;
|
|
15
|
+
}
|
|
16
|
+
.header .title {
|
|
17
|
+
font-size: 18px;
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
@@ -12,11 +12,12 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
var IconFont = createFromIconfontCN({
|
|
16
17
|
scriptUrl: '//at.alicdn.com/t/c/font_3429456_0fjwg76h4xco.js'
|
|
17
18
|
});
|
|
18
19
|
var IconFontCom = function IconFontCom(props) {
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsx(IconFont, {
|
|
20
21
|
type: props.type,
|
|
21
22
|
style: _objectSpread({
|
|
22
23
|
fontSize: (props === null || props === void 0 ? void 0 : props.size) || 12,
|