You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using Avalonia.Data.Converters;
|
|
|
|
|
|
using AI.Models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace AI.Converters
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将工作流步骤状态转换为图标
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class WorkflowStatusToIconConverter : IValueConverter
|
|
|
|
|
|
{
|
|
|
|
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注意:这个转换器现在主要用于其他场景,UI 中的图标已经改为使用 Grid 叠加显示
|
|
|
|
|
|
// 保持兼容性,返回基本图标
|
|
|
|
|
|
if (value is WorkflowStepStatus status)
|
|
|
|
|
|
{
|
|
|
|
|
|
return status switch
|
|
|
|
|
|
{
|
|
|
|
|
|
WorkflowStepStatus.Completed => "○", // UI 中会叠加显示勾
|
|
|
|
|
|
WorkflowStepStatus.Running => "○", // 保持圆圈,只变颜色
|
|
|
|
|
|
WorkflowStepStatus.Failed => "✗",
|
|
|
|
|
|
WorkflowStepStatus.Skipped => "⊘",
|
|
|
|
|
|
WorkflowStepStatus.Pending => "○",
|
|
|
|
|
|
_ => "○"
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return "○";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|