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

212 lines
14 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl x:Class="YY.Admin.Views.SysManage.MenuManagementView"
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:prism="http://prismlibrary.com/"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="980"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid Style="{StaticResource BaseViewStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Margin="0,0,0,10">
<hc:UniformSpacingPanel Spacing="10">
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding RefreshCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Refresh"/>
<TextBlock Text="刷新" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonSuccess}" Command="{Binding AddRootCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="FolderPlusOutline"/>
<TextBlock Text="新增根目录" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonSuccess}" Command="{Binding AddChildCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="FileTreeOutline"/>
<TextBlock Text="新增子级" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding SaveCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="ContentSaveOutline"/>
<TextBlock Text="保存" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonDanger}" Command="{Binding DeleteCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="DeleteOutline"/>
<TextBlock Text="删除" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
</hc:UniformSpacingPanel>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" MinWidth="240"/>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="4">
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Top" Margin="4,0,4,8" Text="菜单树(点击选中后在右侧编辑)" TextWrapping="Wrap" Opacity="0.85"/>
<ListBox ItemsSource="{Binding FlatRows}"
SelectedItem="{Binding SelectedRow, Mode=TwoWay}"
DisplayMemberPath="IndentTitle"
VirtualizingStackPanel.IsVirtualizing="True"/>
</DockPanel>
</Border>
<GridSplitter Grid.Column="1" Width="12" HorizontalAlignment="Stretch" Background="Transparent"/>
<ScrollViewer Grid.Column="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel>
<TextBlock Text="编辑区" FontWeight="SemiBold" Margin="0,0,0,8"/>
<TextBlock TextWrapping="Wrap" Margin="0,0,0,12" Opacity="0.75"
Text="桌面端左侧导航依赖「路径 / 组件 / 路由名」与 MenuTreeViewModel 中的路由映射。新增业务页时,请将「组件」填写为已在 Prism 中 RegisterForNavigation 的视图名(如 VehicleListView。"/>
<Border CornerRadius="4" Padding="8"
Visibility="{Binding HasEditor, Converter={StaticResource Boolean2VisibilityConverter}}">
<hc:Row DataContext="{Binding Editor}">
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:TextBox Text="{Binding Title, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="菜单名称"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:ComboBox ItemsSource="{Binding DataContext.ParentOptions, RelativeSource={RelativeSource AncestorType=UserControl}}"
DisplayMemberPath="Value"
SelectedValuePath="Key"
SelectedValue="{Binding Pid, Mode=TwoWay}"
hc:InfoElement.Title="父级"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:ComboBox ItemsSource="{Binding DataContext.MenuTypeList, RelativeSource={RelativeSource AncestorType=UserControl}}"
DisplayMemberPath="Key"
SelectedValuePath="Value"
SelectedValue="{Binding Type, Converter={StaticResource EnumToIntConverter}, ConverterParameter={x:Type core:MenuTypeEnum}}"
hc:InfoElement.Title="类型"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:ComboBox ItemsSource="{Binding DataContext.StatusList, RelativeSource={RelativeSource AncestorType=UserControl}}"
DisplayMemberPath="Key"
SelectedValuePath="Value"
SelectedValue="{Binding Status, Converter={StaticResource EnumToIntConverter}, ConverterParameter={x:Type core:StatusEnum}}"
hc:InfoElement.Title="状态"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:TextBox Text="{Binding OrderNo, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="排序号"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="路由名称"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:TextBox Text="{Binding Path, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="路径"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:TextBox Text="{Binding Component, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="组件/视图名"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:TextBox Text="{Binding Icon, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="图标"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:TextBox Text="{Binding Permission, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="权限标识"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:TextBox Text="{Binding Redirect, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="重定向"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:TextBox Text="{Binding Remark, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="备注"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:TextBox Text="{Binding OutLink, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="外链"
hc:InfoElement.TitleWidth="88"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.ShowClearButton="True"
Margin="0,0,0,10"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=4, Lg=4, Xl=4}">
<CheckBox Content="内嵌 IFrame" IsChecked="{Binding IsIframe}" Margin="0,6,0,0"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=4, Lg=4, Xl=4}">
<CheckBox Content="隐藏菜单" IsChecked="{Binding IsHide}" Margin="0,6,0,0"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=4, Lg=4, Xl=4}">
<CheckBox Content="固定页签" IsChecked="{Binding IsAffix}" Margin="0,6,0,0"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=4, Lg=4, Xl=4}">
<CheckBox Content="缓存页面" IsChecked="{Binding IsKeepAlive}" Margin="0,6,0,0"/>
</hc:Col>
</hc:Row>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>