教学管理文字调整
This commit is contained in:
parent
c8150bfa32
commit
097c95beaa
@ -11,7 +11,7 @@
|
|||||||
<span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span>
|
<span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="companyAdmin">
|
<el-dropdown-item v-if="companyAdmin">
|
||||||
<span style="display:block;" @click="handleOrganization">{{ $t('global.organization') }}</span>
|
<span style="display:block;" @click="handleOrganization">教学管理</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
<span style="display:block;" @click="logout">{{ $t('global.exit') }}</span>
|
<span style="display:block;" @click="logout">{{ $t('global.exit') }}</span>
|
||||||
|
@ -1,22 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="back_box">
|
<div class="back_box">
|
||||||
<el-button v-if="companyAdmin" :loading="loadingStudentInfo" type="text" class="uploadDemo" style="margin-top: 10px;">
|
|
||||||
<input
|
|
||||||
id="importResults"
|
|
||||||
ref="files"
|
|
||||||
type="file"
|
|
||||||
class="file_box"
|
|
||||||
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
||||||
@change="importResults"
|
|
||||||
>
|
|
||||||
导入学生信息
|
|
||||||
</el-button>
|
|
||||||
<el-button type="text" @click="exportTemplate">学生信息导入模板</el-button>
|
|
||||||
<el-button type="text" @click="goBack">返回</el-button>
|
<el-button type="text" @click="goBack">返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs v-model="activeName" type="card">
|
<el-tabs v-model="activeName" type="card">
|
||||||
<el-tab-pane label="部门管理" name="first">
|
<el-tab-pane label="组织" name="first">
|
||||||
<div style="font-size: 22px;text-align: center;">{{ $store.state.user.companyName }}</div>
|
<div style="font-size: 22px;text-align: center;">{{ $store.state.user.companyName }}</div>
|
||||||
<div style="position: relative;transform: translateX(-50%);left: 50%;padding: 20px;width: 500px;">
|
<div style="position: relative;transform: translateX(-50%);left: 50%;padding: 20px;width: 500px;">
|
||||||
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick">
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick">
|
||||||
@ -29,11 +17,11 @@
|
|||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="成员管理" name="second">
|
<el-tab-pane label="成员" name="second">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="21" :offset="1">
|
<el-col :span="19" style="padding-left: 20px;">
|
||||||
<span>班级</span>
|
<span>班级</span>
|
||||||
<el-select v-model="classId" size="small" placeholder="班级">
|
<el-select v-model="classId" size="mini" placeholder="班级">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in classList"
|
v-for="item in classList"
|
||||||
:key="item.departmentId"
|
:key="item.departmentId"
|
||||||
@ -42,8 +30,20 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="5">
|
||||||
<el-button type="primary" size="small" @click="onSubmit">查询</el-button>
|
<el-button v-if="companyAdmin" :loading="loadingStudentInfo" type="primary" size="mini" class="uploadDemo" style="margin-top: 10px;">
|
||||||
|
<input
|
||||||
|
id="importResults"
|
||||||
|
ref="files"
|
||||||
|
type="file"
|
||||||
|
class="file_box"
|
||||||
|
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||||
|
@change="importResults"
|
||||||
|
>
|
||||||
|
导入学生信息
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="exportTemplate">学生信息导入模板</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="tableData" border style="width: 100%;margin-top: 10px;" :max-height="height">
|
<el-table :data="tableData" border style="width: 100%;margin-top: 10px;" :max-height="height">
|
||||||
@ -69,7 +69,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="成绩导出" name="third">
|
<el-tab-pane label="成绩" name="third">
|
||||||
<grade-export refs="gradeExport" :class-list="classList" :height="height" />
|
<grade-export refs="gradeExport" :class-list="classList" :height="height" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@ -247,29 +247,24 @@ export default {
|
|||||||
for (const index in wb.Sheets) {
|
for (const index in wb.Sheets) {
|
||||||
const dataList = convertSheetToList(wb.Sheets[index], true);
|
const dataList = convertSheetToList(wb.Sheets[index], true);
|
||||||
if (dataList.length) {
|
if (dataList.length) {
|
||||||
const depart = dataList[2][0].trim();
|
const depart = dataList[1][0].trim();
|
||||||
const parentDepart = dataList[1][0].trim();
|
const parentDepart = dataList[0][0].trim();
|
||||||
studentData.depart = depart;
|
studentData.depart = depart;
|
||||||
studentData.parentDepart = parentDepart;
|
studentData.parentDepart = parentDepart;
|
||||||
for ( let i = 2; i <= dataList[0].length; i++) {
|
for ( let i = 2; i <= dataList[0].length; i++) {
|
||||||
const serialNumber = dataList[0][i];
|
const studentId = dataList[0][i];
|
||||||
const studentId = dataList[1][i];
|
const name = dataList[1][i];
|
||||||
const name = dataList[2][i];
|
|
||||||
const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
|
const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
|
||||||
const studentIdJudge = !!studentId && !reg.test(studentId);
|
const studentIdJudge = !!studentId && !reg.test(studentId);
|
||||||
const serialNumberJudge = serialNumber == (i - 1);
|
if (studentIdJudge && name) {
|
||||||
console.log(studentIdJudge, serialNumberJudge);
|
|
||||||
if (studentIdJudge && serialNumberJudge && name) {
|
|
||||||
students.push({account:dataList[1][i], name: dataList[2][i]});
|
students.push({account:dataList[1][i], name: dataList[2][i]});
|
||||||
} else {
|
} else {
|
||||||
if (!serialNumber && !studentId && !name) {
|
if (!studentId && !name) {
|
||||||
break;
|
break;
|
||||||
} else if (!name) {
|
} else if (!name) {
|
||||||
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学生姓名为空!`);
|
throw new Error(`学号为:《${studentId}》的数据学生姓名为空!`);
|
||||||
} else if (!studentIdJudge) {
|
} else if (!studentIdJudge) {
|
||||||
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学号格式不正确!`);
|
throw new Error(`,学号为:《${studentId}》的数据学号格式不正确!`);
|
||||||
} else if (!serialNumberJudge) {
|
|
||||||
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据序号顺序不正确!`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,10 +300,10 @@ export default {
|
|||||||
},
|
},
|
||||||
exportTemplate() {
|
exportTemplate() {
|
||||||
const wb = XLSX.utils.book_new();
|
const wb = XLSX.utils.book_new();
|
||||||
const data1 = [{A: '', B: '年级一', C:'班级二'}];
|
const data1 = [{ A: 'XXXX级', B:'XX班'}];
|
||||||
const data2 = [{A: '序号', B: '学号', C:'姓名'}];
|
const data2 = [{A: '学号', C:'姓名'}];
|
||||||
const data3 = [{A: '1', B: '00001', C:'张三'}];
|
const data3 = [{A: '00001', C:'张三'}];
|
||||||
const data4 = [{A: '2', B: '00002', C:'李四'}];
|
const data4 = [{A: '00002', C:'李四'}];
|
||||||
const data = [...data1, ...data2, ...data3, ...data4];
|
const data = [...data1, ...data2, ...data3, ...data4];
|
||||||
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
|
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
|
||||||
ws['!cols'] = [
|
ws['!cols'] = [
|
||||||
@ -331,7 +326,7 @@ export default {
|
|||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
z-index: 36;
|
z-index: 36;
|
||||||
width: 320px;
|
width: 40px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user