更新项目配置,新增设备同步模块,优化WebSocket和Swagger配置,增强SCADA系统的免登录接口,支持数据字典项和登录日志的免登录查询与记录。调整Java编译设置,确保更好的开发体验。
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
<UserControl x:Class="YY.Admin.Views.SysManage.DataDictionaryManagementView"
|
||||
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:core="clr-namespace:YY.Admin.Core;assembly=YY.Admin.Core"
|
||||
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.DictCode, 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.DictName, 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.ItemText, 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.ItemValue, 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:ComboBox
|
||||
SelectedValue="{Binding Input.Status, Converter={StaticResource EnumToIntConverter}, ConverterParameter={x:Type core:StatusEnum}}"
|
||||
ItemsSource="{Binding StatusList}"
|
||||
DisplayMemberPath="Key"
|
||||
SelectedValuePath="Value"
|
||||
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: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>
|
||||
<Button Style="{StaticResource ButtonSuccess}" Command="{Binding SyncCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="CloudSyncOutline"/>
|
||||
<TextBlock Text="同步数据字典" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="2"
|
||||
AutoGenerateColumns="False"
|
||||
HeadersVisibility="All"
|
||||
ItemsSource="{Binding PaginationDataGridViewModel.Data}"
|
||||
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
|
||||
Style="{StaticResource CusDataGridStyle}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding DictCode}" Header="字典编码" Width="150" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding DictName}" Header="字典名称" Width="170" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding ItemText}" Header="字典项文本" Width="170" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding ItemValue}" Header="字典项值" Width="140" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding ItemDescription}" Header="描述" Width="220" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding SortOrder}" Header="排序" Width="80" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Status, Converter={StaticResource EnumDescriptionConverter}}" 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>
|
||||
|
||||
<components:PaginationDataGridControl Grid.Row="3" DataContext="{Binding PaginationDataGridViewModel}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace YY.Admin.Views.SysManage
|
||||
{
|
||||
/// <summary>
|
||||
/// DataDictionaryManagementView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DataDictionaryManagementView : UserControl
|
||||
{
|
||||
public DataDictionaryManagementView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="YY.Admin.Views.SysManage.RoleManagementView"
|
||||
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:local="clr-namespace:YY.Admin.Views.SysManage"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Style="{StaticResource BaseViewStyle}">
|
||||
<Button Content="AlertDialogView" x:Name="AlertDialogView" Command="{Binding AlertDialogCommand}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace YY.Admin.Views.SysManage
|
||||
{
|
||||
/// <summary>
|
||||
/// RoleManagementView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RoleManagementView : UserControl
|
||||
{
|
||||
|
||||
public RoleManagementView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<UserControl x:Class="YY.Admin.Views.SysManage.TenantManagementView"
|
||||
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:core="clr-namespace:YY.Admin.Core;assembly=YY.Admin.Core"
|
||||
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.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:ComboBox
|
||||
SelectedValue="{Binding Input.Status, Converter={StaticResource EnumToIntConverter}, ConverterParameter={x:Type core:StatusEnum}}"
|
||||
ItemsSource="{Binding StatusList}"
|
||||
DisplayMemberPath="Key"
|
||||
SelectedValuePath="Value"
|
||||
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: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>
|
||||
<Button Style="{StaticResource ButtonSuccess}" Command="{Binding SyncCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="CloudSyncOutline"/>
|
||||
<TextBlock Text="从Jeecg同步" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="2"
|
||||
AutoGenerateColumns="False"
|
||||
HeadersVisibility="All"
|
||||
ItemsSource="{Binding PaginationDataGridViewModel.Data}"
|
||||
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
|
||||
Style="{StaticResource CusDataGridStyle}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Id}" Header="租户ID" Width="130" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Title}" Header="租户名称" Width="220" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Status, Converter={StaticResource EnumDescriptionConverter}}" Header="状态" Width="100" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Logo}" Header="Logo" Width="280" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding CreateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" Header="创建时间" Width="180" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding UpdateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" Header="更新时间" Width="180" CellStyle="{StaticResource CusDataGridCellStyle}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<components:PaginationDataGridControl Grid.Row="3" DataContext="{Binding PaginationDataGridViewModel}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace YY.Admin.Views.SysManage
|
||||
{
|
||||
/// <summary>
|
||||
/// TenantManagementView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TenantManagementView : UserControl
|
||||
{
|
||||
public TenantManagementView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
185
yy-admin-master/YY.Admin/Views/SysManage/UserEditDialogView.xaml
Normal file
185
yy-admin-master/YY.Admin/Views/SysManage/UserEditDialogView.xaml
Normal file
@@ -0,0 +1,185 @@
|
||||
<UserControl x:Class="YY.Admin.Views.SysManage.UserEditDialogView"
|
||||
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:local="clr-namespace:YY.Admin.Views.SysManage"
|
||||
xmlns:core="clr-namespace:YY.Admin.Core;assembly=YY.Admin.Core"
|
||||
xmlns:corefv="clr-namespace:YY.Admin.Core.FluentValidation;assembly=YY.Admin.Core"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d"
|
||||
Width="650"
|
||||
MinHeight="300">
|
||||
|
||||
<Grid Background="{DynamicResource ThirdlyRegionBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<hc:SimplePanel Margin="20">
|
||||
<TextBlock FontSize="18" Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding DialogTitle}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||
</hc:SimplePanel>
|
||||
|
||||
<hc:ScrollViewer Grid.Row="1" IsInertiaEnabled="True">
|
||||
<StackPanel x:Name="RootPanel" Margin="20 0 20 0">
|
||||
<hc:Row Gutter="10">
|
||||
<hc:Col Span="12" Visibility="{Binding IsAddMode, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<hc:TextBox
|
||||
Text="{Binding SysUser.Account, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
Margin="0,0,0,20"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入账号"
|
||||
hc:InfoElement.Title="账号"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
hc:IsEnabled="{Binding IsAddMode}"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12" Visibility="{Binding IsAddMode, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<hc:PasswordBox
|
||||
UnsafePassword="{Binding SysUser.Password, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsSafeEnabled="False"
|
||||
Margin="0,0,0,20"
|
||||
ShowEyeButton="True"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入密码"
|
||||
hc:InfoElement.Title="密码"
|
||||
hc:IsEnabled="{Binding IsAddMode}"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox
|
||||
Text="{Binding SysUser.RealName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
Margin="0,0,0,20"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
Validation.ErrorTemplate="{StaticResource BottomLeftErrorTemplate_ForInfoElement}"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
corefv:FluentValidationHelper.SkipValidation="False"
|
||||
hc:InfoElement.Placeholder="请输入姓名"
|
||||
hc:InfoElement.Title="姓名"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<hc:TextBox
|
||||
Text="{Binding SysUser.NickName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
Margin="0,0,0,20"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入昵称"
|
||||
hc:InfoElement.Title="昵称"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<hc:ComboBox
|
||||
SelectedItem="{Binding SysUser.Sex}"
|
||||
Margin="0 0 0 20"
|
||||
ItemsSource="{Binding GenderList}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请选择性别"
|
||||
hc:InfoElement.Title="性别">
|
||||
<hc:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}"/>
|
||||
</DataTemplate>
|
||||
</hc:ComboBox.ItemTemplate>
|
||||
</hc:ComboBox>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<hc:DatePicker
|
||||
SelectedDate="{Binding SysUser.Birthday}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请选择出生日期"
|
||||
hc:InfoElement.Title="出生日期"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0 0 0 20"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<hc:NumericUpDown
|
||||
Value="{Binding SysUser.Age}"
|
||||
Minimum="0"
|
||||
Maximum="150"
|
||||
Style="{StaticResource NumericUpDownPlus}"
|
||||
hc:InfoElement.TitleWidth="70"
|
||||
hc:InfoElement.Necessary="True"
|
||||
hc:InfoElement.Symbol="*"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.Placeholder="请输入年龄"
|
||||
hc:InfoElement.Title="年龄"
|
||||
Margin="0 0 0 20"/>
|
||||
</hc:Col>
|
||||
<hc:Col Span="12">
|
||||
<Grid Margin="0,0,0,20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="70" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock Text="状态" VerticalAlignment="Center" />
|
||||
<!--<TextBlock Text="*" Foreground="Red" Margin="6,0,0,0" VerticalAlignment="Center"/>-->
|
||||
</StackPanel>
|
||||
<ItemsControl Grid.Column="1" ItemsSource="{Binding StatusOptions}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton
|
||||
Margin="0,0,15,0"
|
||||
GroupName="StatusGroup"
|
||||
Tag="{Binding}"
|
||||
Content="{Binding Converter={StaticResource EnumDescriptionConverter}}"
|
||||
Command="{Binding DataContext.StatusSelectedCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
CommandParameter="{Binding}">
|
||||
<RadioButton.IsChecked>
|
||||
<MultiBinding Converter="{StaticResource RadioButtonEnumMultiConverter}">
|
||||
<!-- 当前选项 -->
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Self}"/>
|
||||
<!-- SysUser.Status -->
|
||||
<Binding Path="DataContext.SysUser.Status" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
|
||||
</MultiBinding>
|
||||
</RadioButton.IsChecked>
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</hc:Col>
|
||||
</hc:Row>
|
||||
</StackPanel>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
<!-- 按钮区域 -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="20">
|
||||
<Button Content="取消"
|
||||
Command="{Binding CancelCommand}"
|
||||
Style="{StaticResource ButtonDefault}"
|
||||
Margin="0,0,15,0"
|
||||
Width="100"/>
|
||||
|
||||
<Button Content="确定"
|
||||
Click="Submit_Click"
|
||||
Style="{StaticResource ButtonPrimary}"
|
||||
Width="100"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using YY.Admin.Core.FluentValidation;
|
||||
using YY.Admin.ViewModels.SysManage;
|
||||
|
||||
namespace YY.Admin.Views.SysManage
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UserEditDialog.xaml
|
||||
/// </summary>
|
||||
public partial class UserEditDialogView : UserControl
|
||||
{
|
||||
public UserEditDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
FluentValidationHelper.Attach(RootPanel, typeof(UserEditDialogViewModel));
|
||||
}
|
||||
|
||||
private void Submit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = (UserEditDialogViewModel)DataContext;
|
||||
bool valid = FluentValidationHelper.ValidateAll(RootPanel, vm.SysUser!, vm.SysUserValidator);
|
||||
if (valid)
|
||||
{
|
||||
_ = vm.SaveUserAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
258
yy-admin-master/YY.Admin/Views/SysManage/UserManagementView.xaml
Normal file
258
yy-admin-master/YY.Admin/Views/SysManage/UserManagementView.xaml
Normal file
@@ -0,0 +1,258 @@
|
||||
<UserControl x:Class="YY.Admin.Views.SysManage.UserManagementView"
|
||||
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:local="clr-namespace:YY.Admin.Views.SysManage"
|
||||
xmlns:core="clr-namespace:YY.Admin.Core;assembly=YY.Admin.Core"
|
||||
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 UserInput.Account, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Placeholder="请输入账号"
|
||||
hc:InfoElement.Title="账号"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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 UserInput.RealName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Placeholder="请输入姓名"
|
||||
hc:InfoElement.Title="姓名"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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 UserInput.NickName, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Placeholder="请输入昵称"
|
||||
hc:InfoElement.Title="昵称"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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:ComboBox
|
||||
SelectedValue="{Binding UserInput.Sex}"
|
||||
ItemsSource="{Binding GenderList}"
|
||||
hc:InfoElement.Placeholder="请选择性别"
|
||||
hc:InfoElement.Title="性别"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
hc:InfoElement.TitlePlacement="Left"
|
||||
hc:InfoElement.ShowClearButton="True"
|
||||
Margin="0 0 10 10">
|
||||
<hc:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
</DataTemplate>
|
||||
</hc:ComboBox.ItemTemplate>
|
||||
</hc:ComboBox>
|
||||
</hc:Col>
|
||||
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
|
||||
<hc:TextBox
|
||||
Text="{Binding UserInput.Phone, UpdateSourceTrigger=PropertyChanged}"
|
||||
hc:InfoElement.Placeholder="请输入手机号码"
|
||||
hc:InfoElement.Title="手机号码"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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:ComboBox
|
||||
SelectedValue="{Binding UserInput.Status, Converter={StaticResource EnumToIntConverter}, ConverterParameter={x:Type core:StatusEnum}}"
|
||||
ItemsSource="{Binding StatusList}"
|
||||
DisplayMemberPath="Key"
|
||||
SelectedValuePath="Value"
|
||||
hc:InfoElement.Placeholder="请选择状态"
|
||||
hc:InfoElement.Title="状态"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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:DateTimePicker
|
||||
x:Name="BeginTimePicker"
|
||||
Style="{StaticResource DateTimePickerPlus}"
|
||||
SelectedDateTime="{Binding UserInput.BeginTime}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
hc:InfoElement.Title="创建时间"
|
||||
hc:InfoElement.Placeholder="开始时间"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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:DateTimePicker
|
||||
x:Name="EndTimePicker"
|
||||
Style="{StaticResource DateTimePickerPlus}"
|
||||
SelectedDateTime="{Binding UserInput.EndTime}"
|
||||
DateTimeFormat="yyyy-MM-dd HH:mm:ss"
|
||||
hc:InfoElement.Title="至"
|
||||
hc:InfoElement.Placeholder="结束时间"
|
||||
hc:InfoElement.TitleWidth="65"
|
||||
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}"
|
||||
Click="ResetButton_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="Refresh"/>
|
||||
<TextBlock Text="重置" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
Command="{Binding AddCommand}"
|
||||
Style="{StaticResource ButtonSuccess}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="Plus"/>
|
||||
<TextBlock Text="新增" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
IsEnabled="{Binding HasSelectedItems}"
|
||||
Command="{Binding BatchDeleteCommand}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="TrashCanOutline"/>
|
||||
<TextBlock Text="删除" Style="{StaticResource IconButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</hc:UniformSpacingPanel>
|
||||
</Border>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="2"
|
||||
RowHeaderWidth="55"
|
||||
AutoGenerateColumns="False"
|
||||
HeadersVisibility="All"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow"
|
||||
ItemsSource="{Binding PaginationDataGridViewModel.Data}"
|
||||
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
|
||||
Style="{StaticResource CusDataGridStyle}"
|
||||
hc:DataGridAttach.ShowSelectAllButton="True"
|
||||
SelectionChanged="DataGrid_SelectionChanged">
|
||||
|
||||
<!-- 同步行选择和数据选择 -->
|
||||
<DataGrid.ItemContainerStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
|
||||
</Style>
|
||||
</DataGrid.ItemContainerStyle>
|
||||
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Account}" Header="账号" CellStyle="{StaticResource CusDataGridCellStyle}" Width="100"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding RealName}" Header="姓名" CellStyle="{StaticResource CusDataGridCellStyle}" Width="100"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding NickName}" Header="昵称" CellStyle="{StaticResource CusDataGridCellStyle}" Width="120"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Phone}" Header="手机号码" CellStyle="{StaticResource CusDataGridCellStyle}" Width="120"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Birthday, StringFormat='yyyy-MM-dd'}" Header="出生日期" CellStyle="{StaticResource CusDataGridCellStyle}" Width="120"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding Sex, Converter={StaticResource EnumDescriptionConverter}}" Header="性别" CellStyle="{StaticResource CusDataGridCellStyle}" Width="100"/>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding AccountType, Converter={StaticResource EnumDescriptionConverter}}" Header="用户类型" CellStyle="{StaticResource CusDataGridCellStyle}" Width="100"/>
|
||||
<DataGridTemplateColumn Header="状态" Width="80" CellStyle="{StaticResource CusDataGridCellStyle}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ToggleButton
|
||||
Command="{Binding DataContext.StatusToggleCommand,
|
||||
RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding}"
|
||||
IsChecked="{Binding Status, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter=Enable}"
|
||||
Cursor="Hand"
|
||||
Style="{StaticResource ToggleButtonSwitch}"
|
||||
hc:VisualElement.HighlightBrush="{DynamicResource PrimaryBrush}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Binding="{Binding CreateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" Header="创建时间" CellStyle="{StaticResource CusDataGridCellStyle}" Width="180"/>
|
||||
<!-- 操作列 -->
|
||||
<DataGridTemplateColumn Header="操作" Width="150" CellStyle="{StaticResource CusOperDataGridCellStyle}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<hc:UniformSpacingPanel Spacing="5">
|
||||
<!-- 修改 -->
|
||||
<Border Style="{DynamicResource DataGridOpeButtonStyle}">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding
|
||||
Command="{Binding DataContext.EditCommand,
|
||||
RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding}"
|
||||
MouseAction="LeftClick"/>
|
||||
</Border.InputBindings>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="SquareEditOutline" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="修改" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 删除 -->
|
||||
<Border Style="{DynamicResource DataGridOpeButtonStyle}">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding
|
||||
Command="{Binding DataContext.DeleteCommand,
|
||||
RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
CommandParameter="{Binding Id}"
|
||||
MouseAction="LeftClick"/>
|
||||
</Border.InputBindings>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<md:PackIcon Kind="TrashCanOutline" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="删除" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</hc:UniformSpacingPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<components:PaginationDataGridControl Grid.Row="3" DataContext="{Binding PaginationDataGridViewModel}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using YY.Admin.Services.Service;
|
||||
using YY.Admin.ViewModels.SysManage;
|
||||
|
||||
namespace YY.Admin.Views.SysManage
|
||||
{
|
||||
/// <summary>
|
||||
/// UserManagementView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UserManagementView : UserControl
|
||||
{
|
||||
public UserManagementView()
|
||||
{
|
||||
InitializeComponent();
|
||||
//this.Loaded += UserManagementView_Loaded;
|
||||
}
|
||||
|
||||
//private void UserManagementView_Loaded(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// if (DataContext is UserManagementViewModel viewModel)
|
||||
// {
|
||||
// Task.Run(viewModel.PaginationDataGridViewModel.LoadData);
|
||||
// }
|
||||
|
||||
// // 记得取消事件订阅,避免重复执行
|
||||
// this.Loaded -= UserManagementView_Loaded;
|
||||
//}
|
||||
|
||||
// 在 Window 或 UserControl 的代码后台
|
||||
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is DataGrid dataGrid && dataGrid.DataContext is UserManagementViewModel viewModel)
|
||||
{
|
||||
// 获取所有新增选中的项
|
||||
foreach (var addedItem in e.AddedItems)
|
||||
{
|
||||
if (addedItem is UserOutput user)
|
||||
{
|
||||
user.IsSelected = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有取消选中的项
|
||||
foreach (var removedItem in e.RemovedItems)
|
||||
{
|
||||
if (removedItem is UserOutput user)
|
||||
{
|
||||
user.IsSelected = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 通知 ViewModel 更新状态
|
||||
viewModel.UpdateSelectionState();
|
||||
}
|
||||
}
|
||||
|
||||
private async void ResetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 手动清除 DateTimePicker
|
||||
// TO-DO HC DateTimePicker控件存在Bug,这里需要显示地清除,Bug已修复已提交PR
|
||||
//BeginTimePicker.Text = string.Empty;
|
||||
//EndTimePicker.Text = string.Empty;
|
||||
|
||||
// 通过反射获取内部 TextBox
|
||||
//var searchTextBoxField = typeof(AutoCompleteTextBox).GetField("_searchTextBox",
|
||||
// System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
|
||||
//if (searchTextBoxField?.GetValue(AutoCompleteTextBox) is System.Windows.Controls.TextBox textBox)
|
||||
//{
|
||||
// // 直接清空内部 TextBox
|
||||
// textBox.Text = string.Empty;
|
||||
//}
|
||||
|
||||
//// 清空其他状态
|
||||
//AutoCompleteTextBox.SelectedItem = null;
|
||||
//AutoCompleteTextBox.SelectedIndex = -1;
|
||||
|
||||
|
||||
// 调用 ViewModel 的重置方法
|
||||
if (DataContext is UserManagementViewModel viewModel)
|
||||
{
|
||||
await viewModel.ResetFormAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user