-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskStatisticsWindow.xaml
More file actions
200 lines (179 loc) · 12.3 KB
/
TaskStatisticsWindow.xaml
File metadata and controls
200 lines (179 loc) · 12.3 KB
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
<Window x:Class="TimeTask.TaskStatisticsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="任务统计" Height="600" Width="800"
WindowStartupLocation="CenterScreen">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 标题和时间范围选择 -->
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock Text="任务统计分析" FontSize="18" FontWeight="Bold" VerticalAlignment="Center"/>
<ComboBox x:Name="TimeRangeComboBox" Width="120" Margin="20,0,0,0" SelectedIndex="0">
<ComboBoxItem Content="最近7天"/>
<ComboBoxItem Content="最近30天"/>
<ComboBoxItem Content="最近90天"/>
<ComboBoxItem Content="全部"/>
</ComboBox>
<Button x:Name="RefreshButton" Content="刷新" Margin="10,0,0,0" Click="RefreshButton_Click"/>
</StackPanel>
<!-- 统计内容 -->
<TabControl Grid.Row="1">
<!-- 概览标签页 -->
<TabItem Header="概览">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 关键指标 -->
<UniformGrid Grid.Row="0" Rows="1" Columns="4" Margin="0,0,0,20">
<Border Background="#E3F2FD" CornerRadius="5" Padding="15" Margin="5">
<StackPanel>
<TextBlock Text="总任务数" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="TotalTasksText" Text="0" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#1976D2"/>
</StackPanel>
</Border>
<Border Background="#E8F5E8" CornerRadius="5" Padding="15" Margin="5">
<StackPanel>
<TextBlock Text="已完成" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="CompletedTasksText" Text="0" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#388E3C"/>
</StackPanel>
</Border>
<Border Background="#FFF3E0" CornerRadius="5" Padding="15" Margin="5">
<StackPanel>
<TextBlock Text="进行中" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="ActiveTasksText" Text="0" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#F57C00"/>
</StackPanel>
</Border>
<Border Background="#FFEBEE" CornerRadius="5" Padding="15" Margin="5">
<StackPanel>
<TextBlock Text="完成率" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="CompletionRateText" Text="0%" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#D32F2F"/>
</StackPanel>
</Border>
</UniformGrid>
<!-- 象限分布 -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- 象限任务分布 -->
<GroupBox Grid.Column="0" Header="象限任务分布" Margin="0,0,10,0">
<StackPanel>
<ProgressBar x:Name="Q1ProgressBar" Height="30" Margin="0,5" Background="LightGray">
<ProgressBar.Resources>
<Style TargetType="ProgressBar">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ProgressBar">
<Grid>
<Border Background="{TemplateBinding Background}" CornerRadius="3"/>
<Border Background="#FFDADA" Width="{TemplateBinding Width}"
HorizontalAlignment="Left" CornerRadius="3"/>
<TextBlock Text="{Binding ElementName=Q1Label, Path=Content}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ProgressBar.Resources>
</ProgressBar>
<TextBlock x:Name="Q1Label" Text="重要且紧急: 0 (0%)" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q2ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q2Label" Text="重要不紧急: 0 (0%)" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q3ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q3Label" Text="不重要但紧急: 0 (0%)" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q4ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q4Label" Text="不重要不紧急: 0 (0%)" HorizontalAlignment="Center"/>
</StackPanel>
</GroupBox>
<!-- 最近活动 -->
<GroupBox Grid.Column="1" Header="最近活动" Margin="10,0,0,0">
<ListBox x:Name="RecentActivityListBox" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,2">
<TextBlock Text="{Binding Description}" FontWeight="Bold" TextWrapping="Wrap"/>
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm}'}"
FontSize="10" Foreground="Gray"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</Grid>
</Grid>
</TabItem>
<!-- 趋势分析标签页 -->
<TabItem Header="趋势分析">
<Grid Margin="10">
<TextBlock Text="趋势图表将在此处显示" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="16" Foreground="Gray"/>
<!-- 这里可以集成图表控件,如LiveCharts或OxyPlot -->
</Grid>
</TabItem>
<!-- 效率分析标签页 -->
<TabItem Header="效率分析">
<Grid Margin="10">
<ScrollViewer>
<StackPanel>
<GroupBox Header="工作效率指标" Margin="0,0,0,10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,0,10,0">
<TextBlock Text="平均完成时间" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="AvgCompletionTimeText" Text="计算中..." Foreground="Blue"/>
<TextBlock Text="最高效时段" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="MostProductiveTimeText" Text="分析中..." Foreground="Blue"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="10,0,0,0">
<TextBlock Text="任务延期率" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="DelayRateText" Text="计算中..." Foreground="Blue"/>
<TextBlock Text="推荐改进" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="RecommendationText" Text="分析中..." Foreground="Blue" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="任务类型分析">
<ListBox x:Name="TaskTypeAnalysisListBox" Height="200">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Category}" FontWeight="Bold"/>
<TextBlock Grid.Column="1" Text="{Binding Count}" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="2" Text="{Binding Percentage}" HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</ScrollViewer>
</Grid>
</TabItem>
</TabControl>
<!-- 底部按钮 -->
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
<Button x:Name="ExportButton" Content="导出报告" Margin="0,0,10,0" Click="ExportButton_Click"/>
<Button Content="关闭" IsCancel="True" Click="CloseButton_Click"/>
</StackPanel>
</Grid>
</Window>