-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskStatisticsWindow.xaml
More file actions
201 lines (180 loc) · 12.9 KB
/
Copy pathTaskStatisticsWindow.xaml
File metadata and controls
201 lines (180 loc) · 12.9 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
201
<Window x:Class="TimeTask.TaskStatisticsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:loc="clr-namespace:TimeTask"
Title="{loc:Loc TaskStats_WindowTitle}" 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="{loc:Loc TaskStats_Title}" FontSize="18" FontWeight="Bold" VerticalAlignment="Center"/>
<ComboBox x:Name="TimeRangeComboBox" Width="120" Margin="20,0,0,0" SelectedIndex="0">
<ComboBoxItem Content="{loc:Loc TaskStats_Range7Days}"/>
<ComboBoxItem Content="{loc:Loc TaskStats_Range30Days}"/>
<ComboBoxItem Content="{loc:Loc TaskStats_Range90Days}"/>
<ComboBoxItem Content="{loc:Loc TaskStats_RangeAll}"/>
</ComboBox>
<Button x:Name="RefreshButton" Content="{loc:Loc Button_Refresh}" Margin="10,0,0,0" Click="RefreshButton_Click"/>
</StackPanel>
<!-- 统计内容 -->
<TabControl Grid.Row="1">
<!-- 概览标签页 -->
<TabItem Header="{loc:Loc TaskStats_TabOverview}">
<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="{loc:Loc TaskStats_TotalTasks}" 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="{loc:Loc TaskStats_Completed}" 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="{loc:Loc TaskStats_Active}" 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="{loc:Loc TaskStats_CompletionRate}" 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="{loc:Loc TaskStats_QuadrantDistribution}" 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="{loc:Loc Quadrant_ImportantUrgent}" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q2ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q2Label" Text="{loc:Loc Quadrant_ImportantNotUrgent}" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q3ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q3Label" Text="{loc:Loc Quadrant_NotImportantUrgent}" HorizontalAlignment="Center"/>
<ProgressBar x:Name="Q4ProgressBar" Height="30" Margin="0,5" Background="LightGray"/>
<TextBlock x:Name="Q4Label" Text="{loc:Loc Quadrant_NotImportantNotUrgent}" HorizontalAlignment="Center"/>
</StackPanel>
</GroupBox>
<!-- 最近活动 -->
<GroupBox Grid.Column="1" Header="{loc:Loc TaskStats_RecentActivity}" 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="{loc:Loc TaskStats_TabTrend}">
<Grid Margin="10">
<TextBlock Text="{loc:Loc TaskStats_TrendPlaceholder}" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="16" Foreground="Gray"/>
<!-- 这里可以集成图表控件,如LiveCharts或OxyPlot -->
</Grid>
</TabItem>
<!-- 效率分析标签页 -->
<TabItem Header="{loc:Loc TaskStats_TabEfficiency}">
<Grid Margin="10">
<ScrollViewer>
<StackPanel>
<GroupBox Header="{loc:Loc TaskStats_EfficiencyMetrics}" 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="{loc:Loc TaskStats_AvgCompletionTime}" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="AvgCompletionTimeText" Text="{loc:Loc TaskStats_Analyzing}" Foreground="Blue"/>
<TextBlock Text="{loc:Loc TaskStats_MostProductiveTime}" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="MostProductiveTimeText" Text="{loc:Loc TaskStats_Analyzing}" Foreground="Blue"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="10,0,0,0">
<TextBlock Text="{loc:Loc TaskStats_DelayRate}" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="DelayRateText" Text="{loc:Loc TaskStats_Calculating}" Foreground="Blue"/>
<TextBlock Text="{loc:Loc TaskStats_Recommendation}" FontWeight="Bold" Margin="0,5"/>
<TextBlock x:Name="RecommendationText" Text="{loc:Loc TaskStats_Analyzing}" Foreground="Blue" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="{loc:Loc TaskStats_TaskTypeAnalysis}">
<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="{loc:Loc TaskStats_ButtonExport}" Margin="0,0,10,0" Click="ExportButton_Click"/>
<Button Content="{loc:Loc Button_Close}" IsCancel="True" Click="CloseButton_Click"/>
</StackPanel>
</Grid>
</Window>