Commit 564eeaba by liulongfei

打开当前页 Take当前页

parent 5f14b939
...@@ -25,6 +25,12 @@ namespace VIZ.Package.Module ...@@ -25,6 +25,12 @@ namespace VIZ.Package.Module
void Take(Action callback); void Take(Action callback);
/// <summary> /// <summary>
/// 当页打开后Take指定页
/// </summary>
/// <param name="pageBase">指定页</param>
void TakeWhenPageOpend(PageModelBase pageBase);
/// <summary>
/// 继续 /// 继续
/// </summary> /// </summary>
void Continue(); void Continue();
......
...@@ -52,9 +52,19 @@ namespace VIZ.Package.Module ...@@ -52,9 +52,19 @@ namespace VIZ.Package.Module
private void InitMessage() private void InitMessage()
{ {
ApplicationDomainEx.MessageManager.Register<HotkeyMessage>(this, this.OnHotkeyMessage); ApplicationDomainEx.MessageManager.Register<HotkeyMessage>(this, this.OnHotkeyMessage);
ApplicationDomainEx.MessageManager.Register<PageOpenOverMessage>(this, this.OnPageOpenOverMessage);
} }
// ============================================================== // ==============================================================
// Field
// ==============================================================
/// <summary>
/// 等待Take的页
/// </summary>
private PageModelBase waitTakePageBase;
// ==============================================================
// Service & Controller // Service & Controller
// ============================================================== // ==============================================================
...@@ -277,6 +287,23 @@ namespace VIZ.Package.Module ...@@ -277,6 +287,23 @@ namespace VIZ.Package.Module
} }
} }
/// <summary>
/// 页打开完成消息
/// </summary>
/// <param name="msg">消息</param>
private void OnPageOpenOverMessage(PageOpenOverMessage msg)
{
if (this.waitTakePageBase == null)
return;
if (this.waitTakePageBase != msg.Page)
return;
this.waitTakePageBase = null;
this.Take();
}
// ============================================================== // ==============================================================
// Public Function // Public Function
// ============================================================== // ==============================================================
...@@ -333,6 +360,15 @@ namespace VIZ.Package.Module ...@@ -333,6 +360,15 @@ namespace VIZ.Package.Module
}); });
} }
/// <summary>
/// 当页打开后Take指定页
/// </summary>
/// <param name="pageBase">指定页</param>
public void TakeWhenPageOpend(PageModelBase pageBase)
{
this.waitTakePageBase = pageBase;
}
// ============================================================== // ==============================================================
// Private Function // Private Function
// ============================================================== // ==============================================================
......
...@@ -425,6 +425,9 @@ ...@@ -425,6 +425,9 @@
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/> Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
</dxg:TableView.ColumnMenuCustomizations> </dxg:TableView.ColumnMenuCustomizations>
<dxg:TableView.RowCellMenuCustomizations> <dxg:TableView.RowCellMenuCustomizations>
<dxb:BarButtonItem Name="OpenAndTakePage" Content="Take"
Command="{Binding ElementName=uc,Path=DataContext.OpenAndTakePageCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarButtonItem Name="OpenPage" Content="打开" <dxb:BarButtonItem Name="OpenPage" Content="打开"
Command="{Binding ElementName=uc,Path=DataContext.OpenPageCommand}" Command="{Binding ElementName=uc,Path=DataContext.OpenPageCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/> Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
......
...@@ -96,6 +96,7 @@ namespace VIZ.Package.Module ...@@ -96,6 +96,7 @@ namespace VIZ.Package.Module
this.DeleteGroupCommand = new VCommand(this.DeleteGroup); this.DeleteGroupCommand = new VCommand(this.DeleteGroup);
this.DeleteItemCommand = new VCommand(this.DeleteItem); this.DeleteItemCommand = new VCommand(this.DeleteItem);
this.OpenPageCommand = new VCommand(this.OpenPage, this.CanOpenPage); this.OpenPageCommand = new VCommand(this.OpenPage, this.CanOpenPage);
this.OpenAndTakePageCommand = new VCommand(this.OpenAndTakePage, this.CanOpenAndTakePage);
this.UpdateCommand = new VCommand(this.Update, this.CanUpdate); this.UpdateCommand = new VCommand(this.Update, this.CanUpdate);
this.TakeClearCommand = new VCommand(this.TakeClear); this.TakeClearCommand = new VCommand(this.TakeClear);
this.TakeInitCommand = new VCommand(this.TakeInit, this.CanTakeInit); this.TakeInitCommand = new VCommand(this.TakeInit, this.CanTakeInit);
...@@ -467,6 +468,51 @@ namespace VIZ.Package.Module ...@@ -467,6 +468,51 @@ namespace VIZ.Package.Module
#endregion #endregion
#region OpenAndTakePageCommand -- 打开并Take页命令
/// <summary>
/// 打开并Take页命令
/// </summary>
public VCommand OpenAndTakePageCommand { get; set; }
/// <summary>
/// 是否可以打开并Take页
/// </summary>
/// <returns>是否可以打开并Take页</returns>
private bool CanOpenAndTakePage()
{
return this.SelectedPageGroupModel != null &&
this.SelectedPageGroupModel.SelectedPage != null;
}
/// <summary>
/// 打开并Take页
/// </summary>
private void OpenAndTakePage()
{
if (this.SelectedPageGroupModel == null)
return;
if (this.SelectedPageGroupModel.SelectedPage == null)
return;
// 记录操作日志
string remark = $"{this.SelectedPageGroupModel.SelectedPage.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_OPEN, remark);
// 设置需要等待Take的页
IControlService service = ApplicationDomainEx.ServiceManager.GetService<IControlService>(ViewServiceKeys.CONTROL_SERVICE);
if (service == null)
return;
service.TakeWhenPageOpend(this.SelectedPageGroupModel.SelectedPage);
// 打开页
this.OpenPage(this.SelectedPageGroupModel.SelectedPage);
}
#endregion
#region UpdateCommand -- 更新命令 #region UpdateCommand -- 更新命令
/// <summary> /// <summary>
...@@ -1020,6 +1066,15 @@ namespace VIZ.Package.Module ...@@ -1020,6 +1066,15 @@ namespace VIZ.Package.Module
return; return;
} }
// 打开并Take选中页
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.OpenAndTakeSelectedPage))
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.OpenAndTakePage();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition> <RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Take --> <!-- Take -->
<TextBlock Text="Take:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock> <TextBlock Text="Take:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
...@@ -75,6 +76,10 @@ ...@@ -75,6 +76,10 @@
<TextBlock Text="Take当前页打开下一页:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="5"></TextBlock> <TextBlock Text="Take当前页打开下一页:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="5"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Height="30" Grid.Row="5" Margin="15,0,10,0" <fcommon:HotkeyBox Grid.Column="1" Height="30" Grid.Row="5" Margin="15,0,10,0"
Hotkey="{Binding Path=TakeAndOpenNextPage,Mode=TwoWay}"></fcommon:HotkeyBox> Hotkey="{Binding Path=TakeAndOpenNextPage,Mode=TwoWay}"></fcommon:HotkeyBox>
<!-- 打开并Take -->
<TextBlock Text="打开并Take选中页:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="6"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Height="30" Grid.Row="6" Margin="15,0,10,0"
Hotkey="{Binding Path=TakeAndOpenNextPage,Mode=TwoWay}"></fcommon:HotkeyBox>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Header="其他快捷键" Margin="10,5,10,10" Padding="5" Grid.Row="1"> <GroupBox Header="其他快捷键" Margin="10,5,10,10" Padding="5" Grid.Row="1">
......
...@@ -153,6 +153,20 @@ namespace VIZ.Package.Module ...@@ -153,6 +153,20 @@ namespace VIZ.Package.Module
#endregion #endregion
#region OpenAndTakeSelectedPage -- 打开并Take当前页
private string openAndTakeSelectedPage;
/// <summary>
/// 打开并Take当前页
/// </summary>
public string OpenAndTakeSelectedPage
{
get { return openAndTakeSelectedPage; }
set { openAndTakeSelectedPage = value; this.RaisePropertyChanged(nameof(OpenAndTakeSelectedPage)); }
}
#endregion
#region SaveOpendPageOrTemplateAndProject -- 保存当前打开的页或模板和项目 #region SaveOpendPageOrTemplateAndProject -- 保存当前打开的页或模板和项目
private string saveOpendPageOrTemplateAndProject; private string saveOpendPageOrTemplateAndProject;
...@@ -196,6 +210,7 @@ namespace VIZ.Package.Module ...@@ -196,6 +210,7 @@ namespace VIZ.Package.Module
this.TakeUpdate = config.TakeUpdate; this.TakeUpdate = config.TakeUpdate;
this.OpenNextPage = config.OpenNextPage; this.OpenNextPage = config.OpenNextPage;
this.TakeAndOpenNextPage = config.TakeAndOpenNextPage; this.TakeAndOpenNextPage = config.TakeAndOpenNextPage;
this.OpenAndTakeSelectedPage = config.OpenAndTakeSelectedPage;
this.SaveOpendPageOrTemplateAndProject = config.SaveOpendPageOrTemplateAndProject; this.SaveOpendPageOrTemplateAndProject = config.SaveOpendPageOrTemplateAndProject;
} }
...@@ -218,6 +233,7 @@ namespace VIZ.Package.Module ...@@ -218,6 +233,7 @@ namespace VIZ.Package.Module
config.TakeUpdate = this.TakeUpdate; config.TakeUpdate = this.TakeUpdate;
config.OpenNextPage = this.OpenNextPage; config.OpenNextPage = this.OpenNextPage;
config.TakeAndOpenNextPage = this.TakeAndOpenNextPage; config.TakeAndOpenNextPage = this.TakeAndOpenNextPage;
config.OpenAndTakeSelectedPage = this.OpenAndTakeSelectedPage;
config.SaveOpendPageOrTemplateAndProject = this.SaveOpendPageOrTemplateAndProject; config.SaveOpendPageOrTemplateAndProject = this.SaveOpendPageOrTemplateAndProject;
ApplicationDomainEx.LocalDbContext.HotKeyConfig.Update(config); ApplicationDomainEx.LocalDbContext.HotKeyConfig.Update(config);
...@@ -262,6 +278,10 @@ namespace VIZ.Package.Module ...@@ -262,6 +278,10 @@ namespace VIZ.Package.Module
{ {
this.TakeAndOpenNextPage = string.Empty; this.TakeAndOpenNextPage = string.Empty;
} }
if (string.Equals(this.OpenAndTakeSelectedPage, key))
{
this.OpenAndTakeSelectedPage = string.Empty;
}
if (string.Equals(this.SaveOpendPageOrTemplateAndProject, key)) if (string.Equals(this.SaveOpendPageOrTemplateAndProject, key))
{ {
this.SaveOpendPageOrTemplateAndProject = string.Empty; this.SaveOpendPageOrTemplateAndProject = string.Empty;
......
...@@ -69,6 +69,11 @@ namespace VIZ.Package.Storage ...@@ -69,6 +69,11 @@ namespace VIZ.Package.Storage
public string TakeAndOpenNextPage { get; set; } = "F10"; public string TakeAndOpenNextPage { get; set; } = "F10";
/// <summary> /// <summary>
/// 打开当前页 Take & 当前当前页
/// </summary>
public string OpenAndTakeSelectedPage { get; set; } = "F11";
/// <summary>
/// 保存当前打开的页或模板和项目 /// 保存当前打开的页或模板和项目
/// </summary> /// </summary>
public string SaveOpendPageOrTemplateAndProject { get; set; } = "Ctrl + S"; public string SaveOpendPageOrTemplateAndProject { get; set; } = "Ctrl + S";
......
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