Random loot is based on your level, but the actual buffs on weapons and armor arev based on the item's level. Or rather, the items you get are based on your level. You're not gonna find a basic level 1 short sword when you're level 30 unless it was generated back around level 1 (in which case everything, including buffs, are already set).
Enchantment slots are based on rarity. Legendary have 4 possible buffs and 1 enchantment, always.