wargerm 0.2.2 → 0.2.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.
package/dist/index.esm.js CHANGED
@@ -9392,17 +9392,10 @@ var ModalForm = function ModalForm(props, ref) {
9392
9392
  }
9393
9393
  };
9394
9394
 
9395
- var done = function done() {
9396
- setVisible(false);
9397
- };
9398
-
9399
9395
  useImperativeHandle(ref, function () {
9400
9396
  return {
9401
9397
  formRef: formRef,
9402
- onSubmit: onSubmit,
9403
- done: done // resetFields,
9404
- // setFieldsValue,
9405
-
9398
+ onSubmit: onSubmit
9406
9399
  };
9407
9400
  });
9408
9401
 
@@ -9442,20 +9435,20 @@ var ModalForm = function ModalForm(props, ref) {
9442
9435
  res = {};
9443
9436
 
9444
9437
  if (!submitMethod) {
9445
- _context2.next = 6;
9438
+ _context2.next = 7;
9446
9439
  break;
9447
9440
  }
9448
9441
 
9449
9442
  _context2.next = 5;
9450
9443
  return submitMethod(values, function () {
9451
- setConfirmLoading(false);
9452
9444
  setVisible(false);
9453
9445
  });
9454
9446
 
9455
9447
  case 5:
9456
9448
  res = _context2.sent;
9449
+ setConfirmLoading(false);
9457
9450
 
9458
- case 6:
9451
+ case 7:
9459
9452
  case "end":
9460
9453
  return _context2.stop();
9461
9454
  }
@@ -9520,11 +9513,6 @@ var TabelCard = function TabelCard(props, ref) {
9520
9513
  modalFormConfig = _useState4[0],
9521
9514
  setModalFormConfig = _useState4[1];
9522
9515
 
9523
- var _useState5 = useState({}),
9524
- _useState6 = _slicedToArray(_useState5, 2),
9525
- submitValues = _useState6[0],
9526
- setSubmitValues = _useState6[1];
9527
-
9528
9516
  useImperativeHandle(ref, function () {
9529
9517
  return {};
9530
9518
  });
@@ -9547,7 +9535,7 @@ var TabelCard = function TabelCard(props, ref) {
9547
9535
  type: '编辑',
9548
9536
  record: record,
9549
9537
  modalOnOk: function () {
9550
- var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) {
9538
+ var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values, loading) {
9551
9539
  return regeneratorRuntime.wrap(function _callee$(_context) {
9552
9540
  while (1) {
9553
9541
  switch (_context.prev = _context.next) {
@@ -9561,6 +9549,7 @@ var TabelCard = function TabelCard(props, ref) {
9561
9549
  return item.actionMethod(values, function () {
9562
9550
  var _actionRef$current;
9563
9551
 
9552
+ loading();
9564
9553
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.reload();
9565
9554
  });
9566
9555
 
@@ -9572,7 +9561,7 @@ var TabelCard = function TabelCard(props, ref) {
9572
9561
  }, _callee);
9573
9562
  }));
9574
9563
 
9575
- function modalOnOk(_x) {
9564
+ function modalOnOk(_x, _x2) {
9576
9565
  return _modalOnOk.apply(this, arguments);
9577
9566
  }
9578
9567
 
@@ -9708,7 +9697,7 @@ var TabelCard = function TabelCard(props, ref) {
9708
9697
  type: '新增',
9709
9698
  record: {},
9710
9699
  modalOnOk: function () {
9711
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values) {
9700
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
9712
9701
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
9713
9702
  while (1) {
9714
9703
  switch (_context5.prev = _context5.next) {
@@ -9722,7 +9711,8 @@ var TabelCard = function TabelCard(props, ref) {
9722
9711
  return item.actionMethod(values, function () {
9723
9712
  var _actionRef$current4;
9724
9713
 
9725
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9714
+ loading();
9715
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9726
9716
  });
9727
9717
 
9728
9718
  case 3:
@@ -9733,7 +9723,7 @@ var TabelCard = function TabelCard(props, ref) {
9733
9723
  }, _callee5);
9734
9724
  }));
9735
9725
 
9736
- function modalOnOk(_x2) {
9726
+ function modalOnOk(_x3, _x4) {
9737
9727
  return _modalOnOk3.apply(this, arguments);
9738
9728
  }
9739
9729
 
@@ -9754,7 +9744,7 @@ var TabelCard = function TabelCard(props, ref) {
9754
9744
  });
9755
9745
  }
9756
9746
  });
9757
- }, [submitValues, actionRef]);
9747
+ }, [actionRef]);
9758
9748
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
9759
9749
  ref: formRef,
9760
9750
  title: modalFormConfig.type || '新增',
@@ -9769,17 +9759,14 @@ var TabelCard = function TabelCard(props, ref) {
9769
9759
  switch (_context6.prev = _context6.next) {
9770
9760
  case 0:
9771
9761
  if (!modalFormConfig.modalOnOk) {
9772
- _context6.next = 4;
9762
+ _context6.next = 3;
9773
9763
  break;
9774
9764
  }
9775
9765
 
9776
9766
  _context6.next = 3;
9777
- return modalFormConfig.modalOnOk(values);
9767
+ return modalFormConfig.modalOnOk(values, loading);
9778
9768
 
9779
9769
  case 3:
9780
- loading();
9781
-
9782
- case 4:
9783
9770
  case "end":
9784
9771
  return _context6.stop();
9785
9772
  }
@@ -9787,7 +9774,7 @@ var TabelCard = function TabelCard(props, ref) {
9787
9774
  }, _callee6);
9788
9775
  }));
9789
9776
 
9790
- function submitMethod(_x3, _x4) {
9777
+ function submitMethod(_x5, _x6) {
9791
9778
  return _submitMethod.apply(this, arguments);
9792
9779
  }
9793
9780
 
@@ -9805,14 +9792,14 @@ var TabelCard = function TabelCard(props, ref) {
9805
9792
  options: false,
9806
9793
  toolBarRender: false,
9807
9794
  request: request,
9808
- columns: [].concat(_toConsumableArray(columns || []), [{
9795
+ columns: tableAction && (tableAction === null || tableAction === void 0 ? void 0 : tableAction.length) > 0 ? [].concat(_toConsumableArray(columns || []), [{
9809
9796
  title: '操作',
9810
9797
  dataIndex: 'option',
9811
9798
  valueType: 'option',
9812
9799
  render: function render(_, record, index) {
9813
9800
  return tableActionDom(record, index);
9814
9801
  }
9815
- }]),
9802
+ }]) : columns || [],
9816
9803
  search: {
9817
9804
  labelWidth: 'auto',
9818
9805
  optionRender: function optionRender(searchConfig, formProps, dom) {
package/dist/index.js CHANGED
@@ -9424,17 +9424,10 @@ var ModalForm = function ModalForm(props, ref) {
9424
9424
  }
9425
9425
  };
9426
9426
 
9427
- var done = function done() {
9428
- setVisible(false);
9429
- };
9430
-
9431
9427
  React.useImperativeHandle(ref, function () {
9432
9428
  return {
9433
9429
  formRef: formRef,
9434
- onSubmit: onSubmit,
9435
- done: done // resetFields,
9436
- // setFieldsValue,
9437
-
9430
+ onSubmit: onSubmit
9438
9431
  };
9439
9432
  });
9440
9433
 
@@ -9474,20 +9467,20 @@ var ModalForm = function ModalForm(props, ref) {
9474
9467
  res = {};
9475
9468
 
9476
9469
  if (!submitMethod) {
9477
- _context2.next = 6;
9470
+ _context2.next = 7;
9478
9471
  break;
9479
9472
  }
9480
9473
 
9481
9474
  _context2.next = 5;
9482
9475
  return submitMethod(values, function () {
9483
- setConfirmLoading(false);
9484
9476
  setVisible(false);
9485
9477
  });
9486
9478
 
9487
9479
  case 5:
9488
9480
  res = _context2.sent;
9481
+ setConfirmLoading(false);
9489
9482
 
9490
- case 6:
9483
+ case 7:
9491
9484
  case "end":
9492
9485
  return _context2.stop();
9493
9486
  }
@@ -9552,11 +9545,6 @@ var TabelCard = function TabelCard(props, ref) {
9552
9545
  modalFormConfig = _useState4[0],
9553
9546
  setModalFormConfig = _useState4[1];
9554
9547
 
9555
- var _useState5 = React.useState({}),
9556
- _useState6 = _slicedToArray(_useState5, 2),
9557
- submitValues = _useState6[0],
9558
- setSubmitValues = _useState6[1];
9559
-
9560
9548
  React.useImperativeHandle(ref, function () {
9561
9549
  return {};
9562
9550
  });
@@ -9579,7 +9567,7 @@ var TabelCard = function TabelCard(props, ref) {
9579
9567
  type: '编辑',
9580
9568
  record: record,
9581
9569
  modalOnOk: function () {
9582
- var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) {
9570
+ var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values, loading) {
9583
9571
  return regeneratorRuntime.wrap(function _callee$(_context) {
9584
9572
  while (1) {
9585
9573
  switch (_context.prev = _context.next) {
@@ -9593,6 +9581,7 @@ var TabelCard = function TabelCard(props, ref) {
9593
9581
  return item.actionMethod(values, function () {
9594
9582
  var _actionRef$current;
9595
9583
 
9584
+ loading();
9596
9585
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.reload();
9597
9586
  });
9598
9587
 
@@ -9604,7 +9593,7 @@ var TabelCard = function TabelCard(props, ref) {
9604
9593
  }, _callee);
9605
9594
  }));
9606
9595
 
9607
- function modalOnOk(_x) {
9596
+ function modalOnOk(_x, _x2) {
9608
9597
  return _modalOnOk.apply(this, arguments);
9609
9598
  }
9610
9599
 
@@ -9740,7 +9729,7 @@ var TabelCard = function TabelCard(props, ref) {
9740
9729
  type: '新增',
9741
9730
  record: {},
9742
9731
  modalOnOk: function () {
9743
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values) {
9732
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
9744
9733
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
9745
9734
  while (1) {
9746
9735
  switch (_context5.prev = _context5.next) {
@@ -9754,7 +9743,8 @@ var TabelCard = function TabelCard(props, ref) {
9754
9743
  return item.actionMethod(values, function () {
9755
9744
  var _actionRef$current4;
9756
9745
 
9757
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9746
+ loading();
9747
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9758
9748
  });
9759
9749
 
9760
9750
  case 3:
@@ -9765,7 +9755,7 @@ var TabelCard = function TabelCard(props, ref) {
9765
9755
  }, _callee5);
9766
9756
  }));
9767
9757
 
9768
- function modalOnOk(_x2) {
9758
+ function modalOnOk(_x3, _x4) {
9769
9759
  return _modalOnOk3.apply(this, arguments);
9770
9760
  }
9771
9761
 
@@ -9786,7 +9776,7 @@ var TabelCard = function TabelCard(props, ref) {
9786
9776
  });
9787
9777
  }
9788
9778
  });
9789
- }, [submitValues, actionRef]);
9779
+ }, [actionRef]);
9790
9780
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
9791
9781
  ref: formRef,
9792
9782
  title: modalFormConfig.type || '新增',
@@ -9801,17 +9791,14 @@ var TabelCard = function TabelCard(props, ref) {
9801
9791
  switch (_context6.prev = _context6.next) {
9802
9792
  case 0:
9803
9793
  if (!modalFormConfig.modalOnOk) {
9804
- _context6.next = 4;
9794
+ _context6.next = 3;
9805
9795
  break;
9806
9796
  }
9807
9797
 
9808
9798
  _context6.next = 3;
9809
- return modalFormConfig.modalOnOk(values);
9799
+ return modalFormConfig.modalOnOk(values, loading);
9810
9800
 
9811
9801
  case 3:
9812
- loading();
9813
-
9814
- case 4:
9815
9802
  case "end":
9816
9803
  return _context6.stop();
9817
9804
  }
@@ -9819,7 +9806,7 @@ var TabelCard = function TabelCard(props, ref) {
9819
9806
  }, _callee6);
9820
9807
  }));
9821
9808
 
9822
- function submitMethod(_x3, _x4) {
9809
+ function submitMethod(_x5, _x6) {
9823
9810
  return _submitMethod.apply(this, arguments);
9824
9811
  }
9825
9812
 
@@ -9837,14 +9824,14 @@ var TabelCard = function TabelCard(props, ref) {
9837
9824
  options: false,
9838
9825
  toolBarRender: false,
9839
9826
  request: request,
9840
- columns: [].concat(_toConsumableArray(columns || []), [{
9827
+ columns: tableAction && (tableAction === null || tableAction === void 0 ? void 0 : tableAction.length) > 0 ? [].concat(_toConsumableArray(columns || []), [{
9841
9828
  title: '操作',
9842
9829
  dataIndex: 'option',
9843
9830
  valueType: 'option',
9844
9831
  render: function render(_, record, index) {
9845
9832
  return tableActionDom(record, index);
9846
9833
  }
9847
- }]),
9834
+ }]) : columns || [],
9848
9835
  search: {
9849
9836
  labelWidth: 'auto',
9850
9837
  optionRender: function optionRender(searchConfig, formProps, dom) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",