|
|
|
|
@ -45,8 +45,19 @@
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="教师姓名" prop="name" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="工号" prop="username" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="电话" prop="phone" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="邮箱" prop="email" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="名下班级" align="center" min-width="280">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<div v-if="row.ownedClassNames?.length" class="owned-class-list" :title="row.ownedClassNames.join('、')">
|
|
|
|
|
<span v-for="className in row.ownedClassNames" :key="className" class="owned-class-chip">{{ className }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span v-else class="empty-summary">暂无班级</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="学生数量" align="center" width="130">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<strong class="student-count">{{ Number(row.ownedStudentCount || 0) }}<small> 人</small></strong>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="创建日期" prop="createTime" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ formatDate(row.createTime) }}</span>
|
|
|
|
|
@ -57,6 +68,7 @@
|
|
|
|
|
<template v-if="isManagerTeacher">
|
|
|
|
|
<el-button type="primary" text :disabled="row.hasCreatedClass" @click="editSchool(row)">编辑</el-button>
|
|
|
|
|
<el-button type="danger" text :disabled="row.hasCreatedClass" @click="delSchool(row)">删除</el-button>
|
|
|
|
|
<el-button type="warning" text @click="initializeTeacherPassword(row)">密码初始化</el-button>
|
|
|
|
|
<el-tag v-if="row.hasCreatedClass" type="warning" size="small">该教师已创建班级,不允许编辑或删除</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
<el-tag v-else type="info">仅查看</el-tag>
|
|
|
|
|
@ -101,6 +113,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
@ -228,6 +242,24 @@ const onClose = () => {
|
|
|
|
|
const refresh = () => {
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
const initializeTeacherPassword = (row) => {
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
`确定将教师“${row.name || row.username}”的登录密码初始化为 123qwe 吗?`,
|
|
|
|
|
"密码初始化",
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: "确定初始化",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}
|
|
|
|
|
).then(() => {
|
|
|
|
|
indexApi
|
|
|
|
|
.initializeTeacherPassword({
|
|
|
|
|
userId: row.userId,
|
|
|
|
|
operatorId: currentUserId.value,
|
|
|
|
|
})
|
|
|
|
|
.then(() => proxy.$message.success("密码初始化成功"));
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 查询院系下拉列表
|
|
|
|
|
const facultyList = ref([]);
|
|
|
|
|
const getFacultyList = () => {
|
|
|
|
|
@ -306,5 +338,39 @@ onMounted(() => {
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
}
|
|
|
|
|
.owned-class-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
max-height: 68px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
}
|
|
|
|
|
.owned-class-chip {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
min-height: 26px;
|
|
|
|
|
padding: 2px 10px;
|
|
|
|
|
color: #79dcff;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 20px;
|
|
|
|
|
border: 1px solid rgba(55, 194, 255, 0.38);
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
background: rgba(15, 111, 164, 0.18);
|
|
|
|
|
}
|
|
|
|
|
.empty-summary {
|
|
|
|
|
color: rgba(184, 218, 235, 0.58);
|
|
|
|
|
}
|
|
|
|
|
.student-count {
|
|
|
|
|
color: #63dcff;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-variant-numeric: tabular-nums;
|
|
|
|
|
small {
|
|
|
|
|
color: rgba(210, 238, 248, 0.72);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|