| | |
| | | } |
| | | #endregion |
| | | |
| | | #region AGVTaskTypeEnum |
| | | { |
| | | Type type = typeof(AGVTaskTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(AGVTaskTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(AGVTaskTypeEnum).GetField(((AGVTaskTypeEnum)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++; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region AGVTaskStatusEnum |
| | | { |
| | | Type type = typeof(AGVTaskStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(AGVTaskStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(AGVTaskStatusEnum).GetField(((AGVTaskStatusEnum)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++; |
| | | } |
| | | } |
| | | #endregion |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |