fix: use DialogHelper.ShowAutoClosingMessageBox for import result dialog

- 5s auto-close, test automation mode skips dialog
- Consistent with existing project patterns
This commit is contained in:
tian 2026-06-03 20:25:15 +08:00
parent ab0b5760d8
commit 27ab485558

View File

@ -5803,26 +5803,24 @@ namespace NavisworksTransport.UI.WPF.ViewModels
UpdateMainStatus(statusMsg);
var dialogMsg = new StringBuilder();
dialogMsg.AppendLine($"导入完成");
dialogMsg.AppendLine();
dialogMsg.AppendLine($"成功导入: {totalImported} 个路径");
if (totalFailed > 0)
dialogMsg.AppendLine($"导入失败: {totalFailed} 个路径");
dialogMsg.AppendLine($"来源文件数: {filePaths.Length}");
System.Windows.MessageBox.Show(
DialogHelper.ShowAutoClosingMessageBox(
dialogMsg.ToString(),
"导入结果",
System.Windows.MessageBoxButton.OK,
totalFailed == 0 ? System.Windows.MessageBoxImage.Information : System.Windows.MessageBoxImage.Warning);
"导入完成",
totalFailed == 0 ? System.Windows.MessageBoxImage.Information : System.Windows.MessageBoxImage.Warning,
autoCloseMilliseconds: 5000);
}
else
{
UpdateMainStatus($"❌ 导入失败: 所有文件导入失败");
System.Windows.MessageBox.Show(
DialogHelper.ShowAutoClosingMessageBox(
"所有文件导入失败。\n请确认文件格式是否正确。",
"导入结果",
System.Windows.MessageBoxButton.OK,
System.Windows.MessageBoxImage.Error);
"导入失败",
System.Windows.MessageBoxImage.Error,
autoCloseMilliseconds: 5000);
}
}
}