| | |
| | | xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI" |
| | | xmlns:pw="https://opensource.panuon.com/wpf" |
| | | xmlns:pu="https://opensource.panuon.com/wpf-ui" |
| | | xmlns:dp="clr-namespace:HMI.UI;assembly=HMI.UI" |
| | | mc:Ignorable="d" |
| | | Padding="10" |
| | | xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI" |
| | | mc:Ignorable="d" |
| | | Loaded="UserControl_Loaded" |
| | | Background="{StaticResource WorkspaceBackground}" |
| | | d:DesignHeight="450" d:DesignWidth="800"> |
| | | <Grid> |
| | | <Grid.ColumnDefinitions> |
| | | <ColumnDefinition Width="5*"/> |
| | | <ColumnDefinition Width="5*"/> |
| | | </Grid.ColumnDefinitions> |
| | | |
| | | <Border Style="{StaticResource CardBoarder}" Margin="0,0,2,0"> |
| | | <StackPanel> |
| | | <DockPanel Margin="0,0,0,10"> |
| | | <Button DockPanel.Dock="Right" pu:ButtonHelper.Icon="" Style="{StaticResource DangerButton}">删除</Button> |
| | | <Button DockPanel.Dock="Right" Style="{StaticResource PrimaryButton}" |
| | | pu:IconHelper.FontFamily="{StaticResource iconfont}" |
| | | pu:ButtonHelper.Icon="" Margin="0,0,10,0" x:Name="refreshBtn" Click="Button_Click">刷新</Button> |
| | | <Button DockPanel.Dock="Right" Style="{StaticResource PrimaryButton}" |
| | | pu:IconHelper.FontFamily="{StaticResource iconfont}" |
| | | pu:ButtonHelper.Icon="" Margin="0,0,10,0" x:Name="addBtn" Click="Button_Click">新增</Button> |
| | | <TextBlock DockPanel.Dock="Left" FontSize="{StaticResource TitleFontSize}" |
| | | VerticalAlignment="Center" HorizontalAlignment="Left" Text="菜单列表"/> |
| | | </DockPanel> |
| | | <UserControl.Resources> |
| | | <Style TargetType="Label"> |
| | | <Setter Property="VerticalContentAlignment" Value="Center"/> |
| | | <Setter Property="VerticalAlignment" Value="Center"/> |
| | | </Style> |
| | | <CollectionViewSource x:Key="disFilter" Source="{Binding Dis}" Filter="CollectionViewSource_Filter"/> |
| | | <CollectionViewSource x:Key="dosFilter" Source="{Binding Dos}" Filter="CollectionViewSource_Filter"/> |
| | | </UserControl.Resources> |
| | | |
| | | <DataGrid Grid.Column="1" x:Name="diTable" Style="{StaticResource DefaultDataGrid}" ItemsSource="{Binding DataSource}"> |
| | | <DataGrid.Columns> |
| | | <DataGridTemplateColumn Header="" Width="Auto" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <CheckBox VerticalAlignment="Center" IsChecked="{Binding Selected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTemplateColumn Header="#" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <TextBlock Text="{Binding Converter={StaticResource rowNumber}, |
| | | RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Code}" Header="编号" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Name}" Header="名称" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Type}" Header="类型" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Value}" Header="DI值" /> |
| | | <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <StackPanel Orientation="Horizontal"> |
| | | <Button x:Name="editBtn" Style="{StaticResource RowLink}" |
| | | Margin="0,0,10,0" |
| | | Click="Button_Click" |
| | | DataContext="{Binding }">编辑</Button> |
| | | <Button x:Name="delBtn" Style="{StaticResource DangerLinkButton}" |
| | | DataContext="{Binding }" |
| | | Click="Button_Click">删除</Button> |
| | | </StackPanel> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | </DataGrid.Columns> |
| | | </DataGrid> |
| | | </StackPanel> |
| | | </Border> |
| | | <Border Grid.Row="1" Style="{StaticResource CardBoarder}"> |
| | | <Grid dp:GridHelper.Space="10"> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <Border Grid.Column="1" Style="{StaticResource CardBoarder}" Margin="2,0,0,0"> |
| | | <StackPanel> |
| | | <DockPanel Margin="0,0,0,10" > |
| | | <TextBlock DockPanel.Dock="Left" FontSize="{StaticResource TitleFontSize}" |
| | | VerticalAlignment="Center" HorizontalAlignment="Left" Text="菜单结构"/> |
| | | </DockPanel> |
| | | <Grid.ColumnDefinitions> |
| | | <ColumnDefinition Width="5*"/> |
| | | <ColumnDefinition Width="5*"/> |
| | | </Grid.ColumnDefinitions> |
| | | |
| | | <DataGrid Grid.Column="1" x:Name="doTable" Style="{StaticResource DefaultDataGrid}" ItemsSource="{Binding DataSource}"> |
| | | <DataGrid.Columns> |
| | | <DataGridTemplateColumn Header="" Width="Auto" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <CheckBox VerticalAlignment="Center" IsChecked="{Binding Selected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTemplateColumn Header="#" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <TextBlock Text="{Binding Converter={StaticResource rowNumber}, |
| | | <DockPanel Grid.Row="0" Grid.ColumnSpan="2"> |
| | | <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}"> |
| | | <Button Style="{StaticResource PrimaryButton}" x:Name="addBtn" Click="Button_Click">新增</Button> |
| | | <Button Style="{StaticResource PrimaryButton}" x:Name="importBtn" Click="Button_Click">导入</Button> |
| | | </StackPanel> |
| | | |
| | | <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center" |
| | | FontSize="{StaticResource TitleFontSize}" Text="DIO监控"/> |
| | | </DockPanel> |
| | | |
| | | <Border Grid.Row="1" Style="{StaticResource CardBoarder}" Padding="0"> |
| | | <Grid dp:GridHelper.Space="10"> |
| | | <Grid.ColumnDefinitions> |
| | | <ColumnDefinition Width="Auto"/> |
| | | <ColumnDefinition /> |
| | | <ColumnDefinition Width="Auto"/> |
| | | <ColumnDefinition Width="Auto"/> |
| | | </Grid.ColumnDefinitions> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <Label Grid.Row="0" Grid.Column="0" Content="DI名称" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="0" Grid.Column="1" x:Name="diName" |
| | | IsEditable="True" Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="2" |
| | | x:Name="diSelect" Click="Button_Click" |
| | | >DI查询</Button> |
| | | <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="3" |
| | | x:Name="diReset" Click="Button_Click">DI重置</Button> |
| | | |
| | | <Label Grid.Row="1" Grid.Column="0" Content="DI编号" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="1" Grid.Column="1" x:Name="diCode" |
| | | IsEditable="True" |
| | | Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <Label Grid.Row="2" Grid.Column="0" Content="DI分组" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="2" Grid.Column="1" x:Name="diGroup" |
| | | IsEditable="True" Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <DataGrid Grid.Row="3" Grid.ColumnSpan="4" x:Name="diTable" Style="{StaticResource DefaultDataGrid}" |
| | | ItemsSource="{Binding Source={StaticResource disFilter}}"> |
| | | |
| | | <DataGrid.RowStyle> |
| | | <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}"> |
| | | <Style.Triggers> |
| | | <DataTrigger Binding="{Binding Value}" Value="True"> |
| | | <Setter Property="Background" Value="{StaticResource DangerColor}"/> |
| | | <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/> |
| | | </DataTrigger> |
| | | </Style.Triggers> |
| | | </Style> |
| | | </DataGrid.RowStyle> |
| | | <DataGrid.Columns> |
| | | <!--<DataGridTemplateColumn Header="" Width="Auto" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <CheckBox VerticalAlignment="Center" IsChecked="{Binding Selected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn>--> |
| | | <DataGridTemplateColumn Header="#" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <TextBlock Text="{Binding Converter={StaticResource rowNumber}, |
| | | RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Code}" Header="编号"/> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Name}" Header="名称" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Type}" Header="类型" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Value}" Header="DO值" /> |
| | | <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <StackPanel Orientation="Horizontal" ui:StackPanelHelper.ChildSpace="10"> |
| | | <Button x:Name="editBtn" Style="{StaticResource RowLink}" |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Code}" Header="编号" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Name}" Header="名称" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Type}" Header="类型" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Value}" Header="DI值" /> |
| | | <!--<DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <StackPanel Orientation="Horizontal"> |
| | | <Button x:Name="editBtn" Style="{StaticResource RowLink}" |
| | | Margin="0,0,10,0" |
| | | Click="Button_Click" |
| | | DataContext="{Binding }">编辑</Button> |
| | | <Button x:Name="delBtn" Style="{StaticResource DangerLinkButton}" |
| | | <Button x:Name="delBtn" Style="{StaticResource DangerLinkButton}" |
| | | DataContext="{Binding }" |
| | | Click="Button_Click">删除</Button> |
| | | </StackPanel> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | </DataGrid.Columns> |
| | | </DataGrid> |
| | | </StackPanel> |
| | | </Border> |
| | | </Grid> |
| | | </StackPanel> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn>--> |
| | | </DataGrid.Columns> |
| | | </DataGrid> |
| | | </Grid> |
| | | |
| | | |
| | | </Border> |
| | | |
| | | <Border Grid.Row="1" Grid.Column="1" Style="{StaticResource CardBoarder}" Padding="0"> |
| | | <Grid dp:GridHelper.Space="10"> |
| | | <Grid.ColumnDefinitions> |
| | | <ColumnDefinition Width="Auto"/> |
| | | <ColumnDefinition /> |
| | | <ColumnDefinition Width="Auto"/> |
| | | <ColumnDefinition Width="Auto"/> |
| | | </Grid.ColumnDefinitions> |
| | | <Grid.RowDefinitions> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition Height="Auto"/> |
| | | <RowDefinition/> |
| | | </Grid.RowDefinitions> |
| | | |
| | | <Label Grid.Row="0" Grid.Column="0" Content="DO名称" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="0" Grid.Column="1" x:Name="doName" |
| | | IsEditable="True" Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="2" |
| | | x:Name="doSelect" Click="Button_Click">DO查询</Button> |
| | | <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="3" |
| | | x:Name="doReset" Click="Button_Click" |
| | | >DO重置</Button> |
| | | |
| | | <Label Grid.Row="1" Grid.Column="0" Content="DO编号" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="1" Grid.Column="1" x:Name="doCode" |
| | | IsEditable="True" Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <Label Grid.Row="2" Grid.Column="0" Content="DO分组" |
| | | FontSize="{StaticResource TitleFontSize}"/> |
| | | <ComboBox Grid.Row="2" Grid.Column="1" x:Name="doGroup" |
| | | IsEditable="True" Style="{StaticResource FormComboxStyle}"/> |
| | | |
| | | <DataGrid Grid.Row="3" Grid.ColumnSpan="4" x:Name="doTable" Style="{StaticResource DefaultDataGrid}" |
| | | ItemsSource="{Binding Source={StaticResource dosFilter}}"> |
| | | <DataGrid.RowStyle> |
| | | <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}"> |
| | | <Style.Triggers> |
| | | <DataTrigger Binding="{Binding Value}" Value="True"> |
| | | <Setter Property="Background" Value="{StaticResource DangerColor}"/> |
| | | <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/> |
| | | </DataTrigger> |
| | | </Style.Triggers> |
| | | </Style> |
| | | </DataGrid.RowStyle> |
| | | <DataGrid.Columns> |
| | | <!--<DataGridTemplateColumn Header="" Width="Auto" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <CheckBox VerticalAlignment="Center" IsChecked="{Binding Selected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn>--> |
| | | <DataGridTemplateColumn Header="#" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <TextBlock Text="{Binding Converter={StaticResource rowNumber}, |
| | | RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Code}" Header="编号" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Name}" Header="名称" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Type}" Header="类型" /> |
| | | <DataGridTextColumn Width="*" Binding="{Binding Value}" Header="DO值" /> |
| | | <!--<DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" CanUserResize="False"> |
| | | <DataGridTemplateColumn.CellTemplate> |
| | | <DataTemplate> |
| | | <StackPanel Orientation="Horizontal"> |
| | | <Button x:Name="editBtn" Style="{StaticResource RowLink}" |
| | | Margin="0,0,10,0" |
| | | Click="Button_Click" |
| | | DataContext="{Binding }">编辑</Button> |
| | | <Button x:Name="delBtn" Style="{StaticResource DangerLinkButton}" |
| | | DataContext="{Binding }" |
| | | Click="Button_Click">删除</Button> |
| | | </StackPanel> |
| | | </DataTemplate> |
| | | </DataGridTemplateColumn.CellTemplate> |
| | | </DataGridTemplateColumn>--> |
| | | </DataGrid.Columns> |
| | | </DataGrid> |
| | | </Grid> |
| | | </Border> |
| | | </Grid> |
| | | </Border> |
| | | </hb:PluginControl> |