Teachers' perceptions of teacher-student relations in their school are linked to their job satisfaction, but whether positive teaching-related emotion constitutes a statistical indirect association between them, and whether school leadership context alters it, remains unclear. Using Teaching and Learning International Survey (TALIS) 2024 data for Shanghai (China), this study analyzed the OECD scales for teacher-student relations, joy of teaching, job satisfaction, and principal relational leadership in 1,338 teachers from 205 schools. A conditional process regression adjusted for teacher demographic and career characteristics; point estimates used the final teacher weight, and sampling variance was estimated from 100 Fay balanced repeated replication weights. Perceived school-wide teacher-student relations were positively associated with job satisfaction, and the indirect association through joy of teaching was supported. Principal relational leadership did not significantly alter the conditional direct association, whereas its interaction with joy of teaching was positive; this interaction was not reproduced when the constructs were scored as simple item means, so the moderation result is reported as exploratory. The pattern is consistent with the work environment-emotion-work attitude linkage proposed by Affective Events Theory. Conclusions are restricted to lower-secondary teachers in Shanghai and offer leads for longitudinal and intervention research.