lsc il y a 1 an
Parent
commit
a876848f44

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.b7e47276d5609c1c79bfcb59a1d9b8e2.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.1b8e037bd3fbbd358d74.js></script><script type=text/javascript src=./static/js/app.47180941627332270db5.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.54d19d675f2acfe287e34a6a3e776313.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.1b8e037bd3fbbd358d74.js></script><script type=text/javascript src=./static/js/app.3b652a804b70406fa455.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.54d19d675f2acfe287e34a6a3e776313.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.54d19d675f2acfe287e34a6a3e776313.css.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.3b652a804b70406fa455.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.3b652a804b70406fa455.js.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.47180941627332270db5.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 87 - 206
src/components/pages/student.vue

@@ -1,53 +1,27 @@
 <template>
   <div class="pb_content" style="background: unset">
-    <div
-      class="pb_content_body"
-      style="
+    <div class="pb_content_body" style="
         background: #fff;
         padding: 0px 25px;
         box-sizing: border-box;
         border-radius: 5px;
-      "
-    >
+      ">
       <div class="pb_head">
         <span>学生管理</span>
       </div>
       <div class="student_head">
         <div class="head_left">
-          <el-input
-            v-model="sPhoneUser"
-            class="student_input"
-            placeholder="请输入用户名"
-          ></el-input>
-          <el-select
-            v-model="cid"
-            placeholder="请选择班级"
-            class="student_input"
-            @change="searchStudent"
-          >
+          <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入用户名"></el-input>
+          <el-select v-model="cid" placeholder="请选择班级" class="student_input" @change="searchStudent">
             <el-option label="所有人" value=""></el-option>
-            <el-option
-              v-for="(item, index) in classJuri"
-              :key="index"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
+            <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
-          <el-button class="student_button" @click="searchStudent"
-            >查询</el-button
-          >
+          <el-button class="student_button" @click="searchStudent">查询</el-button>
         </div>
         <div class="head_right">
           <el-button @click="addStudent">添加学生</el-button>
-          <el-upload
-            v-show="false"
-            class="upload-demo newCss"
-            :http-request="handleChange"
-            :on-remove="handleRemove"
-            action="#"
-            :file-list="fileListUpload"
-            accept=".xlsx"
-          >
+          <el-upload v-show="false" class="upload-demo newCss" :http-request="handleChange" :on-remove="handleRemove"
+            action="#" :file-list="fileListUpload" accept=".xlsx">
             <el-button size="primary" type="primary">批量添加</el-button>
             <div slot="tip" class="el-upload__tip" style="margin-left: 10px">
               只能上传xlsx文件,且不超过500kb
@@ -60,39 +34,25 @@
     </div>
     <div class="pb_content_body">
       <div class="student_table">
-        <el-table
-          ref="table"
-          :data="tableData"
-          border
-          :height="tableHeight"
-          :fit="true"
-          v-loading="isLoading"
-          style="width: 100%"
-          :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
-          :row-class-name="tableRowClassName"
-        >
+        <el-table ref="table" :data="tableData" border :height="tableHeight" :fit="true" v-loading="isLoading"
+          style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
+          :row-class-name="tableRowClassName">
           <el-table-column label="姓名" min-width="10" align="center">
             <template slot-scope="scope">
               <div class="userImg">
                 <div class="tx">
-                  <img
-                    :src="
-                      scope.row.headportrait != null
-                        ? scope.row.headportrait
-                        : tx
-                    "
-                    alt
-                  />
+                  <img :src="scope.row.headportrait != null
+                      ? scope.row.headportrait
+                      : tx
+                    " alt />
                 </div>
-                <div
-                  style="
+                <div style="
                     width: 150px;
                     text-align: left;
                     white-space: nowrap;
                     overflow: hidden;
                     text-overflow: ellipsis;
-                  "
-                >
+                  ">
                   {{ scope.row.name }}
                 </div>
               </div>
@@ -116,41 +76,19 @@
             align="center"
           >
           </el-table-column>-->
-          <el-table-column
-            prop="classname2"
-            label="班级"
-            min-width="15"
-            align="center"
-          >
+          <el-table-column prop="classname2" label="班级" min-width="15" align="center">
           </el-table-column>
           <el-table-column label="操作" width="250px">
             <template slot-scope="scope">
               <div class="btnBox">
-                <el-button
-                  class="de_button"
-                  type="primary"
-                  size="small"
-                  style="
+                <el-button class="de_button" type="primary" size="small" style="
                     width: auto;
                     padding: 5px !important;
                     line-height: 15px;
-                  "
-                  @click="iniPassword(scope.row.userid)"
-                  >初始化密码</el-button
-                >
-                <el-button
-                  class="de_button"
-                  type="primary"
-                  size="small"
-                  @click="updateStudentA(scope.row)"
-                  >修改</el-button
-                >
+                  " @click="iniPassword(scope.row.userid)">初始化密码</el-button>
+                <el-button class="de_button" type="primary" size="small" @click="updateStudentA(scope.row)">修改</el-button>
                 <div class="delete">
-                  <img
-                    src="../../assets/remove.png"
-                    alt
-                    @click="deleteStudent(scope.row.userid, scope.row.state)"
-                  />
+                  <img src="../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
                 </div>
               </div>
             </template>
@@ -158,23 +96,12 @@
         </el-table>
       </div>
       <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          v-if="page"
-          @current-change="handleCurrentChange"
-        ></el-pagination>
+        <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
+          @current-change="handleCurrentChange"></el-pagination>
       </div>
     </div>
-    <el-dialog
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="700px"
-      :before-close="handleClose"
-      class="add_student"
-    >
+    <el-dialog :visible.sync="dialogVisible" :append-to-body="true" width="700px" :before-close="handleClose"
+      class="add_student">
       <div slot="title" class="header-title">
         <div class="logoImg">
           <img src="../../assets/logo.png" alt />
@@ -184,15 +111,10 @@
       <el-form>
         <el-form-item label="学生姓名" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生姓名"
-              clearable
-              v-model="sName"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生姓名" clearable v-model="sName" class="add_input"></el-input>
           </span>
         </el-form-item>
-        <el-form-item label="学生学号" :label-width="formLabelWidth">
+        <!-- <el-form-item label="学生学号" :label-width="formLabelWidth">
           <span>
             <el-input
               placeholder="请输入学生学号"
@@ -211,37 +133,18 @@
               class="add_input"
             ></el-input>
           </span>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="学生账号" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生账号"
-              clearable
-              v-model="sMail"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生账号" clearable v-model="sMail" class="add_input"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="所属学校" :label-width="formLabelWidth">
-          <el-input
-            disabled
-            style="width: 300px"
-            v-model="schoolName"
-          ></el-input>
+          <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
         </el-form-item>
         <el-form-item label="班级" :label-width="formLabelWidth">
-          <el-select
-            multiple
-            collapse-tags
-            v-model="sByClass"
-            placeholder="请选择班级"
-          >
-            <el-option
-              v-for="(item, index) in classJuri"
-              :key="index"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
+          <el-select multiple collapse-tags v-model="sByClass" placeholder="请选择班级">
+            <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
         </el-form-item>
         <div style="text-align: center; color: #adb3b7">
@@ -252,13 +155,8 @@
         <el-button class="right" @click="insertStudent">确认</el-button>
       </span>
     </el-dialog>
-    <el-dialog
-      :visible.sync="dialogVisibleUpdate"
-      :append-to-body="true"
-      width="700px"
-      :before-close="handleClose"
-      class="add_student"
-    >
+    <el-dialog :visible.sync="dialogVisibleUpdate" :append-to-body="true" width="700px" :before-close="handleClose"
+      class="add_student">
       <div slot="title" class="header-title">
         <div class="logoImg">
           <img src="../../assets/logo.png" alt />
@@ -268,64 +166,30 @@
       <el-form>
         <el-form-item label="学生名称" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生姓名"
-              clearable
-              v-model="userinfo.name"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生姓名" clearable v-model="userinfo.name" class="add_input"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="学生学号" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生学号"
-              clearable
-              v-model="userinfo.studentid"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生学号" clearable v-model="userinfo.studentid" class="add_input"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="学生手机号" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生手机号"
-              clearable
-              v-model="userinfo.phonenumber"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生手机号" clearable v-model="userinfo.phonenumber" class="add_input"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="学生账号" :label-width="formLabelWidth">
           <span>
-            <el-input
-              placeholder="请输入学生账号"
-              clearable
-              v-model="userinfo.un"
-              class="add_input"
-            ></el-input>
+            <el-input placeholder="请输入学生账号" clearable v-model="userinfo.un" class="add_input"></el-input>
           </span>
         </el-form-item>
         <el-form-item label="所属学校" :label-width="formLabelWidth">
-          <el-input
-            disabled
-            style="width: 300px"
-            v-model="schoolName"
-          ></el-input>
+          <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
         </el-form-item>
         <el-form-item label="班级" :label-width="formLabelWidth">
-          <el-select
-            multiple
-            collapse-tags
-            v-model="userinfo.classid"
-            placeholder="请选择班级"
-          >
-            <el-option
-              v-for="(item, index) in classJuri"
-              :key="index"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
+          <el-select multiple collapse-tags v-model="userinfo.classid" placeholder="请选择班级">
+            <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
         </el-form-item>
         <div style="text-align: center; color: #adb3b7">
@@ -372,10 +236,12 @@ export default {
       org: this.$route.query.org,
       cid: "",
       tx: require("../../assets/avatar.png"),
+      userSuffix:""
     };
   },
   mounted() {
     this.$nextTick(function () {
+      this.getUser()
       this.tableHeight =
         window.innerHeight - this.$refs.table.$el.offsetTop - 200;
       if (this.tableHeight <= 530) {
@@ -393,6 +259,19 @@ export default {
     });
   },
   methods: {
+    getUser() {
+      let params = {
+        userid: this.userid
+      }
+      this.ajax
+        .get(this.$store.state.api + "selectUser", params)
+        .then((res) => {
+          this.userSuffix = res.data[0][0].accountNumber.split("@")[1]
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     tableRowClassName({ row, rowIndex }) {
       if ((rowIndex + 1) % 2 === 0) {
         return "even_row";
@@ -455,9 +334,11 @@ export default {
         this.$message.error("手机号格式不正确");
         return;
       } else if (
-        !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)
+        // !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)
+        this.sMail === ""
       ) {
-        this.$message.error("邮箱格式不正确");
+        // this.$message.error("邮箱格式不正确");
+        this.$message.error("学生账号不能为空");
         return;
       }
 
@@ -476,7 +357,7 @@ export default {
         //     if (res.data[0].length > 0) {
         //       this.$message.error("此学生手机号码已被注册");
         //     } else {
-        let params = { un: this.sMail };
+        let params = { un: this.sMail + '@' + this.userSuffix };
         this.ajax
           .get(this.$store.state.api + "findMail", params)
           .then((res) => {
@@ -511,7 +392,7 @@ export default {
     add_Student() {
       let params = [
         {
-          username: this.sMail,
+          username: this.sMail + '@' + this.userSuffix,
           userpassword: 123456,
           alias: this.sName,
           oid: this.oid,
@@ -630,7 +511,7 @@ export default {
       if (this.fileTemp) {
         if (
           this.fileTemp.type ==
-            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
+          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
           this.fileTemp.type == "application/vnd.ms-excel"
         ) {
           this.importCount = 1;
@@ -1104,7 +985,7 @@ export default {
               console.error(err);
             });
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     iniPassword(id) {
       this.$confirm("确定" + "初始化" + "此学生的密码吗?", "提示", {
@@ -1131,7 +1012,7 @@ export default {
               console.error(err);
             });
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     updateStudentA(res) {
       this.userinfo = JSON.parse(JSON.stringify(res));
@@ -1222,7 +1103,7 @@ export default {
 </script>
 
 <style scoped>
-.pb_head > span:nth-child(2) {
+.pb_head>span:nth-child(2) {
   font-size: 20px;
   margin-left: 5px;
   color: #828282;
@@ -1256,7 +1137,7 @@ export default {
   align-items: baseline;
 }
 
-.student_input >>> .el-input__inner {
+.student_input>>>.el-input__inner {
   height: 30px;
   width: 190px;
   font-size: 13px;
@@ -1273,7 +1154,7 @@ export default {
   line-height: 30px;
 }
 
-.head_right > button:nth-child(1) {
+.head_right>button:nth-child(1) {
   color: #fff;
   background: #2268bc;
   width: 70px;
@@ -1283,7 +1164,7 @@ export default {
   line-height: 30px;
 }
 
-.head_right > button:nth-child(2) {
+.head_right>button:nth-child(2) {
   color: #fff;
   background: #2268bc;
   width: 70px;
@@ -1293,7 +1174,7 @@ export default {
   line-height: 30px;
 }
 
-.head_right > div {
+.head_right>div {
   font-size: 12px;
   line-height: 40px;
   margin-left: 10px;
@@ -1302,16 +1183,16 @@ export default {
   cursor: pointer;
 }
 
-.student_table >>> .el-table--border td {
+.student_table>>>.el-table--border td {
   border-right: 0px !important;
 }
 
-.student_table >>> .el-table,
-.student_table >>> .el-table__body-wrapper {
+.student_table>>>.el-table,
+.student_table>>>.el-table__body-wrapper {
   height: auto !important;
 }
 
-.el-table >>> .even_row {
+.el-table>>>.even_row {
   background-color: #f1f1f1 !important;
 }
 
@@ -1325,30 +1206,30 @@ export default {
   line-height: 25px;
 }
 
-.add_student >>> .el-dialog__header {
+.add_student>>>.el-dialog__header {
   padding: 20px 20px 10px;
   text-align: center;
   background: #32455b;
 }
 
-.add_student >>> .el-dialog__title {
+.add_student>>>.el-dialog__title {
   font-size: 14px !important;
   color: #fff !important;
 }
 
-.add_student >>> .el-dialog__headerbtn {
+.add_student>>>.el-dialog__headerbtn {
   font-size: 20px !important;
 }
 
-.add_student >>> .el-form-item__label {
+.add_student>>>.el-form-item__label {
   margin-left: 65px;
 }
 
-.add_student >>> .el-form-item {
+.add_student>>>.el-form-item {
   display: flex;
 }
 
-.add_student >>> .el-form-item__content {
+.add_student>>>.el-form-item__content {
   margin: 0 !important;
 }
 
@@ -1356,7 +1237,7 @@ export default {
   width: 365px;
 }
 
-.add_student >>> .el-dialog__footer {
+.add_student>>>.el-dialog__footer {
   text-align: center !important;
 }
 
@@ -1375,7 +1256,7 @@ export default {
   width: 30px;
 }
 
-.logoImg > img {
+.logoImg>img {
   width: 100%;
   height: 100%;
 }
@@ -1389,7 +1270,7 @@ export default {
   line-height: 0px !important;
 }
 
-.upload-demo >>> .el-button {
+.upload-demo>>>.el-button {
   color: #fff;
   background: #2268bc;
   width: 70px;
@@ -1418,8 +1299,8 @@ export default {
   margin-left: 10px;
 }
 
-.tx > img,
-.delete > img {
+.tx>img,
+.delete>img {
   width: 100%;
   height: 100%;
 }
@@ -1439,7 +1320,7 @@ export default {
   margin-right: 10px;
 }
 
-.student_input >>> .el-input__icon {
+.student_input>>>.el-input__icon {
   line-height: unset;
 }
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff