WinEquipment.xaml
9.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<win:MyWindow
xmlns:win="clr-namespace:HHECS.View.Win" x:Class="HHECS.View.EquipmentInfo.WinEquipment"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:HHECS.View.EquipmentInfo"
xmlns:control="clr-namespace:HHECS.Controls"
mc:Ignorable="d"
Title="设备管理" Height="450" Width="800">
<Window.Resources>
<Style TargetType="StackPanel" >
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0,0,0"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Width" Value="100"/>
</Style>
</Window.Resources>
<Grid>
<TabControl>
<TabItem x:Name="TIMain" Header="设备">
<Grid x:Name="GridMain">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="0" CornerRadius="6" Background="AliceBlue">
<WrapPanel>
<StackPanel>
<TextBlock>设备编码:</TextBlock>
<TextBox x:Name="TxtCode"></TextBox>
</StackPanel>
<StackPanel>
<TextBlock>设备名:</TextBlock>
<TextBox x:Name="TxtName"></TextBox>
</StackPanel>
</WrapPanel>
</Border>
<StackPanel Grid.Row="1" HorizontalAlignment="Right">
<Button x:Name="BtnQuery" Click="BtnQuery_Click">查询</Button>
<Button x:Name="BtnViewDetail" Click="BtnViewDetail_Click">查看详细</Button>
<Button x:Name="BtnAdd" Click="BtnAdd_Click">新增设备</Button>
<Button x:Name="BtnEdit" Click="BtnEdit_Click">编辑设备</Button>
<Button x:Name="BtnDelete" Click="BtnDelete_Click">删除设备</Button>
</StackPanel>
<DockPanel Grid.Row="2">
<control:DataPager x:Name="page" DockPanel.Dock="Bottom" PageIndex="{Binding PageIndex}" PageSize="{Binding PageSize}" TotalCount="{Binding TotalCount}"
PageChanged="page_PageChanged"></control:DataPager>
<DataGrid x:Name="DGMain" >
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<EventSetter Event="MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="Id" Binding="{Binding Id}"/>
<DataGridTextColumn Header="设备编码" Binding="{Binding Code}"/>
<DataGridTextColumn Header="设备名" Binding="{Binding Name}"/>
<DataGridTextColumn Header="设备类型编码" Binding="{Binding TypeCode}"/>
<DataGridTextColumn Header="设备类型名" Binding="{Binding TypeName}"/>
<DataGridTextColumn Header="IP" Binding="{Binding IP}"/>
<DataGridTextColumn Header="自身地址" Binding="{Binding SelfAddress}"/>
<DataGridTextColumn Header="巷道" Binding="{Binding RoadWay}"/>
<DataGridTextColumn Header="站台索引" Binding="{Binding StationIndex}"/>
<DataGridTextColumn Header="组名" Binding="{Binding GroupName}"/>
<DataGridTextColumn Header="描述" Binding="{Binding Desciption}"/>
<DataGridCheckBoxColumn Header="禁用" Binding="{Binding Disable}"/>
<DataGridTextColumn Header="创建时间" Binding="{Binding Created}"/>
<DataGridTextColumn Header="创建人" Binding="{Binding CreatedBy}"/>
<DataGridTextColumn Header="更新时间" Binding="{Binding Updated}"/>
<DataGridTextColumn Header="更新人" Binding="{Binding UpdatedBy}"/>
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Grid>
</TabItem>
<TabItem x:Name="TIDetail" Header="设备属性">
<Grid x:Name="GridDetail">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="63"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="设备信息">
<WrapPanel>
<StackPanel>
<TextBlock>设备编码:</TextBlock>
<TextBox x:Name="TxtMainCode" IsReadOnly="true" Text="{Binding Code}"></TextBox>
</StackPanel>
<StackPanel>
<TextBlock>设备名:</TextBlock>
<TextBox x:Name="TxtMainName" IsReadOnly="true" Text="{Binding Name}"></TextBox>
</StackPanel>
<StackPanel>
<TextBlock>描述:</TextBlock>
<TextBox x:Name="TxtDescription" IsReadOnly="true" Text="{Binding Description}"></TextBox>
</StackPanel>
</WrapPanel>
</GroupBox>
<GroupBox Grid.Row="1" Header="操作">
<StackPanel Grid.Row="1" HorizontalAlignment="Right">
<Button x:Name="BtnUpdateDetail" Click="BtnUpdateDetail_Click">刷新</Button>
<Button x:Name="BtnSaveProp" Click="BtnSaveProp_Click">保存</Button>
<Button x:Name="BtnDeleteProp" Click="BtnDeleteProp_Click">删除</Button>
<Button x:Name="BtnSync" Click="BtnSync_Click">同步</Button>
</StackPanel>
</GroupBox>
<GroupBox Grid.Row="2" Header="明细列表">
<DataGrid x:Name="DGDetail" IsReadOnly="False" AutoGenerateColumns="False">
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsReadOnly" Value="False">
<Setter Property="Background" Value="GreenYellow">
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="Id" Binding="{Binding Id}" IsReadOnly="True"/>
<!--<DataGridTextColumn Header="设备编码" Binding="{Binding EquipmentCode}"/>
<DataGridTextColumn Header="设备名" Binding="{Binding EquipmentName}"/>-->
<DataGridTextColumn Header="属性编码" Binding="{Binding EquipmentTypePropTemplateCode}" IsReadOnly="True"/>
<DataGridTextColumn Header="OPC句柄" Binding="{Binding ServerHandle}" IsReadOnly="True"/>
<DataGridTextColumn Header="地址" Binding="{Binding Address}" IsReadOnly="False"/>
<DataGridTextColumn Header="值" Binding="{Binding Value}" IsReadOnly="False"/>
<DataGridTextColumn Header="备注" Binding="{Binding Remark}" IsReadOnly="False"/>
<DataGridTextColumn Header="创建时间" Binding="{Binding Created}" IsReadOnly="True"/>
<DataGridTextColumn Header="创建人" Binding="{Binding CreatedBy}" IsReadOnly="True"/>
<DataGridTextColumn Header="更新时间" Binding="{Binding Updated}" IsReadOnly="True"/>
<DataGridTextColumn Header="更新人" Binding="{Binding UpdatedBy}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
</TabItem>
</TabControl>
</Grid>
</win:MyWindow>