lsc 1 тиждень тому
батько
коміт
7a6c0f9c47
1 змінених файлів з 24 додано та 4 видалено
  1. 24 4
      src/components/pages/studentManage/student.vue

+ 24 - 4
src/components/pages/studentManage/student.vue

@@ -285,7 +285,8 @@ export default {
       role: this.$route.query.role,
       role: this.$route.query.role,
       cid: "",
       cid: "",
       tx: require("../../../assets/avatar.png"),
       tx: require("../../../assets/avatar.png"),
-      userSuffix: ""
+      userSuffix: "",
+      schoolChar: "",
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -405,7 +406,12 @@ 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{
-        mail = this.sMail + "@" + this.userSuffix
+        if(this.org != "" && this.org != "null"  && this.org != undefined && this.org && this.schoolChar){
+          mail = this.sMail + "@" + this.schoolChar + '.' + this.userSuffix
+        }else {
+          mail = this.sMail + "@" + this.userSuffix
+        }
+        // mail = this.sMail + "@" + this.userSuffix
       }
       }
       if (this.time()) {
       if (this.time()) {
         // let params = { un: this.sPhone };
         // let params = { un: this.sPhone };
@@ -452,7 +458,11 @@ 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{
-        mail = this.sMail + "@" + this.userSuffix
+        if(this.org != "" && this.org != "null"  && this.org != undefined && this.org && this.schoolChar){
+          mail = this.sMail + "@" + this.schoolChar + '.' + this.userSuffix
+        }else {
+          mail = this.sMail + "@" + this.userSuffix
+        }
       }
       }
       let params = [
       let params = [
         {
         {
@@ -705,7 +715,12 @@ export default {
               if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(v["学生账号"])){
               if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(v["学生账号"])){
                 obj.mail = v["学生账号"];
                 obj.mail = v["学生账号"];
               }else{
               }else{
-                obj.mail = v["学生账号"] + "@" + _this.userSuffix
+                if(_this.org != "" && _this.org != "null"  && _this.org != undefined && _this.org && _this.schoolChar){
+                  obj.mail = v["学生账号"] + "@" + _this.schoolChar + '.' + _this.userSuffix
+                }else {
+                  obj.mail = v["学生账号"] + "@" + _this.userSuffix
+                }
+                // obj.mail = v["学生账号"] + "@" + _this.userSuffix
               }
               }
               
               
             }else{
             }else{
@@ -1048,6 +1063,11 @@ export default {
         .get(this.$store.state.api + "selectSchoolName2", params)
         .get(this.$store.state.api + "selectSchoolName2", params)
         .then((res) => {
         .then((res) => {
           this.schoolName = res.data[0][0].name;
           this.schoolName = res.data[0][0].name;
+          const cleanedSchoolName = res.data[0][0].name.replace(/[,。;:!“”‘’()()]/g, ''); // 去掉标点符号
+          console.log(pinyin);
+          console.log(pinyin.getFullChars(cleanedSchoolName));
+          console.log(pinyin.getCamelChars(cleanedSchoolName));
+          this.schoolChar = pinyin.getCamelChars(cleanedSchoolName).toLowerCase()
         })
         })
         .catch((err) => {
         .catch((err) => {
           console.error(err);
           console.error(err);