From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;

---
 HMI.MenuManage/Modal/RoleModal.xaml |   49 +++++++++++++++++--------------------------------
 1 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/HMI.MenuManage/Modal/RoleModal.xaml b/HMI.MenuManage/Modal/RoleModal.xaml
index 734f03e..da5371d 100644
--- a/HMI.MenuManage/Modal/RoleModal.xaml
+++ b/HMI.MenuManage/Modal/RoleModal.xaml
@@ -6,49 +6,34 @@
             xmlns:local="clr-namespace:HMI.MenuManage"
             xmlns:pw="https://opensource.panuon.com/wpf"
             xmlns:pu="https://opensource.panuon.com/wpf-ui"
+            xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
             mc:Ignorable="d"
             Title="Form"
-            SizeToContent="Height"
             Width="600"
+            Height="800"
             WindowStartupLocation="CenterOwner"
-            BorderBrush="#3E3E45"
-            BorderThickness="1"
-            Foreground="Black"
-            pu:WindowXCaption.Background="{StaticResource MainBorder}"
-            pu:WindowXCaption.Foreground="#FFF"
-            pu:WindowXCaption.Buttons="Close"
-            pu:WindowXModalDialog.Buttons="OKCancel"
-            pu:WindowXModalDialog.CancelButtonContent="鍙栨秷"
-            pu:WindowXModalDialog.OKButtonContent="淇濆瓨"
-            pu:WindowXModalDialog.ButtonStyle="{StaticResource ModalButton}"
-            pu:WindowXModalDialog.ButtonPanelMargin="0,30,10,10">
-    <Window.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <pu:StyleDictionary Includes="TextBox,ComboBox,Button" />
-                <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
-                <ResourceDictionary Source="/HMI.UI;component/Style/Colors.xaml"/>
-                <ResourceDictionary Source="/HMI.UI;component/Style/FormStyle.xaml"/>
-                <ResourceDictionary Source="/HMI.UI;component/Style/PanuonResource.xaml"/>
-            </ResourceDictionary.MergedDictionaries>
-        </ResourceDictionary>
-    </Window.Resources>
-
+            Style="{StaticResource ModalWindow}">
     <Grid Margin="10">
-        <StackPanel>
-            <pu:FormGroup x:Name="FgCode" Style="{StaticResource RequiredInputFormGroupStyle}" 
-              Header="瑙掕壊缂栧彿" GroupName="MyFormGroup">
+        <StackPanel x:Name="formPanel">
+            <pu:FormGroup x:Name="FgCode" Style="{StaticResource InputFormGroupStyle}" 
+              Header="{DynamicResource HMI.Role.Code}"
+                          dp:FormGroupHelper.IsRequired="True"
+                          dp:FormGroupHelper.ValidateMethod="ValidateCode"
+                          GroupName="MyFormGroup">
                 <TextBox x:Name="TbCode" Style="{StaticResource EditorTextBoxStyle}" />
             </pu:FormGroup>
 
-            <pu:FormGroup x:Name="FgName" Style="{StaticResource RequiredInputFormGroupStyle}" 
-                              Header="瑙掕壊鍚嶇О" GroupName="MyFormGroup">
+            <pu:FormGroup x:Name="FgName" Style="{StaticResource InputFormGroupStyle}" 
+                              Header="{DynamicResource HMI.Role.Name}"
+            dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                 <TextBox x:Name="TbName" Style="{StaticResource EditorTextBoxStyle}" />
             </pu:FormGroup>
-            
+
             <pu:FormGroup x:Name="FgMenu" Orientation="Vertical" Style="{StaticResource RequiredInputFormGroupStyle}" 
-                              Header="鏉冮檺" GroupName="MyFormGroup">
-                <TreeView x:Name="menuTree" Grid.Column="1" Style="{StaticResource DefaultTreeView}" 
+                              Header="{DynamicResource HMI.Role.Permission}" GroupName="MyFormGroup">
+                <TreeView x:Name="menuTree" Grid.Column="1" Style="{StaticResource DefaultTreeView}"
+                          
+                          MaxHeight="550"
                           ItemsSource="{Binding TreeDataSource}">
                     <TreeView.ItemTemplate>
                         <HierarchicalDataTemplate ItemsSource="{Binding Children}">

--
Gitblit v1.9.1