feat: remove student contact fields

dev-QQq
chenyuan 1 month ago
parent c4fd23ad54
commit 5e0bd3e8c5

@ -26,8 +26,6 @@
<el-table-column label="班级" min-width="160">
<template #default="{ row }">{{ className(row.schoolClassId) }}</template>
</el-table-column>
<el-table-column label="手机" prop="phone" min-width="140" />
<el-table-column label="邮箱" prop="email" min-width="180" />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button link type="primary" @click="openEdit(row)"></el-button>
@ -62,8 +60,6 @@
<el-option v-for="option in sexOptions" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</el-form-item>
<el-form-item label="手机"><el-input v-model="form.phone" /></el-form-item>
<el-form-item label="邮箱"><el-input v-model="form.email" /></el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
@ -90,7 +86,7 @@ const form = ref({});
const faculties = ref([]);
const majors = ref([]);
const classes = ref([]);
const studentTemplateHeaders = ["姓名", "学号", "性别", "所属院系", "所属专业", "所属班级", "手机", "邮箱"];
const studentTemplateHeaders = ["姓名", "学号", "性别", "所属院系", "所属专业", "所属班级"];
const sexOptions = [
{ label: "男", value: "男" },
{ label: "女", value: "女" },
@ -144,11 +140,11 @@ const downloadStudentTemplate = async () => {
const sampleOrg = firstOrgRow();
const templateRows = [
studentTemplateHeaders,
["张三", "20260001", "男", sampleOrg.所属院系, sampleOrg.所属专业, sampleOrg.所属班级, "13800000000", "zhangsan@example.com"],
["张三", "20260001", "男", sampleOrg.所属院系, sampleOrg.所属专业, sampleOrg.所属班级],
];
const templateSheet = XLSX.utils.aoa_to_sheet(templateRows);
templateSheet["!cols"] = [{ wch: 14 }, { wch: 18 }, { wch: 10 }, { wch: 18 }, { wch: 18 }, { wch: 18 }, { wch: 18 }, { wch: 28 }];
templateSheet["!autofilter"] = { ref: "A1:H1" };
templateSheet["!cols"] = [{ wch: 14 }, { wch: 18 }, { wch: 10 }, { wch: 18 }, { wch: 18 }, { wch: 18 }];
templateSheet["!autofilter"] = { ref: "A1:F1" };
const orgSheet = XLSX.utils.json_to_sheet(orgRows().length ? orgRows() : [{ 所属院系: "请先维护院系", 所属专业: "请先维护专业", 所属班级: "请先维护班级" }]);
orgSheet["!cols"] = [{ wch: 22 }, { wch: 22 }, { wch: 22 }];

@ -58,8 +58,6 @@
<el-table-column label="所属班级" prop="className" align="center"></el-table-column>
<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="账号来源" prop="codeFrom" align="center"></el-table-column>
<el-table-column label="创建日期" prop="createTime" align="center">
<template #default="{ row }">
@ -104,12 +102,6 @@
<el-form-item label="学号:" prop="userName">
<el-input v-model="formInline.userName" style="width: 20rem" placeholder=""></el-input>
</el-form-item>
<el-form-item label="电话号码:">
<el-input v-model="formInline.phone" style="width: 20rem" placeholder=""></el-input>
</el-form-item>
<el-form-item label="电子邮箱:">
<el-input v-model="formInline.email" style="width: 20rem" placeholder=""></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footers">
@ -140,8 +132,6 @@ const formInline = ref({
schoolClassId: "",
schoolName: "",
userName: "",
email: "",
phone: "",
});
const createEmptyForm = () => ({
schoolFacultyId: "",
@ -152,8 +142,6 @@ const createEmptyForm = () => ({
schoolName: "",
userName: "",
name: "",
email: "",
phone: "",
});
const rules = ref({
schoolFacultyId: [{ required: true, message: "请选择所属院系", trigger: "change" }],
@ -329,10 +317,10 @@ const downloadTemplate = async () => {
const adminClassRows = await buildOwnedAdminClassRows();
const firstAdminClass = adminClassRows[0] || ["电子商务学院", "电子商务", "行政一班"];
const templateSheet = XLSX.utils.aoa_to_sheet([
["姓名", "学号", "性别", "所属院系", "所属专业", "所属班级", "手机", "邮箱"],
["张三", "20260001", "男", firstAdminClass[0], firstAdminClass[1], firstAdminClass[2], "13800000000", "student@example.com"],
["姓名", "学号", "性别", "所属院系", "所属专业", "所属班级"],
["张三", "20260001", "男", firstAdminClass[0], firstAdminClass[1], firstAdminClass[2]],
]);
templateSheet["!cols"] = [{ wch: 14 }, { wch: 18 }, { wch: 10 }, { wch: 24 }, { wch: 24 }, { wch: 20 }, { wch: 16 }, { wch: 28 }];
templateSheet["!cols"] = [{ wch: 14 }, { wch: 18 }, { wch: 10 }, { wch: 24 }, { wch: 24 }, { wch: 20 }];
const dataRows = adminClassRows.length ? adminClassRows : [["暂无可导入行政班", "请先维护专业", "请先创建行政班"]];
const dataSheet = XLSX.utils.aoa_to_sheet([["所属院系", "所属专业", "所属班级"], ...dataRows]);
dataSheet["!cols"] = [{ wch: 28 }, { wch: 28 }, { wch: 24 }];

@ -0,0 +1,16 @@
const assert = require("assert");
const fs = require("fs");
const path = require("path");
const readView = (...parts) => fs.readFileSync(path.join(__dirname, "..", "src", "views", ...parts), "utf8");
const teacherStudentView = readView("teacherEnd", "student", "index.vue");
const schoolAdminStudentView = readView("schoolAdmin", "student", "index.vue");
for (const [name, source] of [
["教师端学生管理", teacherStudentView],
["学校管理员端学生管理", schoolAdminStudentView],
]) {
assert(!/\b(phone|email)\b/.test(source), `${name}不应再展示、录入或导出电话和邮箱字段`);
}
console.log("student contact fields static checks passed");
Loading…
Cancel
Save