Elemental damage is a category of magic damage, so the damage from the flame/frost/lightning weapon enchantment should be based off of magicka damage. If you have added spell resistance, it will resist flame/frost/lightning damage, so it should go the other way around too. However, the damage the weapon itself does should still be based off of weapon damage, so on a hit, you're doing both weapon and spell damage. Crit should apply just as damage does. I have not tested any of this (so take it with a grain of salt), but this is how the game should work based on my understanding of it.