Commit c2bb96cf by liulongfei

日志记录

parent d7beaaee
...@@ -50,6 +50,137 @@ namespace VIZ.Package.Domain ...@@ -50,6 +50,137 @@ namespace VIZ.Package.Domain
public const string OPERATE_SHUTDOWN = "关闭系统"; public const string OPERATE_SHUTDOWN = "关闭系统";
// ============================================================================= // =============================================================================
// 设置
// =============================================================================
/// <summary>
/// 打开设置页面
/// </summary>
public const string OPERATE_SETTING_OPEN = "打开设置页面";
/// <summary>
/// 重置布局
/// </summary>
public const string OPERATE_SETTING_RESET_LAYOUT = "重置布局";
// =============================================================================
// 项目
// =============================================================================
/// <summary>
/// 创建项目
/// </summary>
public const string OPERATE_PROJECT_CREATE = "创建项目";
/// <summary>
/// 打开项目
/// </summary>
public const string OPERATE_PROJECT_OPEN = "打开项目";
/// <summary>
/// 保存项目
/// </summary>
public const string OPERATE_PROJECT_SAVE = "保存项目";
/// <summary>
/// 关闭项目
/// </summary>
public const string OPERATE_PROJECT_CLOSE = "关闭项目";
// =============================================================================
// 模板
// =============================================================================
/// <summary>
/// 添加模板
/// </summary>
public const string OPERATE_TEMPLATE_ADD = "添加模板";
/// <summary>
/// 打开模板
/// </summary>
public const string OPERATE_TEMPLATE_OPEN = "打开模板";
/// <summary>
/// 更新模板
/// </summary>
public const string OPERATE_TEMPLATE_UPDATE = "更新模板";
/// <summary>
/// 删除模板
/// </summary>
public const string OPERATE_TEMPLATE_DELETE = "删除模板";
// =============================================================================
// 播出单
// =============================================================================
/// <summary>
/// 播出单添加分组
/// </summary>
public const string OPERATE_PAGE_GROUP_ADD = "播出单添加分组";
/// <summary>
/// 播出单重名了
/// </summary>
public const string OPERATE_PAGE_GROUP_RENAME = "播出单重命名";
/// <summary>
/// 播出单删除分组
/// </summary>
public const string OPERATE_PAGE_GROUP_DELETE = "播出单删除分组";
/// <summary>
/// 播出单删除页
/// </summary>
public const string OPERATE_PAGE_DELETE = "播出单删除页";
/// <summary>
/// 打开播出单页
/// </summary>
public const string OPERATE_PAGE_OPEN = "打开播出单页";
/// <summary>
/// 更新播出单页
/// </summary>
public const string OPERATE_PAGE_UPDATE = "更新播出单页";
/// <summary>
/// 清理页
/// </summary>
public const string OPERATE_PAGE_CLEAR = "清理页";
/// <summary>
/// 初始化页
/// </summary>
public const string OPERATE_PAGE_INIT = "初始化页";
/// <summary>
/// 拷贝播出单分组
/// </summary>
public const string OPERATE_PAGE_GROUP_COPY = "拷贝播出单分组";
/// <summary>
/// 复制页
/// </summary>
public const string OPERATE_PAGE_BEGIN_COPY = "复制页";
/// <summary>
/// 粘贴页
/// </summary>
public const string OPERATE_PAGE_PASTE = "粘贴页";
/// <summary>
/// 添加页
/// </summary>
public const string OPERATE_PAGE_ADD = "添加页";
/// <summary>
/// 修改页号
/// </summary>
public const string OPERATE_PAGE_CHANGE_PAGE_NUM = "修改页号";
// =============================================================================
// Viz预览 // Viz预览
// ============================================================================= // =============================================================================
...@@ -61,52 +192,52 @@ namespace VIZ.Package.Domain ...@@ -61,52 +192,52 @@ namespace VIZ.Package.Domain
/// <summary> /// <summary>
/// 点击预览播放 /// 点击预览播放
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_PLAY = "点击预览播放"; public const string OPERATE_PREVIEW_PLAY = "预览:点击播放";
/// <summary> /// <summary>
/// 点击预览继续 /// 点击预览继续
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_CONTINUE = "点击预览继续"; public const string OPERATE_PREVIEW_CONTINUE = "预览:点击继续";
/// <summary> /// <summary>
/// 点击预览停止 /// 点击预览停止
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_STOP = "点击预览停止"; public const string OPERATE_PREVIEW_STOP = "预览:点击停止";
/// <summary> /// <summary>
/// 点击预览更新 /// 点击预览更新
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_UPDATE = "点击预览更新"; public const string OPERATE_PREVIEW_UPDATE = "预览:点击更新";
/// <summary> /// <summary>
/// 点击预览RGB /// 点击预览RGB
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_RGB = "点击预览RGB"; public const string OPERATE_PREVIEW_RGB = "预览:点击RGB";
/// <summary> /// <summary>
/// 点击预览Key /// 点击预览Key
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_KEY = "点击预览Key"; public const string OPERATE_PREVIEW_KEY = "预览:点击Key";
/// <summary> /// <summary>
/// 点击预览KeyPreview /// 点击预览KeyPreview
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_KEY_PREVIEW = "点击预览KeyPreview"; public const string OPERATE_PREVIEW_KEY_PREVIEW = "预览:点击KeyPreview";
/// <summary> /// <summary>
/// 点击预览TS /// 点击预览TS
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_TS = "点击预览TS"; public const string OPERATE_PREVIEW_TS = "预览:点击TS";
/// <summary> /// <summary>
/// 点击预览SA /// 点击预览SA
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_SA = "点击预览SA"; public const string OPERATE_PREVIEW_SA = "预览:点击SA";
/// <summary> /// <summary>
/// 点击预览BB /// 点击预览BB
/// </summary> /// </summary>
public const string OPERATE_PREVIEW_BB = "点击预览BB"; public const string OPERATE_PREVIEW_BB = "预览:点击BB";
// ============================================================================= // =============================================================================
// Take // Take
...@@ -131,5 +262,19 @@ namespace VIZ.Package.Domain ...@@ -131,5 +262,19 @@ namespace VIZ.Package.Domain
/// 点击更新 /// 点击更新
/// </summary> /// </summary>
public const string OPERATE_TAKE_UPDATE = "播控:点击Update"; public const string OPERATE_TAKE_UPDATE = "播控:点击Update";
// =============================================================================
// 控制对象字段编辑
// =============================================================================
/// <summary>
/// 保存控制字段
/// </summary>
public const string OPERATE_CONTROL_FIELD_SAVE = "保存控制字段";
/// <summary>
/// 另存为页
/// </summary>
public const string OPERATE_CONTROL_FIELD_SAVE_AS = "另存为页";
} }
} }
...@@ -65,6 +65,11 @@ namespace VIZ.Package.Module ...@@ -65,6 +65,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private ControlObjectService controlObjectService = new ControlObjectService(); private ControlObjectService controlObjectService = new ControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ============================================================= // =============================================================
// Property // Property
// ============================================================= // =============================================================
...@@ -163,6 +168,10 @@ namespace VIZ.Package.Module ...@@ -163,6 +168,10 @@ namespace VIZ.Package.Module
return; return;
} }
// 记录操作日志
string remark = $"{ApplicationDomainEx.CurrentPage.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE, remark);
// 更新列表值 // 更新列表值
service.TryUpdateControlFieldListValue(); service.TryUpdateControlFieldListValue();
// 保存 // 保存
...@@ -221,6 +230,10 @@ namespace VIZ.Package.Module ...@@ -221,6 +230,10 @@ namespace VIZ.Package.Module
PageModel page = pageGroupService.AddPage(srcTemplate); PageModel page = pageGroupService.AddPage(srcTemplate);
this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes); this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes);
pageGroupService.OpenPage(page); pageGroupService.OpenPage(page);
// 记录操作日志
string remark = $"模板:{srcTemplate.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE_AS, remark);
} }
// 另存页 // 另存页
else if (ApplicationDomainEx.CurrentPage is PageModel srcPage) else if (ApplicationDomainEx.CurrentPage is PageModel srcPage)
...@@ -228,6 +241,10 @@ namespace VIZ.Package.Module ...@@ -228,6 +241,10 @@ namespace VIZ.Package.Module
PageModel page = pageGroupService.CopyPage(); PageModel page = pageGroupService.CopyPage();
this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes); this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes);
pageGroupService.OpenPage(page); pageGroupService.OpenPage(page);
// 记录操作日志
string remark = $"页:{page.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE_AS, remark);
} }
} }
...@@ -304,6 +321,9 @@ namespace VIZ.Package.Module ...@@ -304,6 +321,9 @@ namespace VIZ.Package.Module
// 保存 // 保存
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.SaveOpendPageOrTemplateAndProject)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.SaveOpendPageOrTemplateAndProject))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.Save(); this.Save();
return; return;
} }
......
...@@ -90,7 +90,7 @@ namespace VIZ.Package.Module ...@@ -90,7 +90,7 @@ namespace VIZ.Package.Module
private void OnVizCommandLogMessage(VizCommandLogMessage msg) private void OnVizCommandLogMessage(VizCommandLogMessage msg)
{ {
// 记录操作日志 // 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SEND_VIZ_COMMAND, msg.Log); this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.VizCommand, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SEND_VIZ_COMMAND, msg.Log);
// 更新界面 // 更新界面
WPFHelper.BeginInvoke(() => WPFHelper.BeginInvoke(() =>
......
...@@ -396,7 +396,7 @@ namespace VIZ.Package.Module ...@@ -396,7 +396,7 @@ namespace VIZ.Package.Module
// 记录操作日志 // 记录操作日志
StringBuilder remark = new StringBuilder(); StringBuilder remark = new StringBuilder();
remark.Append($"GH库: {vizConfig.GH_IP}:{vizConfig.GH_Port} 服务名: {vizConfig.GH_ServerName} "); remark.Append($"GH库: {vizConfig.GH_IP}:{vizConfig.GH_Port} 服务名: {vizConfig.GH_ServerName} ");
remark.Append($"账号: {vizConfig.GH_UserName} 密码: {vizConfig.VIZ_Password} "); remark.Append($"账号: {vizConfig.GH_UserName} ");
remark.Append($"节目: {vizConfig.PluginGroup ?? string.Empty} "); remark.Append($"节目: {vizConfig.PluginGroup ?? string.Empty} ");
remark.Append($"引擎类型: {vizConfig.EngineFullType.GetDescription()} "); remark.Append($"引擎类型: {vizConfig.EngineFullType.GetDescription()} ");
remark.Append($"预览模式: {vizConfig.EnginePreviewMode.GetDescription()} "); remark.Append($"预览模式: {vizConfig.EnginePreviewMode.GetDescription()} ");
......
...@@ -13,6 +13,7 @@ using System.Windows.Forms; ...@@ -13,6 +13,7 @@ using System.Windows.Forms;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Domain.Model; using VIZ.Package.Domain.Model;
using VIZ.Package.Service;
using VIZ.Package.Storage; using VIZ.Package.Storage;
namespace VIZ.Package.Module namespace VIZ.Package.Module
...@@ -74,6 +75,11 @@ namespace VIZ.Package.Module ...@@ -74,6 +75,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private bool isNeedOpenLastProject = true; private bool isNeedOpenLastProject = true;
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ===================================================================== // =====================================================================
// Property // Property
// ===================================================================== // =====================================================================
...@@ -222,6 +228,9 @@ namespace VIZ.Package.Module ...@@ -222,6 +228,9 @@ namespace VIZ.Package.Module
ApplicationDomainEx.MessageManager.Send(msg); ApplicationDomainEx.MessageManager.Send(msg);
this.UpdateCommandStatus(); this.UpdateCommandStatus();
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_CREATE, path);
} }
#endregion #endregion
...@@ -269,6 +278,9 @@ namespace VIZ.Package.Module ...@@ -269,6 +278,9 @@ namespace VIZ.Package.Module
/// <param name="path">项目路径</param> /// <param name="path">项目路径</param>
private void OpenProject(string path) private void OpenProject(string path)
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_OPEN, path);
this.ProjectName = System.IO.Path.GetFileNameWithoutExtension(path); this.ProjectName = System.IO.Path.GetFileNameWithoutExtension(path);
ApplicationDomainEx.ProjectDbContext = new ProjectDbContext(path); ApplicationDomainEx.ProjectDbContext = new ProjectDbContext(path);
...@@ -305,6 +317,9 @@ namespace VIZ.Package.Module ...@@ -305,6 +317,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void SaveProject() private void SaveProject()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_SAVE, this.ProjectName);
ProjectSaveMessage msg = new ProjectSaveMessage(); ProjectSaveMessage msg = new ProjectSaveMessage();
ApplicationDomainEx.MessageManager.Send(msg); ApplicationDomainEx.MessageManager.Send(msg);
} }
...@@ -344,6 +359,9 @@ namespace VIZ.Package.Module ...@@ -344,6 +359,9 @@ namespace VIZ.Package.Module
ApplicationDomainEx.ProjectDbContext.Dispose(); ApplicationDomainEx.ProjectDbContext.Dispose();
} }
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_CLOSE, this.ProjectName);
this.ProjectName = null; this.ProjectName = null;
ApplicationDomainEx.ProjectDbContext = null; ApplicationDomainEx.ProjectDbContext = null;
...@@ -371,6 +389,9 @@ namespace VIZ.Package.Module ...@@ -371,6 +389,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Setting() private void Setting()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_SETTING_OPEN);
SettingWindow window = new SettingWindow(); SettingWindow window = new SettingWindow();
window.Owner = ApplicationDomainEx.MainWindow; window.Owner = ApplicationDomainEx.MainWindow;
window.ShowDialog(); window.ShowDialog();
...@@ -394,6 +415,9 @@ namespace VIZ.Package.Module ...@@ -394,6 +415,9 @@ namespace VIZ.Package.Module
if (service == null) if (service == null)
return; return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_SETTING_RESET_LAYOUT);
service.LoadLayout(); service.LoadLayout();
} }
......
...@@ -155,6 +155,11 @@ namespace VIZ.Package.Module ...@@ -155,6 +155,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private ControlObjectService controlObjectService = new ControlObjectService(); private ControlObjectService controlObjectService = new ControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ====================================================================================== // ======================================================================================
// Property // Property
// ====================================================================================== // ======================================================================================
...@@ -278,6 +283,9 @@ namespace VIZ.Package.Module ...@@ -278,6 +283,9 @@ namespace VIZ.Package.Module
model.GroupName = "新建分组"; model.GroupName = "新建分组";
e.Item = model; e.Item = model;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_GROUP_ADD, model.GroupName);
} }
#endregion #endregion
...@@ -299,6 +307,9 @@ namespace VIZ.Package.Module ...@@ -299,6 +307,9 @@ namespace VIZ.Package.Module
model.GroupName = "新建分组"; model.GroupName = "新建分组";
this.PageGroupModels.Add(model); this.PageGroupModels.Add(model);
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_GROUP_ADD, model.GroupName);
} }
#endregion #endregion
...@@ -317,10 +328,14 @@ namespace VIZ.Package.Module ...@@ -317,10 +328,14 @@ namespace VIZ.Package.Module
{ {
PageGroupRenameWindow window = new PageGroupRenameWindow(); PageGroupRenameWindow window = new PageGroupRenameWindow();
PageGroupRenameViewModel vm = window.DataContext as PageGroupRenameViewModel; PageGroupRenameViewModel vm = window.DataContext as PageGroupRenameViewModel;
vm.PageGroupName = this.SelectedPageGroupModel.GroupName; vm.PageGroupName = this.SelectedPageGroupModel.GroupName?.Trim() ?? string.Empty;
if (window.ShowDialog() != true) if (window.ShowDialog() != true)
return; return;
// 记录操作日志
string remark = $"{this.SelectedPageGroupModel.GroupName} -> {vm.PageGroupName}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_GROUP_RENAME, remark);
this.SelectedPageGroupModel.GroupName = vm.PageGroupName; this.SelectedPageGroupModel.GroupName = vm.PageGroupName;
} }
...@@ -344,6 +359,10 @@ namespace VIZ.Package.Module ...@@ -344,6 +359,10 @@ namespace VIZ.Package.Module
if (DXMessageBox.Show($"是否删除分组【{this.SelectedPageGroupModel.GroupName}】?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes) if (DXMessageBox.Show($"是否删除分组【{this.SelectedPageGroupModel.GroupName}】?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return; return;
// 记录操作日志
string remark = $"{this.SelectedPageGroupModel.GroupName}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_GROUP_DELETE, remark);
PageGroupModel group = this.SelectedPageGroupModel; PageGroupModel group = this.SelectedPageGroupModel;
this.PageGroupModels.Remove(this.SelectedPageGroupModel); this.PageGroupModels.Remove(this.SelectedPageGroupModel);
...@@ -378,6 +397,10 @@ namespace VIZ.Package.Module ...@@ -378,6 +397,10 @@ namespace VIZ.Package.Module
List<PageModel> pages = this.SelectedPageGroupModel.SelectedPages.ToList(); List<PageModel> pages = this.SelectedPageGroupModel.SelectedPages.ToList();
// 记录操作日志
string remark = string.Join("", pages.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_DELETE, remark);
foreach (PageModel page in pages) foreach (PageModel page in pages)
{ {
this.SelectedPageGroupModel.Pages.Remove(page); this.SelectedPageGroupModel.Pages.Remove(page);
...@@ -418,6 +441,10 @@ namespace VIZ.Package.Module ...@@ -418,6 +441,10 @@ namespace VIZ.Package.Module
if (this.SelectedPageGroupModel.SelectedPage == null) if (this.SelectedPageGroupModel.SelectedPage == null)
return; return;
// 记录操作日志
string remark = $"{this.SelectedPageGroupModel.SelectedPage.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_OPEN, remark);
this.OpenPage(this.SelectedPageGroupModel.SelectedPage); this.OpenPage(this.SelectedPageGroupModel.SelectedPage);
} }
...@@ -454,6 +481,10 @@ namespace VIZ.Package.Module ...@@ -454,6 +481,10 @@ namespace VIZ.Package.Module
List<PageModelBase> pages = this.SelectedPageGroupModel.SelectedPages.ToList<PageModelBase>(); List<PageModelBase> pages = this.SelectedPageGroupModel.SelectedPages.ToList<PageModelBase>();
// 记录操作日志
string remark = string.Join(",", pages.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_UPDATE, remark);
// 开始下载图片 // 开始下载图片
this.pageModelController.BeginDownLoadIamge(pages); this.pageModelController.BeginDownLoadIamge(pages);
...@@ -483,6 +514,9 @@ namespace VIZ.Package.Module ...@@ -483,6 +514,9 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void TakeClear() private void TakeClear()
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_CLEAR);
// 清理状态 // 清理状态
lock (ApplicationDomainEx.SceneInfoList) lock (ApplicationDomainEx.SceneInfoList)
{ {
...@@ -538,6 +572,10 @@ namespace VIZ.Package.Module ...@@ -538,6 +572,10 @@ namespace VIZ.Package.Module
List<PageModel> pages = this.SelectedPageGroupModel.SelectedPages.ToList(); List<PageModel> pages = this.SelectedPageGroupModel.SelectedPages.ToList();
// 记录操作日志
string remark = string.Join(",", pages.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_INIT, remark);
// 开始初始化 // 开始初始化
this.pageModelController.BeginTakeInit(pages); this.pageModelController.BeginTakeInit(pages);
} }
...@@ -564,6 +602,10 @@ namespace VIZ.Package.Module ...@@ -564,6 +602,10 @@ namespace VIZ.Package.Module
List<PageModel> pages = this.SelectedPageGroupModel.Pages.ToList(); List<PageModel> pages = this.SelectedPageGroupModel.Pages.ToList();
// 记录操作日志
string remark = string.Join(",", pages.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_INIT, remark);
// 开始初始化 // 开始初始化
this.pageModelController.BeginTakeInit(pages); this.pageModelController.BeginTakeInit(pages);
} }
...@@ -633,6 +675,10 @@ namespace VIZ.Package.Module ...@@ -633,6 +675,10 @@ namespace VIZ.Package.Module
if (destGroup == null) if (destGroup == null)
return; return;
// 记录操作日志
string remark = $"{this.SelectedPageGroupModel.GroupName}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_GROUP_COPY, remark);
destGroup.Order = this.PageGroupModels.MaxOrDefault(p => p.Order) + 1; destGroup.Order = this.PageGroupModels.MaxOrDefault(p => p.Order) + 1;
this.PageGroupModels.Add(destGroup); this.PageGroupModels.Add(destGroup);
...@@ -677,6 +723,10 @@ namespace VIZ.Package.Module ...@@ -677,6 +723,10 @@ namespace VIZ.Package.Module
} }
this.pageModelCopyController.WaitCopyPages = this.SelectedPageGroupModel.SelectedPages.ToList(); this.pageModelCopyController.WaitCopyPages = this.SelectedPageGroupModel.SelectedPages.ToList();
// 记录操作日志
string remark = string.Join(",", this.pageModelCopyController.WaitCopyPages.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_BEGIN_COPY, remark);
} }
#endregion #endregion
...@@ -710,6 +760,11 @@ namespace VIZ.Package.Module ...@@ -710,6 +760,11 @@ namespace VIZ.Package.Module
if (this.pageModelCopyController.WaitCopyPages == null || this.pageModelCopyController.WaitCopyPages.Count == 0) if (this.pageModelCopyController.WaitCopyPages == null || this.pageModelCopyController.WaitCopyPages.Count == 0)
return; return;
// 记录操作日志
string remark = string.Join(",", this.pageModelCopyController.WaitCopyPages.Select(p => p.Scene));
remark = $"分组: {this.SelectedPageGroupModel.GroupName}, 页: {remark}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_PASTE, remark);
int maxPageNum = this.SelectedPageGroupModel.Pages.MaxOrDefault(p => p.PageNum); int maxPageNum = this.SelectedPageGroupModel.Pages.MaxOrDefault(p => p.PageNum);
int maxOrder = this.SelectedPageGroupModel.Pages.MaxOrDefault(p => p.Order); int maxOrder = this.SelectedPageGroupModel.Pages.MaxOrDefault(p => p.Order);
...@@ -753,6 +808,9 @@ namespace VIZ.Package.Module ...@@ -753,6 +808,9 @@ namespace VIZ.Package.Module
// 复制页 // 复制页
if (string.Equals(key, HotKeyConfigEntity.COPY)) if (string.Equals(key, HotKeyConfigEntity.COPY))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, key);
this.BeginCopyPage(); this.BeginCopyPage();
return; return;
} }
...@@ -760,6 +818,9 @@ namespace VIZ.Package.Module ...@@ -760,6 +818,9 @@ namespace VIZ.Package.Module
// 粘贴页 // 粘贴页
if (string.Equals(key, HotKeyConfigEntity.PASTE)) if (string.Equals(key, HotKeyConfigEntity.PASTE))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, key);
this.PastePage(); this.PastePage();
return; return;
} }
...@@ -767,6 +828,9 @@ namespace VIZ.Package.Module ...@@ -767,6 +828,9 @@ namespace VIZ.Package.Module
// 删除页 // 删除页
if (string.Equals(key, HotKeyConfigEntity.DELETE)) if (string.Equals(key, HotKeyConfigEntity.DELETE))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, key);
this.DeleteItem(); this.DeleteItem();
return; return;
} }
...@@ -892,6 +956,9 @@ namespace VIZ.Package.Module ...@@ -892,6 +956,9 @@ namespace VIZ.Package.Module
// 打开下一页 // 打开下一页
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.OpenNextPage)) if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.OpenNextPage))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.OpenNextPageItem(); this.OpenNextPageItem();
return; return;
} }
...@@ -925,6 +992,10 @@ namespace VIZ.Package.Module ...@@ -925,6 +992,10 @@ namespace VIZ.Package.Module
if (window.ShowDialog() != true) if (window.ShowDialog() != true)
return null; return null;
// 记录操作日志
string remark = $"{template.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_ADD, remark);
// 根据模板拷贝页 // 根据模板拷贝页
PageModel destPage = this.pageModelCopyController.CopyPage(template, vm, this.SelectedPageGroupModel); PageModel destPage = this.pageModelCopyController.CopyPage(template, vm, this.SelectedPageGroupModel);
// 页码 // 页码
...@@ -997,7 +1068,13 @@ namespace VIZ.Package.Module ...@@ -997,7 +1068,13 @@ namespace VIZ.Package.Module
PageModel same = this.SelectedPageGroupModel.Pages.FirstOrDefault(p => p != page && p.PageNum == pageNum); PageModel same = this.SelectedPageGroupModel.Pages.FirstOrDefault(p => p != page && p.PageNum == pageNum);
if (same == null) if (same == null)
{
// 记录操作日志
string remark = $"分组:{this.SelectedPageGroupModel.GroupName}, 页: {page.PageNum} -> {pageNum}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PAGE_CHANGE_PAGE_NUM, remark);
return true; return true;
}
DXMessageBox.Show($"页 {pageNum} 已经存在!", "提示"); DXMessageBox.Show($"页 {pageNum} 已经存在!", "提示");
......
using DevExpress.Xpf.Core; using DevExpress.Xpf.Core;
using DevExpress.Xpf.Core.HandleDecorator.Helpers;
using log4net; using log4net;
using System; using System;
using System.Collections; using System.Collections;
...@@ -17,6 +18,7 @@ using VIZ.Framework.Core; ...@@ -17,6 +18,7 @@ using VIZ.Framework.Core;
using VIZ.Package.Domain; using VIZ.Package.Domain;
using VIZ.Package.Service; using VIZ.Package.Service;
using VIZ.Package.Storage; using VIZ.Package.Storage;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace VIZ.Package.Module namespace VIZ.Package.Module
{ {
...@@ -103,6 +105,11 @@ namespace VIZ.Package.Module ...@@ -103,6 +105,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private VizControlObjectDownloadService vizControlObjectDownloadService = new VizControlObjectDownloadService(); private VizControlObjectDownloadService vizControlObjectDownloadService = new VizControlObjectDownloadService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ====================================================================================== // ======================================================================================
// Property // Property
// ====================================================================================== // ======================================================================================
...@@ -222,6 +229,7 @@ namespace VIZ.Package.Module ...@@ -222,6 +229,7 @@ namespace VIZ.Package.Module
if (this.SelectedSceneTemplateModel == null) if (this.SelectedSceneTemplateModel == null)
return; return;
// 打开模板页
this.OpenScenePage(this.SelectedSceneTemplateModel); this.OpenScenePage(this.SelectedSceneTemplateModel);
} }
...@@ -231,6 +239,10 @@ namespace VIZ.Package.Module ...@@ -231,6 +239,10 @@ namespace VIZ.Package.Module
/// <param name="page">页</param> /// <param name="page">页</param>
private void OpenScenePage(PageModelBase page) private void OpenScenePage(PageModelBase page)
{ {
// 记录操作日志
string remark = $"{page.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_OPEN, remark);
if (ApplicationDomainEx.CurrentPage != null) if (ApplicationDomainEx.CurrentPage != null)
{ {
ApplicationDomainEx.CurrentPage.IsOpen = false; ApplicationDomainEx.CurrentPage.IsOpen = false;
...@@ -263,6 +275,10 @@ namespace VIZ.Package.Module ...@@ -263,6 +275,10 @@ namespace VIZ.Package.Module
List<PageModelBase> templates = this.SelectedSceneTemplateModels.ToList<PageModelBase>(); List<PageModelBase> templates = this.SelectedSceneTemplateModels.ToList<PageModelBase>();
// 记录操作日志
string remark = string.Join(",", templates.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_UPDATE, remark);
// 开始下载图片 // 开始下载图片
this.pageModelController.BeginDownLoadIamge(templates); this.pageModelController.BeginDownLoadIamge(templates);
...@@ -299,6 +315,10 @@ namespace VIZ.Package.Module ...@@ -299,6 +315,10 @@ namespace VIZ.Package.Module
if (DXMessageBox.Show($"是否删除模板 [{scenes}] ?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes) if (DXMessageBox.Show($"是否删除模板 [{scenes}] ?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return; return;
// 记录操作日志
string remark = string.Join(",", this.SelectedSceneTemplateModels.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_DELETE, remark);
List<PageTemplateModel> templates = this.SelectedSceneTemplateModels.ToList(); List<PageTemplateModel> templates = this.SelectedSceneTemplateModels.ToList();
foreach (PageTemplateModel template in templates) foreach (PageTemplateModel template in templates)
{ {
...@@ -332,6 +352,9 @@ namespace VIZ.Package.Module ...@@ -332,6 +352,9 @@ namespace VIZ.Package.Module
// 删除模板 // 删除模板
if (string.Equals(key, HotKeyConfigEntity.DELETE)) if (string.Equals(key, HotKeyConfigEntity.DELETE))
{ {
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, key);
this.Delete(); this.Delete();
return; return;
} }
...@@ -406,6 +429,10 @@ namespace VIZ.Package.Module ...@@ -406,6 +429,10 @@ namespace VIZ.Package.Module
/// <param name="fileModels">文件模型集合</param> /// <param name="fileModels">文件模型集合</param>
public void AddSceneTemplate(List<GHResourceFileModel> fileModels) public void AddSceneTemplate(List<GHResourceFileModel> fileModels)
{ {
// 记录操作日志
string remark = string.Join(",", fileModels.Select(p => p.Name));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_ADD, remark);
List<PageModelBase> list = new List<PageModelBase>(); List<PageModelBase> list = new List<PageModelBase>();
foreach (GHResourceFileModel fileModel in fileModels) foreach (GHResourceFileModel fileModel in fileModels)
......
...@@ -34,12 +34,6 @@ namespace VIZ.Package.Storage ...@@ -34,12 +34,6 @@ namespace VIZ.Package.Storage
/// Http请求 /// Http请求
/// </summary> /// </summary>
[Description("Http请求")] [Description("Http请求")]
Http, Http
/// <summary>
/// 数据仓储
/// </summary>
[Description("数据仓储")]
Storage
} }
} }
...@@ -15,7 +15,7 @@ namespace VIZ.Package.Storage ...@@ -15,7 +15,7 @@ namespace VIZ.Package.Storage
/// <summary> /// <summary>
/// 手动操作触发 /// 手动操作触发
/// </summary> /// </summary>
[Description("手动")] [Description("手动操作")]
Human, Human,
/// <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