Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.TVP.Golf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.TVP.Golf
Commits
1cc292a5
Commit
1cc292a5
authored
Nov 24, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版子数据
parent
3c0c1077
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
524 additions
and
51 deletions
+524
-51
VIZ.TVP.Golf.Domain/Model/TempModel/GroupTempModel.cs
+73
-2
VIZ.TVP.Golf.Module/Package/GroupRanking/AfterMatchGroupRanking/View/AfterMatchGroupRankingView.xaml
+2
-5
VIZ.TVP.Golf.Module/Package/GroupRanking/BeforeMatchGroupRanking/View/BeforeMatchGroupRankingView.xaml
+1
-5
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingConstrrastViewModelBase.cs
+113
-0
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingViewModelBase.cs
+64
-5
VIZ.TVP.Golf.Module/Package/GroupRanking/LongGroupRanking/View/LongGroupRankingView.xaml
+50
-16
VIZ.TVP.Golf.Module/Package/GroupRanking/LongGroupRanking/ViewModel/LongGroupRankingViewModel.cs
+44
-1
VIZ.TVP.Golf.Module/Package/GroupRanking/ShortGroupRanking/View/ShortMatchGroupRankingView.xaml
+34
-15
VIZ.TVP.Golf.Module/Package/GroupRanking/ShortGroupRanking/ViewModel/ShortGroupRankingViewModel.cs
+1
-1
VIZ.TVP.Golf.Module/Package/TeamRanking/TeamRankingConstrrastViewModelBase.cs
+1
-0
VIZ.TVP.Golf.Module/VIZ.TVP.Golf.Module.csproj
+8
-0
VIZ.TVP.Golf.Module/Widgets/Group/GroupPickerPanelSingle.xaml
+40
-0
VIZ.TVP.Golf.Module/Widgets/Group/GroupPickerPanelSingle.xaml.cs
+28
-0
VIZ.TVP.Golf.Service/RealData/Implementation/RealDataService.cs
+52
-1
VIZ.TVP.Golf.Service/RealData/Interface/IRealDataService.cs
+13
-0
No files found.
VIZ.TVP.Golf.Domain/Model/TempModel/GroupTempModel.cs
View file @
1cc292a5
...
...
@@ -111,11 +111,11 @@ namespace VIZ.TVP.Golf.Domain
#
endregion
#
region
PlayersScore
--
总
得分
#
region
PlayersScore
--
得分
private
string
playersScore
;
/// <summary>
///
总杆数
///
得分
/// </summary>
public
string
PlayersScore
{
...
...
@@ -124,5 +124,76 @@ namespace VIZ.TVP.Golf.Domain
}
#
endregion
#
region
PlayerScoreValue
--
得分值
private
int
?
playerScoreValue
;
/// <summary>
/// 得分值
/// </summary>
public
int
?
PlayerScoreValue
{
get
{
return
playerScoreValue
;
}
set
{
playerScoreValue
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PlayerScoreValue
));
}
}
#
endregion
#
region
GroupHoleTempModels
--
分组洞信息模型
private
ObservableCollection
<
GroupHoleTempModel
>
groupHoleTempModels
=
new
ObservableCollection
<
GroupHoleTempModel
>();
/// <summary>
/// 分组洞信息模型
/// </summary>
public
ObservableCollection
<
GroupHoleTempModel
>
GroupHoleTempModels
{
get
{
return
groupHoleTempModels
;
}
set
{
groupHoleTempModels
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
GroupHoleTempModels
));
}
}
#
endregion
#
region
PositionOldIndex
--
排名之前的索引
private
int
positionOldIndex
;
/// <summary>
/// 排名之前的索引
/// </summary>
public
int
PositionOldIndex
{
get
{
return
positionOldIndex
;
}
set
{
positionOldIndex
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PositionOldIndex
));
}
}
#
endregion
#
region
PositionNewIndex
--
排名之后的索引
private
int
positionNewIndex
;
/// <summary>
/// 排名之后的索引
/// </summary>
public
int
PositionNewIndex
{
get
{
return
positionNewIndex
;
}
set
{
positionNewIndex
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PositionNewIndex
));
}
}
#
endregion
#
region
PositionChangedDesc
--
排名变化说明
private
string
positionChangedDesc
;
/// <summary>
/// 排名变化说明
/// </summary>
public
string
PositionChangedDesc
{
get
{
return
positionChangedDesc
;
}
set
{
positionChangedDesc
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PositionChangedDesc
));
}
}
#
endregion
}
}
VIZ.TVP.Golf.Module/Package/GroupRanking/AfterMatchGroupRanking/View/AfterMatchGroupRankingView.xaml
View file @
1cc292a5
...
...
@@ -87,11 +87,8 @@
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="200" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=PlayersStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="Logo" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=TeamLogo}"></DataGridComboBoxColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
...
...
VIZ.TVP.Golf.Module/Package/GroupRanking/BeforeMatchGroupRanking/View/BeforeMatchGroupRankingView.xaml
View file @
1cc292a5
...
...
@@ -87,11 +87,7 @@
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="200" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=PlayersStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="Logo" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=TeamLogo}"></DataGridComboBoxColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
...
...
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingConstrrastViewModelBase.cs
0 → 100644
View file @
1cc292a5
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
VIZ.Framework.Core
;
using
VIZ.TVP.Golf.Domain
;
namespace
VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 小组排名对比
/// </summary>
public
abstract
class
GroupRankingConstrrastViewModelBase
:
GroupRankingViewModelBase
{
public
GroupRankingConstrrastViewModelBase
()
{
// 初始化命令
this
.
InitCommand
();
}
/// <summary>
/// 初始化命令
/// </summary>
private
void
InitCommand
()
{
this
.
LoadContrastDataCommand
=
new
VCommand
(
this
.
LoadContrastData
);
this
.
RefreshIndexChangedCommand
=
new
VCommand
(
RefreshIndexChanged
);
}
// ===================================================================================
// Property
// ===================================================================================
#
region
ConstrrastGroupTempModels
--
对比分组临时模型集合
private
ObservableCollection
<
GroupTempModel
>
constrrastGroupTempModels
;
/// <summary>
/// 对比分组临时模型集合
/// </summary>
public
ObservableCollection
<
GroupTempModel
>
ConstrrastGroupTempModels
{
get
{
return
constrrastGroupTempModels
;
}
set
{
constrrastGroupTempModels
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ConstrrastGroupTempModels
));
}
}
#
endregion
// ===================================================================================
// Command
// ===================================================================================
#
region
LoadContrastDataCommand
--
加载对比数据命令
/// <summary>
/// 加载对比数据命令
/// </summary>
public
VCommand
LoadContrastDataCommand
{
get
;
set
;
}
/// <summary>
/// 加载对比数据
/// </summary>
private
void
LoadContrastData
()
{
RealDataWindow
window
=
new
RealDataWindow
();
window
.
ShowDialog
();
RealDataViewModel
vm
=
window
.
realDataView
.
DataContext
as
RealDataViewModel
;
if
(
vm
==
null
)
return
;
if
(!
vm
.
IsEnter
)
return
;
List
<
PlayerRealModel
>
list
=
this
.
realDataService
.
LoadPlayerRealModelFormLocal
(
vm
.
SelectedFile
.
FileName
);
this
.
ConstrrastGroupTempModels
=
this
.
GetGroupTempModels
(
list
);
this
.
realDataService
.
UpdateGroupPosition
(
this
.
ConstrrastGroupTempModels
);
this
.
realDataService
.
UpdateGroupPositionChanged
(
this
.
ConstrrastGroupTempModels
,
this
.
GroupTempModels
);
}
#
endregion
#
region
RefreshIndexChangedCommand
--
刷新索引变化命令
/// <summary>
/// 刷新索引变化命令
/// </summary>
public
VCommand
RefreshIndexChangedCommand
{
get
;
set
;
}
/// <summary>
/// 刷新索引变化
/// </summary>
private
void
RefreshIndexChanged
()
{
foreach
(
GroupTempModel
group
in
this
.
GroupTempModels
)
{
group
.
PositionChangedDesc
=
$"
{
group
.
PositionOldIndex
}
-->
{
group
.
PositionNewIndex
}
"
;
}
}
#
endregion
// ===================================================================================
// Private Function
// ===================================================================================
}
}
\ No newline at end of file
VIZ.TVP.Golf.Module/Package/GroupRanking/GroupRankingViewModelBase.cs
View file @
1cc292a5
...
...
@@ -5,8 +5,10 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Documents
;
using
VIZ.Framework.Core
;
using
VIZ.TVP.Golf.Domain
;
using
VIZ.TVP.Golf.Service
;
namespace
VIZ.TVP.Golf.Module
{
...
...
@@ -35,7 +37,7 @@ namespace VIZ.TVP.Golf.Module
#
region
SelectedRound
--
选中的轮次
private
int
selectedRound
=
2
;
private
int
selectedRound
=
TvpStaticResource
.
DEFAULT_ROUND
;
/// <summary>
/// 选中的轮次信息
/// </summary>
...
...
@@ -82,7 +84,7 @@ namespace VIZ.TVP.Golf.Module
List
<
PlayerRealModel
>
list
=
this
.
realDataService
.
LoadPlayerRealModelFormLocal
(
vm
.
SelectedFile
.
FileName
);
this
.
Update
GroupTempModels
(
list
);
this
.
GroupTempModels
=
this
.
Get
GroupTempModels
(
list
);
}
#
endregion
...
...
@@ -109,7 +111,7 @@ namespace VIZ.TVP.Golf.Module
{
List
<
PlayerRealModel
>
list
=
this
.
realDataService
.
LoadPlayerRealModelFormLocal
(
fileName
);
this
.
Update
GroupTempModels
(
list
);
this
.
GroupTempModels
=
this
.
Get
GroupTempModels
(
list
);
});
});
}
...
...
@@ -121,12 +123,69 @@ namespace VIZ.TVP.Golf.Module
// ===================================================================================
/// <summary>
///
更新组临时模型
///
获取组临时模型集合
/// </summary>
/// <param name="list">球员真实模型</param>
protected
virtual
void
UpdateGroupTempModels
(
List
<
PlayerRealModel
>
list
)
/// <returns>组临时模型集合</returns>
protected
virtual
ObservableCollection
<
GroupTempModel
>
GetGroupTempModels
(
List
<
PlayerRealModel
>
list
)
{
List
<
GroupTempModel
>
groupTempModels
=
new
List
<
GroupTempModel
>();
var
groups
=
ApplicationDomainEx
.
PlayerInfos
.
GroupBy
(
p
=>
p
.
Group
);
foreach
(
var
group
in
groups
)
{
foreach
(
var
team_group
in
group
.
GroupBy
(
p
=>
p
.
TeamID
))
{
GroupTempModel
temp_model
=
new
GroupTempModel
();
temp_model
.
Group
=
group
.
Key
;
temp_model
.
TeamInfo
=
ApplicationDomainEx
.
TeamInfos
.
FirstOrDefault
(
p
=>
p
.
TeamID
==
team_group
.
Key
);
temp_model
.
TeamLogo
=
temp_model
.
TeamInfo
?.
Logo
;
List
<
PlayerInfoModel
>
players
=
team_group
.
ToList
();
if
(
players
.
Count
!=
2
)
continue
;
temp_model
.
Player1
=
players
[
0
];
temp_model
.
Player2
=
players
[
1
];
temp_model
.
PlayersDisplayName
=
$"
{
temp_model
.
Player1
.
Name
}
/
{
temp_model
.
Player2
.
Name
}
"
;
PlayerRealModel
player1
=
list
.
FirstOrDefault
(
p
=>
p
.
PlayerID
==
temp_model
.
Player1
.
PlayerID
);
PlayerRealModel
player2
=
list
.
FirstOrDefault
(
p
=>
p
.
PlayerID
==
temp_model
.
Player2
.
PlayerID
);
if
(
player1
==
null
||
player2
==
null
)
continue
;
var
dic
=
this
.
realDataService
.
GetGroupHoleStatisticsDataDic
(
group
.
Key
,
player1
,
player2
,
this
.
SelectedRound
);
foreach
(
HoleInfoModel
holeInfo
in
ApplicationDomainEx
.
HoleInfos
)
{
GroupHoleTempModel
model
=
new
GroupHoleTempModel
();
model
.
HoleID
=
holeInfo
.
HoleID
.
ToString
();
model
.
Par
=
holeInfo
.
Par
;
if
(!
dic
.
TryGetValue
(
holeInfo
.
HoleID
,
out
GroupHoleStatisticsData
data
))
continue
;
model
.
TotalStrokes
=
data
.
Strokes
.
ToString
();
model
.
TotalScore
=
this
.
realDataService
.
GetScoreString
(
data
.
Score
);
model
.
TotalStrokesDetail
=
$"
{
data
.
Player1
.
Name
}
:
{
data
.
PlayerStrokes1
}
|
{
data
.
Player2
.
Name
}
:
{
data
.
PlayerStrokes2
}
"
;
temp_model
.
GroupHoleTempModels
.
Add
(
model
);
}
int
total_score
=
dic
.
Values
.
Sum
(
p
=>
p
.
Score
);
temp_model
.
PlayersScore
=
this
.
realDataService
.
GetScoreString
(
total_score
);
groupTempModels
.
Add
(
temp_model
);
}
}
// 排序
GroupTempModelComparer
comparer
=
new
GroupTempModelComparer
(
list
,
this
.
SelectedRound
);
groupTempModels
.
Sort
(
comparer
);
this
.
realDataService
.
UpdateGroupPosition
(
groupTempModels
);
return
groupTempModels
.
ToObservableCollection
();
}
}
}
VIZ.TVP.Golf.Module/Package/GroupRanking/LongGroupRanking/View/LongGroupRankingView.xaml
View file @
1cc292a5
...
...
@@ -12,7 +12,7 @@
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:LongGroupRankingViewModel}"
mc:Ignorable="d"
d:DesignHeight="
8
00" d:DesignWidth="1700">
d:DesignHeight="
10
00" d:DesignWidth="1700">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
...
...
@@ -41,6 +41,13 @@
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
<Rectangle Width="2" Margin="10,0,10,0" Height="30" Fill="#44000000"></Rectangle>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/contrast_16x16.png"
Content="加载对比数据" Command="{Binding Path=LoadContrastDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_green_16x16.png" Margin="5,0,0,0"
Content="根据界面值刷新索引变化" Command="{Binding Path=RefreshIndexChangedCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
...
...
@@ -61,7 +68,6 @@
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="轮次:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1"></TextBlock>
<StackPanel Grid.Column="1" Margin="10,0,10,0" HorizontalAlignment="Left" Orientation="Horizontal">
<ComboBox Height="30" Width="220" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=SelectedRound,Mode=TwoWay}"
...
...
@@ -76,27 +82,55 @@
<TextBlock Text="排名" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
VerticalAlignment="Top" Margin="0,5,0,0"></Image>
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="200" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=PlayersStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="Logo" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=TeamLogo}"></DataGridComboBoxColumn>
</DataGrid.Columns>
</DataGrid>
VerticalAlignment="Top" Margin="0,30,0,0"></Image>
<GroupBox Header="实时数据" Grid.Column="1" Padding="10" Margin="0,0,5,0">
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}"
SelectedValue="{Binding Path=SelectedGroupTempModel,Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
<DataGridTextColumn Header="之前索引" Width="60" Binding="{Binding Path=PositionOldIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="之后索引" Width="60" Binding="{Binding Path=PositionNewIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="索引变化" Width="80" Binding="{Binding Path=PositionChangedDesc}" IsReadOnly="True"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Header="对比数据" Grid.Column="2" Padding="10" Margin="5,0,0,0">
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=ConstrrastGroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Header="小组每洞数据" Grid.Row="1" Grid.Column="1" Padding="10" Margin="0,0,5,0">
<DataGrid Grid.Row="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding SelectedGroupTempModel.GroupHoleTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="编号(*)" Width="100" Binding="{Binding Path=HoleID}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="标准杆(*)" Width="100" Binding="{Binding Path=Par}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数(*)" Width="100" Binding="{Binding Path=TotalStrokes}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=TotalScore}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数描述" Width="200" Binding="{Binding Path=TotalStrokesDetail}" IsReadOnly="True"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
...
...
VIZ.TVP.Golf.Module/Package/GroupRanking/LongGroupRanking/ViewModel/LongGroupRankingViewModel.cs
View file @
1cc292a5
...
...
@@ -5,6 +5,7 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Navigation
;
using
VIZ.Framework.Core
;
using
VIZ.TVP.Golf.Domain
;
...
...
@@ -13,7 +14,7 @@ namespace VIZ.TVP.Golf.Module
/// <summary>
/// 包装视图模型 -- 长版小组排名
/// </summary>
public
class
LongGroupRankingViewModel
:
GroupRankingViewModelBase
public
class
LongGroupRankingViewModel
:
GroupRanking
Constrrast
ViewModelBase
{
public
LongGroupRankingViewModel
()
{
...
...
@@ -24,6 +25,48 @@ namespace VIZ.TVP.Golf.Module
// Property
// ===================================================================================
#
region
GroupPickerPanelModel
--
分组选择面板模型
private
GroupPickerPanelModel
groupPickerPanelModel
=
new
GroupPickerPanelModel
();
/// <summary>
/// 分组选择面板模型
/// </summary>
public
GroupPickerPanelModel
GroupPickerPanelModel
{
get
{
return
groupPickerPanelModel
;
}
set
{
groupPickerPanelModel
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
GroupPickerPanelModel
));
}
}
#
endregion
#
region
SelectedGroupTempModel
--
选中的分组模型
private
GroupTempModel
selectedGroupTempModel
;
/// <summary>
/// 选中的分组模型
/// </summary>
public
GroupTempModel
SelectedGroupTempModel
{
get
{
return
selectedGroupTempModel
;
}
set
{
selectedGroupTempModel
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SelectedGroupTempModel
));
}
}
#
endregion
#
region
GroupHoleTempModels
--
分组洞信息临时模型集合
private
ObservableCollection
<
GroupHoleTempModel
>
groupHoleTempModels
;
/// <summary>
/// 分组洞信息临时模型集合
/// </summary>
public
ObservableCollection
<
GroupHoleTempModel
>
GroupHoleTempModels
{
get
{
return
groupHoleTempModels
;
}
set
{
groupHoleTempModels
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
GroupHoleTempModels
));
}
}
#
endregion
// ===================================================================================
// Command
// ===================================================================================
...
...
VIZ.TVP.Golf.Module/Package/GroupRanking/ShortGroupRanking/View/ShortMatchGroupRankingView.xaml
View file @
1cc292a5
...
...
@@ -41,6 +41,13 @@
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
<Rectangle Width="2" Margin="10,0,10,0" Height="30" Fill="#44000000"></Rectangle>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/contrast_16x16.png"
Content="加载对比数据" Command="{Binding Path=LoadContrastDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_green_16x16.png" Margin="5,0,0,0"
Content="根据界面值刷新索引变化" Command="{Binding Path=RefreshIndexChangedCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
...
...
@@ -61,7 +68,6 @@
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="轮次:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1"></TextBlock>
<StackPanel Grid.Column="1" Margin="10,0,10,0" HorizontalAlignment="Left" Orientation="Horizontal">
<ComboBox Height="30" Width="220" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=SelectedRound,Mode=TwoWay}"
...
...
@@ -78,22 +84,34 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
VerticalAlignment="Top" Margin="0,5,0,0"></Image>
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="200" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=PlayersStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="Logo" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=TeamLogo}"></DataGridComboBoxColumn>
</DataGrid.Columns>
</DataGrid>
VerticalAlignment="Top" Margin="0,30,0,0"></Image>
<GroupBox Header="实时数据" Grid.Column="1" Padding="10" Margin="0,0,5,0">
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
<DataGridTextColumn Header="之前索引" Width="60" Binding="{Binding Path=PositionOldIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="之后索引" Width="60" Binding="{Binding Path=PositionNewIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="索引变化" Width="80" Binding="{Binding Path=PositionChangedDesc}" IsReadOnly="True"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Header="对比数据" Grid.Column="2" Padding="10" Margin="5,0,0,0">
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=ConstrrastGroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
</GroupBox>
...
...
@@ -118,4 +136,4 @@
</Grid>
</Border>
</Grid>
</UserControl>
</UserControl>
\ No newline at end of file
VIZ.TVP.Golf.Module/Package/GroupRanking/ShortGroupRanking/ViewModel/ShortGroupRankingViewModel.cs
View file @
1cc292a5
...
...
@@ -13,7 +13,7 @@ namespace VIZ.TVP.Golf.Module
/// <summary>
/// 包装视图模型 -- 短板小组排名
/// </summary>
public
class
ShortGroupRankingViewModel
:
GroupRankingViewModelBase
public
class
ShortGroupRankingViewModel
:
GroupRanking
Constrrast
ViewModelBase
{
public
ShortGroupRankingViewModel
()
{
...
...
VIZ.TVP.Golf.Module/Package/TeamRanking/TeamRankingConstrrastViewModelBase.cs
View file @
1cc292a5
...
...
@@ -78,6 +78,7 @@ namespace VIZ.TVP.Golf.Module
List
<
PlayerRealModel
>
list
=
this
.
realDataService
.
LoadPlayerRealModelFormLocal
(
vm
.
SelectedFile
.
FileName
);
this
.
ContrastTeamTempModels
=
this
.
GetTeamTempModels
(
list
);
this
.
realDataService
.
UpdateTeamPosition
(
this
.
ContrastTeamTempModels
);
this
.
realDataService
.
UpdateTeamPositionChanged
(
this
.
ContrastTeamTempModels
,
this
.
TeamTempModels
);
}
...
...
VIZ.TVP.Golf.Module/VIZ.TVP.Golf.Module.csproj
View file @
1cc292a5
...
...
@@ -145,6 +145,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Widgets\Group\GroupPickerPanelSingle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
...
...
@@ -219,6 +223,7 @@
<Compile Include="Package\GroupInfo\View\GroupInfoWithHoleView.xaml.cs">
<DependentUpon>GroupInfoWithHoleView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\GroupRanking\GroupRankingConstrrastViewModelBase.cs" />
<Compile Include="Package\GroupRanking\LongGroupRanking\ViewModel\LongGroupRankingViewModel.cs" />
<Compile Include="Package\GroupRanking\LongGroupRanking\View\LongGroupRankingView.xaml.cs">
<DependentUpon>LongGroupRankingView.xaml</DependentUpon>
...
...
@@ -271,6 +276,9 @@
</Compile>
<Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" />
<Compile Include="Widgets\Detail\DetailPanelModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPanelSingle.xaml.cs">
<DependentUpon>GroupPickerPanelSingle.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml.cs">
<DependentUpon>GroupPickerPanelNoPlayer.xaml</DependentUpon>
</Compile>
...
...
VIZ.TVP.Golf.Module/Widgets/Group/GroupPickerPanelSingle.xaml
0 → 100644
View file @
1cc292a5
<UserControl x:Class="VIZ.TVP.Golf.Module.GroupPickerPanelSingle"
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:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:GroupPickerPanelModel}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="1000">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_player" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<!-- 预设 -->
<StackPanel Orientation="Horizontal">
<!-- 名称 -->
<TextBlock Text="名称:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Width="30" TextAlignment="Right"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=Name,Mode=TwoWay}" IsReadOnly="True" Padding="3" Width="200"></TextBox>
<!-- 预设 -->
<TextBlock Text="预设:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Width="30" TextAlignment="Right"></TextBlock>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="选择分组" Grid.Column="1" Width="80" Height="30" Margin="5,0,0,0"
Command="{Binding SelectGroupCommand}"></fcommon:IconButton>
</StackPanel>
</Grid>
</UserControl>
VIZ.TVP.Golf.Module/Widgets/Group/GroupPickerPanelSingle.xaml.cs
0 → 100644
View file @
1cc292a5
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
VIZ.TVP.Golf.Module
{
/// <summary>
/// GroupPickerPanelSingle.xaml 的交互逻辑
/// </summary>
public
partial
class
GroupPickerPanelSingle
:
UserControl
{
public
GroupPickerPanelSingle
()
{
InitializeComponent
();
}
}
}
VIZ.TVP.Golf.Service/RealData/Implementation/RealDataService.cs
View file @
1cc292a5
...
...
@@ -422,7 +422,8 @@ namespace VIZ.TVP.Golf.Service
/// <summary>
/// 更新队伍排名变化
/// </summary>
/// <param name="teams">已经完成排序的队伍</param>
/// <param name="before">之前的排名</param>
/// <param name="after">之后的排名</param>
public
void
UpdateTeamPositionChanged
(
IList
<
TeamTempModel
>
before
,
IList
<
TeamTempModel
>
after
)
{
foreach
(
TeamTempModel
after_team
in
after
)
...
...
@@ -436,5 +437,55 @@ namespace VIZ.TVP.Golf.Service
after_team
.
PositionChangedDesc
=
$"
{
after_team
.
PositionOldIndex
}
-->
{
after_team
.
PositionNewIndex
}
"
;
}
}
/// <summary>
/// 更新分组排名值
/// </summary>
/// <param name="groups">已经完成排序的分组</param>
public
void
UpdateGroupPosition
(
IList
<
GroupTempModel
>
groups
)
{
int
position
=
1
;
for
(
int
i
=
0
;
i
<
groups
.
Count
;
i
++)
{
if
(
groups
[
i
].
PlayerScoreValue
==
null
)
break
;
if
(
i
==
0
)
{
groups
[
i
].
Position
=
position
.
ToString
();
continue
;
}
if
(
groups
[
i
].
PlayerScoreValue
==
groups
[
i
-
1
].
PlayerScoreValue
)
{
groups
[
i
].
Position
=
$"T
{
position
}
"
;
}
else
{
groups
[
i
].
Position
=
$"
{
position
}
"
;
++
position
;
}
}
}
/// <summary>
/// 更新分组排名变化
/// </summary>
/// <param name="before">之前的排名</param>
/// <param name="after">之后的排名</param>
public
void
UpdateGroupPositionChanged
(
IList
<
GroupTempModel
>
before
,
IList
<
GroupTempModel
>
after
)
{
foreach
(
GroupTempModel
after_group
in
after
)
{
GroupTempModel
before_group
=
before
.
FirstOrDefault
(
p
=>
p
.
Group
==
after_group
.
Group
&&
p
.
TeamInfo
==
after_group
.
TeamInfo
);
if
(
before_group
==
null
)
continue
;
after_group
.
PositionOldIndex
=
before
.
IndexOf
(
before_group
);
after_group
.
PositionNewIndex
=
after
.
IndexOf
(
after_group
);
after_group
.
PositionChangedDesc
=
$"
{
after_group
.
PositionOldIndex
}
-->
{
after_group
.
PositionNewIndex
}
"
;
}
}
}
}
VIZ.TVP.Golf.Service/RealData/Interface/IRealDataService.cs
View file @
1cc292a5
...
...
@@ -121,5 +121,18 @@ namespace VIZ.TVP.Golf.Service
/// </summary>
/// <param name="teams">已经完成排序的队伍</param>
void
UpdateTeamPositionChanged
(
IList
<
TeamTempModel
>
before
,
IList
<
TeamTempModel
>
after
);
/// <summary>
/// 更新分组排名值
/// </summary>
/// <param name="groups">已经完成排序的分组</param>
void
UpdateGroupPosition
(
IList
<
GroupTempModel
>
groups
);
/// <summary>
/// 更新分组排名变化
/// </summary>
/// <param name="before">之前的排名</param>
/// <param name="after">之后的排名</param>
void
UpdateGroupPositionChanged
(
IList
<
GroupTempModel
>
before
,
IList
<
GroupTempModel
>
after
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment