const assert = require("assert"); const fs = require("fs"); const path = require("path"); const root = path.join(__dirname, ".."); const page = fs.readFileSync(path.join(root, "src", "views", "teacherEnd", "student", "index.vue"), "utf8"); assert(page.includes("operatorId: currentUserId.value"), "学生列表必须携带当前教师"); assert(page.includes("const isManagerTeacher = computed(() => userStore.userInfo.teacherAdmin === true);"), "教师管理员身份必须由当前登录账号识别"); assert(page.includes("const studentClassOptions = computed(() => teachingClassOptions.value);"), "学生筛选下拉框必须只展示教学班"); assert(page.includes("isManagerTeacher.value || sameValue(schoolClass.createdBy, currentUserId.value)"), "教师管理员必须可查看本校全部教学班"); assert(page.includes("const resolveRowTeachingClassId = (row) =>"), "未选择班级时操作必须从学生行解析教学班"); assert(page.includes('class="student-action-group"'), "学生操作按钮必须使用固定操作组布局"); assert(page.includes("flex-wrap: nowrap"), "学生操作按钮不得换行"); assert(!page.includes("仅查看"), "学生列表不应再展示仅查看操作"); assert(page.includes("请选择自己的教学班后再导入学生"), "导入必须要求选中教学班"); assert(page.includes('["学生姓名", "学号"]'), "教学班导入模板必须只有学生姓名和学号"); assert(page.includes("initPassword(row, 1)"), "学生列表必须提供数据初始化操作"); console.log("teacher owned student management static checks passed");