zmdms-webui 3.0.8 → 3.1.0

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.
@@ -51,6 +51,7 @@ declare const DatePickerDayJs: antd_es_date_picker_generatePicker_interface.Pick
51
51
  popupClassName?: string | undefined;
52
52
  }, "picker">, unknown>;
53
53
  };
54
- type IDatePickerProps = React.ComponentProps<typeof DatePickerDayJs>;
54
+ type IDatePickerProps = React.ComponentProps<typeof DatePickerDayJs>;
55
+ type IDatePickerTimePickerProps = React.ComponentProps<typeof DatePickerDayJs.TimePicker>;
55
56
 
56
- export { DatePickerDayJs, IDatePickerProps };
57
+ export { DatePickerDayJs, IDatePickerProps, IDatePickerTimePickerProps };
@@ -76,10 +76,21 @@ function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
76
76
  // `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
77
77
  var formatterFn = function (v) {
78
78
  var value = getValue(v, isFocusRef, precision);
79
- return formatCurrency(value);
79
+ var formattedValue = formatCurrency(value);
80
+ // 如果传入了货币符号,则添加货币符号前缀
81
+ if (currencySymbol) {
82
+ return "".concat(currencySymbol, " ").concat(formattedValue);
83
+ }
84
+ return formattedValue;
80
85
  };
81
86
  var parserFn = function (val) {
82
- var value = val.replace(/(,*)/g, "");
87
+ var value = val;
88
+ // 如果传入了货币符号,需要移除货币符号和空格
89
+ if (currencySymbol) {
90
+ value = value.replace(new RegExp("[".concat(currencySymbol, "\\s]"), "g"), "");
91
+ }
92
+ // 移除千分符
93
+ value = value.replace(/(,*)/g, "");
83
94
  // return value;
84
95
  return saveSafeInteger(value, precision);
85
96
  // return value!.replace(/(,*)/g, '');
@@ -21,10 +21,14 @@ interface IProps {
21
21
  [prop: string]: any;
22
22
  };
23
23
  getCaptcha?: any;
24
- /** 前置内容 */
24
+ /** 表单输入前置内容 */
25
25
  prefixRender?: React__default.ReactElement;
26
- /** 后置内容 */
26
+ /** 表单输入后置内容 */
27
27
  suffixRender?: React__default.ReactElement;
28
+ /** 底部操作按钮前置内容 */
29
+ bottomPrefixRender?: React__default.ReactElement;
30
+ /** 底部操作按钮后置内容 */
31
+ bottomSuffixRender?: React__default.ReactElement;
28
32
  /** 登录组件ref */
29
33
  loginHandleRef?: React__default.RefObject<any>;
30
34
  }
@@ -14,7 +14,7 @@ var USERNAME_KEY = "PUsvG";
14
14
  var USERPWS_KEY = "kVhfO";
15
15
  var KEY = "simide";
16
16
  var Login = function (props) {
17
- var loginLogo = props.loginLogo, loginBg = props.loginBg, onFinishHandle = props.onFinishHandle, loading = props.loading, customRender = props.customRender, checkUserPhone = props.checkUserPhone, sendCode = props.sendCode, submitRequest = props.submitRequest, captcha = props.captcha, getCaptcha = props.getCaptcha, prefixRender = props.prefixRender, suffixRender = props.suffixRender, loginHandleRef = props.loginHandleRef;
17
+ var loginLogo = props.loginLogo, loginBg = props.loginBg, onFinishHandle = props.onFinishHandle, loading = props.loading, customRender = props.customRender, checkUserPhone = props.checkUserPhone, sendCode = props.sendCode, submitRequest = props.submitRequest, captcha = props.captcha, getCaptcha = props.getCaptcha, prefixRender = props.prefixRender, suffixRender = props.suffixRender, loginHandleRef = props.loginHandleRef, bottomPrefixRender = props.bottomPrefixRender, bottomSuffixRender = props.bottomSuffixRender;
18
18
  var _a = useState(false), open = _a[0], setOpen = _a[1];
19
19
  var form = Form.useForm()[0];
20
20
  useEffect(function () {
@@ -73,9 +73,9 @@ var Login = function (props) {
73
73
  required: true,
74
74
  message: "请输入验证码",
75
75
  },
76
- ] }, { children: jsx(Input, { size: "large", addonAfter: jsx("img", { src: (captcha === null || captcha === void 0 ? void 0 : captcha.image) || "", alt: "\u9A8C\u8BC1\u7801", style: { height: "26px", cursor: "pointer" }, onClick: function () { return getCaptcha(); } }) }) }))) : null, jsx(Item, { children: jsx(ButtonCom, __assign({ htmlType: "submit", block: true, className: "form__item--button", loading: loading }, { children: "\u767B\u5F55" })) }), jsxs("div", __assign({ className: "form__item--remember" }, { children: [jsx(Item, __assign({ name: "remember", valuePropName: "checked" }, { children: jsx(Checkbox, { children: "\u8BB0\u4F4F\u5BC6\u7801" }) })), jsx("div", __assign({ className: "form__item--remember-forget", onClick: function () {
76
+ ] }, { children: jsx(Input, { size: "large", addonAfter: jsx("img", { src: (captcha === null || captcha === void 0 ? void 0 : captcha.image) || "", alt: "\u9A8C\u8BC1\u7801", style: { height: "26px", cursor: "pointer" }, onClick: function () { return getCaptcha(); } }) }) }))) : null, jsx(Item, { children: jsx(ButtonCom, __assign({ htmlType: "submit", block: true, className: "form__item--button", loading: loading }, { children: "\u767B\u5F55" })) }), bottomPrefixRender, jsxs("div", __assign({ className: "form__item--remember" }, { children: [jsx(Item, __assign({ name: "remember", valuePropName: "checked" }, { children: jsx(Checkbox, { children: "\u8BB0\u4F4F\u5BC6\u7801" }) })), jsx("div", __assign({ className: "form__item--remember-forget", onClick: function () {
77
77
  setOpen(true);
78
- } }, { children: "\u5FD8\u8BB0\u5BC6\u7801" }))] })), jsx(ForgetPassword, { open: open, setOpen: setOpen, checkUserPhone: checkUserPhone, sendCode: sendCode, submitRequest: submitRequest })] })) })));
78
+ } }, { children: "\u5FD8\u8BB0\u5BC6\u7801" }))] })), bottomSuffixRender, jsx(ForgetPassword, { open: open, setOpen: setOpen, checkUserPhone: checkUserPhone, sendCode: sendCode, submitRequest: submitRequest })] })) })));
79
79
  };
80
80
  Login.displayName = "ZTXK_WEBUI_Login";
81
81
 
@@ -1,19 +1,16 @@
1
- import * as antd_es_button from 'antd/es/button';
2
1
  import * as antd_es_date_picker_generatePicker from 'antd/es/date-picker/generatePicker';
3
- import * as rc_picker_lib_Picker from 'rc-picker/lib/Picker';
4
2
  import * as dayjs from 'dayjs';
5
3
  import React__default from 'react';
4
+ import { IDatePickerTimePickerProps } from '../datepicker/interface.js';
6
5
 
7
- declare const TimePicker: React__default.ForwardRefExoticComponent<Omit<Omit<rc_picker_lib_Picker.PickerTimeProps<dayjs.Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
8
- locale?: antd_es_date_picker_generatePicker.PickerLocale | undefined;
9
- size?: antd_es_button.ButtonSize;
10
- placement?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | undefined;
11
- bordered?: boolean | undefined;
12
- status?: "" | "warning" | "error" | undefined;
13
- } & {
14
- status?: "" | "warning" | "error" | undefined;
6
+ declare const TimePickerRangePicker: React__default.ForwardRefExoticComponent<(antd_es_date_picker_generatePicker.RangePickerProps<dayjs.Dayjs> & {
15
7
  dropdownClassName?: string | undefined;
16
8
  popupClassName?: string | undefined;
17
- }, "picker"> & React__default.RefAttributes<unknown>>;
9
+ }) & React__default.RefAttributes<unknown>>;
10
+ interface TimePickerComponent extends React__default.ForwardRefExoticComponent<IDatePickerTimePickerProps & React__default.RefAttributes<unknown>> {
11
+ displayName: string;
12
+ RangePicker: typeof TimePickerRangePicker;
13
+ }
14
+ declare const MemoTimePicker: TimePickerComponent;
18
15
 
19
- export { TimePicker as default };
16
+ export { MemoTimePicker as default };
@@ -1,11 +1,17 @@
1
1
  import { __assign } from '../_virtual/_tslib.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { forwardRef } from 'react';
3
+ import { forwardRef, memo } from 'react';
4
4
  import { DatePickerDayJs } from '../datepicker/interface.js';
5
5
 
6
- var TimePicker = forwardRef(function (props, ref) {
6
+ var TimePicker = function (props, ref) {
7
7
  return jsx(DatePickerDayJs.TimePicker, __assign({ ref: ref }, props));
8
+ };
9
+ // 时间段选择器
10
+ var TimePickerRangePicker = forwardRef(function (props, ref) {
11
+ return jsx(DatePickerDayJs.RangePicker, __assign({ picker: "time", ref: ref }, props));
8
12
  });
9
- TimePicker.displayName = "TimePicker";
13
+ var MemoTimePicker = memo(forwardRef(TimePicker));
14
+ MemoTimePicker.displayName = "TimePicker";
15
+ MemoTimePicker.RangePicker = TimePickerRangePicker;
10
16
 
11
- export { TimePicker as default };
17
+ export { MemoTimePicker as default };
@@ -81,6 +81,10 @@ interface IUploadListProps extends Omit<UploadProps, "onChange"> {
81
81
  * 是否需要翻译
82
82
  */
83
83
  isTranslation?: boolean;
84
+ /**
85
+ * 表格操作列自定义渲染内容
86
+ */
87
+ renderTableOperationColumn?: (text: any, record: any, index: number) => React.ReactNode;
84
88
  }
85
89
  interface IFileItem {
86
90
  /** 附件id */
@@ -33,7 +33,7 @@ var MAXSIZE = 104857600; // 100 * 1024 * 1024
33
33
  */
34
34
  var UploadList = function (props, ref) {
35
35
  var _a;
36
- 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, _g = props.isImageCrop, isImageCrop = _g === void 0 ? true : _g, imgCropProps = props.imgCropProps, _h = props.imgWidth, imgWidth = _h === void 0 ? 110 : _h, _j = props.imgHeight, imgHeight = _j === void 0 ? 110 : _j, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, tableColumns = props.tableColumns, onBeforeDownloadValidate = props.onBeforeDownloadValidate, onBeforePreviewValidate = props.onBeforePreviewValidate, onBeforeDeleteValidate = props.onBeforeDeleteValidate, isImgPreview = props.isImgPreview, isTranslation = props.isTranslation, 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", "isImageCrop", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames", "tableColumns", "onBeforeDownloadValidate", "onBeforePreviewValidate", "onBeforeDeleteValidate", "isImgPreview", "isTranslation"]);
36
+ 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, _g = props.isImageCrop, isImageCrop = _g === void 0 ? true : _g, imgCropProps = props.imgCropProps, _h = props.imgWidth, imgWidth = _h === void 0 ? 110 : _h, _j = props.imgHeight, imgHeight = _j === void 0 ? 110 : _j, customRenderBtn = props.customRenderBtn, disAllowDuplicateFile = props.disAllowDuplicateFile, fieldNames = props.fieldNames, tableColumns = props.tableColumns, onBeforeDownloadValidate = props.onBeforeDownloadValidate, onBeforePreviewValidate = props.onBeforePreviewValidate, onBeforeDeleteValidate = props.onBeforeDeleteValidate, isImgPreview = props.isImgPreview, isTranslation = props.isTranslation, renderTableOperationColumn = props.renderTableOperationColumn, 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", "isImageCrop", "imgCropProps", "imgWidth", "imgHeight", "customRenderBtn", "disAllowDuplicateFile", "fieldNames", "tableColumns", "onBeforeDownloadValidate", "onBeforePreviewValidate", "onBeforeDeleteValidate", "isImgPreview", "isTranslation", "renderTableOperationColumn"]);
37
37
  var _k = useBaseContext(), apiBaseUrl = _k.apiBaseUrl, fileBaseUrl = _k.fileBaseUrl, enableTranslationButton = _k.enableTranslationButton;
38
38
  // 翻译按钮是否显示
39
39
  var isTranslationButton = getFinalValue(enableTranslationButton, isTranslation);
@@ -400,7 +400,7 @@ var UploadList = function (props, ref) {
400
400
  onClick: function (e) {
401
401
  onBatchDownloadHandle(e.key);
402
402
  },
403
- }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u4E0B\u8F7D" })) }))) : null, customRenderBtn, showTable ? (jsx(UploadTable, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, filePreview: filePreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType, tableColumns: tableColumns, onBeforeDeleteValidate: onBeforeDeleteValidate, onBeforeDownloadValidate: onBeforeDownloadValidate, onBeforePreviewValidate: onBeforePreviewValidate, isTranslation: isTranslationButton })) : null, isPreview && !showTable && !isImage ? (jsx(UploadListDetail, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType, tableColumns: tableColumns, onBeforeDeleteValidate: onBeforeDeleteValidate, onBeforeDownloadValidate: onBeforeDownloadValidate, onBeforePreviewValidate: onBeforePreviewValidate, isTranslation: isTranslationButton })) : null, isImage && (jsx(ModalComponent, __assign({ ref: modalRef, footer: null, width: "520px" }, { children: jsx("div", __assign({ style: {
403
+ }, placement: "bottomLeft" }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u4E0B\u8F7D" })) }))) : null, customRenderBtn, showTable ? (jsx(UploadTable, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, filePreview: filePreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType, tableColumns: tableColumns, onBeforeDeleteValidate: onBeforeDeleteValidate, onBeforeDownloadValidate: onBeforeDownloadValidate, onBeforePreviewValidate: onBeforePreviewValidate, isTranslation: isTranslationButton, renderTableOperationColumn: renderTableOperationColumn })) : null, isPreview && !showTable && !isImage ? (jsx(UploadListDetail, { dataSource: uploadTableData, action: fileAction, headers: fileHeaders, data: fileData, method: method, setInnerFileList: setInnerFileList, isPublic: isPublic, API_BASEURL: API_BASEURL, FILE_API_BASEURL: FILE_API_BASEURL, maxPreviewSize: maxPreviewSize, isPreview: isPreview, isDelete: isDelete, isDownload: isDownload, ref: tableRef, listType: listType, tableColumns: tableColumns, onBeforeDeleteValidate: onBeforeDeleteValidate, onBeforeDownloadValidate: onBeforeDownloadValidate, onBeforePreviewValidate: onBeforePreviewValidate, isTranslation: isTranslationButton })) : null, isImage && (jsx(ModalComponent, __assign({ ref: modalRef, footer: null, width: "520px" }, { children: jsx("div", __assign({ style: {
404
404
  textAlign: "center",
405
405
  } }, { children: jsx("img", { src: imgSrc, alt: "\u9884\u89C8", style: {
406
406
  maxWidth: "400px",
@@ -14,7 +14,7 @@ import myMessage from '../message/index.js';
14
14
  import { Progress } from 'antd';
15
15
 
16
16
  var UploadTable = function (_a, ref) {
17
- 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, filePreview = _a.filePreview, isDelete = _a.isDelete, isDownload = _a.isDownload; _a.listType; var tableColumns = _a.tableColumns, onBeforeDownloadValidate = _a.onBeforeDownloadValidate, onBeforePreviewValidate = _a.onBeforePreviewValidate, onBeforeDeleteValidate = _a.onBeforeDeleteValidate, isTranslation = _a.isTranslation;
17
+ 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, filePreview = _a.filePreview, isDelete = _a.isDelete, isDownload = _a.isDownload; _a.listType; var tableColumns = _a.tableColumns, onBeforeDownloadValidate = _a.onBeforeDownloadValidate, onBeforePreviewValidate = _a.onBeforePreviewValidate, onBeforeDeleteValidate = _a.onBeforeDeleteValidate, isTranslation = _a.isTranslation, renderTableOperationColumn = _a.renderTableOperationColumn;
18
18
  var _d = useState(false), loading = _d[0], setLoading = _d[1];
19
19
  var _e = useState(), checked = _e[0], setChecked = _e[1];
20
20
  var isDownloadSingleBoolean = isDownload;
@@ -337,7 +337,8 @@ var UploadTable = function (_a, ref) {
337
337
  newInnerFileList.splice(index, 1, __assign(__assign({}, record), { tid: tid }));
338
338
  return newInnerFileList;
339
339
  });
340
- } }))] }));
340
+ } })), renderTableOperationColumn &&
341
+ renderTableOperationColumn(text, record, index)] }));
341
342
  };
342
343
  // 重新上传
343
344
  var onReloadUploadHandle = function (record, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "3.0.8",
3
+ "version": "3.1.0",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",