forked from ferventdesert/Hawk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataProcessManagerUI.xaml
More file actions
269 lines (229 loc) · 17.1 KB
/
Copy pathDataProcessManagerUI.xaml
File metadata and controls
269 lines (229 loc) · 17.1 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
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<UserControl
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:mvvm="clr-namespace:Hawk.Core.Utils.MVVM;assembly=Hawk.Core"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Connectors="clr-namespace:Hawk.Core.Connectors;assembly=Hawk.Core" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Hawk_Core_Themes="clr-namespace:Hawk.Core.Themes;assembly=Hawk.Core" x:Class="Hawk.ETL.Controls.DataProcessManagerUI"
mc:Ignorable="d" d:DesignWidth="972.666" d:DesignHeight="465.502">
<UserControl.Resources>
<ResourceDictionary>
<Hawk_Core_Themes:TaskMetroConverter x:Key="TaskMetroConverter"/>
<Style x:Key="GroupContainerStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,0,10,0">
<TextBlock Text="{Binding Name}" />
</StackPanel>
<Line Grid.Column="1" SnapsToDevicePixels="true" X1="0" X2="1" Stretch="Fill"
StrokeThickness="1" />
</Grid>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<mvvm:BindingProxy x:Key="BindingProxy" Data="{Binding}"/>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Header" Value="{Binding Text}" />
<Setter Property="Command" Value="{Binding}" />
<Setter Property="ItemsSource" Value="{Binding ChildActions}" />
<Setter Property="CommandParameter" Value="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}, Mode=FindAncestor}}"/>
</Style>
<Style TargetType="{x:Type ContextMenu}" BasedOn="{StaticResource {x:Type ContextMenu}}">
<Setter Property="ItemContainerStyle" Value="{StaticResource {x:Type MenuItem}}"/>
<Setter Property="DataContext" Value="{Binding Data, Source={StaticResource BindingProxy}}"/>
</Style>
<DataTemplate x:Key="DataTemplateList">
<StackPanel Orientation="Horizontal" Width="300" Margin="0,4">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding LogoURL, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<StackPanel Height="Auto" mvvm:ListItemDoubleClick.Property="BindingCommands.ChildActions[6].ChildActions[0]" Margin="0" Width="Auto">
<TextBlock Margin="0,0,0,8" TextWrapping="Wrap" Text="{Binding Name}" d:LayoutOverrides="Width" FontSize="{DynamicResource LargeFont}" FontWeight="Normal"/>
<TextBlock TextWrapping="Wrap" Text="{Binding Description}" />
</StackPanel>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="DataTemplate2">
<StackPanel mvvm:ListItemDoubleClick.Property="BindingCommands.ChildActions[1].ChildActions[0]" HorizontalAlignment="Stretch" Height="30" VerticalAlignment="Stretch" Width="Auto" Orientation="Horizontal" >
<Rectangle Width="20" Height="20" VerticalAlignment="Center" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ProcessToDo[Type], Converter={StaticResource TaskMetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<Label Content="{Binding Name}" ToolTip="{Binding Description}" Margin="5,5,0,5" VerticalAlignment="Center" FontSize="14.667" HorizontalAlignment="Left" Width="Auto" />
</StackPanel>
</DataTemplate>
<System:Double x:Key="LargeFont">14.667</System:Double>
<DataTemplate x:Key="DataTemplateHelp">
<StackPanel Orientation="Horizontal">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding Icon, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<StackPanel Margin="0,6" Width="300">
<StackPanel Width="300" Orientation="Horizontal">
<TextBlock Margin="0,0,8,8" Text="{Binding Text}" d:LayoutOverrides="Width" FontSize="{DynamicResource LargeFont}" FontWeight="Normal" VerticalAlignment="Center"/>
<TextBlock VerticalAlignment="Center"><Hyperlink Command="{Binding}"><Run Text="访问"/></Hyperlink></TextBlock>
</StackPanel>
<TextBlock TextWrapping="Wrap" Text="{Binding Description}" />
</StackPanel>
</StackPanel>
</DataTemplate>
<System:Double x:Key="UltraFont">21.333</System:Double>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="0"/>
<RowDefinition Height="0.339*"/>
<RowDefinition Height="0.661*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.400*"/>
<ColumnDefinition Width="0.400*"/>
<ColumnDefinition Width="0.3*"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Black" BorderThickness="1" Grid.ColumnSpan="3" Grid.RowSpan="4"/>
<ListBox x:Name="listBox" DataContext="{Binding}" ToolTip="双击可加载任务,右键可对任务进行删除等操作" SelectedItem="{Binding SelectedTask}" ItemsSource="{Binding ProjectTaskList}" HorizontalContentAlignment="Stretch" Margin="30,40,30,20" ItemTemplate="{DynamicResource DataTemplate2}" Grid.Row="2" Grid.Column="1" Grid.RowSpan="2" >
<ListBox.Resources>
<ContextMenu x:Key="resourceContextMenu" ItemsSource="{Binding BindingCommands.ChildActions[1].ChildActions}"/>
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="ContextMenu" Value="{StaticResource resourceContextMenu}" />
</Style>
</ListBox.Resources>
<ListBox.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource GroupContainerStyle}">
<GroupStyle.HeaderTemplate>
<DataTemplate>
<Border BorderBrush="Black" BorderThickness="1" Height="30">
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
</Border>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListBox.GroupStyle>
</ListBox>
<StackPanel Grid.Column="1" HorizontalAlignment="Left" Margin="30,8,0,0" Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=disk, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock TextWrapping="Wrap" FontSize="21.333" VerticalAlignment="Top" Grid.Row="2" HorizontalAlignment="Left" Grid.Column="1"><Run Language="zh-cn" Text="保存的任务" /></TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Right" Margin="0,5.76,30,0" Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=magnify, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<StackPanel Orientation="Vertical" d:LayoutOverrides="Width">
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left"><Run Language="zh-cn" Text="快速检索" /></TextBlock>
<TextBox TextWrapping="Wrap" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Width="70.237" Height="19"/>
</StackPanel>
</StackPanel>
<TreeView DataContext="{Binding MainFrmUI.PluginDictionary[数据管理]}" ToolTip="右键可新建数据源" Margin="30,40,30,20" x:Name="treeView" ItemsSource="{Binding CurrentConnectors}" Grid.Row="3">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Connectors:DBConnectorBase}"
ItemsSource="{Binding TableNames.Collection}" >
<StackPanel Orientation="Horizontal" >
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=database, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock Text="{Binding Name}" mvvm:TreeViewItemDoubleClick.Property="{Binding Data.Commands[0].ChildActions[0], Source={StaticResource BindingProxy}}"
AllowDrop="True" FontSize="{DynamicResource LargeFont}" ToolTip="{Binding TypeName}" VerticalAlignment="Center">
<mvvm:DropHelper.DropSupport>
<mvvm:DropSupportData BindingPath="Commands[0]" />
</mvvm:DropHelper.DropSupport>
<TextBlock.ContextMenu>
<ContextMenu ItemsSource="{Binding MainFrmUI.PluginDictionary[数据管理].Commands[0].ChildActions}" />
</TextBlock.ContextMenu>
</TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type Connectors:TableInfo}" >
<StackPanel Orientation="Horizontal" >
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=paper, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock Text="{Binding Name}" AllowDrop="True" ToolTip="{Binding Description}" FontSize="13" mvvm:TreeViewItemDoubleClick.Property="Commands[1].ChildActions[0]">
<TextBlock.ContextMenu>
<ContextMenu ItemsSource="{Binding MainFrmUI.PluginDictionary[数据管理].Commands[1].ChildActions}"/>
</TextBlock.ContextMenu>
</TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.Resources>
<TreeView.ContextMenu>
<ContextMenu ItemsSource="{Binding MainFrmUI.PluginDictionary[数据管理].Commands[4].ChildActions}"/>
</TreeView.ContextMenu>
</TreeView>
<StackPanel Grid.Column="0" HorizontalAlignment="Left" Margin="30,8,0,0" Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=paper, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock TextWrapping="Wrap" FontSize="21.333" VerticalAlignment="Top" Grid.Row="2" HorizontalAlignment="Left" Grid.Column="1"><Run Language="zh-cn" Text="新建任务" /></TextBlock>
</StackPanel>
<ListBox x:Name="listboxProcessMethodList" ToolTip="双击图标以新建任务" ItemsSource="{Binding ProgramNameFilterView}" x:FieldModifier="public" ItemTemplate="{DynamicResource DataTemplateList}" Margin="30,40,30,0" Grid.Row="2" VerticalAlignment="Top"/>
<StackPanel Grid.Column="0" HorizontalAlignment="Left" Margin="30,8,0,0" Orientation="Horizontal" Grid.Row="3" VerticalAlignment="Top">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=connect, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock TextWrapping="Wrap" FontSize="21.333" VerticalAlignment="Top" Grid.Row="2" HorizontalAlignment="Left" Grid.Column="1"><Run Language="zh-cn" Text="数据库配置" /></TextBlock>
</StackPanel>
<TextBlock TextWrapping="Wrap" Margin="34,20,0,20" HorizontalAlignment="Left" FontSize="64" Opacity="0.175" VerticalAlignment="Bottom" Foreground="Black"><Run Text="Hawk"/></TextBlock>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" FontSize="64" Margin="30,0,0,20" VerticalAlignment="Bottom"><Run Language="zh-cn" Text="H"/><Run Text="awk"/><Run Foreground="#FF10AB8B" Language="zh-cn" Text=" 3"/></TextBlock>
<StackPanel Grid.Column="2" HorizontalAlignment="Left" Margin="30,8,0,0" Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top">
<Rectangle Width="20" Height="20" Margin="0,0,10,0" >
<Rectangle.Fill>
<VisualBrush Stretch="Fill"
Visual="{Binding ConverterParameter=rss, Converter={StaticResource MetroConverter}, Mode=OneWay}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock TextWrapping="Wrap" Margin="0,0,-0.001,0" FontSize="{DynamicResource UltraFont}" d:LayoutOverrides="Width, GridBox"><Run Language="zh-cn" Text="快速链接"/></TextBlock>
</StackPanel>
<ListBox Grid.Column="2" Margin="30,40,30,20" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateHelp}" ItemsSource="{Binding MainFrmUI.CommandCollection[1].ChildActions}" Grid.RowSpan="2"/>
<StackPanel VerticalAlignment="Bottom" Margin="270,0,0,30" HorizontalAlignment="Left" Width="235.283" Grid.ColumnSpan="2">
<TextBlock TextWrapping="Wrap" FontSize="16" Foreground="#FFA1A1A1" HorizontalAlignment="Left"><Run Text="数据处理革命"/></TextBlock>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" FontSize="16" Foreground="#FFA1A1A1" Margin="0,8,0,0"><Run Text="Smart ETL Crawler Engine"/></TextBlock>
</StackPanel>
<TextBlock TextWrapping="Wrap" Margin="30,20,0,20" HorizontalAlignment="Left" FontSize="26.667" VerticalAlignment="Bottom" Grid.Column="2"><Run Language="zh-cn" Text="欢迎使用Hawk!"/></TextBlock>
</Grid>
</UserControl>