7. Among the 6-digit numbers composed of the digits 1, 2, and 3, if each digit appears at least once, then there are $\qquad$ such 6-digit numbers.
When there is only one digit repeated, the corresponding 6-digit numbers are $C_{3}^{1} \cdot A_{6}^{2}=90$; when there are two digits repeated, the corresponding 6-digit numbers are $C_{3}^{1} \cdot C_{6}^{1} \cdot C_{2}^{1} \cdot C_{5}^{2}=360$; when all three digits are repeated, the corresponding 6-digit numbers are $C_{6}^{2} \cdot C_{4}^{2}=90$. Therefore, there are a total of 540 such 6-digit numbers.