|
@@ -107,6 +107,11 @@
|
|
<div>{{ scope.row.un ? scope.row.un : "" }}</div>
|
|
<div>{{ scope.row.un ? scope.row.un : "" }}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="身份" min-width="15" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>{{ scope.row.role ? '管理员' : "普通教师" }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="schoolName"
|
|
prop="schoolName"
|
|
label="学校"
|
|
label="学校"
|
|
@@ -314,7 +319,7 @@ export default {
|
|
dName: "",
|
|
dName: "",
|
|
tel: "",
|
|
tel: "",
|
|
radio: 0,
|
|
radio: 0,
|
|
- type: 0,
|
|
|
|
|
|
+ type: 1,
|
|
role: 0
|
|
role: 0
|
|
},
|
|
},
|
|
sName: "",
|
|
sName: "",
|
|
@@ -360,13 +365,17 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getUser() {
|
|
getUser() {
|
|
|
|
+
|
|
let params = {
|
|
let params = {
|
|
userid: this.userid
|
|
userid: this.userid
|
|
};
|
|
};
|
|
|
|
+ // console.log(111,params);
|
|
this.ajax
|
|
this.ajax
|
|
.get(this.$store.state.api + "selectUser", params)
|
|
.get(this.$store.state.api + "selectUser", params)
|
|
.then(res => {
|
|
.then(res => {
|
|
|
|
+ // console.log(res);
|
|
this.userSuffix = res.data[0][0].accountNumber.split("@")[1];
|
|
this.userSuffix = res.data[0][0].accountNumber.split("@")[1];
|
|
|
|
+ // console.log(this.userSuffix);
|
|
})
|
|
})
|
|
.catch(err => {
|
|
.catch(err => {
|
|
console.error(err);
|
|
console.error(err);
|
|
@@ -383,13 +392,11 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
let uRole = null;
|
|
let uRole = null;
|
|
- let uType = null;
|
|
|
|
|
|
+ let uType = 1;
|
|
if (!this.modifyDiaData.radio) {
|
|
if (!this.modifyDiaData.radio) {
|
|
uRole = 1;
|
|
uRole = 1;
|
|
- uType = 0;
|
|
|
|
} else {
|
|
} else {
|
|
- uRole = this.modifyDiaData.role;
|
|
|
|
- uType = this.modifyDiaData.type;
|
|
|
|
|
|
+ uRole = 0;
|
|
}
|
|
}
|
|
|
|
|
|
let params = [
|
|
let params = [
|
|
@@ -424,7 +431,7 @@ export default {
|
|
},
|
|
},
|
|
// 修改用户信息弹窗
|
|
// 修改用户信息弹窗
|
|
modifyDiaBtn(val) {
|
|
modifyDiaBtn(val) {
|
|
- console.log(val);
|
|
|
|
|
|
+ // console.log(val);
|
|
this.modifyDiaData.userid = val.userid;
|
|
this.modifyDiaData.userid = val.userid;
|
|
this.modifyDiaData.dName = val.username;
|
|
this.modifyDiaData.dName = val.username;
|
|
this.modifyDiaData.tel = "";
|
|
this.modifyDiaData.tel = "";
|
|
@@ -432,7 +439,7 @@ export default {
|
|
this.modifyDiaData.type = val.type;
|
|
this.modifyDiaData.type = val.type;
|
|
this.modifyDiaData.mail = val.un;
|
|
this.modifyDiaData.mail = val.un;
|
|
|
|
|
|
- if (val.type == 0 && val.role == 1) {
|
|
|
|
|
|
+ if (val.role == 1) {
|
|
this.modifyDiaData.radio = 0;
|
|
this.modifyDiaData.radio = 0;
|
|
} else {
|
|
} else {
|
|
this.modifyDiaData.radio = 1;
|
|
this.modifyDiaData.radio = 1;
|
|
@@ -502,20 +509,22 @@ export default {
|
|
} else if (this.sMail === "") {
|
|
} else if (this.sMail === "") {
|
|
this.$message.error("教师账号不能为空");
|
|
this.$message.error("教师账号不能为空");
|
|
return;
|
|
return;
|
|
- } else if (
|
|
|
|
- // !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
|
|
|
|
- // this.sMail
|
|
|
|
- // )
|
|
|
|
- this.sMail === ""
|
|
|
|
- ) {
|
|
|
|
- this.$message.error("学生账号不能为空");
|
|
|
|
-
|
|
|
|
- // this.$message.error("邮箱格式不正确");
|
|
|
|
- return;
|
|
|
|
} else if (this.schoolName === "") {
|
|
} else if (this.schoolName === "") {
|
|
this.$message.error("请选择学校");
|
|
this.$message.error("请选择学校");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ // else if (
|
|
|
|
+ // // !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
|
|
|
|
+ // // this.sMail
|
|
|
|
+ // // )
|
|
|
|
+ // this.sMail === ""
|
|
|
|
+ // ) {
|
|
|
|
+ // this.$message.error("学生账号不能为空");
|
|
|
|
+
|
|
|
|
+ // // this.$message.error("邮箱格式不正确");
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if (this.sName === "") {
|
|
if (this.sName === "") {
|
|
this.$message.error("教师姓名不能为空");
|
|
this.$message.error("教师姓名不能为空");
|
|
@@ -523,30 +532,31 @@ export default {
|
|
} else if (this.sMail === "") {
|
|
} else if (this.sMail === "") {
|
|
this.$message.error("教师账号不能为空");
|
|
this.$message.error("教师账号不能为空");
|
|
return;
|
|
return;
|
|
- } else if (
|
|
|
|
- // !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
|
|
|
|
- // this.sMail
|
|
|
|
- // )
|
|
|
|
- this.sMail === ""
|
|
|
|
- ) {
|
|
|
|
- this.$message.error("学生账号不能为空");
|
|
|
|
|
|
+ }
|
|
|
|
+ // else if (
|
|
|
|
+ // // !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
|
|
|
|
+ // // this.sMail
|
|
|
|
+ // // )
|
|
|
|
+ // this.sMail === ""
|
|
|
|
+ // ) {
|
|
|
|
+ // this.$message.error("学生账号不能为空");
|
|
|
|
|
|
- // this.$message.error("邮箱格式不正确");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ // // this.$message.error("邮箱格式不正确");
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
let mail = '';
|
|
let mail = '';
|
|
if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
|
|
if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
|
|
mail = this.sMail;
|
|
mail = this.sMail;
|
|
}else{
|
|
}else{
|
|
- this.sMail + "@" + this.userSuffix
|
|
|
|
|
|
+ mail = this.sMail + "@" + this.userSuffix
|
|
}
|
|
}
|
|
|
|
|
|
if (this.time()) {
|
|
if (this.time()) {
|
|
// let params = { un: this.sMail };
|
|
// let params = { un: this.sMail };
|
|
let params = { un: mail};
|
|
let params = { un: mail};
|
|
-
|
|
|
|
|
|
+ // console.log('mail',mail,this.userSuffix);
|
|
this.ajax
|
|
this.ajax
|
|
.get(this.$store.state.api + "findMail", params)
|
|
.get(this.$store.state.api + "findMail", params)
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -562,13 +572,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
add_Student() {
|
|
add_Student() {
|
|
- let AddT = 0;
|
|
|
|
|
|
+ let AddT = 1;
|
|
let addR = 0;
|
|
let addR = 0;
|
|
if (!this.addRadio) {
|
|
if (!this.addRadio) {
|
|
- AddT = 0;
|
|
|
|
addR = 1;
|
|
addR = 1;
|
|
} else {
|
|
} else {
|
|
- AddT = 1;
|
|
|
|
addR = 0;
|
|
addR = 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -576,7 +584,7 @@ export default {
|
|
if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
|
|
if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
|
|
mail = this.sMail;
|
|
mail = this.sMail;
|
|
}else{
|
|
}else{
|
|
- this.sMail + "@" + this.userSuffix
|
|
|
|
|
|
+ mail = this.sMail + "@" + this.userSuffix
|
|
}
|
|
}
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
@@ -716,7 +724,7 @@ export default {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
this.tableData = res.data[0];
|
|
this.tableData = res.data[0];
|
|
- console.log("this.tableData", this.tableData);
|
|
|
|
|
|
+ // console.log("this.tableData", this.tableData);
|
|
})
|
|
})
|
|
.catch(err => {
|
|
.catch(err => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|