| | |
| | | } |
| | | vueDictionaryDTOs.AddRange(selectDics); |
| | | } |
| | | |
| | | //object GetSourceData(string dicNo, string dbSql, object data) |
| | | //{ |
| | | // if (string.IsNullOrEmpty(dbSql)) |
| | | // { |
| | | // return data; |
| | | // } |
| | | // return BaseDal.QueryObjectDataBySql(dbSql, null); |
| | | //} |
| | | //List<VueDictionaryDTO> vueDictionaryDTOs = dicConfig.Select(item => new VueDictionaryDTO |
| | | //{ |
| | | // DicNo = item.dicNo, |
| | | // Config = item.config, |
| | | // Data = GetSourceData(item.dicNo, item.dbSql, item.list) |
| | | //}).ToList(); |
| | | |
| | | try |
| | | { |
| | | List<string> dicList = dicNos.ToList(); |
| | |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | //{ |
| | | // Type type = typeof(TaskTypeEnum); |
| | | // List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList(); |
| | | // int index = 0; |
| | | // foreach (var item in enums) |
| | | // { |
| | | // FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)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; |
| | |
| | | } |
| | | } |
| | | |
| | | //{ |
| | | // Type type = typeof(TaskStatusEnum); |
| | | // List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList(); |
| | | // int index = 0; |
| | | // foreach (var item in enums) |
| | | // { |
| | | // FieldInfo? fieldInfo = typeof(TaskStatusEnum).GetField(((TaskStatusEnum)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; |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "materielUnitEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(MaterielUnitEnum); |
| | | List<string> enumNames = Enum.GetNames(typeof(MaterielUnitEnum)).ToList(); |
| | | int index = 0; |
| | | foreach (var item in enumNames) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(MaterielUnitEnum).GetField((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; |
| | | case "agvStationAreaEnum": |
| | | { |
| | | List<object> data = new List<object>(); |