...
|
...
|
@@ -543,20 +543,30 @@ |
543
|
543
|
|
544
|
544
|
// 批量公开设备
|
545
|
545
|
const handleBatchPublic = async () => {
|
546
|
|
- const options = getSelectRows();
|
547
|
|
- const tbDeviceIdJoinStr = options.map((item) => item.tbDeviceId).join(',');
|
548
|
|
- const res = await doBatchPublicDevice(tbDeviceIdJoinStr);
|
549
|
|
- createMessage.success(res);
|
550
|
|
- handleReload();
|
|
546
|
+ setLoading(true);
|
|
547
|
+ try {
|
|
548
|
+ const options = getSelectRows();
|
|
549
|
+ const tbDeviceIdJoinStr = options.map((item) => item.tbDeviceId).join(',');
|
|
550
|
+ const res = await doBatchPublicDevice(tbDeviceIdJoinStr);
|
|
551
|
+ createMessage.success(res);
|
|
552
|
+ } finally {
|
|
553
|
+ handleReload();
|
|
554
|
+ setLoading(false);
|
|
555
|
+ }
|
551
|
556
|
};
|
552
|
557
|
|
553
|
558
|
// 批量私有设备
|
554
|
559
|
const handleBatchPrivate = async () => {
|
555
|
|
- const options = getSelectRows();
|
556
|
|
- const tbDeviceIdJoinStr = options.map((item) => item.tbDeviceId).join(',');
|
557
|
|
- const res = await doBatchPrivateDevice(tbDeviceIdJoinStr);
|
558
|
|
- createMessage.success(res);
|
559
|
|
- handleReload();
|
|
560
|
+ setLoading(true);
|
|
561
|
+ try {
|
|
562
|
+ const options = getSelectRows();
|
|
563
|
+ const tbDeviceIdJoinStr = options.map((item) => item.tbDeviceId).join(',');
|
|
564
|
+ const res = await doBatchPrivateDevice(tbDeviceIdJoinStr);
|
|
565
|
+ createMessage.success(res);
|
|
566
|
+ } finally {
|
|
567
|
+ handleReload();
|
|
568
|
+ setLoading(false);
|
|
569
|
+ }
|
560
|
570
|
};
|
561
|
571
|
|
562
|
572
|
const handleDelete = async (record?: DeviceRecord) => {
|
...
|
...
|
|