| | |
| | | case "inspectAcceptEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(InspectAcceptEnum); |
| | | List<int> enums = Enum.GetValues(typeof(InspectAcceptEnum)).Cast<int>().ToList(); |
| | | List<string> enumNames = Enum.GetNames(typeof(InspectAcceptEnum)).ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | foreach (var item in enumNames) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(InspectAcceptEnum).GetField(((InspectAcceptEnum)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(InspectAcceptEnum).GetField((item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "takeStockDetailStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | { |
| | | Type type = typeof(TakeStockDetailStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(TakeStockDetailStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TakeStockDetailStatusEnum).GetField(((TakeStockDetailStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |