Commit 179f796b by wangonghui

媒体资源库添加操作日志

parent fcdf418f
......@@ -131,5 +131,123 @@ namespace VIZ.Package.Domain
/// 点击更新
/// </summary>
public const string OPERATE_TAKE_UPDATE = "播控:点击Update";
// =============================================================================
// 媒体资源库
// =============================================================================
/// <summary>
/// 刷新文件夹
/// </summary>
public const string OPERATE_FLODER_REFRESH = "文件夹:刷新";
/// <summary>
/// 文件夹创建
/// </summary>
public const string OPERATE_FLODER_CREATE = "文件夹:创建";
/// <summary>
/// 文件夹删除
/// </summary>
public const string OPERATE_FLODER_DELETE = "文件夹:删除";
/// <summary>
/// 文件夹移入文件
/// </summary>
public const string OPERATE_FLODER_MOVEFILE = "文件夹:移入文件";
/// <summary>
/// 导出文件夹文件
/// </summary>
public const string OPERATE_FLODER_EXPORT = "文件夹:导出文件夹文件";
/// <summary>
/// 文件夹双击打开
/// </summary>
public const string OPERATE_FLODER_EXPAND = "文件夹:文件夹双击展开";
/// <summary>
/// 文件刷新
/// </summary>
public const string OPERATE_FILE_REFRESH = "文件:刷新";
/// <summary>
/// 文件创建
/// </summary>
public const string OPERATE_FILE_CREATE = "文件:创建";
/// <summary>
/// 文件删除
/// </summary>
public const string OPERATE_FILE_DELETE = "文件:删除";
/// <summary>
/// 文件移动
/// </summary>
public const string OPERATE_FILE_MOVE = "文件:移动";
/// <summary>
/// 文件导出
/// </summary>
public const string OPERATE_FILE_EXPORT = "文件:导出";
/// <summary>
/// 文件列表
/// </summary>
public const string OPERATE_FILE_LIST = "文件:列表";
/// <summary>
/// 图片列表
/// </summary>
public const string OPERATE_FILE_IMAGELIST = "文件:图片列表";
/// <summary>
/// 图片名称排序
/// </summary>
public const string OPERATE_FILE_SORTNAME = "文件:名称排序";
/// <summary>
/// 文件日期排序
/// </summary>
public const string OPERATE_FILE_DATE = "文件:日期排序";
/// <summary>
/// 文件双击
/// </summary>
public const string OPERATE_FILE_DOUBLECLICK = "文件:双击";
/// <summary>
/// 文件编辑图片
/// </summary>
public const string OPERATE_FILE_EDITIMAGE = "文件:编辑图片";
/// <summary>
/// 回收站文件刷新
/// </summary>
public const string OPERATE_RECYCLEH_REFRESH = "回收站:文件刷新";
/// <summary>
/// 回收站文件还原
/// </summary>
public const string OPERATE_RECYCLEH_FILE = "回收站:文件还原";
}
}
......@@ -18,6 +18,8 @@ using System.Windows.Forms;
using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
using static System.Net.WebRequestMethods;
......@@ -30,6 +32,11 @@ namespace VIZ.Package.Module
/// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(MediaResourceViewModel));
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public MediaResourcePanelViewModel()
{
// 初始化控制器
......@@ -302,6 +309,9 @@ namespace VIZ.Package.Module
/// </summary>
private void FileDoubleClick()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_DOUBLECLICK);
this.OnFileDoubleClick?.Invoke(this, new MHResourceFileDoubleClickEventArgs { File = this.SelectedFileModel });
}
......@@ -320,8 +330,13 @@ namespace VIZ.Package.Module
/// </summary>
private void RefreshFolder()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_REFRESH);
this.IsFolderLoading = false;
Task.Run(async () =>
{
try
......@@ -366,7 +381,8 @@ namespace VIZ.Package.Module
if (folder == null)
return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_REFRESH);
this.mediaResourceFileController.DisposeFileModels(folder);
folder.IsRefreshedFiles = false;
this.mediaResourceFileController.UpdateFileModels(this.SelectedFolderModel);
......@@ -421,6 +437,9 @@ namespace VIZ.Package.Module
/// </summary>
private async void CreateFloder()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_CREATE);
CreateFolderWindow floderView = new CreateFolderWindow();
CreateFolderViewModel vm = floderView.createFolderView.DataContext as CreateFolderViewModel;
......@@ -493,6 +512,9 @@ namespace VIZ.Package.Module
{
if (selectedFolderModel != null)
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_DELETE);
if ((DialogResult)DXMessageBox.Show("是否此文件夹", "", MessageBoxButton.OKCancel) == DialogResult.OK)
{
string path = SelectedFolderModel.Path;
......@@ -531,6 +553,8 @@ namespace VIZ.Package.Module
/// </summary>
private async void CreateFile()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_CREATE);
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
......@@ -616,6 +640,10 @@ namespace VIZ.Package.Module
private async void DeleteFile()
{
if (selectedFileModel == null) return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_DELETE);
if ((DialogResult)DXMessageBox.Show("是否删除此文件", "", MessageBoxButton.OKCancel) == DialogResult.OK)
{
......@@ -651,6 +679,9 @@ namespace VIZ.Package.Module
{
if (selectedFileModel != null)
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_MOVE);
if ((DialogResult)DXMessageBox.Show("是否移动此文件", "", MessageBoxButton.OKCancel) == DialogResult.OK)
{
......@@ -668,6 +699,8 @@ namespace VIZ.Package.Module
private void FilesList()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_LIST);
VisibilityImage = Visibility.Hidden;
VisibilityList = Visibility.Visible;
}
......@@ -680,6 +713,8 @@ namespace VIZ.Package.Module
private void ShowImageList()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_IMAGELIST);
VisibilityImage = Visibility.Visible;
VisibilityList = Visibility.Hidden;
}
......@@ -692,6 +727,8 @@ namespace VIZ.Package.Module
private void SortFileName()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_SORTNAME);
this.FileModels = this.FileModels.OrderBy(a => a.Name).ToObservableCollection();
}
......@@ -703,6 +740,8 @@ namespace VIZ.Package.Module
private void SortDate()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_DATE);
this.FileModels = this.FileModels.OrderBy(a => Convert.ToDateTime(a.Date)).ToObservableCollection();
}
......@@ -723,6 +762,9 @@ namespace VIZ.Package.Module
if (SelectedFolderModel == null || FileModels == null) return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_EXPORT);
try
{
System.Windows.Forms.FolderBrowserDialog ofd = new System.Windows.Forms.FolderBrowserDialog();
......@@ -794,6 +836,9 @@ namespace VIZ.Package.Module
if (SelectedFileModel == null) return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_EXPORT);
try
{
System.Windows.Forms.FolderBrowserDialog ofd = new System.Windows.Forms.FolderBrowserDialog();
......@@ -862,6 +907,8 @@ namespace VIZ.Package.Module
}
else
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_MOVEFILE);
var result = await this.mediaResourceFileController.MoveFile(moveFilePath, selectedFolderModel.Path);
if (result != null)
......@@ -900,6 +947,8 @@ namespace VIZ.Package.Module
if (selectedFileModel == null || selectedFileModel.ThumbnailBitmap == null) return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FILE_EDITIMAGE);
ImageEditWindow imageEditWindow = new ImageEditWindow();
ImageEditViewModel vm = imageEditWindow.ImageCut.DataContext as ImageEditViewModel;
......@@ -980,6 +1029,8 @@ namespace VIZ.Package.Module
private void RefresRecyclehFile()
{
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_RECYCLEH_REFRESH);
this.mediaResourceFileController.GetMeiaResourceRecycleFile();
}
......@@ -995,6 +1046,9 @@ namespace VIZ.Package.Module
{
if (SelectedfileRecycleFileModel == null) return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_RECYCLEH_FILE);
var result = await this.mediaResourceFileController.ReStoreRecycFile(SelectedfileRecycleFileModel.Name);
if (result.status == "0")
......@@ -1028,6 +1082,8 @@ namespace VIZ.Package.Module
{
if (this.SelectedFolderModel == null || e.ChangedButton != System.Windows.Input.MouseButton.Left)
return;
//记录操作log日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_FLODER_EXPAND);
this.SelectedFolderModel.IsExpand = !this.SelectedFolderModel.IsExpand;
}
......
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