@lemon-fe/kits 1.2.12-alpha.1 → 1.2.13

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.
@@ -37,7 +37,9 @@ interface Props<RecordType extends Record<string, any> = Record<string, any>, Re
37
37
  /**
38
38
  * @description modal footer 默认为null
39
39
  */
40
- footer?: ReactNode | ((record: RecordType[]) => ReactNode);
40
+ footer?: ReactNode | ((record: RecordType[], others: {
41
+ results: Map<Key, Result<ResultType>>;
42
+ }) => ReactNode);
41
43
  /**
42
44
  * @description 关闭时触发
43
45
  * @param success 成功的结果
@@ -592,6 +592,21 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
592
592
  });
593
593
  return cols;
594
594
  }
595
+ }, {
596
+ key: "getError",
597
+ value: function getError() {
598
+ var res = new Map();
599
+ _toConsumableArray(this.state.results).forEach(function (_ref10) {
600
+ var _ref11 = _slicedToArray(_ref10, 2),
601
+ key = _ref11[0],
602
+ item = _ref11[1];
603
+ if (!item.loading) {
604
+ res.set(key, item.result || item.error);
605
+ }
606
+ return false;
607
+ });
608
+ return res;
609
+ }
595
610
  }, {
596
611
  key: "render",
597
612
  value: function render() {
@@ -630,7 +645,9 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
630
645
  _this5.handleClose();
631
646
  });
632
647
  },
633
- footer: typeof footer === 'function' ? footer(data) : footer,
648
+ footer: typeof footer === 'function' ? footer(data, {
649
+ results: this.getError()
650
+ }) : footer,
634
651
  maskClosable: false,
635
652
  afterClose: function afterClose() {
636
653
  _this5.setState({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.2.12-alpha.1",
3
+ "version": "1.2.13",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@ant-design/icons": "^4.7.0",
27
- "@lemon-fe/components": "^1.2.12-alpha.1",
27
+ "@lemon-fe/components": "^1.2.13",
28
28
  "@lemon-fe/hooks": "^1.2.11",
29
29
  "@lemon-fe/utils": "^1.1.0",
30
30
  "antd": "4.24.8",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "registry": "https://registry.npmjs.org"
47
47
  },
48
- "gitHead": "d78e483deec792ba988460766ad6398dc2ee58a7"
48
+ "gitHead": "4658fd8d24c995f46acbb63d6a9e0827d28e23cf"
49
49
  }