|
|
@@ -352,7 +352,7 @@ export default {
|
|
|
getExcel(res) {
|
|
|
require.ensure([], () => {
|
|
|
const { export_json_to_excel } = require("../../../common/Export2Excel");
|
|
|
- const tHeader = ["学生姓名", "学生账号", "班级"];//"学号", "学生手机号",
|
|
|
+ const tHeader = ["学生姓名", "学生账号(建议直接使用学号)", "班级"];//"学号", "学生手机号",
|
|
|
const data = [];
|
|
|
export_json_to_excel(tHeader, data, "上传学生样例");
|
|
|
});
|
|
|
@@ -722,18 +722,21 @@ export default {
|
|
|
obj.name = v["学生姓名"];
|
|
|
// obj.mail = v["学生账号"] ? v["学生账号"] : a;
|
|
|
// console.log('v["学生账号"]',v["学生账号"]==true,v["学生账号"]);
|
|
|
- if (v["学生账号"]) {
|
|
|
- if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(v["学生账号"])){
|
|
|
- obj.mail = v["学生账号"];
|
|
|
+ // 兼容“学生账号(建议直接使用学号)”和“学生账号”两种表头
|
|
|
+ let accountValue = v["学生账号(建议直接使用学号)"] !== undefined && v["学生账号(建议直接使用学号)"] !== ""
|
|
|
+ ? v["学生账号(建议直接使用学号)"]
|
|
|
+ : v["学生账号"];
|
|
|
+ if (accountValue) {
|
|
|
+ if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(accountValue)){
|
|
|
+ obj.mail = accountValue;
|
|
|
}else{
|
|
|
- if(_this.org != "" && _this.org != "null" && _this.org != undefined && _this.org && _this.schoolChar){
|
|
|
- obj.mail = v["学生账号"] + "@" + _this.schoolChar + '.' + _this.userSuffix
|
|
|
+ if(_this.org != "" && _this.org != "null" && _this.org != undefined && _this.org && _this.schoolChar){
|
|
|
+ obj.mail = accountValue + "@" + _this.schoolChar + '.' + _this.userSuffix
|
|
|
}else {
|
|
|
- obj.mail = v["学生账号"] + "@" + _this.userSuffix
|
|
|
+ obj.mail = accountValue + "@" + _this.userSuffix
|
|
|
}
|
|
|
- // obj.mail = v["学生账号"] + "@" + _this.userSuffix
|
|
|
+ // obj.mail = accountValue + "@" + _this.userSuffix
|
|
|
}
|
|
|
-
|
|
|
}else{
|
|
|
obj.mail = a;
|
|
|
}
|