@myun/gimi-chat 0.9.22 → 0.9.24
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/apis/useApi.js +1 -1
- package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
- package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
- package/dist/components/ai-chat-dialogue/index.js +54 -49
- package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
- package/dist/components/ai-chat-dialogue/index.module.css +78 -136
- package/dist/components/chat-input/index.d.ts +5 -0
- package/dist/components/chat-input/index.js +181 -68
- package/dist/components/chat-input/index.module.css +70 -2
- package/dist/components/file-upload/index.js +120 -34
- package/dist/components/iconfont-com/index.js +1 -1
- package/dist/components/message-list/index.js +3 -2
- package/dist/components/templates/CommonChat.js +27 -5
- package/dist/components/templates/GimiChatComponent.js +4 -0
- package/dist/components/upload-list/CustomFile.d.ts +15 -0
- package/dist/components/upload-list/CustomFile.js +105 -0
- package/dist/components/upload-list/ImageFile.d.ts +18 -0
- package/dist/components/upload-list/ImageFile.js +68 -0
- package/dist/components/upload-list/customFile.module.css +122 -0
- package/dist/components/upload-list/imageFile.module.css +95 -0
- package/dist/components/upload-list/index.d.ts +4 -3
- package/dist/components/upload-list/index.js +101 -84
- package/dist/components/upload-list/index.module.css +68 -99
- package/dist/components/voice-bars/index.js +10 -9
- package/dist/components/voice-check-dialog/index.js +2 -1
- package/dist/components/voice-recording/index.d.ts +1 -1
- package/dist/components/voice-recording/index.js +2 -28
- package/dist/hooks/useChatMessage.d.ts +1 -1
- package/dist/hooks/useChatMessage.js +1 -1
- package/dist/hooks/useCommonChatAPI.js +13 -9
- package/dist/hooks/useFile.js +99 -7
- package/dist/i18n/locales/en-US.d.ts +9 -0
- package/dist/i18n/locales/en-US.js +11 -2
- package/dist/i18n/locales/zh-CN.d.ts +9 -0
- package/dist/i18n/locales/zh-CN.js +11 -2
- package/dist/types/chat.d.ts +3 -0
- package/dist/types/file.d.ts +9 -0
- package/dist/umd/index.min.js +1 -1
- package/dist/utils/tools.d.ts +1 -0
- package/dist/utils/tools.js +25 -1
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.uploadBox {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
min-width: 200px; /* 最小宽度保证 */
|
|
6
|
+
max-width: 200px; /* 最大宽度限制 */
|
|
7
|
+
width: fit-content; /* 自动适应内容宽度 */
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
background: var(---, #f2f3f7);
|
|
11
|
+
padding: 14px 16px 14px 12px;
|
|
12
|
+
margin-bottom: 12px;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
.uploadBox:hover .delIcon {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.uploadIcon img {
|
|
20
|
+
width: 24px;
|
|
21
|
+
height: 22px;
|
|
22
|
+
margin-right: 8px;
|
|
23
|
+
}
|
|
24
|
+
.uploadIcon img img {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
object-fit: cover;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.uploadName {
|
|
31
|
+
flex: 1; /* 让文件名占满剩余空间 */
|
|
32
|
+
color: #2e394c;
|
|
33
|
+
font-family: "PingFang SC";
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
line-height: normal;
|
|
38
|
+
min-width: 0; /* 关键:允许flex子元素缩小到内容尺寸以下 */
|
|
39
|
+
}
|
|
40
|
+
.uploadName .uploadfileName {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
max-width: 100%; /* 限制整个文件名区域宽度 */
|
|
44
|
+
}
|
|
45
|
+
.uploadName .uploadfileName .fileName {
|
|
46
|
+
/* 动态计算可用宽度,减去扩展名和间距 */
|
|
47
|
+
flex: 1;
|
|
48
|
+
min-width: 0; /* 允许文件名进一步缩小 */
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
margin-right: 4px; /* 与扩展名保持一点距离 */
|
|
53
|
+
}
|
|
54
|
+
.uploadName .uploadfileName .fileExtension {
|
|
55
|
+
white-space: nowrap; /* 确保扩展名不换行 */
|
|
56
|
+
color: #717F94; /* 可以给扩展名一个不同的颜色区分 */
|
|
57
|
+
}
|
|
58
|
+
.uploadName .sizeText .size {
|
|
59
|
+
margin-right: 4px;
|
|
60
|
+
font-size: 12px; /* 修复之前的语法错误,添加单位px */
|
|
61
|
+
color: #717F94;
|
|
62
|
+
}
|
|
63
|
+
.uploadName .sizeText .errorText {
|
|
64
|
+
color: #f33;
|
|
65
|
+
font-family: "PingFang SC";
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
font-style: normal;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
line-height: normal;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.uploadStatus,
|
|
73
|
+
.uploadLoading {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
margin-left: 8px;
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
color: #717F94;
|
|
80
|
+
}
|
|
81
|
+
.uploadStatus img,
|
|
82
|
+
.uploadLoading img {
|
|
83
|
+
width: 18px;
|
|
84
|
+
height: 18px;
|
|
85
|
+
object-fit: cover;
|
|
86
|
+
margin-left: 5px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.delIcon {
|
|
90
|
+
display: none;
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: -7px;
|
|
93
|
+
top: -5px;
|
|
94
|
+
width: 14px;
|
|
95
|
+
height: 14px;
|
|
96
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
97
|
+
color: white;
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
background-color: white;
|
|
103
|
+
}
|
|
104
|
+
.delIcon img {
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 100%;
|
|
107
|
+
object-fit: cover;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.uploadError {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
color: #4086ff;
|
|
113
|
+
text-align: right;
|
|
114
|
+
font-family: "PingFang SC";
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
font-style: normal;
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
line-height: normal;
|
|
119
|
+
margin-left: 20px;
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.uploadBox {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 54px;
|
|
5
|
+
height: 54px;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
border: 0.5px solid #D9DCE5;
|
|
8
|
+
position: relative;
|
|
9
|
+
overflow: visible;
|
|
10
|
+
margin-bottom: 12px;
|
|
11
|
+
}
|
|
12
|
+
.uploadBox.messageImg {
|
|
13
|
+
width: 100px;
|
|
14
|
+
height: 100px;
|
|
15
|
+
border-radius: 16px;
|
|
16
|
+
border-width: 1px;
|
|
17
|
+
border-color: rgba(0, 0, 0, 0.07);
|
|
18
|
+
}
|
|
19
|
+
.uploadBox.messageImg .uploadImg {
|
|
20
|
+
border-radius: 16px;
|
|
21
|
+
}
|
|
22
|
+
.uploadBox.singleImg {
|
|
23
|
+
width: fit-content;
|
|
24
|
+
height: fit-content;
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
max-width: 320px;
|
|
27
|
+
max-height: 200px;
|
|
28
|
+
border-color: rgba(0, 0, 0, 0.07);
|
|
29
|
+
}
|
|
30
|
+
.uploadBox:hover .delIcon {
|
|
31
|
+
display: flex;
|
|
32
|
+
}
|
|
33
|
+
.uploadBox .uploadImg {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
object-fit: cover;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.uploadStatus,
|
|
41
|
+
.uploadLoading {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
border-radius: 8px;
|
|
48
|
+
border: 0.5px solid #D9DCE5;
|
|
49
|
+
background: rgba(0, 0, 0, 0.4);
|
|
50
|
+
}
|
|
51
|
+
.uploadStatus img,
|
|
52
|
+
.uploadLoading img {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 50%;
|
|
55
|
+
left: 50%;
|
|
56
|
+
transform: translate(-50%, -50%);
|
|
57
|
+
width: 18px;
|
|
58
|
+
height: 18px;
|
|
59
|
+
object-fit: cover;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.delIcon {
|
|
63
|
+
display: none;
|
|
64
|
+
position: absolute;
|
|
65
|
+
right: -7px;
|
|
66
|
+
top: -5px;
|
|
67
|
+
width: 14px;
|
|
68
|
+
height: 14px;
|
|
69
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
70
|
+
color: white;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
background-color: white;
|
|
76
|
+
}
|
|
77
|
+
.delIcon img {
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
object-fit: cover;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.uploadError {
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
color: #4086ff;
|
|
86
|
+
text-align: right;
|
|
87
|
+
font-family: "PingFang SC";
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
font-style: normal;
|
|
90
|
+
font-weight: 400;
|
|
91
|
+
line-height: normal;
|
|
92
|
+
margin-left: 20px;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileStatus } from '../../interfaces/fileInterface';
|
|
3
3
|
interface UploadFileProps {
|
|
4
|
-
|
|
4
|
+
fileList: {
|
|
5
5
|
fileType?: string;
|
|
6
6
|
fileName?: string;
|
|
7
7
|
status: FileStatus;
|
|
8
8
|
[key: string]: any;
|
|
9
|
-
};
|
|
10
|
-
handleDelFile?: () => void;
|
|
9
|
+
}[];
|
|
10
|
+
handleDelFile?: (uid: string) => void;
|
|
11
11
|
handleReTry?: (file: any) => void;
|
|
12
12
|
showDel?: boolean;
|
|
13
|
+
isMessage?: boolean;
|
|
13
14
|
}
|
|
14
15
|
declare const UploadFile: React.FC<UploadFileProps>;
|
|
15
16
|
export default UploadFile;
|
|
@@ -1,93 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useRef, useState, useEffect, useMemo } from 'react';
|
|
12
|
+
import ImageFile from "./ImageFile";
|
|
13
|
+
import CustomFile from "./CustomFile";
|
|
3
14
|
import styles from "./index.module.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
15
|
+
import IconFontCom from "../iconfont-com";
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import { handleFileList } from "../../utils/tools";
|
|
7
18
|
var UploadFile = function UploadFile(_ref) {
|
|
8
|
-
var
|
|
19
|
+
var _ref$fileList = _ref.fileList,
|
|
20
|
+
fileList = _ref$fileList === void 0 ? [] : _ref$fileList,
|
|
9
21
|
handleDelFile = _ref.handleDelFile,
|
|
10
22
|
handleReTry = _ref.handleReTry,
|
|
11
23
|
_ref$showDel = _ref.showDel,
|
|
12
|
-
showDel = _ref$showDel === void 0 ? true : _ref$showDel
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
24
|
+
showDel = _ref$showDel === void 0 ? true : _ref$showDel,
|
|
25
|
+
_ref$isMessage = _ref.isMessage,
|
|
26
|
+
isMessage = _ref$isMessage === void 0 ? false : _ref$isMessage;
|
|
27
|
+
var scrollRef = useRef(null);
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
showLeft = _useState2[0],
|
|
31
|
+
setShowLeft = _useState2[1];
|
|
32
|
+
var _useState3 = useState(false),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
showRight = _useState4[0],
|
|
35
|
+
setShowRight = _useState4[1];
|
|
36
|
+
var transformFileList = useMemo(function () {
|
|
37
|
+
return handleFileList(fileList);
|
|
38
|
+
}, [fileList]);
|
|
39
|
+
var allImages = useMemo(function () {
|
|
40
|
+
return (transformFileList === null || transformFileList === void 0 ? void 0 : transformFileList.length) > 0 && transformFileList.every(function (f) {
|
|
41
|
+
return f.isImage;
|
|
42
|
+
});
|
|
43
|
+
}, [transformFileList]);
|
|
44
|
+
var checkScroll = function checkScroll() {
|
|
45
|
+
var el = scrollRef.current;
|
|
46
|
+
if (!el) return;
|
|
47
|
+
setShowLeft(el.scrollLeft > 0);
|
|
48
|
+
setShowRight(Math.ceil(el.scrollLeft + el.clientWidth) < el.scrollWidth);
|
|
49
|
+
};
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
if (isMessage) return;
|
|
52
|
+
checkScroll();
|
|
53
|
+
}, [fileList]);
|
|
54
|
+
var scroll = function scroll(dir) {
|
|
55
|
+
var el = scrollRef.current;
|
|
56
|
+
if (!el) return;
|
|
57
|
+
el.scrollBy({
|
|
58
|
+
left: dir === 'left' ? -430 : 430,
|
|
59
|
+
behavior: 'smooth'
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, allImages ? /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: classNames(styles.imgList, _defineProperty({}, styles.imgListMessage, isMessage))
|
|
64
|
+
}, transformFileList.map(function (file) {
|
|
65
|
+
return /*#__PURE__*/React.createElement(ImageFile, {
|
|
66
|
+
key: file.uid,
|
|
67
|
+
file: file,
|
|
68
|
+
handleDelFile: handleDelFile ? function () {
|
|
69
|
+
return handleDelFile(file.uid);
|
|
70
|
+
} : undefined,
|
|
71
|
+
handleReTry: handleReTry,
|
|
72
|
+
showDel: showDel,
|
|
73
|
+
isMessage: isMessage,
|
|
74
|
+
isSingle: (transformFileList === null || transformFileList === void 0 ? void 0 : transformFileList.length) === 1
|
|
75
|
+
});
|
|
76
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: classNames(styles.customListWrapper)
|
|
60
78
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
ref: scrollRef,
|
|
80
|
+
className: classNames(styles.customList, _defineProperty({}, styles.customListMessage, isMessage), _defineProperty({}, styles.customListLeft, showLeft), _defineProperty({}, styles.customListRight, showRight)),
|
|
81
|
+
onScroll: checkScroll
|
|
82
|
+
}, transformFileList.map(function (file) {
|
|
83
|
+
return /*#__PURE__*/React.createElement(CustomFile, {
|
|
84
|
+
key: file.uid,
|
|
85
|
+
file: file,
|
|
86
|
+
handleDelFile: handleDelFile ? function () {
|
|
87
|
+
return handleDelFile(file.uid);
|
|
88
|
+
} : undefined,
|
|
89
|
+
handleReTry: handleReTry,
|
|
90
|
+
showDel: showDel
|
|
91
|
+
});
|
|
92
|
+
})), showLeft && /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "".concat(styles.arrowBtn, " ").concat(styles.arrowLeft),
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return scroll('left');
|
|
96
|
+
}
|
|
97
|
+
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
98
|
+
type: "icon-a-jiantouxi2x-copy",
|
|
99
|
+
size: 16
|
|
100
|
+
})), showRight && /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "".concat(styles.arrowBtn, " ").concat(styles.arrowRight),
|
|
102
|
+
onClick: function onClick() {
|
|
103
|
+
return scroll('right');
|
|
84
104
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
src: "https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/12/6fa3e_20250912145501.png",
|
|
90
|
-
alt: "delete"
|
|
91
|
-
})));
|
|
105
|
+
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
106
|
+
type: "icon-a-jiantouxi2x",
|
|
107
|
+
size: 16
|
|
108
|
+
}))));
|
|
92
109
|
};
|
|
93
110
|
export default UploadFile;
|
|
@@ -1,120 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
.uploadBox {
|
|
1
|
+
.imgList {
|
|
3
2
|
display: flex;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
border-radius: 12px;
|
|
10
|
-
background: var(---, #f2f3f7);
|
|
11
|
-
padding: 14px 16px 14px 12px;
|
|
12
|
-
margin-bottom: 12px;
|
|
13
|
-
position: relative;
|
|
14
|
-
margin-top: 5px;
|
|
3
|
+
flex-wrap: nowrap;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
padding-top: 10px;
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
overflow-y: hidden;
|
|
15
8
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
.imgList::-webkit-scrollbar {
|
|
10
|
+
height: 6px;
|
|
11
|
+
}
|
|
12
|
+
.imgList::-webkit-scrollbar-thumb {
|
|
13
|
+
background: rgba(0, 0, 0, 0.2);
|
|
14
|
+
border-radius: 3px;
|
|
21
15
|
}
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
.imgList::-webkit-scrollbar-track {
|
|
17
|
+
background: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.customListWrapper {
|
|
21
|
+
position: relative;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
.
|
|
29
|
-
flex: 1; /* 让文件名占满剩余空间 */
|
|
30
|
-
color: #2e394c;
|
|
31
|
-
font-family: "PingFang SC";
|
|
32
|
-
font-size: 14px;
|
|
33
|
-
font-style: normal;
|
|
34
|
-
font-weight: 400;
|
|
35
|
-
line-height: normal;
|
|
36
|
-
min-width: 0; /* 关键:允许flex子元素缩小到内容尺寸以下 */
|
|
37
|
-
}
|
|
38
|
-
.uploadName .uploadfileName {
|
|
24
|
+
.arrowBtn {
|
|
39
25
|
display: flex;
|
|
40
26
|
align-items: center;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
.uploadName .sizeText .size {
|
|
57
|
-
margin-right: 4px;
|
|
58
|
-
font-size: 12px; /* 修复之前的语法错误,添加单位px */
|
|
59
|
-
color: #717F94;
|
|
60
|
-
}
|
|
61
|
-
.uploadName .sizeText .errorText {
|
|
62
|
-
color: #f33;
|
|
63
|
-
font-family: "PingFang SC";
|
|
64
|
-
font-size: 12px;
|
|
65
|
-
font-style: normal;
|
|
66
|
-
font-weight: 400;
|
|
67
|
-
line-height: normal;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 50%;
|
|
31
|
+
transform: translateY(-50%);
|
|
32
|
+
z-index: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.arrowLeft {
|
|
36
|
+
left: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.arrowRight {
|
|
40
|
+
right: 0;
|
|
68
41
|
}
|
|
69
42
|
|
|
70
|
-
.
|
|
71
|
-
.uploadLoading {
|
|
43
|
+
.customList {
|
|
72
44
|
display: flex;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
45
|
+
flex-wrap: nowrap;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
overflow-x: auto;
|
|
48
|
+
overflow-y: hidden;
|
|
49
|
+
scrollbar-width: none;
|
|
50
|
+
padding: 6px 10px 0 0;
|
|
51
|
+
}
|
|
52
|
+
.customList.customListMessage {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
.customList.customListLeft {
|
|
56
|
+
mask-image: linear-gradient(90deg, transparent 20px, #000 80px, #000);
|
|
78
57
|
}
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
margin-left: 5px;
|
|
58
|
+
.customList.customListRight {
|
|
59
|
+
mask-image: linear-gradient(270deg, transparent 20px, #000 80px, #000);
|
|
60
|
+
}
|
|
61
|
+
.customList::-webkit-scrollbar {
|
|
62
|
+
display: none;
|
|
85
63
|
}
|
|
86
64
|
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
.carouselWrapper {
|
|
66
|
+
padding-top: 10px;
|
|
67
|
+
}
|
|
68
|
+
.carouselWrapper :global .semi-carousel-arrow {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.scrollBtn {
|
|
73
|
+
width: 24px;
|
|
74
|
+
height: 24px;
|
|
95
75
|
border-radius: 50%;
|
|
76
|
+
background: #F2F3F7;
|
|
96
77
|
display: flex;
|
|
97
78
|
align-items: center;
|
|
98
79
|
justify-content: center;
|
|
99
80
|
cursor: pointer;
|
|
100
|
-
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
transition: background 0.2s;
|
|
101
83
|
}
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
height: 100%;
|
|
105
|
-
object-fit: cover;
|
|
84
|
+
.scrollBtn:hover {
|
|
85
|
+
background: #E8E9ED;
|
|
106
86
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
color: #4086ff;
|
|
111
|
-
text-align: right;
|
|
112
|
-
font-family: "PingFang SC";
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
font-style: normal;
|
|
115
|
-
font-weight: 400;
|
|
116
|
-
line-height: normal;
|
|
117
|
-
margin-left: 20px;
|
|
118
|
-
display: flex;
|
|
119
|
-
align-items: center;
|
|
87
|
+
.scrollBtn:active {
|
|
88
|
+
background: #DCDEE5;
|
|
120
89
|
}
|