@guo514360255/antd-lib 1.4.5 → 1.4.6
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/CustomTable/index.js +12 -8
- package/package.json +1 -1
|
@@ -162,23 +162,27 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
162
162
|
return _ref3.apply(this, arguments);
|
|
163
163
|
};
|
|
164
164
|
}();
|
|
165
|
+
var _openModal = function openModal() {
|
|
166
|
+
var _formModalRef$current;
|
|
167
|
+
var record = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
(_formModalRef$current = formModalRef.current) === null || _formModalRef$current === void 0 || _formModalRef$current.open(handleModalData ? handleModalData(record) : record);
|
|
170
|
+
};
|
|
165
171
|
useImperativeHandle(ref, function () {
|
|
166
172
|
return {
|
|
167
173
|
reload: function reload() {
|
|
168
174
|
var _actionRef$current2;
|
|
169
175
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 || _actionRef$current2.reload();
|
|
176
|
+
},
|
|
177
|
+
openModal: function openModal() {
|
|
178
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
179
|
+
_openModal(data);
|
|
170
180
|
}
|
|
171
181
|
};
|
|
172
182
|
});
|
|
173
183
|
var totalWidth = columns === null || columns === void 0 ? void 0 : columns.reduce(function (sum, col) {
|
|
174
184
|
return sum + (col.width || 100);
|
|
175
185
|
}, 0);
|
|
176
|
-
var openModal = function openModal() {
|
|
177
|
-
var _formModalRef$current;
|
|
178
|
-
var record = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
179
|
-
// @ts-ignore
|
|
180
|
-
(_formModalRef$current = formModalRef.current) === null || _formModalRef$current === void 0 || _formModalRef$current.open(handleModalData ? handleModalData(record) : record);
|
|
181
|
-
};
|
|
182
186
|
var handleColumns = function handleColumns() {
|
|
183
187
|
var _newColumns$;
|
|
184
188
|
var newColumns = cloneDeep(columns);
|
|
@@ -245,7 +249,7 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
245
249
|
}, "\u8BE6\u60C5"), isUpdate && /*#__PURE__*/React.createElement(Button, {
|
|
246
250
|
type: "link",
|
|
247
251
|
onClick: function onClick() {
|
|
248
|
-
return
|
|
252
|
+
return _openModal(record);
|
|
249
253
|
}
|
|
250
254
|
}, "\u7F16\u8F91"), isDelete && /*#__PURE__*/React.createElement(Popconfirm, {
|
|
251
255
|
title: "\u786E\u5B9A\u5220\u9664\u5F53\u524D\u6570\u636E\uFF1F",
|
|
@@ -388,7 +392,7 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
388
392
|
// @ts-ignore
|
|
389
393
|
,
|
|
390
394
|
onClick: function onClick() {
|
|
391
|
-
return
|
|
395
|
+
return _openModal({});
|
|
392
396
|
}
|
|
393
397
|
}, createText || '创建')] : []));
|
|
394
398
|
}
|