|
|
|
|
@ -1,99 +1,89 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: qinzhenpen qzp1807@126.com
|
|
|
|
|
* @Date: 2025-05-13 16:22:46
|
|
|
|
|
* @LastEditors: qinzhenpen qzp1807@126.com
|
|
|
|
|
* @LastEditTime: 2025-05-22 09:43:12
|
|
|
|
|
* @FilePath: \e-commerce-internet\src\views\teacherEnd\school\index.vue
|
|
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="class app-container">
|
|
|
|
|
<div class="df">
|
|
|
|
|
<div class="online">
|
|
|
|
|
<span>所属院系:</span>
|
|
|
|
|
<!-- <el-input v-model="paramsquery.schoolName" style="width: 150px" type="text" class="ml10" /> -->
|
|
|
|
|
<el-select v-model="paramsquery.schoolFacultyId" placeholder="" clearable class="ml10" @change="getMajorList" style="width: 14rem">
|
|
|
|
|
<el-option v-for="school in facultyList" :key="school.schoolId" :label="school.schoolFacultyName" :value="school.schoolFacultyId" />
|
|
|
|
|
<div class="class-page app-container">
|
|
|
|
|
<el-tabs v-model="activeClassType" class="class-tabs" @tab-change="handleTabChange">
|
|
|
|
|
<el-tab-pane label="行政班" name="ADMIN" />
|
|
|
|
|
<el-tab-pane label="教学班" name="TEACHING" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
<div class="query-bar">
|
|
|
|
|
<el-select v-model="paramsquery.schoolFacultyId" placeholder="所属院系" clearable class="query-control" @change="getMajorList">
|
|
|
|
|
<el-option v-for="faculty in facultyList" :key="faculty.schoolFacultyId" :label="faculty.schoolFacultyName" :value="faculty.schoolFacultyId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="online">
|
|
|
|
|
<span>所属专业:</span>
|
|
|
|
|
<!-- <el-input v-model="paramsquery.schoolName" style="width: 150px" type="text" class="ml10" /> -->
|
|
|
|
|
<el-select v-model="paramsquery.schoolMajorId" placeholder="" clearable class="ml10">
|
|
|
|
|
<el-select v-model="paramsquery.schoolMajorId" placeholder="所属专业" clearable class="query-control">
|
|
|
|
|
<el-option v-for="major in majorList" :key="major.schoolMajorId" :label="major.schoolMajorName" :value="major.schoolMajorId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input v-model="paramsquery.className" placeholder="班级名称" clearable class="query-control" />
|
|
|
|
|
<el-button type="primary" :icon="Search" @click="getList">查询</el-button>
|
|
|
|
|
<el-button :icon="Refresh" @click="refresh">刷新</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="online">
|
|
|
|
|
<span>班级名称:</span>
|
|
|
|
|
<el-input v-model="paramsquery.className" style="width: 14rem" type="text" class="ml10" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="online">
|
|
|
|
|
<span>班级编号:</span>
|
|
|
|
|
<el-input v-model="paramsquery.classSn" style="width: 14rem" type="text" class="ml10" />
|
|
|
|
|
<el-button @click="getList" type="primary" class="ml10" :icon="Search">搜索</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="table-actions">
|
|
|
|
|
<el-button type="primary" :icon="Plus" @click="openCreateDialog">新增{{ activeClassType === 'ADMIN' ? '行政班' : '教学班' }}</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row class="mt10">
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-button type="primary" :icon="Plus" @click="addschool">新增</el-button>
|
|
|
|
|
<el-button type="primary" :icon="Refresh" @click="refresh">刷新</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
style="width: 100%; margin-top: 20px"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
color: '#fff',
|
|
|
|
|
fontSize: '14px',
|
|
|
|
|
backgroundColor: '#6A7DE9!important',
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="班级名称" prop="schoolClass.className" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="班级编号" prop="schoolClass.classSn" align="center"></el-table-column>
|
|
|
|
|
<el-table-column label="创建人" align="center">
|
|
|
|
|
|
|
|
|
|
<el-table :data="filteredTableData" border v-loading="loading" class="class-table" :header-cell-style="tableHeaderStyle">
|
|
|
|
|
<el-table-column label="班级名称" prop="schoolClass.className" align="center" />
|
|
|
|
|
<el-table-column label="所属院系" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ row.schoolFacultyName || "-" }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="所属专业" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ row.schoolMajorName || "-" }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="activeClassType === 'TEACHING'" label="创建人" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ row.schoolClass.createdByName || row.schoolClass.createdBy || "-" }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="创建日期" prop="schoolClass.createTime" align="center">
|
|
|
|
|
<el-table-column label="数据来源" align="center" width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-tag :type="row.schoolClass.dataSource === 'ZHIYUN' ? 'warning' : 'success'">
|
|
|
|
|
{{ row.schoolClass.dataSource === "ZHIYUN" ? "智云" : "本系统" }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="创建时间" prop="schoolClass.createTime" align="center" width="180">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span>{{ formatDate(row.schoolClass.createTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<el-table-column label="操作" align="center" width="260">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<template v-if="canOperateClass(row.schoolClass)">
|
|
|
|
|
<el-button type="primary" text @click="editSchool(row.schoolClass)">编辑</el-button>
|
|
|
|
|
<el-button type="danger" text @click="delSchool(row.schoolClass.schoolClassId)">删除</el-button>
|
|
|
|
|
<el-button type="primary" text @click="handleSuccess(row)">数据初始化</el-button>
|
|
|
|
|
<el-button type="primary" text @click="editClass(row.schoolClass)">编辑</el-button>
|
|
|
|
|
<el-button type="danger" text @click="deleteClass(row.schoolClass.schoolClassId)">删除</el-button>
|
|
|
|
|
<el-button v-if="activeClassType === 'TEACHING'" type="warning" text @click="initializeClass(row.schoolClass)">
|
|
|
|
|
数据初始化
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<el-tag v-else type="info">仅查看</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination v-show="schoolTotal > 0" :total="schoolTotal" v-model:page="paramsquery.index" v-model:limit="paramsquery.size" @pagination="getList" />
|
|
|
|
|
<el-dialog v-model="dialogVisible" top="110vh" width="50%" :title="`新增院系`" :modal="false" @close="onClose">
|
|
|
|
|
<el-form :model="formInline" class="demo-form-inline" ref="formInlineref" label-width="100px" style="width: 80%" :rules="rules">
|
|
|
|
|
<el-form-item label="所属院系:" prop="schoolFacultyId">
|
|
|
|
|
<el-select v-model="formInline.schoolFacultyId" placeholder="" clearable @change="getMajorList1" style="width: 20rem" v-if="status">
|
|
|
|
|
<el-option v-for="school in facultyList" :key="school.schoolId" :label="school.schoolFacultyName" :value="school.schoolFacultyId" />
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="dialogVisible" width="520px" :title="dialogTitle" class="teacher-dialog" @close="onClose">
|
|
|
|
|
<el-form ref="formInlineref" :model="formInline" label-width="96px" :rules="rules">
|
|
|
|
|
<el-form-item label="所属院系" prop="schoolFacultyId">
|
|
|
|
|
<el-select v-model="formInline.schoolFacultyId" placeholder="请选择院系" clearable class="form-control" @change="getMajorListForForm" :disabled="!isCreate">
|
|
|
|
|
<el-option v-for="faculty in facultyList" :key="faculty.schoolFacultyId" :label="faculty.schoolFacultyName" :value="faculty.schoolFacultyId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input v-else v-model="classInfo.name" style="width: 20rem" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="所属专业:" prop="schoolMajorId">
|
|
|
|
|
<el-select v-model="formInline.schoolMajorId" placeholder="" clearable style="width: 20rem" v-if="status">
|
|
|
|
|
<el-option v-for="major in majorList1" :key="major.schoolMajorId" :label="major.schoolMajorName" :value="major.schoolMajorId" />
|
|
|
|
|
<el-form-item label="所属专业" prop="schoolMajorId">
|
|
|
|
|
<el-select v-model="formInline.schoolMajorId" placeholder="请选择专业" clearable class="form-control" :disabled="!isCreate">
|
|
|
|
|
<el-option v-for="major in majorListForForm" :key="major.schoolMajorId" :label="major.schoolMajorName" :value="major.schoolMajorId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input v-else v-model="classInfo.value" placeholder="请输入所属专业:" style="width: 20rem" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="班级名称:" prop="className">
|
|
|
|
|
<el-input v-model="formInline.className" style="width: 20rem" placeholder=""></el-input>
|
|
|
|
|
<el-form-item label="班级名称" prop="className">
|
|
|
|
|
<el-input v-model="formInline.className" placeholder="请输入班级名称" class="form-control" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footers">
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm">确定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
@ -101,163 +91,266 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { Search, Plus, Refresh } from "@element-plus/icons-vue";
|
|
|
|
|
import { Plus, Refresh, Search } from "@element-plus/icons-vue";
|
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
import { formatDate } from "@/utils/index";
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
import * as indexApi from "@/api/teacher";
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
const currentUserId = computed(() => userStore.userInfo.userId);
|
|
|
|
|
import * as indexApi from "@/api/teacher";
|
|
|
|
|
|
|
|
|
|
const activeClassType = ref("ADMIN");
|
|
|
|
|
const dialogVisible = ref(false);
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const formInline = ref({
|
|
|
|
|
const isCreate = ref(true);
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
const schoolTotal = ref(0);
|
|
|
|
|
const facultyList = ref([]);
|
|
|
|
|
const majorList = ref([]);
|
|
|
|
|
const majorListForForm = ref([]);
|
|
|
|
|
|
|
|
|
|
const currentUserId = computed(() => userStore.userInfo.userId);
|
|
|
|
|
const currentSchoolId = computed(() => userStore.userInfo.schoolId);
|
|
|
|
|
const isManagerTeacher = computed(() => userStore.userInfo.teacherAdmin === true || String(userStore.userInfo.roleId) === "1");
|
|
|
|
|
|
|
|
|
|
const paramsquery = ref({
|
|
|
|
|
index: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
schoolId: currentSchoolId.value,
|
|
|
|
|
schoolFacultyId: "",
|
|
|
|
|
schoolId: userStore.userInfo.schoolId,
|
|
|
|
|
schoolMajorId: "",
|
|
|
|
|
className: "",
|
|
|
|
|
});
|
|
|
|
|
const rules = ref({
|
|
|
|
|
|
|
|
|
|
const formInline = ref(defaultForm());
|
|
|
|
|
|
|
|
|
|
const rules = {
|
|
|
|
|
schoolFacultyId: [{ required: true, message: "请选择所属院系", trigger: "change" }],
|
|
|
|
|
schoolMajorId: [{ required: true, message: "请输入所属专业", trigger: "blur" }],
|
|
|
|
|
schoolMajorId: [{ required: true, message: "请选择所属专业", trigger: "change" }],
|
|
|
|
|
className: [{ required: true, message: "请输入班级名称", trigger: "blur" }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const tableHeaderStyle = {
|
|
|
|
|
color: "#0f3052",
|
|
|
|
|
fontSize: "14px",
|
|
|
|
|
backgroundColor: "#eaf4ff",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const dialogTitle = computed(() => `${isCreate.value ? "新增" : "编辑"}${activeClassType.value === "ADMIN" ? "行政班" : "教学班"}`);
|
|
|
|
|
|
|
|
|
|
const filteredTableData = computed(() => {
|
|
|
|
|
return tableData.value.filter((row) => normalizeClassType(row.schoolClass) === activeClassType.value);
|
|
|
|
|
});
|
|
|
|
|
const paramsquery = ref({
|
|
|
|
|
index: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
classSn: "",
|
|
|
|
|
schoolId: userStore.userInfo.schoolId,
|
|
|
|
|
|
|
|
|
|
function defaultForm() {
|
|
|
|
|
return {
|
|
|
|
|
schoolFacultyId: "",
|
|
|
|
|
schoolId: currentSchoolId.value,
|
|
|
|
|
schoolMajorId: "",
|
|
|
|
|
className: "",
|
|
|
|
|
});
|
|
|
|
|
const classInfo = ref({});
|
|
|
|
|
const schoolTotal = ref(0);
|
|
|
|
|
// 新增编辑状态
|
|
|
|
|
const status = ref(false);
|
|
|
|
|
// 院校list
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
// 获取院校列表
|
|
|
|
|
const getList = () => {
|
|
|
|
|
indexApi.getClassesList(paramsquery.value).then((res) => {
|
|
|
|
|
tableData.value = res.data.list;
|
|
|
|
|
schoolTotal.value = res.data.total;
|
|
|
|
|
});
|
|
|
|
|
classType: activeClassType.value,
|
|
|
|
|
sourceClassIds: "",
|
|
|
|
|
};
|
|
|
|
|
// 删除院校
|
|
|
|
|
const delSchool = (id) => {
|
|
|
|
|
indexApi.deleteClass({ schoolClassId: id, userId: userStore.userInfo.userId }).then((res) => {
|
|
|
|
|
proxy.$message.success("删除成功");
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function normalizeClassType(schoolClass) {
|
|
|
|
|
if (schoolClass?.classType) {
|
|
|
|
|
return schoolClass.classType;
|
|
|
|
|
}
|
|
|
|
|
return schoolClass?.createdBy ? "TEACHING" : "ADMIN";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function canOperateClass(schoolClass) {
|
|
|
|
|
if (schoolClass?.dataSource === "ZHIYUN") {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (normalizeClassType(schoolClass) === "TEACHING") {
|
|
|
|
|
return schoolClass?.createdBy === currentUserId.value;
|
|
|
|
|
}
|
|
|
|
|
return isManagerTeacher.value || schoolClass?.createdBy === currentUserId.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getList() {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
indexApi
|
|
|
|
|
.getClassesList(paramsquery.value)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
tableData.value = res.data?.list || [];
|
|
|
|
|
schoolTotal.value = res.data?.total || 0;
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
loading.value = false;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 新增院校
|
|
|
|
|
const addschool = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleTabChange() {
|
|
|
|
|
paramsquery.value.index = 1;
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openCreateDialog() {
|
|
|
|
|
isCreate.value = true;
|
|
|
|
|
formInline.value = defaultForm();
|
|
|
|
|
dialogVisible.value = true;
|
|
|
|
|
status.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editClass(row) {
|
|
|
|
|
isCreate.value = false;
|
|
|
|
|
formInline.value = {
|
|
|
|
|
...row,
|
|
|
|
|
classType: normalizeClassType(row),
|
|
|
|
|
userId: currentUserId.value,
|
|
|
|
|
};
|
|
|
|
|
const editSchool = (row) => {
|
|
|
|
|
let data = { ...row };
|
|
|
|
|
formInline.value = data;
|
|
|
|
|
dialogVisible.value = true;
|
|
|
|
|
status.value = false;
|
|
|
|
|
indexApi.getFacultyAndMajorName({ schoolMajorId: row.schoolMajorId }).then((res) => {
|
|
|
|
|
classInfo.value.name = Object.keys(res.data)[0];
|
|
|
|
|
classInfo.value.value = Object.values(res.data)[0];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addClass() {
|
|
|
|
|
const payload = {
|
|
|
|
|
...formInline.value,
|
|
|
|
|
schoolId: currentSchoolId.value,
|
|
|
|
|
classType: activeClassType.value,
|
|
|
|
|
userId: currentUserId.value,
|
|
|
|
|
};
|
|
|
|
|
const add = () => {
|
|
|
|
|
formInline.value.userId = currentUserId.value;
|
|
|
|
|
indexApi.addClass(formInline.value).then((res) => {
|
|
|
|
|
indexApi.addClass(payload).then(() => {
|
|
|
|
|
proxy.$message.success("添加成功");
|
|
|
|
|
dialogVisible.value = false;
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateClass() {
|
|
|
|
|
const payload = {
|
|
|
|
|
...formInline.value,
|
|
|
|
|
schoolId: currentSchoolId.value,
|
|
|
|
|
classType: activeClassType.value,
|
|
|
|
|
userId: currentUserId.value,
|
|
|
|
|
status: true,
|
|
|
|
|
};
|
|
|
|
|
const edit = () => {
|
|
|
|
|
formInline.value.schoolId = userStore.userInfo.schoolId;
|
|
|
|
|
formInline.value.userId = currentUserId.value;
|
|
|
|
|
formInline.value.status = true;
|
|
|
|
|
indexApi.updateClass(formInline.value).then((res) => {
|
|
|
|
|
indexApi.updateClass(payload).then(() => {
|
|
|
|
|
proxy.$message.success("编辑成功");
|
|
|
|
|
dialogVisible.value = false;
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const canOperateClass = (schoolClass) => {
|
|
|
|
|
return schoolClass?.createdBy === currentUserId.value;
|
|
|
|
|
};
|
|
|
|
|
// 提交
|
|
|
|
|
const submitForm = () => {
|
|
|
|
|
status.value ? add() : edit();
|
|
|
|
|
};
|
|
|
|
|
const onClose = () => {
|
|
|
|
|
for (const key in formInline.value) {
|
|
|
|
|
formInline.value[key] = "";
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false;
|
|
|
|
|
};
|
|
|
|
|
// 刷新
|
|
|
|
|
const refresh = () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
loading.value = false;
|
|
|
|
|
getList();
|
|
|
|
|
}, 2000);
|
|
|
|
|
};
|
|
|
|
|
// 查询院系下拉列表
|
|
|
|
|
const facultyList = ref([]);
|
|
|
|
|
const getFacultyList = () => {
|
|
|
|
|
indexApi.seleteSchoolFacultyList({ schoolId: userStore.userInfo.schoolId }).then((res) => {
|
|
|
|
|
facultyList.value = res.data;
|
|
|
|
|
|
|
|
|
|
function submitForm() {
|
|
|
|
|
proxy.$refs.formInlineref.validate((valid) => {
|
|
|
|
|
if (!valid) return;
|
|
|
|
|
isCreate.value ? addClass() : updateClass();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 专业下拉框
|
|
|
|
|
const majorList = ref([]);
|
|
|
|
|
const getMajorList = () => {
|
|
|
|
|
if (!paramsquery.value.schoolFacultyId) return;
|
|
|
|
|
paramsquery.value.schoolMajorId = "";
|
|
|
|
|
indexApi.getMajorListBySchoolId({ schoolFacultyId: paramsquery.value.schoolFacultyId }).then((res) => {
|
|
|
|
|
majorList.value = res.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteClass(id) {
|
|
|
|
|
ElMessageBox.confirm("确定删除该班级吗?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}).then(() => {
|
|
|
|
|
indexApi.deleteClass({ schoolClassId: id, userId: currentUserId.value }).then(() => {
|
|
|
|
|
proxy.$message.success("删除成功");
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 专业下拉框
|
|
|
|
|
const majorList1 = ref([]);
|
|
|
|
|
const getMajorList1 = () => {
|
|
|
|
|
indexApi.getMajorListBySchoolId({ schoolFacultyId: formInline.value.schoolFacultyId }).then((res) => {
|
|
|
|
|
majorList1.value = res.data;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
//案例初始话方法
|
|
|
|
|
const handleSuccess = (res) => {
|
|
|
|
|
ElMessageBox.confirm("确定初始化班级数据吗?", "提示", {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initializeClass(schoolClass) {
|
|
|
|
|
ElMessageBox.confirm("确定初始化该教学班全班实训数据吗?该操作不可恢复。", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
}).then(() => {
|
|
|
|
|
indexApi
|
|
|
|
|
.initializeTeachingClassTrainingData({
|
|
|
|
|
teachingClassId: schoolClass.schoolClassId,
|
|
|
|
|
operatorId: currentUserId.value,
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
indexApi.initClass({ classId: res.schoolClass.schoolClassId}).then((res) => {
|
|
|
|
|
proxy.$message.success("初始化成功");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function refresh() {
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onClose() {
|
|
|
|
|
formInline.value = defaultForm();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getFacultyList() {
|
|
|
|
|
indexApi.seleteSchoolFacultyList({ schoolId: currentSchoolId.value }).then((res) => {
|
|
|
|
|
facultyList.value = res.data || [];
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMajorList() {
|
|
|
|
|
paramsquery.value.schoolMajorId = "";
|
|
|
|
|
if (!paramsquery.value.schoolFacultyId) {
|
|
|
|
|
majorList.value = [];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
indexApi.getMajorListBySchoolId({ schoolFacultyId: paramsquery.value.schoolFacultyId }).then((res) => {
|
|
|
|
|
majorList.value = res.data || [];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMajorListForForm() {
|
|
|
|
|
formInline.value.schoolMajorId = "";
|
|
|
|
|
if (!formInline.value.schoolFacultyId) {
|
|
|
|
|
majorListForForm.value = [];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
indexApi.getMajorListBySchoolId({ schoolFacultyId: formInline.value.schoolFacultyId }).then((res) => {
|
|
|
|
|
majorListForForm.value = res.data || [];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList();
|
|
|
|
|
getFacultyList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
|
.class {
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
height: calc(100vh - 70px);
|
|
|
|
|
.df {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.class-page {
|
|
|
|
|
min-height: calc(100vh - 70px);
|
|
|
|
|
background: #f7fbff;
|
|
|
|
|
|
|
|
|
|
.class-tabs {
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.query-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
// 换行
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
padding: 14px;
|
|
|
|
|
border: 1px solid #d8e8f7;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.query-control {
|
|
|
|
|
width: 220px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
margin: 14px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.class-table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-control {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|