zmdms-webui 2.0.7 → 2.0.8
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.
|
@@ -319,22 +319,23 @@ function useColumns(columns, options) {
|
|
|
319
319
|
return jsx(Badge, __assign({}, props, { children: v }));
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
+
var formatRender = function (text) {
|
|
323
|
+
if (typeof text === "object") {
|
|
324
|
+
return PLACEHOLDER_NULL;
|
|
325
|
+
}
|
|
326
|
+
if (text == null || text === "")
|
|
327
|
+
return PLACEHOLDER_NULL;
|
|
328
|
+
if (_column.dateFormat)
|
|
329
|
+
return dayjs(text).format(_column.dateFormat);
|
|
330
|
+
if (_column.precision)
|
|
331
|
+
text = exactRound(text, _column.precision);
|
|
332
|
+
if (_column.thousand)
|
|
333
|
+
text = addThousedSeparator(text);
|
|
334
|
+
return text;
|
|
335
|
+
};
|
|
322
336
|
// 添加render字段,
|
|
323
337
|
if (!_column.render && !_column.editable) {
|
|
324
|
-
_column.render =
|
|
325
|
-
if (typeof text === "object") {
|
|
326
|
-
return PLACEHOLDER_NULL;
|
|
327
|
-
}
|
|
328
|
-
if (text == null || text === "")
|
|
329
|
-
return PLACEHOLDER_NULL;
|
|
330
|
-
if (_column.dateFormat)
|
|
331
|
-
return dayjs(text).format(_column.dateFormat);
|
|
332
|
-
if (_column.precision)
|
|
333
|
-
text = exactRound(text, _column.precision);
|
|
334
|
-
if (_column.thousand)
|
|
335
|
-
text = addThousedSeparator(text);
|
|
336
|
-
return text;
|
|
337
|
-
};
|
|
338
|
+
_column.render = formatRender;
|
|
338
339
|
}
|
|
339
340
|
if (_column.render) {
|
|
340
341
|
// 对外暴露粘贴方法
|
|
@@ -346,7 +347,7 @@ function useColumns(columns, options) {
|
|
|
346
347
|
// 自定义合计行,不需要render属性
|
|
347
348
|
_column.render = function (text, record, index) {
|
|
348
349
|
if (record[IS_SUMMARY]) {
|
|
349
|
-
return text;
|
|
350
|
+
return formatRender(text);
|
|
350
351
|
}
|
|
351
352
|
return __render__1(text, record, index, options_1);
|
|
352
353
|
};
|
|
@@ -45,6 +45,8 @@ interface IUploadListProps extends Omit<UploadProps, "onChange"> {
|
|
|
45
45
|
zipName?: string;
|
|
46
46
|
/** 是否只上传图片 */
|
|
47
47
|
isImage?: boolean;
|
|
48
|
+
/** 图片预览 */
|
|
49
|
+
isImgPreview?: boolean;
|
|
48
50
|
/** 裁剪组件的一些配置 link: https://github.com/nanxiaobei/antd-img-crop/blob/main/README.zh-CN.md */
|
|
49
51
|
imgCropProps?: Partial<ImgCropProps>;
|
|
50
52
|
/** 图片展示的宽度 默认110 */
|
|
@@ -31,7 +31,7 @@ var MAXSIZE = 104857600; // 100 * 1024 * 1024
|
|
|
31
31
|
*/
|
|
32
32
|
var UploadList = function (props, ref) {
|
|
33
33
|
var _a;
|
|
34
|
-
var children = props.children, btnText = props.btnText, className = props.className, _b = props.showTip, showTip = _b === void 0 ? true : _b, _c = props.maxSize, maxSize = _c === void 0 ? MAXSIZE : _c, 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, _d = props.maxPreviewSize, maxPreviewSize = _d === void 0 ? MAX_PREVIEW_SIZE : _d, isPreview = props.isPreview, isDownload = props.isDownload, isDelete = props.isDelete, _e = props.filePreview, filePreview = _e === void 0 ? true : _e, _f = props.zipName, zipName = _f === void 0 ? "\u6279\u91CF\u4E0B\u8F7D-".concat(Date.now(), ".zip") : _f, isImage = props.isImage, imgCropProps = props.imgCropProps, _g = props.imgWidth, imgWidth = _g === void 0 ? 110 : _g, _h = props.imgHeight, imgHeight = _h === void 0 ? 110 : _h, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, tableColumns = props.tableColumns, onBeforeDownloadValidate = props.onBeforeDownloadValidate, onBeforePreviewValidate = props.onBeforePreviewValidate, onBeforeDeleteValidate = props.onBeforeDeleteValidate, 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", "filePreview", "zipName", "isImage", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames", "tableColumns", "onBeforeDownloadValidate", "onBeforePreviewValidate", "onBeforeDeleteValidate"]);
|
|
34
|
+
var children = props.children, btnText = props.btnText, className = props.className, _b = props.showTip, showTip = _b === void 0 ? true : _b, _c = props.maxSize, maxSize = _c === void 0 ? MAXSIZE : _c, 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, _d = props.maxPreviewSize, maxPreviewSize = _d === void 0 ? MAX_PREVIEW_SIZE : _d, isPreview = props.isPreview, isDownload = props.isDownload, isDelete = props.isDelete, _e = props.filePreview, filePreview = _e === void 0 ? true : _e, _f = props.zipName, zipName = _f === void 0 ? "\u6279\u91CF\u4E0B\u8F7D-".concat(Date.now(), ".zip") : _f, isImage = props.isImage, imgCropProps = props.imgCropProps, _g = props.imgWidth, imgWidth = _g === void 0 ? 110 : _g, _h = props.imgHeight, imgHeight = _h === void 0 ? 110 : _h, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, tableColumns = props.tableColumns, onBeforeDownloadValidate = props.onBeforeDownloadValidate, onBeforePreviewValidate = props.onBeforePreviewValidate, onBeforeDeleteValidate = props.onBeforeDeleteValidate, isImgPreview = props.isImgPreview, 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", "filePreview", "zipName", "isImage", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames", "tableColumns", "onBeforeDownloadValidate", "onBeforePreviewValidate", "onBeforeDeleteValidate", "isImgPreview"]);
|
|
35
35
|
var maxCount = resetProps.maxCount, listType = resetProps.listType, method = resetProps.method;
|
|
36
36
|
var imgSizeClassName = "temporary-className-".concat(imgWidth, "-").concat(imgHeight);
|
|
37
37
|
var classes = classNames("ztxk-upload", className, (_a = {},
|
|
@@ -293,7 +293,8 @@ var UploadList = function (props, ref) {
|
|
|
293
293
|
var renderChildren = (jsx(Upload, __assign({ showUploadList: showUploadListMemo, multiple: true, beforeUpload: beforeUploadHandle, onChange: onChangeHandle, action: fileAction, headers: fileHeaders, data: fileData, fileList: innerFileList, onPreview: onPreview, onDownload: onDownload }, resetProps, { children: children ? (children) : !listType || listType === "text" ? (jsxs(ButtonCom, __assign({ type: "primary", icon: jsx(UploadOutlined, {}) }, { children: [btnText || "添加附件", maxCount ? "(\u6700\u591A\u4E0A\u4F20".concat(maxCount, "\u4E2A\u6587\u4EF6)") : ""] }))) : isImage &&
|
|
294
294
|
maxCount &&
|
|
295
295
|
innerFileList &&
|
|
296
|
-
innerFileList.length >= maxCount
|
|
296
|
+
innerFileList.length >= maxCount &&
|
|
297
|
+
!isImgPreview ? null : (jsxs("div", __assign({ className: "ztxk-upload--picture" }, { children: [jsx(UploadOutlined, { style: { fontSize: 18 } }), jsx("div", __assign({ style: { marginTop: 8 } }, { children: btnText || "添加图片" }))] }))) })));
|
|
297
298
|
// 暴露给外部的一些方法
|
|
298
299
|
useImperativeHandle(ref, function () {
|
|
299
300
|
return {
|