@myun/gimi-chat 0.0.5 → 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 +181 -135
- package/dist/components/ai-correction/index.js +38 -25
- package/dist/components/ai-loading/index.js +12 -8
- package/dist/components/answer-item/index.js +135 -113
- package/dist/components/ask-card/index.js +42 -33
- package/dist/components/chat-input/index.js +135 -114
- 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 +10 -7
- package/dist/components/empty/index.js +12 -7
- package/dist/components/excel-components/ExcelCard.js +7 -3
- package/dist/components/excel-components/ExcelExcuting.js +60 -43
- package/dist/components/excel-components/ExcelFailCard.js +15 -10
- package/dist/components/excel-components/ExcelSuccessCard.js +3 -2
- package/dist/components/file-card/fileCardSidebar.js +23 -16
- package/dist/components/file-card/index.js +68 -49
- package/dist/components/file-preview/index.js +36 -29
- 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 +20 -13
- package/dist/components/header/index.js +18 -11
- package/dist/components/iconfont-com/index.js +2 -1
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +28 -22
- package/dist/components/knowledge-trace/classList.js +37 -28
- package/dist/components/knowledge-trace/documentList.js +36 -27
- package/dist/components/knowledge-trace/index.js +28 -21
- package/dist/components/knowledge-trace/videoList.js +46 -36
- 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 +85 -72
- package/dist/components/no-microphone-root/index.js +39 -29
- package/dist/components/preset-agent-content/index.js +20 -15
- package/dist/components/reasoning-content/index.js +55 -42
- package/dist/components/reference-content/index.js +72 -63
- package/dist/components/templates/CommonChat.js +78 -64
- package/dist/components/templates/GimiChatComponent.js +13 -6
- package/dist/components/templates/demo/demo.js +104 -102
- package/dist/components/upload-list/index.js +56 -41
- package/dist/components/voice-bars/index.js +22 -19
- package/dist/components/voice-check-dialog/index.js +24 -17
- package/dist/components/voice-recording/index.js +57 -42
- package/dist/components/work-flow-content/demo.js +2 -1
- package/dist/components/work-flow-content/index.js +12 -9
- package/package.json +6 -5
|
@@ -21,6 +21,8 @@ import LoadingIcon from "../../assets/image/Subtract.png";
|
|
|
21
21
|
import classNames from "classnames";
|
|
22
22
|
import { useExcelExcuteLongPoll } from "../../hooks/useLongPoll";
|
|
23
23
|
import LoadingDots from "../../components/dots-loading";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
26
|
var MOCK_STEPS = [{
|
|
25
27
|
id: 1,
|
|
26
28
|
text: "启动核心分析模块"
|
|
@@ -217,47 +219,62 @@ export var ExcelExcutingSteps = function ExcelExcutingSteps(_ref) {
|
|
|
217
219
|
setContentClass(styles.expanded);
|
|
218
220
|
}
|
|
219
221
|
}, [isExpanded]);
|
|
220
|
-
return /*#__PURE__*/
|
|
221
|
-
className: styles.container
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
222
|
+
return /*#__PURE__*/_jsx("div", {
|
|
223
|
+
className: styles.container,
|
|
224
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
225
|
+
className: styles.aiLoadingSteps,
|
|
226
|
+
children: isExpanded ? /*#__PURE__*/_jsxs("div", {
|
|
227
|
+
className: classNames(styles.contentWrapper, contentClass),
|
|
228
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
229
|
+
className: styles.header,
|
|
230
|
+
children: [!onReady && /*#__PURE__*/_jsxs("h3", {
|
|
231
|
+
className: styles.title,
|
|
232
|
+
children: [/*#__PURE__*/_jsx(LoadingDots, {}), '正在分析与生成模版...']
|
|
233
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
234
|
+
className: styles.description,
|
|
235
|
+
children: '正在启动任务处理流程, 结合上下文信息, 系统已进入深度分析阶段, 请稍候5~10分钟。'
|
|
236
|
+
})]
|
|
237
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
238
|
+
className: styles.stepsContainer,
|
|
239
|
+
children: renderSteps.map(function (step) {
|
|
240
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
241
|
+
className: classNames(step.isCompleted ? "".concat(styles.stepItem, " ").concat(styles.completed) : "".concat(styles.stepActiveItem, " ").concat(styles.active)),
|
|
242
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
243
|
+
className: styles.stepIndicator,
|
|
244
|
+
children: [step.isCompleted ? /*#__PURE__*/_jsx(IconTickCircle, {
|
|
245
|
+
className: styles.checkIcon
|
|
246
|
+
}) : /*#__PURE__*/_jsx("img", {
|
|
247
|
+
src: LoadingIcon,
|
|
248
|
+
className: styles.pendingIcon
|
|
249
|
+
}), step.id !== 6 && /*#__PURE__*/_jsx("div", {
|
|
250
|
+
className: styles.verticalLine
|
|
251
|
+
})]
|
|
252
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
253
|
+
className: styles.stepContent,
|
|
254
|
+
children: !step.isCompleted ? /*#__PURE__*/_jsxs("span", {
|
|
255
|
+
className: styles.stepText,
|
|
256
|
+
children: [displayText, isTyping && /*#__PURE__*/_jsx("span", {
|
|
257
|
+
className: styles.cursor,
|
|
258
|
+
children: "|"
|
|
259
|
+
})]
|
|
260
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
261
|
+
className: styles.stepText,
|
|
262
|
+
children: step.text
|
|
263
|
+
})
|
|
264
|
+
})]
|
|
265
|
+
}, step.id);
|
|
266
|
+
})
|
|
267
|
+
}), onReady && /*#__PURE__*/_jsx("span", {
|
|
268
|
+
className: styles.finishText,
|
|
269
|
+
children: "\u5206\u6790\u5B8C\u6210\uFF0C\u7ED3\u679C\u8F7D\u4F53\u5373\u5C06\u751F\u6210\uFF0C\u6B63\u51C6\u5907\u5448\u73B0..."
|
|
270
|
+
})]
|
|
271
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
272
|
+
className: classNames(styles.contentWrapper),
|
|
273
|
+
children: /*#__PURE__*/_jsx("h3", {
|
|
274
|
+
className: styles.title,
|
|
275
|
+
children: "\u5206\u6790\u5B8C\u6210\uFF0C\u7ED3\u679C\u8F7D\u4F53\u5373\u5C06\u751F\u6210\uFF0C\u6B63\u5728\u51C6\u5907\u5448\u73B0"
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
});
|
|
263
280
|
};
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from "./index.module.css";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
6
|
var ExcelFailCard = function ExcelFailCard(_ref) {
|
|
5
7
|
var item = _ref.item,
|
|
6
8
|
skillDetail = _ref.skillDetail,
|
|
7
9
|
onRetry = _ref.onRetry;
|
|
8
10
|
var message = skillDetail.message;
|
|
9
|
-
return /*#__PURE__*/
|
|
10
|
-
className: styles.excelFail
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
12
|
+
className: styles.excelFail,
|
|
13
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
14
|
+
className: styles.failText,
|
|
15
|
+
children: [" ", message]
|
|
16
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
17
|
+
className: classNames(styles.Retry, item !== null && item !== void 0 && item.reTryed ? styles.disablebox : ''),
|
|
18
|
+
onClick: function onClick() {
|
|
19
|
+
return onRetry(skillDetail, item === null || item === void 0 ? void 0 : item.id);
|
|
20
|
+
},
|
|
21
|
+
children: "\u91CD\u8BD5"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
19
24
|
};
|
|
20
25
|
export default ExcelFailCard;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FileCard, MultipleFileCard } from "../file-card";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
4
|
var transforata = function transforata(data) {
|
|
4
5
|
var fileName = data.file_name || '文件下载.xlsx';
|
|
5
6
|
var size = data.size || '0.0KB';
|
|
@@ -28,7 +29,7 @@ var ExcelSuccessCard = function ExcelSuccessCard(_ref) {
|
|
|
28
29
|
var renderData = skillDetail.map(function (item) {
|
|
29
30
|
return transforata(item);
|
|
30
31
|
});
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/_jsx(MultipleFileCard, {
|
|
32
33
|
list: renderData
|
|
33
34
|
});
|
|
34
35
|
}
|
|
@@ -39,7 +40,7 @@ var ExcelSuccessCard = function ExcelSuccessCard(_ref) {
|
|
|
39
40
|
downloadUrl = _transforata.downloadUrl,
|
|
40
41
|
size = _transforata.size,
|
|
41
42
|
fileType = _transforata.fileType;
|
|
42
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/_jsx(FileCard, {
|
|
43
44
|
fileName: fileName,
|
|
44
45
|
fileType: fileType,
|
|
45
46
|
size: size,
|
|
@@ -6,6 +6,9 @@ import { useCallback } from "react";
|
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
7
|
import styles from "./index.module.css";
|
|
8
8
|
import { FileCard } from ".";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
12
|
var FileCardSideBar = function FileCardSideBar(props) {
|
|
10
13
|
var targetElement = props.targetElement,
|
|
11
14
|
isOverFlow = props.isOverFlow,
|
|
@@ -25,32 +28,36 @@ var FileCardSideBar = function FileCardSideBar(props) {
|
|
|
25
28
|
dispatch(setSidebarFileList([]));
|
|
26
29
|
}, [dispatch]);
|
|
27
30
|
var renderContent = function renderContent() {
|
|
28
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_jsx(GimiSideBar, {
|
|
29
32
|
show: showSidebar,
|
|
30
33
|
isOverFlow: isOverFlow,
|
|
31
34
|
title: "\u5168\u90E8",
|
|
32
35
|
handleClose: handleClose,
|
|
33
36
|
className: className,
|
|
34
|
-
style: style
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
style: style,
|
|
38
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
39
|
+
className: styles.list,
|
|
40
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
41
|
+
className: styles.total,
|
|
42
|
+
children: "\u672C\u5BF9\u8BDD\u5171".concat((fileList === null || fileList === void 0 ? void 0 : fileList.length) || 0, "\u4E2A\u6587\u6863")
|
|
43
|
+
}), fileList.map(function (file, index) {
|
|
44
|
+
return /*#__PURE__*/_jsx(FileCard, {
|
|
45
|
+
fileName: file.fileName,
|
|
46
|
+
fileType: file.fileType,
|
|
47
|
+
size: file.size,
|
|
48
|
+
downloadUrl: file.downloadUrl
|
|
49
|
+
}, index);
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
48
53
|
};
|
|
49
54
|
if (isOverFlow) {
|
|
50
55
|
var targetElm = targetElement || document.getElementById('myun_gimi_design_chat');
|
|
51
56
|
if (!targetElm) return null;
|
|
52
57
|
return /*#__PURE__*/ReactDOM.createPortal(renderContent(), targetElm);
|
|
53
58
|
}
|
|
54
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
60
|
+
children: renderContent()
|
|
61
|
+
});
|
|
55
62
|
};
|
|
56
63
|
export default FileCardSideBar;
|
|
@@ -4,8 +4,11 @@ import styles from "./index.module.css";
|
|
|
4
4
|
import { downloadExcelByUrl } from "../../utils/tools";
|
|
5
5
|
import { useAppDispatch } from "../../store/hooks";
|
|
6
6
|
import { setFilePreviewState, setShowSidebarFileList, setSidebarFileList } from "../../store/slices/gimiMenuSlice";
|
|
7
|
-
import { RightOutlined } from '@ant-design/icons';
|
|
8
7
|
import classNames from 'classnames';
|
|
8
|
+
import { IconChevronRightStroked } from '@douyinfe/semi-icons';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
12
|
export var FileCard = function FileCard(_ref) {
|
|
10
13
|
var fileName = _ref.fileName,
|
|
11
14
|
downloadUrl = _ref.downloadUrl,
|
|
@@ -28,39 +31,52 @@ export var FileCard = function FileCard(_ref) {
|
|
|
28
31
|
}
|
|
29
32
|
}));
|
|
30
33
|
};
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
34
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
35
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
36
|
+
className: classNames(styles.file_main, styles.card),
|
|
37
|
+
onClick: previewExcel,
|
|
38
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: styles.icon,
|
|
40
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
41
|
+
src: "https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202512/19/b8723_20251219094824.png",
|
|
42
|
+
alt: ""
|
|
43
|
+
})
|
|
44
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
45
|
+
className: styles.left,
|
|
46
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
47
|
+
className: styles.iconName,
|
|
48
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
49
|
+
className: styles.nameSize,
|
|
50
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
51
|
+
content: decodeURIComponent(fileName),
|
|
52
|
+
position: "topLeft",
|
|
53
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
54
|
+
className: styles.name,
|
|
55
|
+
children: decodeURIComponent(fileName)
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
58
|
+
className: styles.type,
|
|
59
|
+
children: "".concat(fileType, " | ").concat(size)
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
64
|
+
className: styles.right,
|
|
65
|
+
onClick: handleDownLoad,
|
|
66
|
+
children: [downloadText && /*#__PURE__*/_jsx("span", {
|
|
67
|
+
className: styles.text,
|
|
68
|
+
children: downloadText
|
|
69
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
70
|
+
content: '下载',
|
|
71
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
72
|
+
src: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202509/15/c61c4_20250915193545.png",
|
|
73
|
+
width: 20,
|
|
74
|
+
alt: ""
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
64
80
|
};
|
|
65
81
|
export var MultipleFileCard = function MultipleFileCard(_ref2) {
|
|
66
82
|
var list = _ref2.list;
|
|
@@ -78,20 +94,23 @@ export var MultipleFileCard = function MultipleFileCard(_ref2) {
|
|
|
78
94
|
}));
|
|
79
95
|
dispatch(setSidebarFileList(list));
|
|
80
96
|
};
|
|
81
|
-
return /*#__PURE__*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
98
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
99
|
+
className: styles.main,
|
|
100
|
+
children: [renderList.map(function (item, index) {
|
|
101
|
+
return /*#__PURE__*/_jsx(FileCard, {
|
|
102
|
+
fileName: item.fileName,
|
|
103
|
+
fileType: item.fileType,
|
|
104
|
+
size: item.size,
|
|
105
|
+
downloadUrl: item.downloadUrl,
|
|
106
|
+
downloadText: "\u4E0B\u8F7D"
|
|
107
|
+
}, index);
|
|
108
|
+
}), hasMore && /*#__PURE__*/_jsxs("div", {
|
|
109
|
+
className: styles.all,
|
|
110
|
+
onClick: openSidebar,
|
|
111
|
+
children: ["\u5168\u90E8", /*#__PURE__*/_jsx(IconChevronRightStroked, {})]
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
});
|
|
96
115
|
};
|
|
97
116
|
export default MultipleFileCard;
|
|
@@ -11,6 +11,8 @@ import { Button } from '@douyinfe/semi-ui';
|
|
|
11
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;
|
|
@@ -189,39 +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
|
-
|
|
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
|
+
});
|
|
226
233
|
};
|
|
227
234
|
export default OfficeFilePreviewPanel;
|
|
@@ -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;
|
|
@@ -4,6 +4,8 @@ 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;
|