wenxiangchao
3 天以前 b544d5cccd76735e034c8055918a50927b437474
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<hb:SimpleMaskControl x:Class="Plugin.QualityReport.QualityReport"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Plugin.QualityReport"
             mc:Ignorable="d" 
             xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
             xmlns:pu="https://opensource.panuon.com/wpf-ui"
             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
                      x:Name="control"
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
 
       
 
        <Style x:Key="ReportDataGridRow" TargetType="DataGridRow">
            <Setter Property="Background" Value="White"/>
            <Style.Triggers>
                <Trigger Property="AlternationIndex" Value="1">
                    <Setter Property="Background" Value="#eeeeee"/>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource SecondPrimaryColor}"/>
                    <Setter Property="Foreground" Value="{DynamicResource SecondPrimaryColorContract}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
 
        <Style x:Key="ReportDataGrid" TargetType="DataGrid">
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="AlternationCount" Value="2"/>
            <Setter Property="AutoGenerateColumns" Value="False"/>
            <Setter Property="RowHeight" Value="30"/>
            <Setter Property="IsReadOnly" Value="True"/>
            <Setter Property="RowStyle" Value="{StaticResource ReportDataGridRow}"/>
        </Style>
 
        <Style TargetType="ListBox" x:Key="ListBoxItemStyle1">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Padding" Value="-1"/>
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Margin" Value="0"/>
                        <Setter Property="Padding" Value="0"/>
                        <Setter Property="Foreground" Value="Black"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                    <Border x:Name="border" Padding="10,5" Cursor="Hand" Margin="5,2" Height="30"
                                                BorderThickness="1" BorderBrush="{DynamicResource CommonBoarder}">
                                        <DockPanel VerticalAlignment="Center">
                                            <Button Margin="10,0,0,0" DockPanel.Dock="Right" 
                                                    Command="{Binding RemoveSNCommand,RelativeSource={RelativeSource AncestorType=local:QualityReport}}" 
                                                    CommandParameter="{Binding }"
                                                    Tag="{Binding }">X</Button>
                                            <ContentPresenter x:Name="cp" Content="{TemplateBinding Content}" 
ContentStringFormat="{TemplateBinding ContentStringFormat}" 
ContentTemplate="{TemplateBinding ContentTemplate}" />
                                        </DockPanel>
                                    </Border>
 
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="border" Property="Background" Value="#7093d3" />
                                            <Setter Property="Foreground" Value="{StaticResource SecondPrimaryColorContract}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
 
    <Border Style="{StaticResource CardBoarder}" Padding="0">
        <TabControl Style="{StaticResource HeaderTabControl}" >
            <TabItem Header="CMK">
                <Grid dp:GridHelper.Space="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="10">
                        <pu:FormGroup Header="型号" Style="{StaticResource InputFormGroupStyle}">
                            <ComboBox MinWidth="180" ItemsSource="{Binding Models}" Style="{StaticResource FormComboxStyle}" SelectedValue="{Binding Model}"
SelectedValuePath="Name" DisplayMemberPath="Name" />
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="时间" Style="{StaticResource InputFormGroupStyle}">
                            <StackPanel Orientation="Horizontal">
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding StartTimeCMK}"></pu:DateTimePicker>
                                <TextBlock VerticalAlignment="Center" Text="   至   "/>
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding EndTimeCMK}"></pu:DateTimePicker>
                            </StackPanel>
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="测试项" Style="{StaticResource InputFormGroupStyle}">
                            <pu:SearchBox Text="{Binding TestItemCMK,Mode=TwoWay}" Tag="Step" SearchTextChanged="SearchTextChanged" MinWidth="180" />
                        </pu:FormGroup>
 
                        <Button Style="{StaticResource QueryBtn}" Command="{Binding QueryCMKCommand}"/>
                        <Button Style="{StaticResource ExportBtn}" Command="{Binding ExportCMKCommand}"/>
                    </StackPanel>
                    <DataGrid Grid.Row="2" Style="{StaticResource ReportDataGrid}"
                              ItemsSource="{Binding DatasourceCMK}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="*" Header="数据1" Binding="{Binding d1}"/>
                            <DataGridTextColumn Width="*" Header="数据2" Binding="{Binding d2}"/>
                            <DataGridTextColumn Width="*" Header="数据3" Binding="{Binding d3}"/>
                            <DataGridTextColumn Width="*" Header="数据4" Binding="{Binding d4}"/>
                            <DataGridTextColumn Width="*" Header="数据5" Binding="{Binding d5}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="MSA">
                <Grid dp:GridHelper.Space="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="10">
                        <pu:FormGroup Header="型号" Style="{StaticResource InputFormGroupStyle}">
                            <ComboBox MinWidth="180" ItemsSource="{Binding Models}" Style="{StaticResource FormComboxStyle}" SelectedValue="{Binding Model}"
              SelectedValuePath="Name" DisplayMemberPath="Name" />
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="SN" Style="{StaticResource InputFormGroupStyle}">
                            <DockPanel>
                                <Button DockPanel.Dock="Right"
                                        Command="{Binding AddSnrCommand}"
                                        Style="{StaticResource PrimaryButton}" 
                                        FontFamily="{StaticResource iconfont}"
                                        Content="&#xe61a;"/>
                                <pu:SearchBox Text="{Binding Snr,Mode=TwoWay}" Tag="SN" SearchTextChanged="SearchTextChanged" MinWidth="180" />
                            </DockPanel>
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="时间" Style="{StaticResource InputFormGroupStyle}">
                            <StackPanel Orientation="Horizontal">
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding StartTimeCMK}"></pu:DateTimePicker>
                                <TextBlock VerticalAlignment="Center" Text="   至   "/>
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding EndTimeCMK}"></pu:DateTimePicker>
                            </StackPanel>
                        </pu:FormGroup>
 
                        <Button Style="{StaticResource QueryBtn}" Command="{Binding QueryMSACommand}"/>
                        <Button Style="{StaticResource ExportBtn}" Command="{Binding ExportMSACommand}"/>
                    </StackPanel>
                    <pu:FormGroup Grid.Row="1" Header="已选SN" Style="{StaticResource InputFormGroupStyle}">
                        <ListBox Style="{StaticResource ListBoxItemStyle1}" ItemsSource="{Binding SelectedSnr}" Height="40">
                        </ListBox>
                    </pu:FormGroup>
 
                    <DataGrid Grid.Row="2" Style="{StaticResource ReportDataGrid}"
          ItemsSource="{Binding DatasourceMSA}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="*" Header="条码1" Binding="{Binding d1}"/>
                            <DataGridTextColumn Width="*" Header="条码2" Binding="{Binding d2}"/>
                            <DataGridTextColumn Width="*" Header="条码3" Binding="{Binding d3}"/>
                            <DataGridTextColumn Width="*" Header="条码4" Binding="{Binding d4}"/>
                            <DataGridTextColumn Width="*" Header="条码5" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码6" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码7" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码8" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码9" Binding="{Binding d5}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <!--<Grid Grid.Row="2" x:Name="msaGrid" dp:GridHelper.InnerBorder="1" dp:GridHelper.InnerBorderBrush="Black">
                        
                    </Grid>-->
                </Grid>
            </TabItem>
            <TabItem Header="重复性">
                <Grid dp:GridHelper.Space="10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="10">
                        <pu:FormGroup Header="型号" Style="{StaticResource InputFormGroupStyle}">
                            <ComboBox MinWidth="180" ItemsSource="{Binding Models}" Style="{StaticResource FormComboxStyle}" SelectedValue="{Binding Model}"
    SelectedValuePath="Name" DisplayMemberPath="Name" />
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="SN" Style="{StaticResource InputFormGroupStyle}">
                            <DockPanel>
                                <Button DockPanel.Dock="Right"
                              Command="{Binding AddSnr2RepeatCommand}"
                              Style="{StaticResource PrimaryButton}" 
                              FontFamily="{StaticResource iconfont}"
                              Content="&#xe61a;"/>
                                <pu:SearchBox Text="{Binding Snr,Mode=TwoWay}" Tag="SN" SearchTextChanged="SearchTextChanged" MinWidth="180" />
                            </DockPanel>
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="测试项" Style="{StaticResource InputFormGroupStyle}">
                            <pu:SearchBox Text="{Binding TestItemCMK,Mode=TwoWay}" Tag="Step" SearchTextChanged="SearchTextChanged" MinWidth="180" />
                        </pu:FormGroup>
 
                        <pu:FormGroup Header="时间" Style="{StaticResource InputFormGroupStyle}">
                            <StackPanel Orientation="Horizontal">
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding StartTimeCMK}"></pu:DateTimePicker>
                                <TextBlock VerticalAlignment="Center" Text="   至   "/>
                                <pu:DateTimePicker Style="{StaticResource TimePicker}" SelectedDateTime="{Binding EndTimeCMK}"></pu:DateTimePicker>
                            </StackPanel>
                        </pu:FormGroup>
 
                        <Button Style="{StaticResource QueryBtn}" Command="{Binding QueryRepeatCommand}"/>
                        <Button Style="{StaticResource ExportBtn}" Command="{Binding ExportRepeatCommand}"/>
                    </StackPanel>
                    <pu:FormGroup Grid.Row="1" Header="已选SN" Style="{StaticResource InputFormGroupStyle}">
                        <ListBox Style="{StaticResource ListBoxItemStyle1}" ItemsSource="{Binding SelectedSnrRepeat}" Height="40">
                        </ListBox>
                    </pu:FormGroup>
 
                    <DataGrid Grid.Row="2" Style="{StaticResource ReportDataGrid}" ItemsSource="{Binding DatasourceRepeat}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="*" Header="条码1" Binding="{Binding d1}"/>
                            <DataGridTextColumn Width="*" Header="条码2" Binding="{Binding d2}"/>
                            <DataGridTextColumn Width="*" Header="条码3" Binding="{Binding d3}"/>
                            <DataGridTextColumn Width="*" Header="条码4" Binding="{Binding d4}"/>
                            <DataGridTextColumn Width="*" Header="条码5" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码6" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码7" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码8" Binding="{Binding d5}"/>
                            <DataGridTextColumn Width="*" Header="条码9" Binding="{Binding d5}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
 
            </TabItem>
        </TabControl>
    </Border>
</hb:SimpleMaskControl>