@guo514360255/antd-lib 1.4.1 → 1.4.3
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.
|
@@ -163,7 +163,7 @@ var CustomModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
163
163
|
onClose: close,
|
|
164
164
|
className: "detailContainer"
|
|
165
165
|
}), /*#__PURE__*/React.createElement(Descriptions, _extends({
|
|
166
|
-
column:
|
|
166
|
+
column: 1,
|
|
167
167
|
bordered: true
|
|
168
168
|
}, descProps || {}), columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
|
|
169
169
|
return !item.hideInDetail;
|
|
@@ -13,7 +13,7 @@ var _excluded = ["type", "onSubmit", "columns", "saveRequest", "updateRequest",
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { DeleteOutlined } from '@ant-design/icons';
|
|
16
|
-
import { Button, Drawer, Form, message, Modal } from 'antd';
|
|
16
|
+
import { Button, Drawer, Form, message, Modal, Spin } from 'antd';
|
|
17
17
|
import cloneDeep from 'lodash/cloneDeep';
|
|
18
18
|
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
19
19
|
import CustomUpload from "../CustomUpload";
|
|
@@ -44,6 +44,10 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
44
44
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
45
|
loading = _useState6[0],
|
|
46
46
|
setLoading = _useState6[1];
|
|
47
|
+
var _useState7 = useState(false),
|
|
48
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
+
detailLoading = _useState8[0],
|
|
50
|
+
setDetailLoading = _useState8[1];
|
|
47
51
|
var _message$useMessage = message.useMessage(),
|
|
48
52
|
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
49
53
|
messageApi = _message$useMessage2[0],
|
|
@@ -89,12 +93,14 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
89
93
|
case 0:
|
|
90
94
|
setOpen(true);
|
|
91
95
|
if (!(values !== null && values !== void 0 && values.id && detailRequest)) {
|
|
92
|
-
_context.next =
|
|
96
|
+
_context.next = 19;
|
|
93
97
|
break;
|
|
94
98
|
}
|
|
95
|
-
|
|
99
|
+
setDetailLoading(true);
|
|
100
|
+
_context.prev = 3;
|
|
101
|
+
_context.next = 6;
|
|
96
102
|
return detailRequest(values.id);
|
|
97
|
-
case
|
|
103
|
+
case 6:
|
|
98
104
|
data = _context.sent;
|
|
99
105
|
columns === null || columns === void 0 || columns.forEach(function (item) {
|
|
100
106
|
if (item.formKey) {
|
|
@@ -104,17 +110,25 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
104
110
|
formRef === null || formRef === void 0 || (_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setFieldsValue(data || {});
|
|
105
111
|
setValues(data || {});
|
|
106
112
|
return _context.abrupt("return");
|
|
107
|
-
case
|
|
113
|
+
case 13:
|
|
114
|
+
_context.prev = 13;
|
|
115
|
+
_context.t0 = _context["catch"](3);
|
|
116
|
+
console.warn(_context.t0);
|
|
117
|
+
case 16:
|
|
118
|
+
_context.prev = 16;
|
|
119
|
+
setDetailLoading(false);
|
|
120
|
+
return _context.finish(16);
|
|
121
|
+
case 19:
|
|
108
122
|
setTimeout(function () {
|
|
109
123
|
var _formRef$current2;
|
|
110
124
|
formRef === null || formRef === void 0 || (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFieldsValue(values || {});
|
|
111
125
|
setValues(values || {});
|
|
112
|
-
});
|
|
113
|
-
case
|
|
126
|
+
}, 0);
|
|
127
|
+
case 20:
|
|
114
128
|
case "end":
|
|
115
129
|
return _context.stop();
|
|
116
130
|
}
|
|
117
|
-
}, _callee);
|
|
131
|
+
}, _callee, null, [[3, 13, 16, 19]]);
|
|
118
132
|
}))();
|
|
119
133
|
}
|
|
120
134
|
};
|
|
@@ -210,7 +224,10 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
210
224
|
var getPlaceholder = function getPlaceholder(type, title) {
|
|
211
225
|
return "\u8BF7".concat(placeholder[type || 'input'] || placeholder.default).concat(title ? title : '');
|
|
212
226
|
};
|
|
213
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, messageHolder, /*#__PURE__*/React.createElement(
|
|
227
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, messageHolder, /*#__PURE__*/React.createElement(Spin, {
|
|
228
|
+
fullscreen: true,
|
|
229
|
+
spinning: detailLoading
|
|
230
|
+
}), /*#__PURE__*/React.createElement(Component, _extends({
|
|
214
231
|
width: other.width || 600,
|
|
215
232
|
footer: footer,
|
|
216
233
|
title: "".concat(!!values.id ? '编辑' : '新增').concat(title || '')
|
|
@@ -404,6 +404,7 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
404
404
|
ref: formModalRef,
|
|
405
405
|
saveRequest: saveRequest,
|
|
406
406
|
updateRequest: updateRequest,
|
|
407
|
+
detailRequest: detailRequest,
|
|
407
408
|
columns: columns.filter(function (item) {
|
|
408
409
|
return !item.hideInForm && item.dataIndex !== 'operation' && item.valueType !== 'option';
|
|
409
410
|
})
|