Commit 0b0adb28 by liulongfei

页上添加 Take, TakeContinue,TakeOut

parent 564eeaba
...@@ -31,6 +31,18 @@ namespace VIZ.Package.Module ...@@ -31,6 +31,18 @@ namespace VIZ.Package.Module
void TakeWhenPageOpend(PageModelBase pageBase); void TakeWhenPageOpend(PageModelBase pageBase);
/// <summary> /// <summary>
/// 当页打开后Continue指定页
/// </summary>
/// <param name="pageBase">指定页</param>
void TakeContinueWhenPageOpend(PageModelBase pageBase);
/// <summary>
/// 当页打开后TakeOut指定页
/// </summary>
/// <param name="pageBase">指定页</param>
void TakeOutWhenPageOpend(PageModelBase pageBase);
/// <summary>
/// 继续 /// 继续
/// </summary> /// </summary>
void Continue(); void Continue();
......
...@@ -64,6 +64,16 @@ namespace VIZ.Package.Module ...@@ -64,6 +64,16 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private PageModelBase waitTakePageBase; private PageModelBase waitTakePageBase;
/// <summary>
/// 等待Continue的页
/// </summary>
private PageModelBase waitTakeContinuePageBase;
/// <summary>
/// 等待TakeOut的页
/// </summary>
private PageModelBase waitTakeOutPageBase;
// ============================================================== // ==============================================================
// Service & Controller // Service & Controller
// ============================================================== // ==============================================================
...@@ -293,15 +303,39 @@ namespace VIZ.Package.Module ...@@ -293,15 +303,39 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
private void OnPageOpenOverMessage(PageOpenOverMessage msg) private void OnPageOpenOverMessage(PageOpenOverMessage msg)
{ {
if (this.waitTakePageBase == null) // Wait Take
if (this.waitTakePageBase != null && this.waitTakePageBase == msg.Page)
{
this.waitTakePageBase = null;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = null;
this.Take();
return; return;
}
if (this.waitTakePageBase != msg.Page) // Wait Continue
if (this.waitTakeContinuePageBase != null && this.waitTakeContinuePageBase == msg.Page)
{
this.waitTakePageBase = null;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = null;
this.Continue();
return; return;
}
this.waitTakePageBase = null; // Wait TakeOut
if (this.waitTakeOutPageBase != null && this.waitTakeOutPageBase == msg.Page)
{
this.waitTakePageBase = null;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = null;
this.TakeOut();
return;
}
this.Take(); this.waitTakePageBase = null;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = null;
} }
// ============================================================== // ==============================================================
...@@ -367,6 +401,30 @@ namespace VIZ.Package.Module ...@@ -367,6 +401,30 @@ namespace VIZ.Package.Module
public void TakeWhenPageOpend(PageModelBase pageBase) public void TakeWhenPageOpend(PageModelBase pageBase)
{ {
this.waitTakePageBase = pageBase; this.waitTakePageBase = pageBase;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = null;
}
/// <summary>
/// 当页打开后Continue指定页
/// </summary>
/// <param name="pageBase">指定页</param>
public void TakeContinueWhenPageOpend(PageModelBase pageBase)
{
this.waitTakePageBase = null;
this.waitTakeContinuePageBase = pageBase;
this.waitTakeOutPageBase = null;
}
/// <summary>
/// 当页打开后TakeOut指定页
/// </summary>
/// <param name="pageBase">指定页</param>
public void TakeOutWhenPageOpend(PageModelBase pageBase)
{
this.waitTakePageBase = null;
this.waitTakeContinuePageBase = null;
this.waitTakeOutPageBase = pageBase;
} }
// ============================================================== // ==============================================================
......
...@@ -43,6 +43,6 @@ ...@@ -43,6 +43,6 @@
</Grid> </Grid>
<!-- 数据 --> <!-- 数据 -->
</Grid> </Grid>
</UserControl> </UserControl>
...@@ -11,6 +11,7 @@ using System.Windows; ...@@ -11,6 +11,7 @@ using System.Windows;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Service; using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module namespace VIZ.Package.Module
{ {
...@@ -38,6 +39,21 @@ namespace VIZ.Package.Module ...@@ -38,6 +39,21 @@ namespace VIZ.Package.Module
this.ApplyTemplateCommand = new VCommand(this.ApplyTemplate); this.ApplyTemplateCommand = new VCommand(this.ApplyTemplate);
} }
// ============================================================
// Service & Controller
// ============================================================
/// <summary>
/// 控制对象服务
/// </summary>
private ControlObjectService controlObjectService = new ControlObjectService();
/// <summary>
/// 控制对象命令服务
/// </summary>
private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService();
// ============================================================ // ============================================================
// Property // Property
// ============================================================ // ============================================================
...@@ -108,10 +124,15 @@ namespace VIZ.Package.Module ...@@ -108,10 +124,15 @@ namespace VIZ.Package.Module
if (this.SelectedSceneTemplateModel == null) if (this.SelectedSceneTemplateModel == null)
return; return;
PageModelBase pageBase = ApplicationDomainEx.CurrentPage; if (this.ControlObject == null)
if (pageBase == null)
return; return;
ControlObjectEntity entity = this.controlObjectService.GetControlObject(this.SelectedSceneTemplateModel)?.FirstOrDefault();
ControlObjectModel controlObject = new ControlObjectModel();
this.vizCommandControlObjectService.UpdateControlObjectModel(controlObject, entity);
// 只处理文本与图片类型
List<ControlFieldNodeModel> fields = controlObject.AllFiledNodes.Where(p => p.Type == VizControlFieldType.text || p.Type == VizControlFieldType.image).ToList();
} }
......
...@@ -428,6 +428,13 @@ ...@@ -428,6 +428,13 @@
<dxb:BarButtonItem Name="OpenAndTakePage" Content="Take" <dxb:BarButtonItem Name="OpenAndTakePage" Content="Take"
Command="{Binding ElementName=uc,Path=DataContext.OpenAndTakePageCommand}" Command="{Binding ElementName=uc,Path=DataContext.OpenAndTakePageCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/> Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarButtonItem Name="OpenAndTakeContinuePage" Content="Continue"
Command="{Binding ElementName=uc,Path=DataContext.OpenAndTakeContinueCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarButtonItem Name="OpenAndTakeOutPage" Content="TakeOut"
Command="{Binding ElementName=uc,Path=DataContext.OpenAndTakeOutCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarItemLinkSeparator />
<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}"/>
......
...@@ -97,6 +97,8 @@ namespace VIZ.Package.Module ...@@ -97,6 +97,8 @@ namespace VIZ.Package.Module
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.OpenAndTakePageCommand = new VCommand(this.OpenAndTakePage, this.CanOpenAndTakePage);
this.OpenAndTakeContinueCommand = new VCommand(this.OpenAndTakeContinue, this.CanOpenAndTakeContinue);
this.OpenAndTakeOutCommand = new VCommand(this.OpenAndTakeOut, this.CanOpenAndTakeOut);
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);
...@@ -513,6 +515,94 @@ namespace VIZ.Package.Module ...@@ -513,6 +515,94 @@ namespace VIZ.Package.Module
#endregion #endregion
#region OpenAndTakeContinueCommand -- 打开并Continue页命令
/// <summary>
/// 打开并Continue页命令
/// </summary>
public VCommand OpenAndTakeContinueCommand { get; set; }
/// <summary>
/// 是否可以打开并Continue页
/// </summary>
/// <returns>是否可以打开并Continue页</returns>
private bool CanOpenAndTakeContinue()
{
return this.SelectedPageGroupModel != null && this.SelectedPageGroupModel.SelectedPage != null && this.SelectedPageGroupModel.SelectedPage.IsTake;
}
/// <summary>
/// 打开并Continue页
/// </summary>
private void OpenAndTakeContinue()
{
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);
// 设置需要等待Continue的页
IControlService service = ApplicationDomainEx.ServiceManager.GetService<IControlService>(ViewServiceKeys.CONTROL_SERVICE);
if (service == null)
return;
service.TakeContinueWhenPageOpend(this.SelectedPageGroupModel.SelectedPage);
// 打开页
this.OpenPage(this.SelectedPageGroupModel.SelectedPage);
}
#endregion
#region OpenAndTakeOutCommand -- 打开并下板命令
/// <summary>
/// 打开并下板命令
/// </summary>
public VCommand OpenAndTakeOutCommand { get; set; }
/// <summary>
/// 是否可以执行打开并下板命令
/// </summary>
/// <returns>是否可以执行下板</returns>
private bool CanOpenAndTakeOut()
{
return this.SelectedPageGroupModel != null && this.SelectedPageGroupModel.SelectedPage != null && this.SelectedPageGroupModel.SelectedPage.IsTake;
}
/// <summary>
/// 打开并下板
/// </summary>
private void OpenAndTakeOut()
{
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);
// 设置需要等待Continue的页
IControlService service = ApplicationDomainEx.ServiceManager.GetService<IControlService>(ViewServiceKeys.CONTROL_SERVICE);
if (service == null)
return;
service.TakeOutWhenPageOpend(this.SelectedPageGroupModel.SelectedPage);
// 打开页
this.OpenPage(this.SelectedPageGroupModel.SelectedPage);
}
#endregion
#region UpdateCommand -- 更新命令 #region UpdateCommand -- 更新命令
/// <summary> /// <summary>
......
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