Commit 8ce6ba0f by wangonghui

CBA部分界面的改造

parent 05d68315
...@@ -260,10 +260,7 @@ ...@@ -260,10 +260,7 @@
dx:ScrollBarExtensions.ScrollBarMode="TouchOverlap" dx:ScrollBarExtensions.ScrollBarMode="TouchOverlap"
Focusable="False"> Focusable="False">
</ScrollViewer>--> </ScrollViewer>-->
<dxg:GridControl x:Name="PlayerStatsGrid" ItemsSource="{Binding Path= ShowInfoPlayersStats,Mode=TwoWay}" Grid.Row="0"> <dxg:GridControl x:Name="PlayerStatsGrid" ItemsSource="{Binding Path= ShowInfoPlayersStats,Mode=TwoWay}" Grid.Row="0">
<dxg:GridColumn FieldName="PlayerName" Header="姓名" Width="*" /> <dxg:GridColumn FieldName="PlayerName" Header="姓名" Width="*" />
<dxg:GridColumn FieldName="PlayTime" Header="上场时间" Width="*" /> <dxg:GridColumn FieldName="PlayTime" Header="上场时间" Width="*" />
...@@ -286,11 +283,8 @@ ...@@ -286,11 +283,8 @@
<dxg:GridColumn FieldName="ThreeArea" Header="三分区" Width="*" /> <dxg:GridColumn FieldName="ThreeArea" Header="三分区" Width="*" />
<dxg:GridColumn FieldName="FreeThrow" Header="罚球" Width="*" /> <dxg:GridColumn FieldName="FreeThrow" Header="罚球" Width="*" />
<dxg:GridColumn FieldName="ShootingGoalP" Header="投篮命中率" Width="*" /> <dxg:GridColumn FieldName="ShootingGoalP" Header="投篮命中率" Width="*" />
<dxg:GridColumn FieldName="Steals" Header="抢断" Width="*" /> <dxg:GridColumn FieldName="Steals" Header="抢断" Width="*" />
<dxg:GridColumn FieldName="Blocks" Header="盖帽" Width="*" /> <dxg:GridColumn FieldName="Blocks" Header="盖帽" Width="*" />
<dxg:GridColumn FieldName="TwoShootingGoalP" Header="两分命中率" Width="*" /> <dxg:GridColumn FieldName="TwoShootingGoalP" Header="两分命中率" Width="*" />
<dxg:GridColumn FieldName="ThreeShootingGoalP" Header="三分命中率" Width="*" /> <dxg:GridColumn FieldName="ThreeShootingGoalP" Header="三分命中率" Width="*" />
<dxg:GridColumn FieldName="FreeThrowP" Header="罚球命中率" Width="*" /> <dxg:GridColumn FieldName="FreeThrowP" Header="罚球命中率" Width="*" />
...@@ -309,7 +303,7 @@ ...@@ -309,7 +303,7 @@
AllowColumnFiltering="False" AllowColumnFiltering="False"
AllowSorting="False" AllowSorting="False"
AllowEditing="False" AllowEditing="False"
IsColumnMenuEnabled="False" > IsColumnMenuEnabled="False" >
</dxg:TableView> </dxg:TableView>
</dxg:GridControl.View> </dxg:GridControl.View>
......
...@@ -53,8 +53,6 @@ namespace VIZ.TVP.CBA.Module ...@@ -53,8 +53,6 @@ namespace VIZ.TVP.CBA.Module
set { matchItems = value; this.RaisePropertyChanged(nameof(MatchItems)); } set { matchItems = value; this.RaisePropertyChanged(nameof(MatchItems)); }
} }
//private string selectMatchItems; //private string selectMatchItems;
///// <summary> ///// <summary>
...@@ -72,7 +70,6 @@ namespace VIZ.TVP.CBA.Module ...@@ -72,7 +70,6 @@ namespace VIZ.TVP.CBA.Module
// ScheduleID = SetMatchDict[SelectMatchItems]; // ScheduleID = SetMatchDict[SelectMatchItems];
// } // }
//} //}
/// <summary> /// <summary>
/// 比赛状态 /// 比赛状态
/// </summary> /// </summary>
...@@ -223,7 +220,7 @@ namespace VIZ.TVP.CBA.Module ...@@ -223,7 +220,7 @@ namespace VIZ.TVP.CBA.Module
#region 球员统计信息 #region 球员统计信息
//if (TeamStatsViewModel.CreateInstance)
if(TeamStatsViewModel.TeamStatsViewModelInstance.Count>0) if(TeamStatsViewModel.TeamStatsViewModelInstance.Count>0)
{ {
// Log.Error(string.Format("TeamStatsViewModel.CreateInstance Count:{0}", TeamStatsViewModel.TeamStatsViewModelInstance.Count)); // Log.Error(string.Format("TeamStatsViewModel.CreateInstance Count:{0}", TeamStatsViewModel.TeamStatsViewModelInstance.Count));
...@@ -239,6 +236,19 @@ namespace VIZ.TVP.CBA.Module ...@@ -239,6 +236,19 @@ namespace VIZ.TVP.CBA.Module
} }
} }
if(NewTeamStatsViewModel.TeamStatsViewModelInstance.Count>0)
{
foreach (var tempTeamStatsViewModel in NewTeamStatsViewModel.TeamStatsViewModelInstance)
{
tempTeamStatsViewModel.ScheduleID = selectMatchData.ScheduleID;
tempTeamStatsViewModel.Matchtypeid = selectMatchData.ScheduleTypeID;
tempTeamStatsViewModel.SetTeamData();
}
}
#endregion #endregion
...@@ -275,9 +285,24 @@ namespace VIZ.TVP.CBA.Module ...@@ -275,9 +285,24 @@ namespace VIZ.TVP.CBA.Module
playerCompareViewModel.SetCompareData(); playerCompareViewModel.SetCompareData();
} }
} }
if(NewPlayerComPareViewModel.PlayerCompareViewModelInstance.Count>0)
{
foreach (var playerCompareViewModel in NewPlayerComPareViewModel.PlayerCompareViewModelInstance)
{
//PlayerCompareViewModel playerCompareViewModel = PlayerCompareViewModel.CreateInstance;
playerCompareViewModel.ScheduleID = selectMatchData.ScheduleID;
playerCompareViewModel.Matchtypeid = selectMatchData.ScheduleTypeID;
playerCompareViewModel.SetCompareData();
}
}
#endregion #endregion
} }
} }
......
...@@ -207,6 +207,24 @@ ...@@ -207,6 +207,24 @@
</TabItem> </TabItem>
<TabItem Header="新球员对比" FontSize="20">
<Grid>
<moduel:NewPlayerComPareView>
</moduel:NewPlayerComPareView>
</Grid>
</TabItem>
<TabItem Header="新球队数据对比" FontSize="20">
<Grid>
<moduel:NewTeamStatsView>
</moduel:NewTeamStatsView>
</Grid>
</TabItem>
</TabControl> </TabControl>
......
...@@ -12,8 +12,6 @@ namespace VIZ.TVP.CBA.Module ...@@ -12,8 +12,6 @@ namespace VIZ.TVP.CBA.Module
public class PlayerComModel: ViewModelBase public class PlayerComModel: ViewModelBase
{ {
private string hScore; private string hScore;
public string HScore public string HScore
{ {
...@@ -68,14 +66,14 @@ namespace VIZ.TVP.CBA.Module ...@@ -68,14 +66,14 @@ namespace VIZ.TVP.CBA.Module
public string SelectLight public string SelectLight
{ {
get { return selectLight; } get { return selectLight; }
set { selectLight = value; this.RaisePropertyChanged(nameof(SelectLight)); } set {
selectLight = value;
this.RaisePropertyChanged(nameof(SelectLight));
}
} }
private string techStatsName; private string techStatsName;
public string TechStatsName public string TechStatsName
{ {
get { return techStatsName; } get { return techStatsName; }
......
...@@ -42,7 +42,7 @@ namespace VIZ.TVP.CBA.Module ...@@ -42,7 +42,7 @@ namespace VIZ.TVP.CBA.Module
info.ID = PLUGIN_ID; info.ID = PLUGIN_ID;
info.Name = PLUGIN_NAME; info.Name = PLUGIN_NAME;
info.PluginType = PluginType.Page; info.PluginType = PluginType.Page;
info.ViewType = typeof(PlayerComPareView); info.ViewType = typeof(NewPlayerComPareView);
//info.SettingViewType = typeof(DayMatchUI); //info.SettingViewType = typeof(DayMatchUI);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.TVP.CBA.Module;
namespace VIZ.TVP.CBA.Module
{
/// <summary>
/// Interaction logic for NewPlayerComPareView.xaml
/// </summary>
public partial class NewPlayerComPareView : UserControl, IPluginView
{
public NewPlayerComPareViewModel vm = new NewPlayerComPareViewModel();
public NewPlayerComPareView()
{
InitializeComponent();
NewPlayerComPareViewModel.PlayerCompareViewModelInstance.Add(vm);
WPFHelper.BindingViewModel(this, vm);
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
}
public void Dispose()
{
}
public void PreviewContinue(ConnModel conn)
{
}
public void PreviewIn(ConnModel conn)
{
if (conn.IsConnected )
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
}
}
public void PreviewOut(ConnModel conn)
{
//if(conn.IsConnected)
// {
// conn.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
// }
}
public void TakeContinue(ConnModel conns)
{
}
public void TakeOut(ConnModel conns)
{
if (conns.IsConnected )
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
}
}
public void TakeUpdate(ConnModel conns)
{
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
}
}
public void TakIn(ConnModel conns)
{
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
}
}
/// <summary>
/// 注册任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PlayerComPareView_Init()
{
if (task != null)
return;
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "球员对比";
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
service.Register(task);
}
/// <summary>
/// 任务模型
/// </summary>
public PackageTaskModel task;
IPackageTaskService service;
private void OnPreviewUpdate(ConnModel conn)
{
if (conn.IsConnected)
{
vm.BtnCmd();
//task.CanExecute = vm.flag;
//SCRIPT_INVOKE
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
}
}
private void OnTakeUpdate(ConnModel conn)
{
if (conn.IsConnected)
{
vm.BtnCmd();
//SCRIPT_INVOKE
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
}
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
PlayerComPareView_Init();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if (task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
}
}
...@@ -39,7 +39,7 @@ namespace VIZ.TVP.CBA.Module ...@@ -39,7 +39,7 @@ namespace VIZ.TVP.CBA.Module
info.ID = PLUGIN_ID; info.ID = PLUGIN_ID;
info.Name = PLUGIN_NAME; info.Name = PLUGIN_NAME;
info.PluginType = PluginType.Page; info.PluginType = PluginType.Page;
info.ViewType = typeof(TeamStatsView); info.ViewType = typeof(NewTeamStatsView);
//info.SettingViewType = typeof(DayMatchUI); //info.SettingViewType = typeof(DayMatchUI);
......
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;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
namespace VIZ.TVP.CBA.Module
{
/// <summary>
/// Interaction logic for NewTeamStatsView.xaml
/// </summary>
public partial class NewTeamStatsView : UserControl, IPluginView
{
public NewTeamStatsViewModel vm = new NewTeamStatsViewModel();
public NewTeamStatsView()
{
InitializeComponent();
NewTeamStatsViewModel.TeamStatsViewModelInstance.Add(vm);
WPFHelper.BindingViewModel(this, vm);
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
}
public void Dispose()
{
}
public void PreviewContinue(ConnModel conn)
{
}
public void PreviewIn(ConnModel conn)
{
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
public void PreviewOut(ConnModel conn)
{
//if(conn.IsConnected)
//{
// conn.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
//}
}
public void TakeContinue(ConnModel conns)
{
}
public void TakeOut(ConnModel conns)
{
if (conns.IsConnected)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
}
}
public void TakeUpdate(ConnModel conns)
{
if (conns.IsConnected)
{
conns.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
public void TakIn(ConnModel conns)
{
if (conns.IsConnected)
{
conns.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
private void OnPreviewUpdate(ConnModel conn)
{
if (conn.IsConnected)
{
vm.BtnCmd();
//task.CanExecute = vm.flag;
//SCRIPT_INVOKE
conn.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
private void OnTakeUpdate(ConnModel conn)
{
if (conn.IsConnected)
{
vm.BtnCmd();
//SCRIPT_INVOKE
conn.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
TeamStatsView_Init();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if (task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
/// <summary>
/// 任务模型
/// </summary>
public PackageTaskModel task;
/// <summary>
/// 服务
/// </summary>
IPackageTaskService service;
/// <summary>
/// 注册任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TeamStatsView_Init()
{
if (task != null)
return;
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "球队对比数据";
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
service.Register(task);
}
}
}
...@@ -144,7 +144,11 @@ ...@@ -144,7 +144,11 @@
<Compile Include="OnAirData\OnAirDataModel.cs" /> <Compile Include="OnAirData\OnAirDataModel.cs" />
<Compile Include="PlayerCompare\Model\PlayerComModel.cs" /> <Compile Include="PlayerCompare\Model\PlayerComModel.cs" />
<Compile Include="PlayerCompare\PlayerComparePlugin.cs" /> <Compile Include="PlayerCompare\PlayerComparePlugin.cs" />
<Compile Include="PlayerCompare\ViewModel\NewPlayerComPareViewModel.cs" />
<Compile Include="PlayerCompare\ViewModel\PlayerCompareViewModel.cs" /> <Compile Include="PlayerCompare\ViewModel\PlayerCompareViewModel.cs" />
<Compile Include="PlayerCompare\View\NewPlayerComPareView.xaml.cs">
<DependentUpon>NewPlayerComPareView.xaml</DependentUpon>
</Compile>
<Compile Include="PlayerCompare\View\PlayerComPareView.xaml.cs"> <Compile Include="PlayerCompare\View\PlayerComPareView.xaml.cs">
<DependentUpon>PlayerComPareView.xaml</DependentUpon> <DependentUpon>PlayerComPareView.xaml</DependentUpon>
</Compile> </Compile>
...@@ -182,7 +186,11 @@ ...@@ -182,7 +186,11 @@
</Compile> </Compile>
<Compile Include="TeamStats\Model\MatchStatsNumbers.cs" /> <Compile Include="TeamStats\Model\MatchStatsNumbers.cs" />
<Compile Include="TeamStats\TeamStatsPlugin.cs" /> <Compile Include="TeamStats\TeamStatsPlugin.cs" />
<Compile Include="TeamStats\ViewModel\NewTeamStatsViewModel.cs" />
<Compile Include="TeamStats\ViewModel\TeamStatsViewModel.cs" /> <Compile Include="TeamStats\ViewModel\TeamStatsViewModel.cs" />
<Compile Include="TeamStats\View\NewTeamStatsView.xaml.cs">
<DependentUpon>NewTeamStatsView.xaml</DependentUpon>
</Compile>
<Compile Include="TeamStats\View\TeamStatsView.xaml.cs"> <Compile Include="TeamStats\View\TeamStatsView.xaml.cs">
<DependentUpon>TeamStatsView.xaml</DependentUpon> <DependentUpon>TeamStatsView.xaml</DependentUpon>
</Compile> </Compile>
...@@ -305,6 +313,10 @@ ...@@ -305,6 +313,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="PlayerCompare\View\NewPlayerComPareView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PlayerCompare\View\PlayerComPareView.xaml"> <Page Include="PlayerCompare\View\PlayerComPareView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -333,6 +345,10 @@ ...@@ -333,6 +345,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="TeamStats\View\NewTeamStatsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="TeamStats\View\TeamStatsView.xaml"> <Page Include="TeamStats\View\TeamStatsView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment