完善批量同步失败的设备

This commit is contained in:
ChenYi 2026-07-01 17:02:27 +08:00
parent f17cc21c57
commit cb3f0c1190

View File

@ -2705,23 +2705,31 @@ async function handleBatchSync() {
} }
try { try {
//
batchSyncLoading.value = true; batchSyncLoading.value = true;
pageLoading.value = true;
loadingTip.value = '正在提交批量同步任务...';
const body: any = { ioTPlatform: ioTPlatform!, ioTPlatformProductId }; const body: any = { ioTPlatform: ioTPlatform!, ioTPlatformProductId };
if (selectedAddresses.length > 0) { if (selectedAddresses.length > 0) {
body.deviceAddresses = selectedAddresses; body.deviceAddresses = selectedAddresses;
} }
const resp = await postAggregationDeviceBatchSyncFromOneNETAsync({ body }); const resp = await postAggregationDeviceBatchSyncFromOneNETAsync({ body });
if (resp.data) { if (resp.data) {
Message.success('批量同步设备信息成功'); //
gridApi.reload(); Message.success(
'批量同步任务已提交,正在后台执行,请稍后刷新列表查看同步结果',
);
} else { } else {
Message.error('批量同步设备信息失败'); Message.error('批量同步任务提交失败');
} }
} catch (error) { } catch (error) {
console.error('批量同步设备信息失败:', error); console.error('批量同步任务提交失败:', error);
Message.error('批量同步设备信息失败'); Message.error('批量同步任务提交失败');
} finally { } finally {
batchSyncLoading.value = false; batchSyncLoading.value = false;
pageLoading.value = false;
loadingTip.value = '缓存刷新中...';
} }
} }