zmdms-webui 0.0.71 → 0.0.73
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/es/title/interface.d.ts +4 -0
- package/dist/es/title/title.js +3 -1
- package/dist/es/uploadlist/hooks.js +5 -2
- package/dist/es/uploadlist/uploadList.js +14 -7
- package/dist/es/uploadlist/uploadTable.js +5 -1
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,10 @@ interface ITitleProps {
|
|
|
10
10
|
showBg?: boolean;
|
|
11
11
|
/** 是否左右布局 */
|
|
12
12
|
justifyContent?: "space-between" | "flex-start";
|
|
13
|
+
/** 是否需要上边距 */
|
|
14
|
+
isTopMargin?: boolean;
|
|
15
|
+
/** 是否需要下边距 */
|
|
16
|
+
isBottomMargin?: boolean;
|
|
13
17
|
}
|
|
14
18
|
interface TitleComponent extends React__default.FC<ITitleProps> {
|
|
15
19
|
displayName: string;
|
package/dist/es/title/title.js
CHANGED
|
@@ -3,11 +3,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import classNames from '../node_modules/classnames/index.js';
|
|
4
4
|
|
|
5
5
|
var Title = function (props) {
|
|
6
|
-
var title = props.title, className = props.className, bordered = props.bordered, showBg = props.showBg, _a = props.justifyContent, justifyContent = _a === void 0 ? "space-between" : _a, children = props.children;
|
|
6
|
+
var title = props.title, className = props.className, bordered = props.bordered, showBg = props.showBg, _a = props.justifyContent, justifyContent = _a === void 0 ? "space-between" : _a, children = props.children, isTopMargin = props.isTopMargin, isBottomMargin = props.isBottomMargin;
|
|
7
7
|
// 主容器类名
|
|
8
8
|
var classes = classNames("ztxk-title", className, {
|
|
9
9
|
"ztxk-title--bordered": bordered,
|
|
10
10
|
"ztxk-title--background": showBg,
|
|
11
|
+
"ztxk-title--marginTop": isTopMargin,
|
|
12
|
+
"ztxk-title--marginBottom": isBottomMargin,
|
|
11
13
|
});
|
|
12
14
|
return (jsxs("div", __assign({ className: classes, style: { justifyContent: justifyContent } }, { children: [jsx("div", __assign({ className: "ztxk-title--title" }, { children: title })), jsx("div", __assign({ className: "ztxk-title--extra" }, { children: children }))] })));
|
|
13
15
|
};
|
|
@@ -116,8 +116,11 @@ function useOnChange(props) {
|
|
|
116
116
|
fileList: currentFileList,
|
|
117
117
|
});
|
|
118
118
|
// 如果所有得附件都已经完成
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
// 如果是初始化数据 一般是没有item.status的 可以默认认为这种附件是成功的
|
|
120
|
+
if (currentFileList.every(function (item) {
|
|
121
|
+
return item.status === "done" || item.status === "error" || !item.status;
|
|
122
|
+
})) {
|
|
123
|
+
var successFileList = fileList.filter(function (item) { return item.status === "done" || !item.status; });
|
|
121
124
|
var errorFileList = fileList.filter(function (item) { return item.status === "error"; });
|
|
122
125
|
onChange &&
|
|
123
126
|
onChange({
|
|
@@ -9,6 +9,8 @@ import ImgCrop from '../node_modules/antd-img-crop/dist/antd-img-crop.esm.js';
|
|
|
9
9
|
import { useBeforeUpload, useOnChange, useBasicInfo, useUploadTableData } from './hooks.js';
|
|
10
10
|
import { MAX_PREVIEW_SIZE } from '../config/constant.js';
|
|
11
11
|
import { toPreviewFile } from './utils.js';
|
|
12
|
+
import '../config/ZtxkContext.js';
|
|
13
|
+
import useBaseContext from '../config/useBaseContext.js';
|
|
12
14
|
import LoadingOutlined from '../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js';
|
|
13
15
|
import DownloadOutlined from '../node_modules/@ant-design/icons/es/icons/DownloadOutlined.js';
|
|
14
16
|
import ButtonCom from '../button/button.js';
|
|
@@ -25,13 +27,18 @@ var MAXSIZE = 104857600; // 100 * 1024 * 1024
|
|
|
25
27
|
* 附件大小 attachSize
|
|
26
28
|
*/
|
|
27
29
|
var UploadList = function (props, ref) {
|
|
28
|
-
var children = props.children, btnText = props.btnText, className = props.className, _a = props.showTip, showTip = _a === void 0 ? true : _a, _b = props.maxSize, maxSize = _b === void 0 ? MAXSIZE : _b, showTable = props.showTable, acceptList = props.acceptList, beforeUpload = props.beforeUpload, onChange = props.onChange,
|
|
30
|
+
var children = props.children, btnText = props.btnText, className = props.className, _a = props.showTip, showTip = _a === void 0 ? true : _a, _b = props.maxSize, maxSize = _b === void 0 ? MAXSIZE : _b, showTable = props.showTable, acceptList = props.acceptList, beforeUpload = props.beforeUpload, onChange = props.onChange, PROPS_API_BASEURL = props.API_BASEURL, PROPS_FILE_API_BASEURL = props.FILE_API_BASEURL, action = props.action, headers = props.headers, data = props.data, userName = props.userName, fileList = props.fileList, isPublic = props.isPublic, _c = props.maxPreviewSize, maxPreviewSize = _c === void 0 ? MAX_PREVIEW_SIZE : _c, isPreview = props.isPreview, isDownload = props.isDownload, isDelete = props.isDelete, _d = props.zipName, zipName = _d === void 0 ? "\u6279\u91CF\u4E0B\u8F7D-".concat(Date.now(), ".zip") : _d, isImage = props.isImage, customRenderBtn = props.customRenderBtn, resetProps = __rest(props, ["children", "btnText", "className", "showTip", "maxSize", "showTable", "acceptList", "beforeUpload", "onChange", "API_BASEURL", "FILE_API_BASEURL", "action", "headers", "data", "userName", "fileList", "isPublic", "maxPreviewSize", "isPreview", "isDownload", "isDelete", "zipName", "isImage", "customRenderBtn"]);
|
|
29
31
|
var maxCount = resetProps.maxCount, listType = resetProps.listType, method = resetProps.method;
|
|
30
32
|
var classes = classNames("ztxk-upload", className, {});
|
|
31
33
|
var maxSizeStr = formatUnit(maxSize);
|
|
32
34
|
var tableRef = useRef({});
|
|
33
35
|
var modalRef = useRef({});
|
|
34
|
-
var
|
|
36
|
+
var _e = useState(), imgSrc = _e[0], setImgSrc = _e[1];
|
|
37
|
+
var _f = useBaseContext(), apiBaseUrl = _f.apiBaseUrl, fileBaseUrl = _f.fileBaseUrl;
|
|
38
|
+
var API_BASEURL = PROPS_API_BASEURL ? PROPS_API_BASEURL : apiBaseUrl;
|
|
39
|
+
var FILE_API_BASEURL = PROPS_FILE_API_BASEURL
|
|
40
|
+
? PROPS_FILE_API_BASEURL
|
|
41
|
+
: fileBaseUrl;
|
|
35
42
|
// 文件上传前的判断处理
|
|
36
43
|
var beforeUploadHandle = useBeforeUpload({
|
|
37
44
|
acceptList: acceptList,
|
|
@@ -41,22 +48,22 @@ var UploadList = function (props, ref) {
|
|
|
41
48
|
isImage: isImage,
|
|
42
49
|
});
|
|
43
50
|
// 文件改变逻辑
|
|
44
|
-
var
|
|
51
|
+
var _g = useOnChange({
|
|
45
52
|
onChange: onChange,
|
|
46
53
|
userName: userName,
|
|
47
54
|
fileList: fileList,
|
|
48
55
|
isImage: isImage,
|
|
49
56
|
isPublic: isPublic,
|
|
50
57
|
API_BASEURL: API_BASEURL,
|
|
51
|
-
}), onChangeHandle =
|
|
58
|
+
}), onChangeHandle = _g.onChangeHandle, innerFileList = _g.innerFileList, setInnerFileList = _g.setInnerFileList;
|
|
52
59
|
// 基础参数
|
|
53
|
-
var
|
|
60
|
+
var _h = useBasicInfo({
|
|
54
61
|
action: action,
|
|
55
62
|
API_BASEURL: API_BASEURL,
|
|
56
63
|
headers: headers,
|
|
57
64
|
data: data,
|
|
58
65
|
isPublic: isPublic,
|
|
59
|
-
}), fileAction =
|
|
66
|
+
}), fileAction = _h.fileAction, fileHeaders = _h.fileHeaders, fileData = _h.fileData;
|
|
60
67
|
// 表格需要的附件列表数据
|
|
61
68
|
var uploadTableData = useUploadTableData({
|
|
62
69
|
fileList: innerFileList,
|
|
@@ -227,7 +234,7 @@ var UploadList = function (props, ref) {
|
|
|
227
234
|
},
|
|
228
235
|
};
|
|
229
236
|
});
|
|
230
|
-
return (jsxs("div", __assign({ className: classes }, { children: [isPreview ? null : (jsxs(Fragment, { children: [isImage ? (jsx(ImgCrop, __assign({ rotationSlider: true, showReset: true, quality: 0.8, modalClassName: "ztxk-upload-imgcrop" }, { children: renderChildren }))) : (renderChildren), showTip ? (jsxs("span", __assign({ className: "ztxk-upload--tips" }, { children: ["(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301", maxSizeStr, ")"] }))) : ("")] })), isDelete && !isPreview ? (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u9644\u4EF6\uFF1F", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onBatchDeleteHandle(); } }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u5220\u9664" })) }))) : null, isDownload ? (jsx(Dropdown, __assign({ menu: {
|
|
237
|
+
return (jsxs("div", __assign({ className: classes }, { children: [isPreview ? null : (jsxs(Fragment, { children: [isImage ? (jsx(ImgCrop, __assign({ rotationSlider: true, showReset: true, quality: 0.8, modalClassName: "ztxk-upload-imgcrop" }, { children: renderChildren }))) : (renderChildren), showTip ? (jsxs("span", __assign({ className: "ztxk-upload--tips" }, { children: ["(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301", maxSizeStr, ")"] }))) : ("")] })), isDelete && !isPreview && listType !== "text" ? (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u9644\u4EF6\uFF1F", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onBatchDeleteHandle(); } }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u5220\u9664" })) }))) : null, isDownload && listType !== "text" ? (jsx(Dropdown, __assign({ menu: {
|
|
231
238
|
items: [
|
|
232
239
|
{
|
|
233
240
|
label: "压缩",
|
|
@@ -8,7 +8,7 @@ import dayjs from 'dayjs';
|
|
|
8
8
|
import { toPreviewFile } from './utils.js';
|
|
9
9
|
import ButtonCom from '../button/button.js';
|
|
10
10
|
import OperationBtn from '../operationbtn/operationBtn.js';
|
|
11
|
-
import { Progress } from 'antd';
|
|
11
|
+
import { Progress, message } from 'antd';
|
|
12
12
|
|
|
13
13
|
var UploadTable = function (_a, ref) {
|
|
14
14
|
var dataSource = _a.dataSource, action = _a.action, headers = _a.headers, data = _a.data, method = _a.method, setInnerFileList = _a.setInnerFileList, isPublic = _a.isPublic, _b = _a.API_BASEURL, API_BASEURL = _b === void 0 ? "" : _b, _c = _a.FILE_API_BASEURL, FILE_API_BASEURL = _c === void 0 ? "" : _c, maxPreviewSize = _a.maxPreviewSize, isPreview = _a.isPreview, isDelete = _a.isDelete, isDownload = _a.isDownload;
|
|
@@ -211,6 +211,10 @@ var UploadTable = function (_a, ref) {
|
|
|
211
211
|
};
|
|
212
212
|
// 重新上传
|
|
213
213
|
var onReloadUploadHandle = function (record, index) {
|
|
214
|
+
if (!record.originFileObj) {
|
|
215
|
+
message.error("当前失败项,没有找到附件原件信息,无法重新上传!");
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
214
218
|
setLoading(true);
|
|
215
219
|
uploadFile({
|
|
216
220
|
action: action,
|