修复一些错误
This commit is contained in:
@@ -367,6 +367,11 @@ public partial class DataServices : ObservableRecipient, IRecipient<LoadMessage>
|
|||||||
{
|
{
|
||||||
// 这是一个新变量表,添加到集合中
|
// 这是一个新变量表,添加到集合中
|
||||||
var newItem = _mapper.Map<VariableTableItemViewModel>(dto);
|
var newItem = _mapper.Map<VariableTableItemViewModel>(dto);
|
||||||
|
var device=Devices.FirstOrDefault(d=>d.Id==dto.DeviceId);
|
||||||
|
if (device!=null)
|
||||||
|
{
|
||||||
|
newItem.Device=device;
|
||||||
|
}
|
||||||
VariableTables.Add(newItem);
|
VariableTables.Add(newItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ public partial class VariableTableItemViewModel : ObservableObject
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private int _deviceId;
|
private int _deviceId;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private DeviceItemViewModel _device;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private ProtocolType _protocol;
|
private ProtocolType _protocol;
|
||||||
|
|
||||||
|
|||||||
@@ -66,15 +66,6 @@ partial class VariableTableViewModel : ViewModelBase,INavigatable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsLoadCompletion { get; set; } = false;
|
public bool IsLoadCompletion { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 变量表数据仓库,用于与变量表相关的数据库操作。
|
|
||||||
/// </summary>
|
|
||||||
// private readonly VarTableRepository _varTableRepository;
|
|
||||||
//
|
|
||||||
// /// <summary>
|
|
||||||
// /// 变量数据仓库,用于与变量数据相关的数据库操作。
|
|
||||||
// /// </summary>
|
|
||||||
// private readonly VarDataRepository _varDataRepository;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 原始变量数据的深拷贝备份,用于在用户取消保存时还原数据。
|
/// 原始变量数据的深拷贝备份,用于在用户取消保存时还原数据。
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
FontSize="14" />
|
FontSize="14" />
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
<Run Text="协议: " />
|
<Run Text="协议: " />
|
||||||
<Run Text="{Binding ProtocolType}" />
|
<Run Text="{Binding Protocol}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -101,9 +101,9 @@
|
|||||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Connect}" VerticalAlignment="Center" Margin="0,0,8,0" FontSize="16" />
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Connect}" VerticalAlignment="Center" Margin="0,0,8,0" FontSize="16" />
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
<Run Text="IP: " />
|
<Run Text="IP: " />
|
||||||
<Run Text="{Binding CurrentDevice.Ip}" />
|
<Run Text="{Binding CurrentDevice.IpAddress}" />
|
||||||
<Run Text=" Port: " />
|
<Run Text=" Port: " />
|
||||||
<Run Text="{Binding CurrentDevice.Prot}" />
|
<Run Text="{Binding CurrentDevice.Port}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,2">
|
<StackPanel Orientation="Horizontal" Margin="0,2">
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<Run Text="设备类型: " />
|
<Run Text="设备类型: " />
|
||||||
<Run Text="{Binding CurrentDevice.DeviceType}" />
|
<Run Text="{Binding CurrentDevice.DeviceType}" />
|
||||||
<Run Text=" 协议类型: " />
|
<Run Text=" 协议类型: " />
|
||||||
<Run Text="{Binding CurrentDevice.ProtocolType}" />
|
<Run Text="{Binding CurrentDevice.Protocol}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,2">
|
<StackPanel Orientation="Horizontal" Margin="0,2">
|
||||||
|
|||||||
Reference in New Issue
Block a user