@bit-sun/business-component 2.4.20 → 2.4.22

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
@@ -11642,9 +11642,11 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
11642
11642
  var _this$props = _this.props,
11643
11643
  _this$props$summary = _this$props.summary,
11644
11644
  summary = _this$props$summary === void 0 ? undefined : _this$props$summary,
11645
- rowSelection = _this$props.rowSelection;
11645
+ rowSelection = _this$props.rowSelection,
11646
+ expandable = _this$props.expandable;
11646
11647
  var showColumns = _this.state.showColumns;
11647
- var summaryRow = rowSelection ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns);
11648
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
11649
+ var summaryRow = rowSelection && expandable ? [{}, {}].concat(_toConsumableArray(showColumns)) : rowSelection || expandable ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns); //兼容table配置展开expandable属性导致汇总列位置不对的问题
11648
11650
  var summaryInitial = summary().cont;
11649
11651
  var summaryDom = /*#__PURE__*/React.createElement(Table.Summary, {
11650
11652
  fixed: true
@@ -11888,9 +11890,11 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
11888
11890
  var _this$props = _this.props,
11889
11891
  _this$props$summary = _this$props.summary,
11890
11892
  summary = _this$props$summary === void 0 ? undefined : _this$props$summary,
11891
- rowSelection = _this$props.rowSelection;
11893
+ rowSelection = _this$props.rowSelection,
11894
+ expandable = _this$props.expandable;
11892
11895
  var showColumns = _this.state.showColumns;
11893
- var summaryRow = rowSelection ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns);
11896
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
11897
+ var summaryRow = rowSelection && expandable ? [{}, {}].concat(_toConsumableArray(showColumns)) : rowSelection || expandable ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns); //兼容table配置展开expandable属性导致汇总列位置不对的问题
11894
11898
  var summaryInitial = summary().cont;
11895
11899
  var summaryDom = /*#__PURE__*/React.createElement(Table.Summary, {
11896
11900
  fixed: true
@@ -12089,16 +12093,21 @@ var doDetailPageAction = function doDetailPageAction(config) {
12089
12093
  successMessage: config === null || config === void 0 ? void 0 : config.successMessage
12090
12094
  };
12091
12095
  var onOk = function onOk() {
12092
- request$1(requestConfig).then(function (res) {
12093
- if (config.backPath) {
12094
- history.push({
12095
- pathname: config.backPath
12096
- });
12097
- }
12098
- // 是否执行成功之后的回调
12099
- if (typeof config.successCb === 'function') {
12100
- config.successCb(res);
12101
- }
12096
+ return new Promise(function (resolve, reject) {
12097
+ request$1(requestConfig).then(function (res) {
12098
+ resolve(res);
12099
+ if (config.backPath) {
12100
+ history.push({
12101
+ pathname: config.backPath
12102
+ });
12103
+ }
12104
+ // 是否执行成功之后的回调
12105
+ if (typeof config.successCb === 'function') {
12106
+ config.successCb(res);
12107
+ }
12108
+ }).catch(function (error) {
12109
+ return reject(error);
12110
+ });
12102
12111
  });
12103
12112
  };
12104
12113
  if (config.noConfirm) {
package/dist/index.js CHANGED
@@ -11662,9 +11662,11 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
11662
11662
  var _this$props = _this.props,
11663
11663
  _this$props$summary = _this$props.summary,
11664
11664
  summary = _this$props$summary === void 0 ? undefined : _this$props$summary,
11665
- rowSelection = _this$props.rowSelection;
11665
+ rowSelection = _this$props.rowSelection,
11666
+ expandable = _this$props.expandable;
11666
11667
  var showColumns = _this.state.showColumns;
11667
- var summaryRow = rowSelection ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns);
11668
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
11669
+ var summaryRow = rowSelection && expandable ? [{}, {}].concat(_toConsumableArray(showColumns)) : rowSelection || expandable ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns); //兼容table配置展开expandable属性导致汇总列位置不对的问题
11668
11670
  var summaryInitial = summary().cont;
11669
11671
  var summaryDom = /*#__PURE__*/React__default['default'].createElement(antd.Table.Summary, {
11670
11672
  fixed: true
@@ -11908,9 +11910,11 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
11908
11910
  var _this$props = _this.props,
11909
11911
  _this$props$summary = _this$props.summary,
11910
11912
  summary = _this$props$summary === void 0 ? undefined : _this$props$summary,
11911
- rowSelection = _this$props.rowSelection;
11913
+ rowSelection = _this$props.rowSelection,
11914
+ expandable = _this$props.expandable;
11912
11915
  var showColumns = _this.state.showColumns;
11913
- var summaryRow = rowSelection ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns);
11916
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
11917
+ var summaryRow = rowSelection && expandable ? [{}, {}].concat(_toConsumableArray(showColumns)) : rowSelection || expandable ? [{}].concat(_toConsumableArray(showColumns)) : _toConsumableArray(showColumns); //兼容table配置展开expandable属性导致汇总列位置不对的问题
11914
11918
  var summaryInitial = summary().cont;
11915
11919
  var summaryDom = /*#__PURE__*/React__default['default'].createElement(antd.Table.Summary, {
11916
11920
  fixed: true
@@ -12109,16 +12113,21 @@ var doDetailPageAction = function doDetailPageAction(config) {
12109
12113
  successMessage: config === null || config === void 0 ? void 0 : config.successMessage
12110
12114
  };
12111
12115
  var onOk = function onOk() {
12112
- bssula.request(requestConfig).then(function (res) {
12113
- if (config.backPath) {
12114
- umi.history.push({
12115
- pathname: config.backPath
12116
- });
12117
- }
12118
- // 是否执行成功之后的回调
12119
- if (typeof config.successCb === 'function') {
12120
- config.successCb(res);
12121
- }
12116
+ return new Promise(function (resolve, reject) {
12117
+ bssula.request(requestConfig).then(function (res) {
12118
+ resolve(res);
12119
+ if (config.backPath) {
12120
+ umi.history.push({
12121
+ pathname: config.backPath
12122
+ });
12123
+ }
12124
+ // 是否执行成功之后的回调
12125
+ if (typeof config.successCb === 'function') {
12126
+ config.successCb(res);
12127
+ }
12128
+ }).catch(function (error) {
12129
+ return reject(error);
12130
+ });
12122
12131
  });
12123
12132
  };
12124
12133
  if (config.noConfirm) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.4.20",
3
+ "version": "2.4.22",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -4,6 +4,7 @@ import { Modal } from 'antd';
4
4
  import { ExclamationCircleOutlined } from '@ant-design/icons';
5
5
  import React from 'react';
6
6
  import { history } from 'umi';
7
+ import { handleError } from '@/utils/requestUtils';
7
8
 
8
9
  interface actionItem {
9
10
  [propName: string]: any;
@@ -21,17 +22,20 @@ export const doDetailPageAction = (config: actionItem) => {
21
22
 
22
23
 
23
24
  const onOk = () => {
24
- request(requestConfig).then((res) => {
25
- if (config.backPath) {
26
- history.push({
27
- pathname: config.backPath
28
- })
29
- }
30
- // 是否执行成功之后的回调
31
- if (typeof (config.successCb) === 'function') {
32
- config.successCb(res);
33
- }
34
- });
25
+ return new Promise((resolve, reject) => {
26
+ request(requestConfig).then((res) => {
27
+ resolve(res);
28
+ if (config.backPath) {
29
+ history.push({
30
+ pathname: config.backPath
31
+ })
32
+ }
33
+ // 是否执行成功之后的回调
34
+ if (typeof (config.successCb) === 'function') {
35
+ config.successCb(res);
36
+ }
37
+ }).catch(error => reject(error));
38
+ })
35
39
  };
36
40
 
37
41
  if (config.noConfirm) {
@@ -69,9 +69,10 @@ export default class ColumnSettingTable extends React.Component {
69
69
  };
70
70
 
71
71
  getTableSummaryInfo = () => {
72
- const { summary = undefined, rowSelection }: any = this.props;
72
+ const { summary = undefined, rowSelection, expandable }: any = this.props;
73
73
  const { showColumns }: any = this.state;
74
- let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
74
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
75
+ let summaryRow = rowSelection && expandable ? [{}, {}, ...showColumns] : rowSelection || expandable ? [{}, ...showColumns] : [...showColumns]; //兼容table配置展开expandable属性导致汇总列位置不对的问题
75
76
  let summaryInitial = summary().cont;
76
77
  let summaryDom: any = <Table.Summary fixed>
77
78
  <Table.Summary.Row>
@@ -75,9 +75,10 @@ export default class ColumnSettingSulaTable extends React.Component {
75
75
  };
76
76
 
77
77
  getTableSummaryInfo = () => {
78
- const { summary = undefined, rowSelection }: any = this.props;
78
+ const { summary = undefined, rowSelection, expandable }: any = this.props;
79
79
  const { showColumns }: any = this.state;
80
- let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
80
+ // let summaryRow = rowSelection ? [{}, ...showColumns] : [...showColumns];
81
+ let summaryRow = rowSelection && expandable ? [{}, {}, ...showColumns] : rowSelection || expandable ? [{}, ...showColumns] : [...showColumns]; //兼容table配置展开expandable属性导致汇总列位置不对的问题
81
82
  let summaryInitial = summary().cont;
82
83
  let summaryDom: any = <Table.Summary fixed>
83
84
  <Table.Summary.Row>