wargerm 0.5.29 → 0.5.30

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/index.esm.js CHANGED
@@ -10701,11 +10701,7 @@ var TabelCard = function TabelCard(props, ref) {
10701
10701
  modalFormConfig = _useState4[0],
10702
10702
  setModalFormConfig = _useState4[1];
10703
10703
 
10704
- var _useState5 = useState({}),
10705
- _useState6 = _slicedToArray(_useState5, 2),
10706
- formSearch = _useState6[0],
10707
- setFormSearch = _useState6[1];
10708
-
10704
+ var formSearchRef = useRef({});
10709
10705
  var modalFormColumn = deepCopy(columns) || [];
10710
10706
  var formSearchColumn = deepCopy(columns) || [];
10711
10707
  useImperativeHandle(ref, function () {
@@ -11101,14 +11097,14 @@ var TabelCard = function TabelCard(props, ref) {
11101
11097
  var onSubmit = function onSubmit(values) {
11102
11098
  var _actionRef$current6;
11103
11099
 
11104
- setFormSearch(values);
11100
+ formSearchRef.current = values;
11105
11101
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload(true);
11106
11102
  };
11107
11103
 
11108
11104
  var onReset = function onReset() {
11109
11105
  var _actionRef$current7;
11110
11106
 
11111
- setFormSearch({});
11107
+ formSearchRef.current = {};
11112
11108
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload(true);
11113
11109
  };
11114
11110
 
@@ -11124,7 +11120,13 @@ var TabelCard = function TabelCard(props, ref) {
11124
11120
  }).forEach(function (item) {
11125
11121
  delete obj[item.dataIndex];
11126
11122
  });
11127
- setFormSearch(obj);
11123
+ formSearchRef.current = obj;
11124
+
11125
+ if (columns === null || columns === void 0 ? void 0 : columns.length) {
11126
+ var _actionRef$current8;
11127
+
11128
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload(true);
11129
+ }
11128
11130
  }
11129
11131
  }, [columns]);
11130
11132
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
@@ -11220,7 +11222,7 @@ var TabelCard = function TabelCard(props, ref) {
11220
11222
  return [].concat(_toConsumableArray(pre), [column]);
11221
11223
  }
11222
11224
  }, [])
11223
- }, searchFormConfig || {})), /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
11225
+ }, searchFormConfig || {})), columns && columns.length && /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
11224
11226
  actionRef: actionRef,
11225
11227
  rowKey: "id",
11226
11228
  bordered: !noBordered,
@@ -11234,7 +11236,7 @@ var TabelCard = function TabelCard(props, ref) {
11234
11236
  switch (_context9.prev = _context9.next) {
11235
11237
  case 0:
11236
11238
  _context9.next = 2;
11237
- return _request(_objectSpread2(_objectSpread2({}, params), formSearch));
11239
+ return _request(_objectSpread2(_objectSpread2({}, params), formSearchRef.current));
11238
11240
 
11239
11241
  case 2:
11240
11242
  return _context9.abrupt("return", _context9.sent);
package/dist/index.js CHANGED
@@ -10762,11 +10762,7 @@ var TabelCard = function TabelCard(props, ref) {
10762
10762
  modalFormConfig = _useState4[0],
10763
10763
  setModalFormConfig = _useState4[1];
10764
10764
 
10765
- var _useState5 = React.useState({}),
10766
- _useState6 = _slicedToArray(_useState5, 2),
10767
- formSearch = _useState6[0],
10768
- setFormSearch = _useState6[1];
10769
-
10765
+ var formSearchRef = React.useRef({});
10770
10766
  var modalFormColumn = deepCopy(columns) || [];
10771
10767
  var formSearchColumn = deepCopy(columns) || [];
10772
10768
  React.useImperativeHandle(ref, function () {
@@ -11162,14 +11158,14 @@ var TabelCard = function TabelCard(props, ref) {
11162
11158
  var onSubmit = function onSubmit(values) {
11163
11159
  var _actionRef$current6;
11164
11160
 
11165
- setFormSearch(values);
11161
+ formSearchRef.current = values;
11166
11162
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload(true);
11167
11163
  };
11168
11164
 
11169
11165
  var onReset = function onReset() {
11170
11166
  var _actionRef$current7;
11171
11167
 
11172
- setFormSearch({});
11168
+ formSearchRef.current = {};
11173
11169
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload(true);
11174
11170
  };
11175
11171
 
@@ -11185,7 +11181,13 @@ var TabelCard = function TabelCard(props, ref) {
11185
11181
  }).forEach(function (item) {
11186
11182
  delete obj[item.dataIndex];
11187
11183
  });
11188
- setFormSearch(obj);
11184
+ formSearchRef.current = obj;
11185
+
11186
+ if (columns === null || columns === void 0 ? void 0 : columns.length) {
11187
+ var _actionRef$current8;
11188
+
11189
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload(true);
11190
+ }
11189
11191
  }
11190
11192
  }, [columns]);
11191
11193
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
@@ -11281,7 +11283,7 @@ var TabelCard = function TabelCard(props, ref) {
11281
11283
  return [].concat(_toConsumableArray(pre), [column]);
11282
11284
  }
11283
11285
  }, [])
11284
- }, searchFormConfig || {})), /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
11286
+ }, searchFormConfig || {})), columns && columns.length && /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
11285
11287
  actionRef: actionRef,
11286
11288
  rowKey: "id",
11287
11289
  bordered: !noBordered,
@@ -11295,7 +11297,7 @@ var TabelCard = function TabelCard(props, ref) {
11295
11297
  switch (_context9.prev = _context9.next) {
11296
11298
  case 0:
11297
11299
  _context9.next = 2;
11298
- return _request(_objectSpread2(_objectSpread2({}, params), formSearch));
11300
+ return _request(_objectSpread2(_objectSpread2({}, params), formSearchRef.current));
11299
11301
 
11300
11302
  case 2:
11301
11303
  return _context9.abrupt("return", _context9.sent);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.5.29",
4
+ "version": "0.5.30",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",