@bit-sun/business-component 2.0.30 → 2.0.31
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 +20 -1
- package/dist/index.js +20 -1
- package/package.json +1 -1
- package/src/components/Functional/AddSelect/index.tsx +12 -2
package/dist/index.esm.js
CHANGED
|
@@ -3447,6 +3447,16 @@ var AddSelect = function AddSelect(props) {
|
|
|
3447
3447
|
tableColumns = _useState36[0],
|
|
3448
3448
|
setTableColumns = _useState36[1];
|
|
3449
3449
|
|
|
3450
|
+
var _useState37 = useState(false),
|
|
3451
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
3452
|
+
confirmLoading = _useState38[0],
|
|
3453
|
+
setConfirmLoading = _useState38[1];
|
|
3454
|
+
|
|
3455
|
+
var _useState39 = useState(false),
|
|
3456
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
3457
|
+
confirmContinueLoading = _useState40[0],
|
|
3458
|
+
setConfirmContinueLoading = _useState40[1];
|
|
3459
|
+
|
|
3450
3460
|
useEffect(function () {
|
|
3451
3461
|
setTableColumns(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns.map(function (item, index) {
|
|
3452
3462
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
@@ -3758,6 +3768,10 @@ var AddSelect = function AddSelect(props) {
|
|
|
3758
3768
|
}
|
|
3759
3769
|
};
|
|
3760
3770
|
|
|
3771
|
+
var handleLoading = function handleLoading(isContinue, flag) {
|
|
3772
|
+
isContinue ? setConfirmContinueLoading(flag) : setConfirmLoading(flag);
|
|
3773
|
+
};
|
|
3774
|
+
|
|
3761
3775
|
var handleOk = function handleOk(isContinue) {
|
|
3762
3776
|
if (!popvalue.length) {
|
|
3763
3777
|
message.warning('至少选中一条数据');
|
|
@@ -3766,6 +3780,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
3766
3780
|
|
|
3767
3781
|
|
|
3768
3782
|
if (onSaveCallback) {
|
|
3783
|
+
handleLoading(isContinue, true);
|
|
3769
3784
|
onSaveCallback(popvalue).then(function (res) {
|
|
3770
3785
|
{
|
|
3771
3786
|
var _document$getElementB2;
|
|
@@ -3775,8 +3790,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
3775
3790
|
(_document$getElementB2 = document.getElementById('first-query')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
|
|
3776
3791
|
!isContinue && handleCancel();
|
|
3777
3792
|
}
|
|
3793
|
+
|
|
3794
|
+
handleLoading(isContinue, false);
|
|
3778
3795
|
}).catch(function (Error) {
|
|
3779
3796
|
message.error(Error);
|
|
3797
|
+
handleLoading(isContinue, false);
|
|
3780
3798
|
});
|
|
3781
3799
|
} else {
|
|
3782
3800
|
!isContinue && handleCancel();
|
|
@@ -4155,7 +4173,6 @@ var AddSelect = function AddSelect(props) {
|
|
|
4155
4173
|
},
|
|
4156
4174
|
// title={modalTableProps?.modalTableTitle}
|
|
4157
4175
|
visible: isModalVisible,
|
|
4158
|
-
onOk: handleOk,
|
|
4159
4176
|
closable: false,
|
|
4160
4177
|
onCancel: handleCancel,
|
|
4161
4178
|
footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
|
|
@@ -4170,6 +4187,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
4170
4187
|
onClick: function onClick() {
|
|
4171
4188
|
handleOk(true);
|
|
4172
4189
|
},
|
|
4190
|
+
loading: confirmContinueLoading,
|
|
4173
4191
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4174
4192
|
}, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React.createElement(Button, {
|
|
4175
4193
|
key: "submit",
|
|
@@ -4177,6 +4195,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
4177
4195
|
onClick: function onClick() {
|
|
4178
4196
|
handleOk(false);
|
|
4179
4197
|
},
|
|
4198
|
+
loading: confirmLoading,
|
|
4180
4199
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4181
4200
|
}, "\u786E\u5B9A")] : null
|
|
4182
4201
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
package/dist/index.js
CHANGED
|
@@ -3457,6 +3457,16 @@ var AddSelect = function AddSelect(props) {
|
|
|
3457
3457
|
tableColumns = _useState36[0],
|
|
3458
3458
|
setTableColumns = _useState36[1];
|
|
3459
3459
|
|
|
3460
|
+
var _useState37 = React.useState(false),
|
|
3461
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
3462
|
+
confirmLoading = _useState38[0],
|
|
3463
|
+
setConfirmLoading = _useState38[1];
|
|
3464
|
+
|
|
3465
|
+
var _useState39 = React.useState(false),
|
|
3466
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
3467
|
+
confirmContinueLoading = _useState40[0],
|
|
3468
|
+
setConfirmContinueLoading = _useState40[1];
|
|
3469
|
+
|
|
3460
3470
|
React.useEffect(function () {
|
|
3461
3471
|
setTableColumns(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns.map(function (item, index) {
|
|
3462
3472
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
@@ -3768,6 +3778,10 @@ var AddSelect = function AddSelect(props) {
|
|
|
3768
3778
|
}
|
|
3769
3779
|
};
|
|
3770
3780
|
|
|
3781
|
+
var handleLoading = function handleLoading(isContinue, flag) {
|
|
3782
|
+
isContinue ? setConfirmContinueLoading(flag) : setConfirmLoading(flag);
|
|
3783
|
+
};
|
|
3784
|
+
|
|
3771
3785
|
var handleOk = function handleOk(isContinue) {
|
|
3772
3786
|
if (!popvalue.length) {
|
|
3773
3787
|
antd.message.warning('至少选中一条数据');
|
|
@@ -3776,6 +3790,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
3776
3790
|
|
|
3777
3791
|
|
|
3778
3792
|
if (onSaveCallback) {
|
|
3793
|
+
handleLoading(isContinue, true);
|
|
3779
3794
|
onSaveCallback(popvalue).then(function (res) {
|
|
3780
3795
|
{
|
|
3781
3796
|
var _document$getElementB2;
|
|
@@ -3785,8 +3800,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
3785
3800
|
(_document$getElementB2 = document.getElementById('first-query')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
|
|
3786
3801
|
!isContinue && handleCancel();
|
|
3787
3802
|
}
|
|
3803
|
+
|
|
3804
|
+
handleLoading(isContinue, false);
|
|
3788
3805
|
}).catch(function (Error) {
|
|
3789
3806
|
antd.message.error(Error);
|
|
3807
|
+
handleLoading(isContinue, false);
|
|
3790
3808
|
});
|
|
3791
3809
|
} else {
|
|
3792
3810
|
!isContinue && handleCancel();
|
|
@@ -4165,7 +4183,6 @@ var AddSelect = function AddSelect(props) {
|
|
|
4165
4183
|
},
|
|
4166
4184
|
// title={modalTableProps?.modalTableTitle}
|
|
4167
4185
|
visible: isModalVisible,
|
|
4168
|
-
onOk: handleOk,
|
|
4169
4186
|
closable: false,
|
|
4170
4187
|
onCancel: handleCancel,
|
|
4171
4188
|
footer: selectMode ? [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -4180,6 +4197,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
4180
4197
|
onClick: function onClick() {
|
|
4181
4198
|
handleOk(true);
|
|
4182
4199
|
},
|
|
4200
|
+
loading: confirmContinueLoading,
|
|
4183
4201
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4184
4202
|
}, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
4185
4203
|
key: "submit",
|
|
@@ -4187,6 +4205,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
4187
4205
|
onClick: function onClick() {
|
|
4188
4206
|
handleOk(false);
|
|
4189
4207
|
},
|
|
4208
|
+
loading: confirmLoading,
|
|
4190
4209
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4191
4210
|
}, "\u786E\u5B9A")] : null
|
|
4192
4211
|
}, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
package/package.json
CHANGED
|
@@ -153,6 +153,8 @@ const AddSelect = (props: any) => {
|
|
|
153
153
|
const [indeterminate, setIndeterminate] = useState(false)
|
|
154
154
|
const [tableFormParams, setTableFormParams] = useState({});
|
|
155
155
|
const [tableColumns, setTableColumns] = useState([]);
|
|
156
|
+
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
157
|
+
const [confirmContinueLoading, setConfirmContinueLoading] = useState(false);
|
|
156
158
|
|
|
157
159
|
useEffect(() => {
|
|
158
160
|
setTableColumns(
|
|
@@ -468,6 +470,10 @@ const AddSelect = (props: any) => {
|
|
|
468
470
|
}
|
|
469
471
|
}
|
|
470
472
|
|
|
473
|
+
const handleLoading = (isContinue,flag) => {
|
|
474
|
+
isContinue ? setConfirmContinueLoading(flag) : setConfirmLoading(flag);
|
|
475
|
+
}
|
|
476
|
+
|
|
471
477
|
const handleOk = (isContinue) => {
|
|
472
478
|
if(!popvalue.length) {
|
|
473
479
|
message.warning('至少选中一条数据')
|
|
@@ -475,6 +481,7 @@ const AddSelect = (props: any) => {
|
|
|
475
481
|
}
|
|
476
482
|
// handleSelectOver(popvalue)
|
|
477
483
|
if(onSaveCallback) {
|
|
484
|
+
handleLoading(isContinue,true)
|
|
478
485
|
onSaveCallback(popvalue).then(res => {
|
|
479
486
|
if(true) {
|
|
480
487
|
message.success('保存成功')
|
|
@@ -483,8 +490,10 @@ const AddSelect = (props: any) => {
|
|
|
483
490
|
!isContinue && handleCancel();
|
|
484
491
|
} else {
|
|
485
492
|
}
|
|
493
|
+
handleLoading(isContinue,false)
|
|
486
494
|
}).catch(Error => {
|
|
487
|
-
message.error(Error)
|
|
495
|
+
message.error(Error);
|
|
496
|
+
handleLoading(isContinue,false)
|
|
488
497
|
})
|
|
489
498
|
} else {
|
|
490
499
|
!isContinue && handleCancel();
|
|
@@ -836,7 +845,6 @@ const AddSelect = (props: any) => {
|
|
|
836
845
|
bodyStyle={{ padding: '0px' }}
|
|
837
846
|
// title={modalTableProps?.modalTableTitle}
|
|
838
847
|
visible={isModalVisible}
|
|
839
|
-
onOk={handleOk}
|
|
840
848
|
closable={false}
|
|
841
849
|
onCancel={handleCancel}
|
|
842
850
|
footer={selectMode ? [
|
|
@@ -847,6 +855,7 @@ const AddSelect = (props: any) => {
|
|
|
847
855
|
key="submit"
|
|
848
856
|
style={{color: '#005CFF', borderColor: '#005CFF'}}
|
|
849
857
|
onClick={() => {handleOk(true)}}
|
|
858
|
+
loading={confirmContinueLoading}
|
|
850
859
|
disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
|
|
851
860
|
>
|
|
852
861
|
保存并继续
|
|
@@ -855,6 +864,7 @@ const AddSelect = (props: any) => {
|
|
|
855
864
|
key="submit"
|
|
856
865
|
type="primary"
|
|
857
866
|
onClick={() => {handleOk(false)}}
|
|
867
|
+
loading={confirmLoading}
|
|
858
868
|
disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
|
|
859
869
|
>
|
|
860
870
|
确定
|