Test.EIImageViewer
he 2023-02-13 16:17:09 +08:00
parent 855f4980d5
commit 4133953b93
3 changed files with 53 additions and 24 deletions

View File

@ -15,9 +15,14 @@ namespace IRaCIS.Core.Application.ViewModel
public string Keyboardkey { get; set; }
public int ShortcutKeyEnum { get; set; }
public int ImageToolType { get; set; }
public DateTime CreateTime { get; set; }
public Guid CreateUserId { get; set; }
}
public bool AltKey { get; set; }
public bool CtrlKey { get; set; }
public bool ShiftKey { get; set; }
public bool MetaKey { get; set; }
}
public class SetDefaultShortcutKey
@ -31,6 +36,14 @@ namespace IRaCIS.Core.Application.ViewModel
{
public string Keyboardkey { get; set; }
public int ShortcutKeyEnum { get; set; }
public bool AltKey { get; set; }
public bool CtrlKey { get; set; }
public bool ShiftKey { get; set; }
public bool MetaKey { get; set; }
}

View File

@ -34,18 +34,36 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<DefaultShortcutKeyView>> GetDefaultShortcutKeyList(DefaultShortcutKeyQuery inQuery)
public async Task<List<DefaultShortcutKeyView>> GetDefaultShortcutKeyList(DefaultShortcutKeyQuery inQuery)
{
var defaultShortcutKey = await _defaultShortcutKeyRepository.Where(x => x.ImageToolType == inQuery.ImageToolType).ToListAsync();
var shortcutKeydic = await _dictionaryRepository.Where(x => x.Parent.Code == "ShortcutKey").ToListAsync();
var result = shortcutKeydic.OrderBy(x=>x.ShowOrder).Select(x => new DefaultShortcutKeyView()
{
Id = x.Id,
ImageToolType = inQuery.ImageToolType,
ShortcutKeyEnum = int.Parse(x.Code),
Keyboardkey = defaultShortcutKey.Where(y => y.ShortcutKeyEnum == int.Parse(x.Code)).Select(y => y.Keyboardkey).FirstOrDefault() ?? string.Empty,
}).ToList();
List<DefaultShortcutKeyView> result = new List<DefaultShortcutKeyView>();
shortcutKeydic.OrderBy(x => x.ShowOrder).ForEach(x =>
{
var key= defaultShortcutKey.Where(y => y.ShortcutKeyEnum == int.Parse(x.Code)).FirstOrDefault();
var isnull = key == null;
result.Add(new DefaultShortcutKeyView()
{
Id = x.Id,
ImageToolType = inQuery.ImageToolType,
ShortcutKeyEnum = int.Parse(x.Code),
Keyboardkey = isnull ? string.Empty : key.Keyboardkey,
AltKey = isnull ? false : key.AltKey,
CtrlKey = isnull ? false : key.CtrlKey,
MetaKey = isnull ? false : key.MetaKey,
ShiftKey = isnull ? false : key.ShiftKey
}) ;
});
return result;
}
@ -58,17 +76,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<List<DefaultShortcutKeyView>> GetDoctorShortcutKey(DefaultShortcutKeyQuery inQuery)
{
var defaultShortcutKey = await _defaultShortcutKeyRepository.Where(x => x.ImageToolType == inQuery.ImageToolType).ToListAsync();
var shortcutKeydic = await _dictionaryRepository.Where(x => x.Parent.Code == "ShortcutKey").ToListAsync();
var result = shortcutKeydic.OrderBy(x => x.ShowOrder).Select(x => new DefaultShortcutKeyView()
{
Id = x.Id,
ImageToolType = inQuery.ImageToolType,
ShortcutKeyEnum = int.Parse(x.Code),
Keyboardkey = defaultShortcutKey.Where(y => y.ShortcutKeyEnum == int.Parse(x.Code)).Select(y => y.Keyboardkey).FirstOrDefault() ?? string.Empty,
}).ToList();
return result;
return await this.GetDefaultShortcutKeyList(inQuery);
}

View File

@ -39,8 +39,16 @@ namespace IRaCIS.Core.Domain.Models
/// CreateUserId
/// </summary>
public Guid CreateUserId { get; set; }
}
public bool AltKey { get; set; }
public bool CtrlKey { get; set; }
public bool ShiftKey { get; set; }
public bool MetaKey { get; set; }
}
}