| | |
| | | } |
| | | return DictionaryDTO; |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="dicNos"></param> |
| | | /// <param name="executeSql">鏄惁鎵ц鑷畾涔塻ql</param> |
| | | /// <returns></returns> |
| | | //public IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, List<RoleNodes> roleNodes, bool executeSql = true) |
| | | //{ |
| | | // List<Sys_Dictionary> Dictionaries = GetAllDictionary(); |
| | | |
| | | // foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo))) |
| | | // { |
| | | // if (executeSql) |
| | | // { |
| | | // // 2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql |
| | | // string sql = item.DBSql; |
| | | // if (!string.IsNullOrEmpty(sql)) |
| | | // { |
| | | // item.DicList = Query(GetCustomDBSql(item.DicNo, sql, roleNodes), item.DicNo); |
| | | // } |
| | | // } |
| | | // } |
| | | // return Dictionaries; |
| | | //} |
| | | List<SourceKeyVaule> QueryRole(string sql) |
| | | { |
| | | try |
| | |
| | | ParentId = 0,//灏嗚嚜宸辩殑瑙掕壊浣滀负root鑺傜偣 |
| | | RoleName = s.RoleName |
| | | }).ToList(); |
| | | //int currnetRoleId = UserContext.Current.RoleId; |
| | | List<int> roleIds = RoleNodes.Select(x => x.Id).ToList(); |
| | | List<int> roleIds = roleNodes.Select(x => x.Id).ToList(); |
| | | //roleIds.Add(App.User.RoleId); |
| | | |
| | | return originalSql = $@"SELECT Role_Id as 'key',Role_Id AS id,ParentId AS parentId,RoleName as 'value' FROM Sys_Role |
| | | WHERE Enable=1 and Role_Id in ({string.Join(',', roleIds)})"; |
| | | return originalSql = $@"SELECT RoleId as 'key',RoleId AS id,ParentId AS parentId,RoleName as 'value' FROM Sys_Role |
| | | WHERE Enable=1 and RoleId in ({string.Join(',', roleIds)})"; |
| | | } |
| | | |
| | | private List<Sys_Dictionary> GetAllDictionary() |