完善批量同步失败的设备
This commit is contained in:
parent
f17cc21c57
commit
cb3f0c1190
@ -2705,23 +2705,31 @@ async function handleBatchSync() {
|
||||
}
|
||||
|
||||
try {
|
||||
// 整屏遮罩,避免用户重复点击或误操作;后端为异步丢弃,提交后即返回
|
||||
batchSyncLoading.value = true;
|
||||
pageLoading.value = true;
|
||||
loadingTip.value = '正在提交批量同步任务...';
|
||||
|
||||
const body: any = { ioTPlatform: ioTPlatform!, ioTPlatformProductId };
|
||||
if (selectedAddresses.length > 0) {
|
||||
body.deviceAddresses = selectedAddresses;
|
||||
}
|
||||
const resp = await postAggregationDeviceBatchSyncFromOneNETAsync({ body });
|
||||
if (resp.data) {
|
||||
Message.success('批量同步设备信息成功');
|
||||
gridApi.reload();
|
||||
// 后端已在后台逐个处理,接口不等待执行完毕,友好提示稍后刷新查看结果
|
||||
Message.success(
|
||||
'批量同步任务已提交,正在后台执行,请稍后刷新列表查看同步结果',
|
||||
);
|
||||
} else {
|
||||
Message.error('批量同步设备信息失败');
|
||||
Message.error('批量同步任务提交失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('批量同步设备信息失败:', error);
|
||||
Message.error('批量同步设备信息失败');
|
||||
console.error('批量同步任务提交失败:', error);
|
||||
Message.error('批量同步任务提交失败');
|
||||
} finally {
|
||||
batchSyncLoading.value = false;
|
||||
pageLoading.value = false;
|
||||
loadingTip.value = '缓存刷新中...';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user