Browse Source

11

样式分支
fyf 2 years ago
parent
commit
125722b2f7
3 changed files with 95 additions and 98 deletions
  1. +77
    -96
      BPASmartClient/Control/LogView.xaml
  2. +16
    -1
      BPASmartClient/MainWindow.xaml
  3. +2
    -1
      BPASmartClient/MainWindow.xaml.cs

+ 77
- 96
BPASmartClient/Control/LogView.xaml View File

@@ -18,109 +18,90 @@
<UserControl.DataContext>
<vm:LogViewModel></vm:LogViewModel>
</UserControl.DataContext>
<Grid>
<!--底部窗体栏-->
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--顶部装饰-->
<Border Grid.Row="0" Style="{DynamicResource border右下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border右上}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左上}" Grid.RowSpan="2" />
<Grid Margin="10">
<Border Style="{DynamicResource borderFromTitle}" Width="600"></Border>
<Button Grid.Row="0" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
<TextBlock x:Name="Title" HorizontalAlignment="Center" FontSize="16" Foreground="#feffff">日志监控界面</TextBlock>
</Grid>
<!--底部窗体栏-->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>

<!--查询按钮栏-->
<StackPanel Orientation="Horizontal" Margin="10,0,10,0">
<ComboBox SelectedIndex="0" Width="80">
<ComboBoxItem>一般日志</ComboBoxItem>
<ComboBoxItem>错误日志</ComboBoxItem>
<ComboBoxItem>告警信息</ComboBoxItem>
</ComboBox>
<Button Margin="10,0,0,0">查询</Button>
<Button Margin="10,0,0,0">导出</Button>
<!--查询按钮栏-->
<StackPanel Orientation="Horizontal" Margin="10,0,10,0">
<ComboBox SelectedIndex="0" Width="80">
<ComboBoxItem>一般日志</ComboBoxItem>
<ComboBoxItem>错误日志</ComboBoxItem>
<ComboBoxItem>告警信息</ComboBoxItem>
</ComboBox>
<Button Margin="10,0,0,0">查询</Button>
<Button Margin="10,0,0,0">导出</Button>

<CheckBox Margin="10,0,0,0" IsChecked="True">实时模式</CheckBox>
<CheckBox Margin="10,0,0,0" IsChecked="True">定时清除</CheckBox>
<CheckBox Margin="10,0,0,0" IsChecked="True">实时模式</CheckBox>
<CheckBox Margin="10,0,0,0" IsChecked="True">定时清除</CheckBox>

</StackPanel>
<!--表格栏-->
<Grid Grid.Row="1">
<DataGrid x:Name="datagrid" Margin="10" ItemsSource="{Binding EquiPment1, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2">
<DataGrid.Columns>
<DataGridTemplateColumn Header="紧急程度" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Ellipse Width="12" Height="12" ToolTip="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Fill="{Binding color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警时间或恢复时间" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="类型" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="状态" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="变量名" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警值或恢复值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="参考值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="操作" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</StackPanel>

<!--表格栏-->
<Grid Grid.Row="1">
<DataGrid x:Name="datagrid" Margin="10" ItemsSource="{Binding EquiPment1, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2">
<DataGrid.Columns>
<DataGridTemplateColumn Header="紧急程度" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Ellipse Width="12" Height="12" ToolTip="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Fill="{Binding color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警时间或恢复时间" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="类型" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="状态" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="变量名" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="报警值或恢复值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="参考值" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="操作" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</UserControl>

+ 16
- 1
BPASmartClient/MainWindow.xaml View File

@@ -113,8 +113,23 @@

<!--底部窗体-->
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--顶部装饰-->
<Border Grid.Row="0" Style="{DynamicResource border右下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左下}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border右上}" Grid.RowSpan="2" />
<Border Grid.Row="0" Style="{DynamicResource border左上}" Grid.RowSpan="2" />
<Grid Margin="10">
<Border Style="{DynamicResource borderFromTitle}" Width="600"></Border>
<Button Grid.Row="0" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
<TextBlock x:Name="Title" HorizontalAlignment="Center" FontSize="16" Foreground="#feffff">日志监控界面</TextBlock>
</Grid>
<!--#region 底部窗体栏-->
<ContentControl x:Name="contentRegion"/>

<ContentControl Grid.Row="1" x:Name="contentRegion"/>
<!--#endregion-->
<!--<Button Grid.Row="2" Content="返回" Style="{DynamicResource CommonBtn_返回}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>



+ 2
- 1
BPASmartClient/MainWindow.xaml.cs View File

@@ -54,7 +54,7 @@ namespace BPASmartClient
}
this.DragMove();
};
MenuItem_Click(new MenuItem() {Tag= "LogView" },null);
MenuItem_Click(new MenuItem() {Tag= "LogView",Header="日志监视" },null);
}

private void Button_Click(object sender, RoutedEventArgs e)
@@ -81,6 +81,7 @@ namespace BPASmartClient
if (type == null) return;
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
contentRegion.Content = (FrameworkElement)cti.Invoke(null);
Title.Text = (sender as MenuItem).Header?.ToString()+"界面";
}
}
catch (Exception ex)


Loading…
Cancel
Save