WinPermission.xaml
7.85 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
<Window
x:Class="HHECS.View.UserOperation.WinPermission"
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.UserOperation"
xmlns:model="clr-namespace:HHECS.Model.Entities;assembly=HHWCS.Model"
xmlns:controls="clr-namespace:HHECS.Model.Controls;assembly=HHWCS.Model"
mc:Ignorable="d"
Title="菜单与权限" Height="450" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Width" Value="80"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="9.4,0,0,0"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="23,0,0,0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
</Window.Resources>
<DockPanel>
<ToolBar DockPanel.Dock="Top">
<Button Tag="permission:add" x:Name="BtnNew" Click="Button_Click">新增</Button>
<Button Tag="permission:delete" x:Name="BtnDelete" Click="BtnDelete_Click">删除</Button>
<!--<Button x:Name="BtnEdit" Click="BtnEdit_Click">编辑</Button>-->
<Button Tag="permission:update" x:Name="BtnUpdate" Click="BtnUpdate_Click" Content="刷新"/>
</ToolBar>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="5*" ></ColumnDefinition>
</Grid.ColumnDefinitions>
<TreeView x:Name="treeMain" Grid.Column="0" TreeViewItem.Selected="treeMain_Selected">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate DataType="{x:Type model:MenuOperation}" ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Source="{Binding Icon}" Width="16" Height="16" Margin="0,0,2,2"></Image>
<TextBlock VerticalAlignment="Center" Text="{Binding MenuName}"></TextBlock>
<Image VerticalAlignment="Center" Source="{Binding EditIcon}" Margin="2,0,0,0"></Image>
<StackPanel.ToolTip>
<TextBlock VerticalAlignment="Center" Text="{Binding Remark}" TextWrapping="Wrap" MaxWidth="200" ></TextBlock>
</StackPanel.ToolTip>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
<GridSplitter Width="5"/>
<Grid x:Name="GridDetail" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="父菜单:" Margin="10,16,0,0" Grid.RowSpan="2" />
<Label Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{Binding Path=ParentId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Grid.Row="1" TextWrapping="Wrap" Text="名称:" />
<TextBlock Grid.Row="1" Grid.Column="2" TextWrapping="Wrap" Text="类型:" />
<TextBlock Grid.Row="2" TextWrapping="Wrap" Text="地址:" />
<TextBlock Grid.Row="3" TextWrapping="Wrap" Text="权限:" />
<TextBlock Grid.Row="4" TextWrapping="Wrap" Text="备注:" />
<StackPanel Grid.Row="5" Grid.Column="0" Grid.RowSpan="2">
<TextBlock TextWrapping="Wrap" Text="创建人:" />
<Label Grid.Column="0" HorizontalAlignment="Center" Content="{Binding Path=CreatedBy,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" />
</StackPanel>
<StackPanel Grid.Row="5" Grid.Column="1" Grid.RowSpan="2">
<TextBlock TextWrapping="Wrap" Text="创建时间:" />
<Label HorizontalAlignment="Center" Content="{Binding Path=Created,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top"/>
</StackPanel>
<StackPanel Grid.Row="5" Grid.Column="2" Grid.RowSpan="2">
<TextBlock TextWrapping="Wrap" Text="更新人:" />
<Label HorizontalAlignment="Center" Content="{Binding Path=LastUpdatedBy,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top"/>
</StackPanel>
<StackPanel Grid.Row="5" Grid.Column="3" Grid.RowSpan="2">
<TextBlock TextWrapping="Wrap" Text="更新时间:"/>
<Label HorizontalAlignment="Center" Content="{Binding Path=LastUpdated,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top"/>
</StackPanel>
<StackPanel x:Name="SPMain" Grid.Row="7" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Orientation="Horizontal">
<Button x:Name="BtnSave" Margin="5" Content="保存" Grid.Column="2" HorizontalAlignment="Left" Width="75" Click="BtnSave_Click" Tag="permission:save"/>
<Button x:Name="BtnCancel" Content="取消" Grid.Column="3" HorizontalAlignment="Left" Width="75" Click="BtnCancel_Click" Tag="permission:close"/>
</StackPanel>
<TextBox x:Name="TxtName" Grid.Row="1" Grid.Column="1" Text="{Binding Path=MenuName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox x:Name="CBType" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" SelectedValue="{Binding Path=MenuType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<TextBox x:Name="TxtUrl" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Width="280" Text="{Binding Path=Url,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBox x:Name="TxtPermission" Grid.Row="3" Grid.Column="1" Text="{Binding Path=Perms,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox x:Name="TxtRemark" Grid.Row="4" Grid.Column="1" Text="{Binding Path=Remark,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Grid.Column="2" HorizontalAlignment="Left" Margin="21.6,20.2,0,0" Grid.Row="4" Text="排序:" VerticalAlignment="Top"/>
<controls:NumericBox x:Name="TxtOrderNum" VerticalAlignment="Center" Width="80" Grid.Row="4" Grid.Column="3" Text="{Binding Path=OrderNum,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</Grid>
</DockPanel>
</Window>