ResultQueryView.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <UserControl x:Class="PLCTool.Views.BusinessManageView.ResultQueryView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PLCTool.Views.BusinessManageView"
  7. xmlns:hc="https://handyorg.github.io/handycontrol"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:myContr="clr-namespace:BlankApp1.Controls"
  10. xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
  11. xmlns:cvt="clr-namespace:PLCTool.Controls.Convert"
  12. mc:Ignorable="d"
  13. d:DesignHeight="450" d:DesignWidth="800">
  14. <UserControl.Resources>
  15. <cvt:TwoParConverter x:Key="TwoParConverter"/>
  16. </UserControl.Resources>
  17. <Grid >
  18. <b:Interaction.Triggers>
  19. <b:EventTrigger EventName="Loaded">
  20. <b:InvokeCommandAction Command="{Binding OnLoadCommand}"/>
  21. </b:EventTrigger>
  22. </b:Interaction.Triggers>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="40"/>
  25. <RowDefinition Height="40"/>
  26. <RowDefinition/>
  27. <RowDefinition Height="40"/>
  28. </Grid.RowDefinitions>
  29. <UniformGrid Grid.Row="0" Columns="4">
  30. <StackPanel Orientation="Horizontal">
  31. <TextBlock Text="设备编号:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
  32. <TextBox Height="28" Width="120" Text="{Binding DeviceNo}" />
  33. </StackPanel>
  34. <StackPanel Orientation="Horizontal">
  35. <TextBlock Text="设备名称:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
  36. <TextBox Height="28" Width="120" Text="{Binding DeviceName}"/>
  37. </StackPanel>
  38. <StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Center">
  39. <TextBlock Text="所属项目:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0" TextAlignment="Right" Width="80"/>
  40. <ComboBox Height="28" Width="120" ItemsSource="{Binding ProjectNameList}" SelectedItem="{Binding ProjectName}" />
  41. </StackPanel>
  42. <StackPanel Orientation="Horizontal" Grid.Row="4" HorizontalAlignment="Center">
  43. <TextBlock Text="所属设备类型:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0" TextAlignment="Right" Width="80"/>
  44. <ComboBox Height="28" Width="120" ItemsSource="{Binding DeviceKindNameList}" SelectedItem="{Binding DeviceKindName}" />
  45. </StackPanel>
  46. </UniformGrid>
  47. <Grid Grid.Row="1">
  48. <Grid.ColumnDefinitions>
  49. <ColumnDefinition/>
  50. <ColumnDefinition/>
  51. </Grid.ColumnDefinitions>
  52. <StackPanel Grid.Column="0" Orientation="Horizontal">
  53. <StackPanel Orientation="Horizontal">
  54. <TextBlock Text="创建时间:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
  55. <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160" Text="{Binding StartTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
  56. </StackPanel>
  57. <StackPanel Orientation="Horizontal">
  58. <TextBlock Text="至:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
  59. <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160" Text="{Binding EndTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
  60. </StackPanel>
  61. </StackPanel>
  62. <StackPanel Grid.Column="1" Orientation="Horizontal">
  63. <Button Content="查询" Width="80" Margin="5,0" Command="{Binding QueryCommand}" Style="{StaticResource NormalButtonStyle}" />
  64. <Button Content="重置" Width="80" Margin="5,0" Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}" />
  65. <Button Content="新增" Width="80" Margin="5,0" Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}"/>
  66. <Button Content="导出Excel" Width="80" Margin="5,0" Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />
  67. </StackPanel>
  68. </Grid>
  69. <DataGrid Grid.Row="2" ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False" SelectionUnit="FullRow" SelectionMode="Single" RowHeaderWidth="0"
  70. ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}" AlternationCount="2"
  71. ItemsSource="{Binding DeviceResultItemList}" IsReadOnly="True" Padding="0" >
  72. <DataGrid.Columns >
  73. <!--<DataGridTextColumn Header="序号" Width="50" Binding="{Binding DeviceId}" CellStyle="{StaticResource MyDataGridCellStyle}" />-->
  74. <DataGridTextColumn Header="设备编号" Binding="{Binding DeviceNo}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  75. <DataGridTextColumn Header="设备名称" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  76. <DataGridTextColumn Header="项目名称" Binding="{Binding ProjectName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  77. <DataGridTextColumn Header="设备类型" Binding="{Binding DeviceKindName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  78. <DataGridTextColumn Header="测试时间" Width="150" Binding="{Binding StartTestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  79. <DataGridTextColumn Header="测试结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
  80. <DataGridTemplateColumn Header="操作" Width="280" CellStyle="{StaticResource MyDataGridCellStyle}">
  81. <DataGridTemplateColumn.CellTemplate>
  82. <DataTemplate>
  83. <UniformGrid Columns="3">
  84. <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
  85. Command="{Binding DataContext.CheckDetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding DeviceId}" Cursor="Hand" Margin="0,0,5,0" >
  86. <StackPanel Orientation="Horizontal">
  87. <TextBlock Text="查看详情" VerticalAlignment="Center" Foreground="Blue"/>
  88. </StackPanel>
  89. </Button>
  90. <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
  91. Command="{Binding DataContext.UnqualifiedCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" Cursor="Hand" >
  92. <Button.CommandParameter>
  93. <MultiBinding Converter="{ StaticResource ResourceKey=TwoParConverter}">
  94. <Binding Path="SchemeId" ></Binding>
  95. <Binding Path="DeviceId"></Binding>
  96. </MultiBinding>
  97. </Button.CommandParameter>
  98. <StackPanel Orientation="Horizontal">
  99. <TextBlock Text="测试不合格项" VerticalAlignment="Center" Foreground="Blue"/>
  100. </StackPanel>
  101. </Button>
  102. <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
  103. Command="{Binding DataContext.PdfReportCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" Cursor="Hand" >
  104. <Button.CommandParameter>
  105. <MultiBinding Converter="{ StaticResource ResourceKey=TwoParConverter}">
  106. <Binding Path="SchemeName" ></Binding>
  107. <Binding Path="DeviceId"></Binding>
  108. </MultiBinding>
  109. </Button.CommandParameter>
  110. <StackPanel Orientation="Horizontal">
  111. <TextBlock Text="生成pdf报表" VerticalAlignment="Center" Foreground="Blue"/>
  112. </StackPanel>
  113. </Button>
  114. </UniformGrid>
  115. </DataTemplate>
  116. </DataGridTemplateColumn.CellTemplate>
  117. </DataGridTemplateColumn>
  118. </DataGrid.Columns>
  119. </DataGrid>
  120. <Grid Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
  121. <wpfdev:Pagination IsLite="False" Margin="0" Width="auto" Height="30" HorizontalAlignment="Center"
  122. Count="{Binding TotalCount,Mode=TwoWay}"
  123. CountPerPage="{Binding CountPerPage,Mode=TwoWay}"
  124. Current="{Binding CurrentPage,Mode=TwoWay}"/>
  125. <!--<hc:Pagination MaxPageCount="10" PageIndex="{Binding PageIndex}" IsJumpEnabled="True">
  126. <hc:Interaction.Triggers>
  127. <hc:EventTrigger EventName="PageUpdated">
  128. <hc:EventToCommand Command="{Binding PageUpdatedCmd}" PassEventArgsToCommand="True" />
  129. </hc:EventTrigger>
  130. </hc:Interaction.Triggers>
  131. </hc:Pagination>-->
  132. </Grid>
  133. </Grid>
  134. </UserControl>