Files
qhmes/yy-admin-master/YY.Admin/Views/SysManage/CategoryDictionaryManagementView.xaml

112 lines
6.1 KiB
XML

<UserControl x:Class="YY.Admin.Views.SysManage.CategoryDictionaryManagementView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:components="clr-namespace:YY.Admin.Views.Control"
mc:Ignorable="d">
<Grid Style="{StaticResource BaseViewStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" CornerRadius="4" Margin="0 0 -10 0">
<hc:Row>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox
Text="{Binding Input.Code, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Placeholder="请输入分类编码"
hc:InfoElement.Title="分类编码"
hc:InfoElement.TitleWidth="70"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0 0 10 10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox
Text="{Binding Input.Name, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Placeholder="请输入分类名称"
hc:InfoElement.Title="分类名称"
hc:InfoElement.TitleWidth="70"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0 0 10 10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox
Text="{Binding Input.Pid, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Placeholder="请输入父级ID"
hc:InfoElement.Title="父级ID"
hc:InfoElement.TitleWidth="70"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0 0 10 10"/>
</hc:Col>
</hc:Row>
</Border>
<Border Grid.Row="1" Margin="0,10">
<hc:UniformSpacingPanel Spacing="10">
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding SearchCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Search"/>
<TextBlock Text="搜索" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonDefault}" Command="{Binding ResetCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Refresh"/>
<TextBlock Text="重置" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
</hc:UniformSpacingPanel>
</Border>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="#FFEDEDED" BorderThickness="1" CornerRadius="4" Padding="8">
<TreeView x:Name="CategoryTreeView"
ItemsSource="{Binding TreeNodes}"
SelectedItemChanged="CategoryTreeView_SelectedItemChanged">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayName}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Border>
<DataGrid
Grid.Column="2"
AutoGenerateColumns="False"
HeadersVisibility="All"
ItemsSource="{Binding PaginationDataGridViewModel.Data}"
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
Style="{StaticResource CusDataGridStyle}">
<DataGrid.Columns>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Code}" Header="分类编码" Width="200" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Name}" Header="分类名称" Width="200" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Pid}" Header="父级ID" Width="220" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding HasChild}" Header="有子级" Width="80" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding CreateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" Header="创建时间" Width="170" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding UpdateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" Header="更新时间" Width="170" CellStyle="{StaticResource CusDataGridCellStyle}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<components:PaginationDataGridControl Grid.Row="3" DataContext="{Binding PaginationDataGridViewModel}"/>
</Grid>
</UserControl>