diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 5ed055278..30214a7c9 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -11,7 +11,7 @@ {{ $t('global.personalDetails') }} - {{ $t('global.organization') }} + 教学管理 {{ $t('global.exit') }} diff --git a/src/views/organization/index.vue b/src/views/organization/index.vue index 38145e7f1..238fd30f1 100644 --- a/src/views/organization/index.vue +++ b/src/views/organization/index.vue @@ -1,22 +1,10 @@ - - - 导入学生信息 - - 学生信息导入模板 返回 - + {{ $store.state.user.companyName }} @@ -29,11 +17,11 @@ - + - + 班级 - + - - 查询 + + + + 导入学生信息 + + 学生信息导入模板 + 查询 @@ -69,7 +69,7 @@ /> - + @@ -247,29 +247,24 @@ export default { for (const index in wb.Sheets) { const dataList = convertSheetToList(wb.Sheets[index], true); if (dataList.length) { - const depart = dataList[2][0].trim(); - const parentDepart = dataList[1][0].trim(); + const depart = dataList[1][0].trim(); + const parentDepart = dataList[0][0].trim(); studentData.depart = depart; studentData.parentDepart = parentDepart; for ( let i = 2; i <= dataList[0].length; i++) { - const serialNumber = dataList[0][i]; - const studentId = dataList[1][i]; - const name = dataList[2][i]; + const studentId = dataList[0][i]; + const name = dataList[1][i]; const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g'); const studentIdJudge = !!studentId && !reg.test(studentId); - const serialNumberJudge = serialNumber == (i - 1); - console.log(studentIdJudge, serialNumberJudge); - if (studentIdJudge && serialNumberJudge && name) { + if (studentIdJudge && name) { students.push({account:dataList[1][i], name: dataList[2][i]}); } else { - if (!serialNumber && !studentId && !name) { + if (!studentId && !name) { break; } else if (!name) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学生姓名为空!`); + throw new Error(`学号为:《${studentId}》的数据学生姓名为空!`); } else if (!studentIdJudge) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学号格式不正确!`); - } else if (!serialNumberJudge) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据序号顺序不正确!`); + throw new Error(`,学号为:《${studentId}》的数据学号格式不正确!`); } } } @@ -305,10 +300,10 @@ export default { }, exportTemplate() { const wb = XLSX.utils.book_new(); - const data1 = [{A: '', B: '年级一', C:'班级二'}]; - const data2 = [{A: '序号', B: '学号', C:'姓名'}]; - const data3 = [{A: '1', B: '00001', C:'张三'}]; - const data4 = [{A: '2', B: '00002', C:'李四'}]; + const data1 = [{ A: 'XXXX级', B:'XX班'}]; + const data2 = [{A: '学号', C:'姓名'}]; + const data3 = [{A: '00001', C:'张三'}]; + const data4 = [{A: '00002', C:'李四'}]; const data = [...data1, ...data2, ...data3, ...data4]; const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true}); ws['!cols'] = [ @@ -331,7 +326,7 @@ export default { padding-right: 20px; height: 40px; z-index: 36; - width: 320px; + width: 40px; text-align: center; position: absolute; right: 0;