| | |
| | | 锘縰sing Autofac.Core; |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskInStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskInStatusEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskInStatusEnum).GetField(((TaskInStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskOutStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskOutStatusEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskOutStatusEnum).GetField(((TaskOutStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskRelocationStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskRelocationStatusEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskRelocationStatusEnum).GetField(((TaskRelocationStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskInboundType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskInboundTypeEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskInboundTypeEnum).GetField(((TaskInboundTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskOutboundType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskOutboundTypeEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskOutboundTypeEnum).GetField(((TaskOutboundTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "taskRelocationType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | List<int> enums = Enum.GetValues(typeof(TaskRelocationTypeEnum)).Cast<int>().ToList(); |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TaskRelocationTypeEnum).GetField(((TaskRelocationTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo?.GetCustomAttribute<DescriptionAttribute>(); |
| | | data.Add(new { key = item.ToString(), value = description != null ? description.Description : item.ToString() }); |
| | | } |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |