Quellcode durchsuchen

铻嶅悎鏍囬鏍 - MainWindow缁熶竴绠$悊鏍囬/PLC鐘舵/鏃堕挓/Tab鏍囬

纾 鏇 vor 1 Woche
Ursprung
Commit
68f88f0c44

+ 92 - 91
src/YZWater.Avalonia/Views/MainWindow.axaml

@@ -16,110 +16,111 @@
     </Window.DataContext>
 
     <DockPanel>
-        <!-- 搴曢儴瀵艰埅鏍 -->
-        <Border DockPanel.Dock="Bottom" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0" Padding="4,0">
+        <!-- 鈺愨晲鈺 缁熶竴椤堕儴鏍囬鏍 鈺愨晲鈺 -->
+        <Border DockPanel.Dock="Top" Background="{DynamicResource SurfaceBgBrush}"
+                BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1" Height="48">
+            <Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto" Margin="16,0">
+                <!-- 宸︿晶: Logo + 鏍囬 -->
+                <StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
+                    <Border Background="{DynamicResource SuccessBrush}" Width="4" Height="24" CornerRadius="2"/>
+                    <TextBlock Text="YZ WATER" FontSize="16" FontWeight="Bold"
+                               Foreground="{DynamicResource TextPrimaryBrush}" FontFamily="Consolas, monospace"
+                               VerticalAlignment="Center"/>
+                    <TextBlock Text="姹℃按澶勭悊鐩戞帶绯荤粺" FontSize="12"
+                               Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
+                </StackPanel>
+
+                <!-- Tab 鏍囬鎸囩ず -->
+                <TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"
+                           FontFamily="Consolas, monospace" FontSize="12" FontWeight="Bold"
+                           Foreground="{DynamicResource TextSecondaryBrush}"
+                           Text="{Binding TabTitle}"/>
+
+                <!-- PLC 鐘舵 + 鎿嶄綔鎸夐挳 -->
+                <StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" Margin="16,0">
+                    <Border Width="10" Height="10" CornerRadius="5"
+                            Background="{Binding IsPlcConnected, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    <TextBlock Text="PLC" FontFamily="Consolas, monospace" FontSize="10"
+                               Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
+                    <Button Content="CONNECT" Command="{Binding ConnectPlcCommand}" Classes="btn-success" Padding="8,3" FontSize="10"/>
+                    <Button Content="DISCONNECT" Command="{Binding DisconnectPlcCommand}" Classes="btn-danger" Padding="8,3" FontSize="10"/>
+                    <Button Content="REFRESH" Command="{Binding RefreshDataCommand}" Classes="btn-info" Padding="8,3" FontSize="10"/>
+                </StackPanel>
+
+                <!-- 鏃堕挓 -->
+                <StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" Margin="16,0">
+                    <Border Background="{DynamicResource BorderBrush}" Width="1" Height="24"/>
+                    <TextBlock Text="{Binding CurrentTime, StringFormat='{}{0:HH:mm:ss}'}"
+                               FontFamily="Consolas, monospace" FontSize="16" FontWeight="Bold"
+                               Foreground="{DynamicResource SuccessBrush}"/>
+                    <TextBlock Text="{Binding CurrentTime, StringFormat='{}{0:yyyy-MM-dd}'}"
+                               FontFamily="Consolas, monospace" FontSize="10"
+                               Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Bottom" Margin="0,0,0,2"/>
+                </StackPanel>
+
+                <!-- 鐗堟湰 -->
+                <TextBlock Grid.Column="4" Text="v3.0" FontFamily="Consolas, monospace" FontSize="9"
+                           Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="12,0,0,0"/>
+            </Grid>
+        </Border>
+
+        <!-- 鈺愨晲鈺 搴曢儴瀵艰埅鏍 鈺愨晲鈺 -->
+        <Border DockPanel.Dock="Bottom" Background="{DynamicResource SurfaceBgBrush}"
+                BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0" Padding="4,0">
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="0">
-                <!-- PROCESS -->
-                <Button Command="{Binding ShowViewACommand}" Padding="20,8" BorderThickness="0">
-                    <Button.Content>
-                        <StackPanel Orientation="Horizontal" Spacing="6">
-                            <Border Width="3" Height="14" CornerRadius="1"
-                                    Background="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                            <TextBlock Text="PROCESS" FontFamily="Consolas, monospace" FontSize="11"
-                                       FontWeight="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
-                                       Foreground="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                        </StackPanel>
-                    </Button.Content>
-                    <Button.Styles>
-                        <Style Selector="Button">
-                            <Setter Property="Background" Value="Transparent"/>
-                        </Style>
-                    </Button.Styles>
+                <Button Command="{Binding ShowViewACommand}" Padding="20,8" BorderThickness="0" Background="Transparent">
+                    <StackPanel Orientation="Horizontal" Spacing="6">
+                        <Border Width="3" Height="14" CornerRadius="1"
+                                Background="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                        <TextBlock Text="PROCESS" FontFamily="Consolas, monospace" FontSize="11"
+                                   FontWeight="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
+                                   Foreground="{Binding IsTabAActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    </StackPanel>
                 </Button>
-
                 <Border Background="{DynamicResource BorderBrush}" Width="1" Height="20" VerticalAlignment="Center"/>
-
-                <!-- PARAMS -->
-                <Button Command="{Binding ShowViewBCommand}" Padding="20,8" BorderThickness="0">
-                    <Button.Content>
-                        <StackPanel Orientation="Horizontal" Spacing="6">
-                            <Border Width="3" Height="14" CornerRadius="1"
-                                    Background="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                            <TextBlock Text="PARAMS" FontFamily="Consolas, monospace" FontSize="11"
-                                       FontWeight="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
-                                       Foreground="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                        </StackPanel>
-                    </Button.Content>
-                    <Button.Styles>
-                        <Style Selector="Button">
-                            <Setter Property="Background" Value="Transparent"/>
-                        </Style>
-                    </Button.Styles>
+                <Button Command="{Binding ShowViewBCommand}" Padding="20,8" BorderThickness="0" Background="Transparent">
+                    <StackPanel Orientation="Horizontal" Spacing="6">
+                        <Border Width="3" Height="14" CornerRadius="1"
+                                Background="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                        <TextBlock Text="PARAMS" FontFamily="Consolas, monospace" FontSize="11"
+                                   FontWeight="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
+                                   Foreground="{Binding IsTabBActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    </StackPanel>
                 </Button>
-
                 <Border Background="{DynamicResource BorderBrush}" Width="1" Height="20" VerticalAlignment="Center"/>
-
-                <!-- FLOW -->
-                <Button Command="{Binding ShowViewCCommand}" Padding="20,8" BorderThickness="0">
-                    <Button.Content>
-                        <StackPanel Orientation="Horizontal" Spacing="6">
-                            <Border Width="3" Height="14" CornerRadius="1"
-                                    Background="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                            <TextBlock Text="FLOW" FontFamily="Consolas, monospace" FontSize="11"
-                                       FontWeight="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
-                                       Foreground="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                        </StackPanel>
-                    </Button.Content>
-                    <Button.Styles>
-                        <Style Selector="Button">
-                            <Setter Property="Background" Value="Transparent"/>
-                        </Style>
-                    </Button.Styles>
+                <Button Command="{Binding ShowViewCCommand}" Padding="20,8" BorderThickness="0" Background="Transparent">
+                    <StackPanel Orientation="Horizontal" Spacing="6">
+                        <Border Width="3" Height="14" CornerRadius="1"
+                                Background="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                        <TextBlock Text="FLOW" FontFamily="Consolas, monospace" FontSize="11"
+                                   FontWeight="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
+                                   Foreground="{Binding IsTabCActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    </StackPanel>
                 </Button>
-
                 <Border Background="{DynamicResource BorderBrush}" Width="1" Height="20" VerticalAlignment="Center"/>
-
-                <!-- ALARM -->
-                <Button Command="{Binding ShowViewDCommand}" Padding="20,8" BorderThickness="0">
-                    <Button.Content>
-                        <StackPanel Orientation="Horizontal" Spacing="6">
-                            <Border Width="3" Height="14" CornerRadius="1"
-                                    Background="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                            <TextBlock Text="ALARM" FontFamily="Consolas, monospace" FontSize="11"
-                                       FontWeight="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
-                                       Foreground="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                        </StackPanel>
-                    </Button.Content>
-                    <Button.Styles>
-                        <Style Selector="Button">
-                            <Setter Property="Background" Value="Transparent"/>
-                        </Style>
-                    </Button.Styles>
+                <Button Command="{Binding ShowViewDCommand}" Padding="20,8" BorderThickness="0" Background="Transparent">
+                    <StackPanel Orientation="Horizontal" Spacing="6">
+                        <Border Width="3" Height="14" CornerRadius="1"
+                                Background="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                        <TextBlock Text="ALARM" FontFamily="Consolas, monospace" FontSize="11"
+                                   FontWeight="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
+                                   Foreground="{Binding IsTabDActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    </StackPanel>
                 </Button>
-
                 <Border Background="{DynamicResource BorderBrush}" Width="1" Height="20" VerticalAlignment="Center"/>
-
-                <!-- ABOUT -->
-                <Button Command="{Binding ShowViewECommand}" Padding="20,8" BorderThickness="0">
-                    <Button.Content>
-                        <StackPanel Orientation="Horizontal" Spacing="6">
-                            <Border Width="3" Height="14" CornerRadius="1"
-                                    Background="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                            <TextBlock Text="ABOUT" FontFamily="Consolas, monospace" FontSize="11"
-                                       FontWeight="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
-                                       Foreground="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
-                        </StackPanel>
-                    </Button.Content>
-                    <Button.Styles>
-                        <Style Selector="Button">
-                            <Setter Property="Background" Value="Transparent"/>
-                        </Style>
-                    </Button.Styles>
+                <Button Command="{Binding ShowViewECommand}" Padding="20,8" BorderThickness="0" Background="Transparent">
+                    <StackPanel Orientation="Horizontal" Spacing="6">
+                        <Border Width="3" Height="14" CornerRadius="1"
+                                Background="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                        <TextBlock Text="ABOUT" FontFamily="Consolas, monospace" FontSize="11"
+                                   FontWeight="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToFontWeight}}"
+                                   Foreground="{Binding IsTabEActive, Converter={x:Static conv:BoolConverters.ToBrush}}"/>
+                    </StackPanel>
                 </Button>
             </StackPanel>
         </Border>
 
-        <!-- 涓诲唴瀹瑰尯鍩 -->
+        <!-- 鈺愨晲鈺 涓诲唴瀹瑰尯鍩 鈺愨晲鈺 -->
         <TabControl SelectedIndex="{Binding SelectedTabIndex}" Background="{DynamicResource AppBgBrush}">
             <TabItem Header="PROCESS" IsVisible="False">
                 <views:ViewAView/>

+ 4 - 46
src/YZWater.Avalonia/Views/ViewAView.axaml

@@ -9,53 +9,11 @@
         <vm:ViewAViewModel/>
     </UserControl.DataContext>
 
-    <!-- 涓嶈鍥哄畾瀹介珮锛岀敱 AdaptiveContainer 鎺у埗缂╂斁 -->
     <Border Background="{DynamicResource AppBgBrush}">
-        <Grid RowDefinitions="48,*,32">
+        <Grid RowDefinitions="*,32">
 
-            <!-- 鈺愨晲鈺 椤堕儴鏍囬鏍 鈺愨晲鈺 -->
-            <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
-                <Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto" Margin="16,0">
-                    <StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
-                        <Border Background="{DynamicResource SuccessBrush}" Width="4" Height="24" CornerRadius="2"/>
-                        <TextBlock Text="YZ WATER" FontSize="16" FontWeight="Bold"
-                                   Foreground="{DynamicResource TextPrimaryBrush}" FontFamily="Consolas, monospace"
-                                   VerticalAlignment="Center"/>
-                        <TextBlock Text="姹℃按澶勭悊鐩戞帶绯荤粺" FontSize="13"
-                                   Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
-                    </StackPanel>
-
-                    <StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center" Margin="24,0">
-                        <Border Width="10" Height="10" CornerRadius="5" Background="{DynamicResource SuccessBrush}"/>
-                        <TextBlock Text="PLC CONNECTED" FontFamily="Consolas, monospace" FontSize="11"
-                                   Foreground="{DynamicResource SuccessBrush}" VerticalAlignment="Center"/>
-                    </StackPanel>
-
-                    <StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center" Margin="16,0">
-                        <Button Content="CONNECT" Command="{Binding ConnectPlcCommand}"
-                                FontFamily="Consolas, monospace" FontSize="10" Padding="10,4"
-                                Background="{DynamicResource BorderBrush}" Foreground="{DynamicResource SuccessBrush}" BorderBrush="{DynamicResource SuccessBrush}"/>
-                        <Button Content="DISCONNECT" Command="{Binding DisconnectPlcCommand}"
-                                FontFamily="Consolas, monospace" FontSize="10" Padding="10,4"
-                                Background="{DynamicResource BorderBrush}" Foreground="{DynamicResource DangerBrush}" BorderBrush="{DynamicResource DangerBrush}"/>
-                        <Button Content="REFRESH" Command="{Binding RefreshDataCommand}"
-                                FontFamily="Consolas, monospace" FontSize="10" Padding="10,4"
-                                Background="{DynamicResource BorderBrush}" Foreground="{DynamicResource InfoBrush}" BorderBrush="{DynamicResource InfoBrush}"/>
-                    </StackPanel>
-
-                    <StackPanel Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Right">
-                        <TextBlock Text="{Binding CurrentTime, StringFormat='{}{0:HH:mm:ss}'}"
-                                   FontFamily="Consolas, monospace" FontSize="18" FontWeight="Bold"
-                                   Foreground="{DynamicResource SuccessBrush}"/>
-                        <TextBlock Text="{Binding CurrentTime, StringFormat='{}{0:yyyy-MM-dd}'}"
-                                   FontFamily="Consolas, monospace" FontSize="10"
-                                   Foreground="{DynamicResource TextDisabledBrush}" HorizontalAlignment="Right"/>
-                    </StackPanel>
-                </Grid>
-            </Border>
-
-            <!-- 鈺愨晲鈺 涓棿涓诲唴瀹瑰尯 鈺愨晲鈺 -->
-            <Grid Grid.Row="1" ColumnDefinitions="*,260" Margin="8,4">
+            <!-- 鈺愨晲鈺 涓诲唴瀹瑰尯 鈺愨晲鈺 -->
+            <Grid Grid.Row="0" ColumnDefinitions="*,260" Margin="8,4">
 
                 <!-- 宸︿晶锛氬伐鑹烘祦绋嬪浘 -->
                 <Border Grid.Column="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2" Margin="0,0,4,0"
@@ -407,7 +365,7 @@
             </Grid>
 
             <!-- 鈺愨晲鈺 搴曢儴鐘舵佹爮 鈺愨晲鈺 -->
-            <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
+            <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                 <Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto" Margin="16,0">
                     <TextBlock Grid.Column="0" VerticalAlignment="Center"
                                FontFamily="Consolas, monospace" FontSize="11" Foreground="{DynamicResource TextDisabledBrush}">

+ 3 - 15
src/YZWater.Avalonia/Views/ViewBView.axaml

@@ -9,21 +9,9 @@
     </UserControl.DataContext>
 
     <Border Background="{DynamicResource AppBgBrush}">
-        <Grid RowDefinitions="48,*,32">
-            <!-- 椤堕儴 -->
-            <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
-                <Grid Margin="16,0">
-                    <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
-                        <Border Background="{DynamicResource InfoBrush}" Width="3" Height="20" CornerRadius="1"/>
-                        <TextBlock Text="PARAMETERS" FontFamily="{DynamicResource MonoFont}" FontSize="16" FontWeight="Bold"
-                                   Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
-                        <TextBlock Text="绯荤粺鍙傛暟閰嶇疆" FontSize="12" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
-                    </StackPanel>
-                </Grid>
-            </Border>
-
+        <Grid RowDefinitions="*,32">
             <!-- 鍐呭 -->
-            <ScrollViewer Grid.Row="1" Margin="8,4">
+            <ScrollViewer Grid.Row="0" Margin="8,4">
                 <Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto">
 
                     <!-- PLC 杩炴帴璁剧疆 -->
@@ -113,7 +101,7 @@
             </ScrollViewer>
 
             <!-- 搴曢儴鐘舵佹爮 -->
-            <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
+            <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                 <TextBlock Text="CONFIG v1.0" FontFamily="{DynamicResource MonoFont}" FontSize="10"
                            Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="16,0"/>
             </Border>

+ 5 - 16
src/YZWater.Avalonia/Views/ViewCView.axaml

@@ -10,21 +10,10 @@
     </UserControl.DataContext>
 
     <Border Background="{DynamicResource AppBgBrush}">
-        <Grid RowDefinitions="48,*,32">
-            <!-- 椤堕儴 -->
-            <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
-                <Grid Margin="16,0">
-                    <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
-                        <Border Background="{DynamicResource SuccessBrush}" Width="3" Height="20" CornerRadius="1"/>
-                        <TextBlock Text="FLOW RECORDS" FontFamily="{DynamicResource MonoFont}" FontSize="16" FontWeight="Bold"
-                                   Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
-                        <TextBlock Text="娴侀噺鍘嗗彶鏁版嵁" FontSize="12" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
-                    </StackPanel>
-                </Grid>
-            </Border>
+        <Grid RowDefinitions="*,32">
 
             <!-- 鍐呭 -->
-            <Grid Grid.Row="1" RowDefinitions="Auto,*,Auto" Margin="8,4">
+            <Grid Grid.Row="0" RowDefinitions="Auto,*,Auto" Margin="8,4">
 
                 <!-- 鏌ヨ鏉′欢 -->
                 <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
@@ -45,7 +34,7 @@
                 </Border>
 
                 <!-- 鍥捐〃 -->
-                <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
+                <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
                         BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12" Margin="0,0,0,4">
                     <ScrollViewer>
                         <StackPanel>
@@ -65,7 +54,7 @@
                 </Border>
 
                 <!-- 鏁版嵁琛ㄦ牸 -->
-                <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
+                <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
                         BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="8">
                     <DataGrid ItemsSource="{Binding FlowRecords}" AutoGenerateColumns="False" IsReadOnly="True" Height="150">
                         <DataGrid.Columns>
@@ -80,7 +69,7 @@
             </Grid>
 
             <!-- 搴曢儴 -->
-            <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
+            <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                 <TextBlock Text="FLOW DATA v1.0" FontFamily="{DynamicResource MonoFont}" FontSize="10"
                            Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="16,0"/>
             </Border>

+ 5 - 20
src/YZWater.Avalonia/Views/ViewDView.axaml

@@ -9,25 +9,10 @@
     </UserControl.DataContext>
 
     <Border Background="{DynamicResource AppBgBrush}">
-        <Grid RowDefinitions="48,*,32">
-            <!-- 椤堕儴 -->
-            <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
-                <Grid Margin="16,0">
-                    <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
-                        <Border Background="{DynamicResource DangerBrush}" Width="3" Height="20" CornerRadius="1"/>
-                        <TextBlock Text="ALARM LOG" FontFamily="{DynamicResource MonoFont}" FontSize="16" FontWeight="Bold"
-                                   Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
-                        <TextBlock Text="鎶ヨ鍘嗗彶璁板綍" FontSize="12" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
-                        <Border Background="{DynamicResource DangerBrush}" CornerRadius="10" Padding="8,2" Margin="8,0,0,0">
-                            <TextBlock Text="{Binding UnconfirmedCount, StringFormat='{}{0}'}" FontFamily="{DynamicResource MonoFont}" FontSize="11"
-                                       Foreground="White"/>
-                        </Border>
-                    </StackPanel>
-                </Grid>
-            </Border>
+        <Grid RowDefinitions="*,32">
 
             <!-- 鍐呭 -->
-            <Grid Grid.Row="1" RowDefinitions="Auto,*,Auto" Margin="8,4">
+            <Grid Grid.Row="0" RowDefinitions="Auto,*,Auto" Margin="8,4">
 
                 <!-- 鏌ヨ鏉′欢 -->
                 <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
@@ -49,7 +34,7 @@
                 </Border>
 
                 <!-- 鎶ヨ鍒楄〃 -->
-                <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
+                <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
                         BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="8" Margin="0,0,0,4">
                     <DataGrid ItemsSource="{Binding AlarmRecords}" AutoGenerateColumns="False" IsReadOnly="True"
                               SelectedItem="{Binding SelectedRecord}">
@@ -67,7 +52,7 @@
                 </Border>
 
                 <!-- 鎶ヨ璇︽儏 -->
-                <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
+                <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
                         BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12"
                         IsVisible="{Binding SelectedRecord, Converter={x:Static ObjectConverters.IsNotNull}}">
                     <Grid ColumnDefinitions="80,*" RowDefinitions="Auto,Auto,Auto,Auto">
@@ -91,7 +76,7 @@
             </Grid>
 
             <!-- 搴曢儴 -->
-            <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
+            <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                 <TextBlock Text="ALARM SYSTEM v1.0" FontFamily="{DynamicResource MonoFont}" FontSize="10"
                            Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="16,0"/>
             </Border>

+ 2 - 13
src/YZWater.Avalonia/Views/ViewEView.axaml

@@ -9,18 +9,7 @@
     </UserControl.DataContext>
 
     <Border Background="{DynamicResource AppBgBrush}">
-        <Grid RowDefinitions="48,*,32">
-            <!-- 椤堕儴 -->
-            <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
-                <Grid Margin="16,0">
-                    <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
-                        <Border Background="{DynamicResource TextSecondaryBrush}" Width="3" Height="20" CornerRadius="1"/>
-                        <TextBlock Text="ABOUT" FontFamily="{DynamicResource MonoFont}" FontSize="16" FontWeight="Bold"
-                                   Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
-                        <TextBlock Text="绯荤粺淇℃伅" FontSize="12" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
-                    </StackPanel>
-                </Grid>
-            </Border>
+        <Grid RowDefinitions="*,32">
 
             <!-- 鍐呭 -->
             <ScrollViewer Grid.Row="1" Margin="8,4">
@@ -96,7 +85,7 @@
             </ScrollViewer>
 
             <!-- 搴曢儴 -->
-            <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
+            <Border Grid.Row="1" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                 <TextBlock Text="ABOUT v1.0" FontFamily="{DynamicResource MonoFont}" FontSize="10"
                            Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="16,0"/>
             </Border>

+ 16 - 0
src/YZWater.Core/ViewModels/MainViewModel.cs

@@ -38,6 +38,11 @@ public partial class MainViewModel : ObservableObject
     [ObservableProperty] private bool _isTabDActive;
     [ObservableProperty] private bool _isTabEActive;
 
+    // 褰撳墠 Tab 鏍囬
+    [ObservableProperty] private string _tabTitle = "PROCESS FLOW";
+
+    private readonly string[] _tabTitles = { "PROCESS FLOW", "PARAMETERS", "FLOW RECORDS", "ALARM LOG", "ABOUT" };
+
     public MainViewModel()
     {
         _viewAViewModel = new ViewAViewModel();
@@ -50,6 +55,16 @@ public partial class MainViewModel : ObservableObject
         StartTimer();
     }
 
+    // PLC 鎿嶄綔浠g悊鍛戒护锛堝鎵樼粰 ViewAViewModel锛
+    [RelayCommand]
+    private async Task ConnectPlcAsync() => await _viewAViewModel.ConnectPlcCommand.ExecuteAsync(null);
+
+    [RelayCommand]
+    private void DisconnectPlc() => _viewAViewModel.DisconnectPlcCommand.Execute(null);
+
+    [RelayCommand]
+    private async Task RefreshDataAsync() => await _viewAViewModel.RefreshDataCommand.ExecuteAsync(null);
+
     private void SetActiveTab(int index)
     {
         SelectedTabIndex = index;
@@ -58,6 +73,7 @@ public partial class MainViewModel : ObservableObject
         IsTabCActive = index == 2;
         IsTabDActive = index == 3;
         IsTabEActive = index == 4;
+        TabTitle = _tabTitles[index];
     }
 
     [RelayCommand]