CAN卡添加
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
FontSize="20" FontWeight="Bold"
|
||||
Margin="4,0,0,8"/>
|
||||
|
||||
<!-- 工具栏:表选择 / WHERE 条件 / 查询 / 刷新表 / 导出 -->
|
||||
<!-- 工具栏:监测项筛选 / 台架筛选 / 日期筛选 / 查询 / 清除 / 导出 -->
|
||||
<Border Grid.Row="1"
|
||||
Background="White"
|
||||
BorderBrush="#DDD" BorderThickness="1"
|
||||
@@ -47,57 +47,71 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="180"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 监测项 -->
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="表:"
|
||||
Text="监测项:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,4,0"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
materialDesign:HintAssist.Hint="数据表"
|
||||
ItemsSource="{Binding TableNames}"
|
||||
SelectedItem="{Binding SelectedTable}"
|
||||
materialDesign:HintAssist.Hint="全部"
|
||||
ItemsSource="{Binding MonitorNames}"
|
||||
SelectedItem="{Binding SelectedMonitorName}"
|
||||
IsEditable="True"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- 台架 -->
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="WHERE:"
|
||||
Text="台架:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,4,0"/>
|
||||
<TextBox Grid.Column="3"
|
||||
Text="{Binding WhereClause, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="条件筛选"
|
||||
ToolTip="例如:Status='OK' AND Id>10。留空表示查询全部">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding QueryCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<ComboBox Grid.Column="3"
|
||||
materialDesign:HintAssist.Hint="全部"
|
||||
ItemsSource="{Binding ScopeNames}"
|
||||
SelectedItem="{Binding SelectedScope}"
|
||||
IsEditable="True"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<Button Grid.Column="4"
|
||||
<!-- 日期 -->
|
||||
<TextBlock Grid.Column="4"
|
||||
Text="日期:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0,4,0"/>
|
||||
<DatePicker Grid.Column="5"
|
||||
SelectedDate="{Binding SelectedDate}"
|
||||
materialDesign:HintAssist.Hint="全部"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!-- 按钮 -->
|
||||
<Button Grid.Column="6"
|
||||
Content="查询"
|
||||
Command="{Binding QueryCommand}"
|
||||
Padding="12,4" Margin="8,0,0,0"/>
|
||||
<Button Grid.Column="5"
|
||||
Content="刷新表"
|
||||
Command="{Binding RefreshTablesCommand}"
|
||||
Padding="12,4" Margin="12,0,0,0"/>
|
||||
<Button Grid.Column="7"
|
||||
Content="清除"
|
||||
Command="{Binding ClearFilterCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"/>
|
||||
<Button Grid.Column="6"
|
||||
<Button Grid.Column="8"
|
||||
Content="导出 CSV"
|
||||
Command="{Binding ExportCsvCommand}"
|
||||
Padding="12,4" Margin="6,0,0,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- DataGrid:自动生成列,绑 DataTable.DefaultView 直显示 -->
|
||||
<!-- DataGrid:显式列定义,隐藏 Id / IsDel -->
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding ResultTable}"
|
||||
AutoGenerateColumns="True"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
@@ -106,7 +120,14 @@
|
||||
AlternatingRowBackground="#F9FAFB"
|
||||
RowBackground="White"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"/>
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="监测项" Binding="{Binding MonitorName}" Width="*"/>
|
||||
<DataGridTextColumn Header="监测值" Binding="{Binding MonitorValue}" Width="120"/>
|
||||
<DataGridTextColumn Header="台架" Binding="{Binding Scope}" Width="120"/>
|
||||
<DataGridTextColumn Header="记录时间" Binding="{Binding CreateTime, StringFormat=yyyy-MM-dd HH:mm:ss}" Width="180"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- 分页控件 -->
|
||||
<Border Grid.Row="3"
|
||||
|
||||
Reference in New Issue
Block a user