wargerm 0.5.26 → 0.5.29

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.
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -54,6 +54,7 @@ export interface WFormProps extends FormProps {
54
54
  columns: ColumnProps[];
55
55
  extraColumns?: ColumnProps[];
56
56
  disabled?: boolean;
57
+ deps?: any;
57
58
  disabledHideInSearch?: boolean;
58
59
  setForm?: (form: any) => void;
59
60
  onSubmit?: (params: Record<string, any>) => void;
package/dist/index.esm.js CHANGED
@@ -7192,7 +7192,7 @@ var WCascader = function WCascader(props) {
7192
7192
  }, extraProps));
7193
7193
  };
7194
7194
 
7195
- var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
7195
+ var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
7196
7196
  var RangePicker$2 = Index$6.RangePicker;
7197
7197
 
7198
7198
  var WForm = function WForm(props, ref) {
@@ -7208,6 +7208,7 @@ var WForm = function WForm(props, ref) {
7208
7208
  onSubmit = props.onSubmit,
7209
7209
  onReset = props.onReset,
7210
7210
  setForm = props.setForm,
7211
+ deps = props.deps,
7211
7212
  extraProps = _objectWithoutProperties(props, _excluded$7);
7212
7213
 
7213
7214
  var _Form$useForm = _Form.useForm(),
@@ -7746,8 +7747,8 @@ var WForm = function WForm(props, ref) {
7746
7747
  return renderItemForm(c);
7747
7748
  }
7748
7749
  });
7749
- }, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
7750
- ]);
7750
+ }, [changedValues, columns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
7751
+ ]));
7751
7752
  var filterExtraColumnsForm = useMemo(function () {
7752
7753
  return filterExtraFormColumns.map(function (c) {
7753
7754
  if (c.type == 'group') {
@@ -7758,7 +7759,7 @@ var WForm = function WForm(props, ref) {
7758
7759
  return renderItemForm(c);
7759
7760
  }
7760
7761
  });
7761
- }, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
7762
+ }, [changedValues, extraColumns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]));
7762
7763
 
7763
7764
  var handleSearch = function handleSearch(v) {
7764
7765
  var searchForm = form.getFieldsValue();
@@ -7893,7 +7894,7 @@ var WForm = function WForm(props, ref) {
7893
7894
 
7894
7895
  filterFormColumns.forEach(function (c) {
7895
7896
  if (c.search && c.search.transformSetForm) {
7896
- var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex]);
7897
+ var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex], setFieldsValues);
7897
7898
  setFieldsValues = _objectSpread2(_objectSpread2({}, setFieldsValues), transformObj);
7898
7899
 
7899
7900
  if (!transformObj[c.dataIndex]) {
@@ -10499,7 +10500,7 @@ function DragBox(_ref) {
10499
10500
  }, children)) : /*#__PURE__*/React.createElement(React.Fragment, null);
10500
10501
  }
10501
10502
 
10502
- var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel"];
10503
+ var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSolt", "modalFooterSolt", "formProps"];
10503
10504
 
10504
10505
  var ModalForm = function ModalForm(props, ref) {
10505
10506
  var columns = props.columns,
@@ -10516,6 +10517,9 @@ var ModalForm = function ModalForm(props, ref) {
10516
10517
  onFormChange = props.onFormChange,
10517
10518
  formItemChild = props.formItemChild,
10518
10519
  onCancel = props.onCancel,
10520
+ modalHeaderSolt = props.modalHeaderSolt,
10521
+ modalFooterSolt = props.modalFooterSolt,
10522
+ formProps = props.formProps,
10519
10523
  extraProps = _objectWithoutProperties(props, _excluded$h);
10520
10524
 
10521
10525
  var formRef = useRef(null);
@@ -10609,6 +10613,7 @@ var ModalForm = function ModalForm(props, ref) {
10609
10613
  _context2.next = 5;
10610
10614
  return submitMethod(values, function () {
10611
10615
  setVisible(false);
10616
+ onCancel && onCancel();
10612
10617
  });
10613
10618
 
10614
10619
  case 5:
@@ -10646,7 +10651,7 @@ var ModalForm = function ModalForm(props, ref) {
10646
10651
  onOk: handleOk,
10647
10652
  confirmLoading: confirmLoading,
10648
10653
  onCancel: handleCancel
10649
- }, extraProps), /*#__PURE__*/React.createElement(WForm$1, {
10654
+ }, extraProps), modalHeaderSolt, /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
10650
10655
  ref: formRef,
10651
10656
  disabled: disabled,
10652
10657
  onSubmit: onSubmit,
@@ -10656,12 +10661,12 @@ var ModalForm = function ModalForm(props, ref) {
10656
10661
  search: search,
10657
10662
  columns: columns,
10658
10663
  extraColumns: extraColumns
10659
- }), title == '查看' && formItemChild ? formItemChild() : null);
10664
+ }, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSolt);
10660
10665
  };
10661
10666
 
10662
10667
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10663
10668
 
10664
- var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10669
+ var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
10665
10670
 
10666
10671
  var TabelCard = function TabelCard(props, ref) {
10667
10672
  var columns = props.columns,
@@ -10676,6 +10681,7 @@ var TabelCard = function TabelCard(props, ref) {
10676
10681
  style = props.style,
10677
10682
  onFormChange = props.onFormChange,
10678
10683
  modalConfig = props.modalConfig,
10684
+ searchFormConfig = props.searchFormConfig,
10679
10685
  optionColumnConfig = props.optionColumnConfig,
10680
10686
  pagination = props.pagination,
10681
10687
  noBordered = props.noBordered,
@@ -10894,11 +10900,45 @@ var TabelCard = function TabelCard(props, ref) {
10894
10900
  key: i
10895
10901
  }, /*#__PURE__*/React.createElement("a", {
10896
10902
  key: btn.key,
10897
- onClick: function onClick() {
10898
- var _actionHandler$item$t;
10903
+ onClick: function () {
10904
+ var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
10905
+ var _actionHandler$item$t;
10906
+
10907
+ var info;
10908
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
10909
+ while (1) {
10910
+ switch (_context5.prev = _context5.next) {
10911
+ case 0:
10912
+ info = null;
10913
+
10914
+ if (!item.fetchInfo) {
10915
+ _context5.next = 5;
10916
+ break;
10917
+ }
10899
10918
 
10900
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10901
- }
10919
+ _context5.next = 4;
10920
+ return item.fetchInfo(record);
10921
+
10922
+ case 4:
10923
+ info = _context5.sent;
10924
+
10925
+ case 5:
10926
+ (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
10927
+
10928
+ case 6:
10929
+ case "end":
10930
+ return _context5.stop();
10931
+ }
10932
+ }
10933
+ }, _callee5);
10934
+ }));
10935
+
10936
+ function onClick() {
10937
+ return _onClick.apply(this, arguments);
10938
+ }
10939
+
10940
+ return onClick;
10941
+ }()
10902
10942
  }, btn.icon, " ", btn.title));
10903
10943
  }
10904
10944
 
@@ -10917,11 +10957,45 @@ var TabelCard = function TabelCard(props, ref) {
10917
10957
  key: i
10918
10958
  }, /*#__PURE__*/React.createElement("a", {
10919
10959
  key: btn.key,
10920
- onClick: function onClick() {
10921
- var _actionHandler$item$t3;
10960
+ onClick: function () {
10961
+ var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
10962
+ var _actionHandler$item$t3;
10963
+
10964
+ var info;
10965
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
10966
+ while (1) {
10967
+ switch (_context6.prev = _context6.next) {
10968
+ case 0:
10969
+ info = null;
10970
+
10971
+ if (!item.fetchInfo) {
10972
+ _context6.next = 5;
10973
+ break;
10974
+ }
10922
10975
 
10923
- return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
10924
- }
10976
+ _context6.next = 4;
10977
+ return item.fetchInfo(record);
10978
+
10979
+ case 4:
10980
+ info = _context6.sent;
10981
+
10982
+ case 5:
10983
+ (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, info || record, index);
10984
+
10985
+ case 6:
10986
+ case "end":
10987
+ return _context6.stop();
10988
+ }
10989
+ }
10990
+ }, _callee6);
10991
+ }));
10992
+
10993
+ function onClick() {
10994
+ return _onClick2.apply(this, arguments);
10995
+ }
10996
+
10997
+ return onClick;
10998
+ }()
10925
10999
  }, btn.icon, " ", btn.title));
10926
11000
  }
10927
11001
 
@@ -10975,17 +11049,17 @@ var TabelCard = function TabelCard(props, ref) {
10975
11049
  type: '新增',
10976
11050
  record: {},
10977
11051
  modalOnOk: function () {
10978
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
10979
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11052
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(values, loading) {
11053
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
10980
11054
  while (1) {
10981
- switch (_context5.prev = _context5.next) {
11055
+ switch (_context7.prev = _context7.next) {
10982
11056
  case 0:
10983
11057
  if (!item.actionMethod) {
10984
- _context5.next = 3;
11058
+ _context7.next = 3;
10985
11059
  break;
10986
11060
  }
10987
11061
 
10988
- _context5.next = 3;
11062
+ _context7.next = 3;
10989
11063
  return item.actionMethod(values, function () {
10990
11064
  var _actionRef$current4;
10991
11065
 
@@ -10995,10 +11069,10 @@ var TabelCard = function TabelCard(props, ref) {
10995
11069
 
10996
11070
  case 3:
10997
11071
  case "end":
10998
- return _context5.stop();
11072
+ return _context7.stop();
10999
11073
  }
11000
11074
  }
11001
- }, _callee5);
11075
+ }, _callee7);
11002
11076
  }));
11003
11077
 
11004
11078
  function modalOnOk(_x3, _x4) {
@@ -11062,25 +11136,25 @@ var TabelCard = function TabelCard(props, ref) {
11062
11136
  disabled: modalFormConfig.type == '查看',
11063
11137
  setVisible: setVisible,
11064
11138
  submitMethod: function () {
11065
- var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(values, loading) {
11066
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11139
+ var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(values, loading) {
11140
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
11067
11141
  while (1) {
11068
- switch (_context6.prev = _context6.next) {
11142
+ switch (_context8.prev = _context8.next) {
11069
11143
  case 0:
11070
11144
  if (!modalFormConfig.modalOnOk) {
11071
- _context6.next = 3;
11145
+ _context8.next = 3;
11072
11146
  break;
11073
11147
  }
11074
11148
 
11075
- _context6.next = 3;
11149
+ _context8.next = 3;
11076
11150
  return modalFormConfig.modalOnOk(values, loading);
11077
11151
 
11078
11152
  case 3:
11079
11153
  case "end":
11080
- return _context6.stop();
11154
+ return _context8.stop();
11081
11155
  }
11082
11156
  }
11083
- }, _callee6);
11157
+ }, _callee8);
11084
11158
  }));
11085
11159
 
11086
11160
  function submitMethod(_x5, _x6) {
@@ -11122,7 +11196,7 @@ var TabelCard = function TabelCard(props, ref) {
11122
11196
 
11123
11197
  return true;
11124
11198
  })
11125
- })), /*#__PURE__*/React.createElement(WForm$1, {
11199
+ })), /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
11126
11200
  ref: searchFormRef,
11127
11201
  disabledRuler: true,
11128
11202
  search: search == false ? {
@@ -11146,7 +11220,7 @@ var TabelCard = function TabelCard(props, ref) {
11146
11220
  return [].concat(_toConsumableArray(pre), [column]);
11147
11221
  }
11148
11222
  }, [])
11149
- }), /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
11223
+ }, searchFormConfig || {})), /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
11150
11224
  actionRef: actionRef,
11151
11225
  rowKey: "id",
11152
11226
  bordered: !noBordered,
@@ -11154,23 +11228,23 @@ var TabelCard = function TabelCard(props, ref) {
11154
11228
  toolBarRender: false
11155
11229
  }, _request ? {
11156
11230
  request: function () {
11157
- var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(params) {
11158
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
11231
+ var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(params) {
11232
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
11159
11233
  while (1) {
11160
- switch (_context7.prev = _context7.next) {
11234
+ switch (_context9.prev = _context9.next) {
11161
11235
  case 0:
11162
- _context7.next = 2;
11236
+ _context9.next = 2;
11163
11237
  return _request(_objectSpread2(_objectSpread2({}, params), formSearch));
11164
11238
 
11165
11239
  case 2:
11166
- return _context7.abrupt("return", _context7.sent);
11240
+ return _context9.abrupt("return", _context9.sent);
11167
11241
 
11168
11242
  case 3:
11169
11243
  case "end":
11170
- return _context7.stop();
11244
+ return _context9.stop();
11171
11245
  }
11172
11246
  }
11173
- }, _callee7);
11247
+ }, _callee9);
11174
11248
  }));
11175
11249
 
11176
11250
  function request(_x7) {
package/dist/index.js CHANGED
@@ -7253,7 +7253,7 @@ var WCascader = function WCascader(props) {
7253
7253
  }, extraProps));
7254
7254
  };
7255
7255
 
7256
- var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
7256
+ var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
7257
7257
  var RangePicker$2 = Index$6.RangePicker;
7258
7258
 
7259
7259
  var WForm = function WForm(props, ref) {
@@ -7269,6 +7269,7 @@ var WForm = function WForm(props, ref) {
7269
7269
  onSubmit = props.onSubmit,
7270
7270
  onReset = props.onReset,
7271
7271
  setForm = props.setForm,
7272
+ deps = props.deps,
7272
7273
  extraProps = _objectWithoutProperties(props, _excluded$7);
7273
7274
 
7274
7275
  var _Form$useForm = _Form__default['default'].useForm(),
@@ -7807,8 +7808,8 @@ var WForm = function WForm(props, ref) {
7807
7808
  return renderItemForm(c);
7808
7809
  }
7809
7810
  });
7810
- }, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
7811
- ]);
7811
+ }, [changedValues, columns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue()) // 依赖值改变,需要重新渲染
7812
+ ]));
7812
7813
  var filterExtraColumnsForm = React.useMemo(function () {
7813
7814
  return filterExtraFormColumns.map(function (c) {
7814
7815
  if (c.type == 'group') {
@@ -7819,7 +7820,7 @@ var WForm = function WForm(props, ref) {
7819
7820
  return renderItemForm(c);
7820
7821
  }
7821
7822
  });
7822
- }, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
7823
+ }, [changedValues, extraColumns, disabled].concat(_toConsumableArray(deps ? [deps] : []), [JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]));
7823
7824
 
7824
7825
  var handleSearch = function handleSearch(v) {
7825
7826
  var searchForm = form.getFieldsValue();
@@ -7954,7 +7955,7 @@ var WForm = function WForm(props, ref) {
7954
7955
 
7955
7956
  filterFormColumns.forEach(function (c) {
7956
7957
  if (c.search && c.search.transformSetForm) {
7957
- var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex]);
7958
+ var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex], setFieldsValues);
7958
7959
  setFieldsValues = _objectSpread2(_objectSpread2({}, setFieldsValues), transformObj);
7959
7960
 
7960
7961
  if (!transformObj[c.dataIndex]) {
@@ -10560,7 +10561,7 @@ function DragBox(_ref) {
10560
10561
  }, children)) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
10561
10562
  }
10562
10563
 
10563
- var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel"];
10564
+ var _excluded$h = ["columns", "extraColumns", "search", "visible", "setVisible", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSolt", "modalFooterSolt", "formProps"];
10564
10565
 
10565
10566
  var ModalForm = function ModalForm(props, ref) {
10566
10567
  var columns = props.columns,
@@ -10577,6 +10578,9 @@ var ModalForm = function ModalForm(props, ref) {
10577
10578
  onFormChange = props.onFormChange,
10578
10579
  formItemChild = props.formItemChild,
10579
10580
  onCancel = props.onCancel,
10581
+ modalHeaderSolt = props.modalHeaderSolt,
10582
+ modalFooterSolt = props.modalFooterSolt,
10583
+ formProps = props.formProps,
10580
10584
  extraProps = _objectWithoutProperties(props, _excluded$h);
10581
10585
 
10582
10586
  var formRef = React.useRef(null);
@@ -10670,6 +10674,7 @@ var ModalForm = function ModalForm(props, ref) {
10670
10674
  _context2.next = 5;
10671
10675
  return submitMethod(values, function () {
10672
10676
  setVisible(false);
10677
+ onCancel && onCancel();
10673
10678
  });
10674
10679
 
10675
10680
  case 5:
@@ -10707,7 +10712,7 @@ var ModalForm = function ModalForm(props, ref) {
10707
10712
  onOk: handleOk,
10708
10713
  confirmLoading: confirmLoading,
10709
10714
  onCancel: handleCancel
10710
- }, extraProps), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
10715
+ }, extraProps), modalHeaderSolt, /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
10711
10716
  ref: formRef,
10712
10717
  disabled: disabled,
10713
10718
  onSubmit: onSubmit,
@@ -10717,12 +10722,12 @@ var ModalForm = function ModalForm(props, ref) {
10717
10722
  search: search,
10718
10723
  columns: columns,
10719
10724
  extraColumns: extraColumns
10720
- }), title == '查看' && formItemChild ? formItemChild() : null);
10725
+ }, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSolt);
10721
10726
  };
10722
10727
 
10723
10728
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
10724
10729
 
10725
- var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10730
+ var _excluded$i = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
10726
10731
 
10727
10732
  var TabelCard = function TabelCard(props, ref) {
10728
10733
  var columns = props.columns,
@@ -10737,6 +10742,7 @@ var TabelCard = function TabelCard(props, ref) {
10737
10742
  style = props.style,
10738
10743
  onFormChange = props.onFormChange,
10739
10744
  modalConfig = props.modalConfig,
10745
+ searchFormConfig = props.searchFormConfig,
10740
10746
  optionColumnConfig = props.optionColumnConfig,
10741
10747
  pagination = props.pagination,
10742
10748
  noBordered = props.noBordered,
@@ -10955,11 +10961,45 @@ var TabelCard = function TabelCard(props, ref) {
10955
10961
  key: i
10956
10962
  }, /*#__PURE__*/React__default['default'].createElement("a", {
10957
10963
  key: btn.key,
10958
- onClick: function onClick() {
10959
- var _actionHandler$item$t;
10964
+ onClick: function () {
10965
+ var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
10966
+ var _actionHandler$item$t;
10967
+
10968
+ var info;
10969
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
10970
+ while (1) {
10971
+ switch (_context5.prev = _context5.next) {
10972
+ case 0:
10973
+ info = null;
10974
+
10975
+ if (!item.fetchInfo) {
10976
+ _context5.next = 5;
10977
+ break;
10978
+ }
10960
10979
 
10961
- return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
10962
- }
10980
+ _context5.next = 4;
10981
+ return item.fetchInfo(record);
10982
+
10983
+ case 4:
10984
+ info = _context5.sent;
10985
+
10986
+ case 5:
10987
+ (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
10988
+
10989
+ case 6:
10990
+ case "end":
10991
+ return _context5.stop();
10992
+ }
10993
+ }
10994
+ }, _callee5);
10995
+ }));
10996
+
10997
+ function onClick() {
10998
+ return _onClick.apply(this, arguments);
10999
+ }
11000
+
11001
+ return onClick;
11002
+ }()
10963
11003
  }, btn.icon, " ", btn.title));
10964
11004
  }
10965
11005
 
@@ -10978,11 +11018,45 @@ var TabelCard = function TabelCard(props, ref) {
10978
11018
  key: i
10979
11019
  }, /*#__PURE__*/React__default['default'].createElement("a", {
10980
11020
  key: btn.key,
10981
- onClick: function onClick() {
10982
- var _actionHandler$item$t3;
11021
+ onClick: function () {
11022
+ var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
11023
+ var _actionHandler$item$t3;
11024
+
11025
+ var info;
11026
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
11027
+ while (1) {
11028
+ switch (_context6.prev = _context6.next) {
11029
+ case 0:
11030
+ info = null;
11031
+
11032
+ if (!item.fetchInfo) {
11033
+ _context6.next = 5;
11034
+ break;
11035
+ }
10983
11036
 
10984
- return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
10985
- }
11037
+ _context6.next = 4;
11038
+ return item.fetchInfo(record);
11039
+
11040
+ case 4:
11041
+ info = _context6.sent;
11042
+
11043
+ case 5:
11044
+ (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, info || record, index);
11045
+
11046
+ case 6:
11047
+ case "end":
11048
+ return _context6.stop();
11049
+ }
11050
+ }
11051
+ }, _callee6);
11052
+ }));
11053
+
11054
+ function onClick() {
11055
+ return _onClick2.apply(this, arguments);
11056
+ }
11057
+
11058
+ return onClick;
11059
+ }()
10986
11060
  }, btn.icon, " ", btn.title));
10987
11061
  }
10988
11062
 
@@ -11036,17 +11110,17 @@ var TabelCard = function TabelCard(props, ref) {
11036
11110
  type: '新增',
11037
11111
  record: {},
11038
11112
  modalOnOk: function () {
11039
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
11040
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11113
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(values, loading) {
11114
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
11041
11115
  while (1) {
11042
- switch (_context5.prev = _context5.next) {
11116
+ switch (_context7.prev = _context7.next) {
11043
11117
  case 0:
11044
11118
  if (!item.actionMethod) {
11045
- _context5.next = 3;
11119
+ _context7.next = 3;
11046
11120
  break;
11047
11121
  }
11048
11122
 
11049
- _context5.next = 3;
11123
+ _context7.next = 3;
11050
11124
  return item.actionMethod(values, function () {
11051
11125
  var _actionRef$current4;
11052
11126
 
@@ -11056,10 +11130,10 @@ var TabelCard = function TabelCard(props, ref) {
11056
11130
 
11057
11131
  case 3:
11058
11132
  case "end":
11059
- return _context5.stop();
11133
+ return _context7.stop();
11060
11134
  }
11061
11135
  }
11062
- }, _callee5);
11136
+ }, _callee7);
11063
11137
  }));
11064
11138
 
11065
11139
  function modalOnOk(_x3, _x4) {
@@ -11123,25 +11197,25 @@ var TabelCard = function TabelCard(props, ref) {
11123
11197
  disabled: modalFormConfig.type == '查看',
11124
11198
  setVisible: setVisible,
11125
11199
  submitMethod: function () {
11126
- var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(values, loading) {
11127
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11200
+ var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(values, loading) {
11201
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
11128
11202
  while (1) {
11129
- switch (_context6.prev = _context6.next) {
11203
+ switch (_context8.prev = _context8.next) {
11130
11204
  case 0:
11131
11205
  if (!modalFormConfig.modalOnOk) {
11132
- _context6.next = 3;
11206
+ _context8.next = 3;
11133
11207
  break;
11134
11208
  }
11135
11209
 
11136
- _context6.next = 3;
11210
+ _context8.next = 3;
11137
11211
  return modalFormConfig.modalOnOk(values, loading);
11138
11212
 
11139
11213
  case 3:
11140
11214
  case "end":
11141
- return _context6.stop();
11215
+ return _context8.stop();
11142
11216
  }
11143
11217
  }
11144
- }, _callee6);
11218
+ }, _callee8);
11145
11219
  }));
11146
11220
 
11147
11221
  function submitMethod(_x5, _x6) {
@@ -11183,7 +11257,7 @@ var TabelCard = function TabelCard(props, ref) {
11183
11257
 
11184
11258
  return true;
11185
11259
  })
11186
- })), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
11260
+ })), /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
11187
11261
  ref: searchFormRef,
11188
11262
  disabledRuler: true,
11189
11263
  search: search == false ? {
@@ -11207,7 +11281,7 @@ var TabelCard = function TabelCard(props, ref) {
11207
11281
  return [].concat(_toConsumableArray(pre), [column]);
11208
11282
  }
11209
11283
  }, [])
11210
- }), /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
11284
+ }, searchFormConfig || {})), /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
11211
11285
  actionRef: actionRef,
11212
11286
  rowKey: "id",
11213
11287
  bordered: !noBordered,
@@ -11215,23 +11289,23 @@ var TabelCard = function TabelCard(props, ref) {
11215
11289
  toolBarRender: false
11216
11290
  }, _request ? {
11217
11291
  request: function () {
11218
- var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(params) {
11219
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
11292
+ var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(params) {
11293
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
11220
11294
  while (1) {
11221
- switch (_context7.prev = _context7.next) {
11295
+ switch (_context9.prev = _context9.next) {
11222
11296
  case 0:
11223
- _context7.next = 2;
11297
+ _context9.next = 2;
11224
11298
  return _request(_objectSpread2(_objectSpread2({}, params), formSearch));
11225
11299
 
11226
11300
  case 2:
11227
- return _context7.abrupt("return", _context7.sent);
11301
+ return _context9.abrupt("return", _context9.sent);
11228
11302
 
11229
11303
  case 3:
11230
11304
  case "end":
11231
- return _context7.stop();
11305
+ return _context9.stop();
11232
11306
  }
11233
11307
  }
11234
- }, _callee7);
11308
+ }, _callee9);
11235
11309
  }));
11236
11310
 
11237
11311
  function request(_x7) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.5.26",
4
+ "version": "0.5.29",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",