|
|
@ -31,6 +31,9 @@ namespace VOL.Core.Infrastructure
|
|
|
|
case "tree_roles":
|
|
|
|
case "tree_roles":
|
|
|
|
originalSql = GetRolesSql(originalSql);
|
|
|
|
originalSql = GetRolesSql(originalSql);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "device_name":
|
|
|
|
|
|
|
|
originalSql = GetDevicesSql(originalSql);
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -65,5 +68,33 @@ namespace VOL.Core.Infrastructure
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return originalSql;
|
|
|
|
return originalSql;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取解决的数据源,只能看到自己与下级所有角色
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="context"></param>
|
|
|
|
|
|
|
|
/// <param name="originalSql"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public static string GetDevicesSql(string originalSql)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UserContext.Current.IsSuperAdmin)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return originalSql;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int UserId = UserContext.Current.UserId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (DBType.Name == DbCurrentType.PgSql.ToString())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
originalSql = $"SELECT \"id\" as key,\"name\" as value from data_config where \"CreateID\" = {UserId}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
originalSql = $@"SELECT id AS 'key',name as 'value' FROM data_config WHERE CreateID={UserId}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return originalSql;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|