重构触发器与变量关联关系的实现

This commit is contained in:
2025-10-20 18:54:43 +08:00
parent 252a99d586
commit 01adc11be7
8 changed files with 31 additions and 26 deletions

View File

@@ -33,11 +33,6 @@ namespace DMS.WPF.ViewModels
[ObservableProperty]
private TriggerItem _currentTrigger;
/// <summary>
/// 与当前触发器关联的变量数据集合。
/// </summary>
[ObservableProperty]
private ObservableCollection<VariableItem> _associatedVariables;
[ObservableProperty]
private IList _selectedVariables = new ArrayList();
@@ -166,15 +161,6 @@ namespace DMS.WPF.ViewModels
{
CurrentTrigger = triggerItem;
// 初始化关联变量列表 - 从VariableIds创建VariableItems列表
AssociatedVariables = new ObservableCollection<VariableItem>();
foreach (var variableId in CurrentTrigger.VariableIds)
{
if (_dataStorageService.Variables.TryGetValue(variableId, out var variableItem))
{
AssociatedVariables.Add(variableItem);
}
}
}
return Task.CompletedTask;