|
|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
<div class="df">
|
|
|
|
|
<div class="online">
|
|
|
|
|
<span>班级:</span>
|
|
|
|
|
<el-select v-model="paramsquery.schoolClassId" placeholder="" style="width: 14rem" clearable class="ml10">
|
|
|
|
|
<el-select v-model="paramsquery.schoolClassId" placeholder="" style="width: 14rem" clearable class="ml10" @change="handleClassFilterChange">
|
|
|
|
|
<el-option v-for="school in studentClassOptions" :key="school.schoolClassId" :label="school.className" :value="school.schoolClassId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -403,6 +403,11 @@ const normalizeClassType = (schoolClass) => {
|
|
|
|
|
return schoolClass?.createdBy ? "TEACHING" : "ADMIN";
|
|
|
|
|
};
|
|
|
|
|
const sameValue = (left, right) => String(left || "") === String(right || "");
|
|
|
|
|
const classCreateTime = (schoolClass) => {
|
|
|
|
|
if (!schoolClass?.createTime) return Number.MAX_SAFE_INTEGER;
|
|
|
|
|
const value = new Date(schoolClass.createTime).getTime();
|
|
|
|
|
return Number.isNaN(value) ? Number.MAX_SAFE_INTEGER : value;
|
|
|
|
|
};
|
|
|
|
|
const canUseAdminClassForStudent = (schoolClass) => {
|
|
|
|
|
if (normalizeClassType(schoolClass) !== "ADMIN") return false;
|
|
|
|
|
return !schoolClass?.schoolId || sameValue(schoolClass.schoolId, currentSchoolId.value);
|
|
|
|
|
@ -414,7 +419,7 @@ const teachingClassOptions = computed(() =>
|
|
|
|
|
normalizeClassType(schoolClass) === "TEACHING" &&
|
|
|
|
|
sameValue(schoolClass.schoolId, currentSchoolId.value) &&
|
|
|
|
|
(isManagerTeacher.value || sameValue(schoolClass.createdBy, currentUserId.value))
|
|
|
|
|
)
|
|
|
|
|
).sort((left, right) => classCreateTime(left) - classCreateTime(right))
|
|
|
|
|
);
|
|
|
|
|
const studentClassOptions = computed(() => teachingClassOptions.value);
|
|
|
|
|
const currentTeachingClassId = () => {
|
|
|
|
|
@ -430,10 +435,19 @@ const beforeImportStudents = (file) => {
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
const getClassList = () => {
|
|
|
|
|
indexApi.getClassListBySchoolId({ schoolId: userStore.userInfo.schoolId }).then((res) => {
|
|
|
|
|
return indexApi.getClassListBySchoolId({ schoolId: userStore.userInfo.schoolId }).then((res) => {
|
|
|
|
|
classList.value = res.data;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const selectDefaultStudentClass = () => {
|
|
|
|
|
if (!isManagerTeacher.value && !paramsquery.value.schoolClassId) {
|
|
|
|
|
paramsquery.value.schoolClassId = teachingClassOptions.value[0]?.schoolClassId || "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const handleClassFilterChange = () => {
|
|
|
|
|
paramsquery.value.index = 1;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
const classList1 = ref([]);
|
|
|
|
|
// 根据专业查班级
|
|
|
|
|
const getClassByMajor = () => {
|
|
|
|
|
@ -484,8 +498,9 @@ const initPassword = (row, status) => {
|
|
|
|
|
};
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await userStore.ensureSchoolProductConfig().catch(() => null);
|
|
|
|
|
await getClassList();
|
|
|
|
|
selectDefaultStudentClass();
|
|
|
|
|
getList();
|
|
|
|
|
getClassList();
|
|
|
|
|
if (!isTeacherRosterMode.value) {
|
|
|
|
|
getFacultyList();
|
|
|
|
|
}
|
|
|
|
|
|