zmdms-webui 0.0.6 → 0.0.7
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/formitem/formItem.d.ts +1 -1
- package/dist/es/formitem/formItem.js +4 -1
- package/dist/es/modal/interface.d.ts +3 -0
- package/dist/es/modal/modal.js +17 -2
- package/dist/es/table/table.js +4 -2
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { FormItemProps, FormInstance } from 'antd/lib/form';
|
|
3
3
|
|
|
4
|
-
type IWidth = "half" | "double" | "all" | "halfAll";
|
|
4
|
+
type IWidth = "half" | "double" | "all" | "halfAll" | number;
|
|
5
5
|
interface IFormItem extends FormItemProps {
|
|
6
6
|
isDisplay?: boolean | string;
|
|
7
7
|
isRequired?: boolean | string;
|
|
@@ -100,9 +100,12 @@ var FormItem = function (props) {
|
|
|
100
100
|
// }
|
|
101
101
|
// }
|
|
102
102
|
function getWidthNum(width) {
|
|
103
|
+
if (typeof width === "number") {
|
|
104
|
+
return width;
|
|
105
|
+
}
|
|
103
106
|
switch (width) {
|
|
104
107
|
case "half":
|
|
105
|
-
return
|
|
108
|
+
return 4;
|
|
106
109
|
case "all":
|
|
107
110
|
return 24;
|
|
108
111
|
case "double":
|
|
@@ -4,6 +4,9 @@ import { Modal } from 'antd';
|
|
|
4
4
|
|
|
5
5
|
interface IModalProps extends ModalProps {
|
|
6
6
|
defaultOpen?: boolean;
|
|
7
|
+
confirmMsg?: string;
|
|
8
|
+
confirmOkText?: string;
|
|
9
|
+
confirmOnOk?: () => Promise<any>;
|
|
7
10
|
}
|
|
8
11
|
interface IModalComponent extends React__default.ForwardRefExoticComponent<IModalProps & React__default.RefAttributes<unknown>> {
|
|
9
12
|
info: typeof Modal.info;
|
package/dist/es/modal/modal.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Modal as Modal$1 } from 'antd';
|
|
|
5
5
|
import classNames from '../node_modules/classnames/index.js';
|
|
6
6
|
|
|
7
7
|
var Modal = function (_a, ref) {
|
|
8
|
-
var className = _a.className, defaultOpen = _a.defaultOpen, resetProps = __rest(_a, ["className", "defaultOpen"]);
|
|
8
|
+
var className = _a.className, defaultOpen = _a.defaultOpen, confirmMsg = _a.confirmMsg, confirmOkText = _a.confirmOkText, confirmOnOk = _a.confirmOnOk, resetProps = __rest(_a, ["className", "defaultOpen", "confirmMsg", "confirmOkText", "confirmOnOk"]);
|
|
9
9
|
var classes = classNames("ztxk-modal", className);
|
|
10
10
|
var _b = useState(defaultOpen), open = _b[0], setOpen = _b[1];
|
|
11
11
|
var close = useCallback(function () {
|
|
@@ -21,7 +21,22 @@ var Modal = function (_a, ref) {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
var onOkHandle = useCallback(function () {
|
|
25
|
+
if (confirmMsg) {
|
|
26
|
+
Modal$1.confirm({
|
|
27
|
+
title: confirmMsg,
|
|
28
|
+
okText: confirmOkText ? confirmOkText : "确认保存",
|
|
29
|
+
onOk: confirmOnOk
|
|
30
|
+
? function () {
|
|
31
|
+
return confirmOnOk().then(function () {
|
|
32
|
+
setOpen(false);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
: undefined,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [confirmMsg, confirmOkText, confirmOnOk]);
|
|
39
|
+
return (jsx(Modal$1, __assign({ open: open, onCancel: close, className: classes, okText: "\u4FDD\u5B58", onOk: onOkHandle }, resetProps)));
|
|
25
40
|
};
|
|
26
41
|
var ModalComponent = forwardRef(Modal);
|
|
27
42
|
ModalComponent.displayName = "ZTXK_WEBUI_ModalComponent";
|
package/dist/es/table/table.js
CHANGED
|
@@ -26,9 +26,11 @@ import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js'
|
|
|
26
26
|
// TODO: 实现可拖拽行
|
|
27
27
|
// TODO: 实现可编辑功能
|
|
28
28
|
var Table = function (props) {
|
|
29
|
-
console.log("表格渲染");
|
|
29
|
+
// console.log("表格渲染");
|
|
30
30
|
var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, _c = props.isDelAll, isDelAll = _c === void 0 ? true : _c, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _d = props.summaryFixed, summaryFixed = _d === void 0 ? true : _d, isInnerPagination = props.isInnerPagination, _e = props.innerPaginationPageSize, innerPaginationPageSize = _e === void 0 ? 30 : _e, _f = props.innerPaginationPosition, innerPaginationPosition = _f === void 0 ? INNER_TABLE_PAGINATION_POSITION : _f, _g = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _g === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _g, tableRefHandle = props.tableRefHandle, tableName = props.tableName, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "addMode", "addCallback", "isDel", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName"]);
|
|
31
|
-
var classes = classNames("ztxk-table", className
|
|
31
|
+
var classes = classNames("ztxk-table", className, {
|
|
32
|
+
"ztxk-table--flex": isFlex,
|
|
33
|
+
});
|
|
32
34
|
// 将表格数据 在 Ref中 存储一份
|
|
33
35
|
var dataSourceRef = useRef();
|
|
34
36
|
useEffect(function () {
|