Explorar o código

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pblUserManage

lzw hai 6 meses
pai
achega
67658152d3

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/app.4b5a86a4.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/app.93d1d371.css


+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.ac8f9183.js"></script><script defer="defer" src="/js/app.617211a9.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.93d1d371.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.ac8f9183.js"></script><script defer="defer" src="/js/app.4ae988ab.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.4b5a86a4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/app.4ae988ab.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/app.4ae988ab.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/app.617211a9.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/app.617211a9.js.map


+ 4 - 0
src/common/apiConfig.js

@@ -46,6 +46,10 @@ export const API_CONFIG = {
   ajax_confirm: {
     functionName: "updata_user_o_s",
   },
+  //查询后缀
+  ajax_Suffix: {
+    functionName: "select_Suffix",
+  },
   ////////////// 以下是账号审核的数据接口
 
   moveUser: {

+ 10 - 59
src/components/examine.vue

@@ -270,7 +270,7 @@
               <div class="checkbox-container">
                 <!-- 循环渲染每个学校 -->
                 <div
-                  v-for="(school, index) in schoolList"
+                  v-for="(school, index) in cn_school"
                   :key="index"
                   class="checkbox_comment"
                 >
@@ -629,56 +629,7 @@ export default {
       sortO: "DESC",
     };
   },
-  watch: {
-    // school:{
-    //   deep:true,
-    //   handler:function(newVal){
-    //     this.schoolList = []
-    //     if (newVal.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == newVal.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //     }else if (this.searchQuery) {
-    //         this.schoolList = this.cn_school.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    //   },
-    //   immediate:true
-    // },
-    // searchQuery(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-  },
+  watch: {},
   computed: {
     ...mapGetters(["userid"]),
   },
@@ -734,12 +685,12 @@ export default {
             org: item.org,
             area:item.area
           }));
-          this.schoolList = res.data[0].map((item) => ({
-            name: item.name,
-            id: item.id,
-            org: item.org,
-            area:item.area
-          }));
+          // this.schoolList = res.data[0].map((item) => ({
+          //   name: item.name,
+          //   id: item.id,
+          //   org: item.org,
+          //   area:item.area
+          // }));
           console.log(this.cn_school);
         }
       })
@@ -1772,8 +1723,8 @@ hr {
   bottom: 0;
   left: 13%;
   width: 250px;
-  height: 2px;
-  background-color: rgb(137, 137, 137);
+  height: 1px;
+  background-color: #e7e7e7;
 }
 /* 添加账户的容器 */
 .el-dialog__body {

+ 137 - 145
src/components/list.vue

@@ -137,7 +137,7 @@
           <div class="checkbox-container">
             <!-- 循环渲染每个学校 -->
             <div
-              v-for="(school, index) in schoolList"
+              v-for="(school, index) in cn_school"
               :key="index"
               class="checkbox_comment"
             >
@@ -179,44 +179,7 @@
       :before-close="close_table"
       width="700px"
     >
-      <div>
-        <form class="el-form">
-          <div class="el-form-item">
-            <label class="el-form-item__label">姓名</label>
-            <div class="el-form-item__content">
-              <el-input
-                v-model="person.name"
-                placeholder="请输入姓名"
-                autocomplete="off"
-                class="add_input"
-              ></el-input>
-            </div>
-          </div>
-          <div class="el-form-item">
-            <label class="el-form-item__label">账号</label>
-            <div class="el-form-item__content">
-              <el-input
-                v-model="person.account"
-                placeholder="请输入账号"
-                autocomplete="off"
-                class="add_input"
-              ></el-input>
-            </div>
-          </div>
-          <!-- <div class="el-form-item">
-            <label class="el-form-item__label">选择身份</label>
-            <div class="el-form-item__content">
-              <el-select
-                v-model="person.type"
-                placeholder="请选择身份"
-                class="custom-select"
-              >
-                <el-option :value="1" label="学生">学生</el-option>
-                <el-option :value="2" label="老师">老师</el-option>
-              </el-select>
-            </div>
-          </div> -->
-          <div class="el-form-item">
+    <div class="el-form-item">
             <label class="el-form-item__label">选择组织</label>
             <div class="el-form-item__content">
               <el-select
@@ -258,11 +221,50 @@
               </el-select>
             </div>
           </div>
+      <div>
+        <form class="el-form">
+          <div class="el-form-item">
+            <label class="el-form-item__label">姓名</label>
+            <div class="el-form-item__content">
+              <el-input
+                v-model="person.name"
+                placeholder="请输入姓名"
+                autocomplete="off"
+                class="add_input"
+              ></el-input>
+            </div>
+          </div>
+          <div class="el-form-item">
+            <label class="el-form-item__label">账号</label>
+            <div class="el-form-item__content">
+              <el-input
+                v-model="person.account"
+                placeholder="请输入账号"
+                autocomplete="off"
+                class="add_input"
+              ></el-input>
+            </div>
+            <span style="margin-left: 5px;">{{ this.SuffixData }}</span>
+          </div>
+          <!-- <div class="el-form-item">
+            <label class="el-form-item__label">选择身份</label>
+            <div class="el-form-item__content">
+              <el-select
+                v-model="person.type"
+                placeholder="请选择身份"
+                class="custom-select"
+              >
+                <el-option :value="1" label="学生">学生</el-option>
+                <el-option :value="2" label="老师">老师</el-option>
+              </el-select>
+            </div>
+          </div> -->
+         
         </form>
       </div>
       <!-- 按钮区域 -->
       <div slot="footer" class="el-dialog__footer">
-        <el-button @click="isTableUseVisible = false">取 消</el-button>
+        <el-button @click="close_table">取 消</el-button>
         <el-button type="primary" @click="addUser">确认</el-button>
       </div>
     </el-dialog>
@@ -565,6 +567,18 @@
             header-align="center"
             align="center"
           />
+          <el-table-column
+            show-overflow-tooltip
+            prop="company_number"
+            label="组织编号"
+            min-width="32"
+            header-align="center"
+            align="center"
+          >
+          <template slot-scope="{ row }">
+              <div>{{ row.orgCode ? row.orgCode : row.schoolCode ? row.schoolCode : '暂无' }}</div>
+            </template>
+          </el-table-column>
           <el-table-column
             show-overflow-tooltip
             prop="name"
@@ -581,6 +595,14 @@
             header-align="center"
             align="center"
           />
+          <el-table-column
+            show-overflow-tooltip
+            prop="Ctime"
+            label="账户开通时间"
+            min-width="40"
+            header-align="center"
+            align="center"
+          />
           <el-table-column
             show-overflow-tooltip
             label="身份"
@@ -666,6 +688,8 @@ export default {
   components: {},
   data() {
     return {
+      // 新增账户默认后缀
+      SuffixData:'',
       // 储存筛选完后的学校
       schoolList:[],
       // 控制下拉菜单的显示与隐藏
@@ -797,99 +821,7 @@ export default {
         : this.cn_school;
     },
   },
-  watch: {
-    // school:{
-    //   deep:true,
-    //   handler:function(newVal){
-    //     this.schoolList = []
-    //     if (newVal.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == newVal.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //         if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //       }
-    //       if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //     }else if (this.searchQuery) {
-    //         this.schoolList = this.cn_school.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //         if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //     } else if(this.selReg){
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.area == this.selReg
-    //       })
-    //     }else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    //   },
-    //   immediate:true
-    // },
-    // searchQuery(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-    // selReg(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-  },
+  watch: {},
   methods: {
     handleSelectionChange(selectedRows) {
       this.checkArray = selectedRows.map((row) => row.userid);
@@ -910,7 +842,7 @@ export default {
       this.selReg = '';
       this.ajax_school()
 
-
+      this.SuffixData = ''
       this.isOrgFormVisible = false;
       this.isTableUseVisible = false;
       this.selectedSchool = ''
@@ -987,6 +919,9 @@ export default {
             org: user.org,
             type: user.usertype,
             state: user.user_state,
+            orgCode: user.org_code,
+            schoolCode: user.school_code,
+            Ctime: user.Ctime,
           }));
 
           // this.tableData = Array(this.pageSize * (this.currentPage - 1)).fill(null).concat(users);
@@ -1127,13 +1062,27 @@ export default {
         });
         return; // 终止函数执行
       }
-      if (!/\S+@\S+\.\S+/.test(this.person.account)) {
+      let emailData = this.getEmailWithAt(this.person.account)
+      
+      let zSuffix = ''
+
+      if (this.SuffixData && emailData) {
+        zSuffix =  this.person.account.split('@')[0] + this.SuffixData
+      }else{
+        zSuffix  = this.person.account + this.SuffixData
+      }
+
+
+      console.log('zSuffix',zSuffix);
+      // this.person.account
+
+      if (!/\S+@\S+\.\S+/.test(zSuffix)) {
         this.$message.error("账号要填写邮箱格式");
         return;
       }
       let params = {
         alias: this.person.name,
-        username: this.person.account,
+        username: zSuffix,
         org: this.person.selectedOrg,
         oid: this.person.selectedSchool,
         ph: "",
@@ -1150,12 +1099,13 @@ export default {
               uid: this.userid,
               cid: "",
               type: "user_op",
-              content: `添加了${this.person.name} 账号为${this.person.account}`,
+              content: `添加了${this.person.name} 账号为${zSuffix}`,
             });
             this.$message({
               type: "success",
               message: "操作成功",
             });
+            this.SuffixData = '';
             this.isTableUseVisible = false;
             this.getData(); // 例如刷新表格数据
           }
@@ -1192,12 +1142,12 @@ export default {
               org: item.org,
               area:item.area
             }));
-            this.schoolList= res.data[0].map((item) => ({
-              name: item.name,
-              id: item.id,
-              org: item.org,
-              area:item.area
-            }));
+            // this.schoolList= res.data[0].map((item) => ({
+            //   name: item.name,
+            //   id: item.id,
+            //   org: item.org,
+            //   area:item.area
+            // }));
             console.log(this.cn_school);
           }
         })
@@ -1412,9 +1362,46 @@ export default {
       this.getData(); // 调用获取数据的方法
     }, 300),
     orgChange() {
+      this.SuffixData = ''
       this.person.selectedSchool = "";
+      this.getSuffix()
       this.$forceUpdate()
     },
+    getSuffix(){
+      let params = [
+        {
+          functionName: API_CONFIG.ajax_Suffix.functionName, // 调用存储过程的名称
+          org: this.person.selectedOrg, //组织id
+          oid: this.person.selectedSchool, //学校id
+        },
+      ];
+
+      // 发起请求
+      this.$ajax
+        .post(API_CONFIG.baseUrl, params)
+        .then((res) => {
+          console.log('getSuffix',res)
+          let data = res.data[0]
+          let orgData = res.data[1]
+
+          if(data.length > 0){
+            let ap = data[0].username
+            this.SuffixData =  this.getEmailWithAt(ap)[0]
+          } else if (orgData.length > 0) {
+            let ap = orgData[0].username
+            this.SuffixData =  this.getEmailWithAt(ap)[0]
+          }
+        
+        })
+        .catch((err) => {
+          console.error("请求失败,错误信息:", err);
+        });
+    },
+    getEmailWithAt(email) {
+      const regex = /@[^@]+$/;  // 匹配最后一个 @ 及其后的内容
+      const match = email.match(regex);
+      return match ? match : '';
+    },
     schoolChange() {
       for (var i = 0; i < this.cn_school.length; i++) {
         if (
@@ -1424,6 +1411,11 @@ export default {
           this.person.selectedOrg = this.cn_school[i].org;
         }
       }
+      this.SuffixData = ''
+      if (this.person.selectedSchool != '') {
+        this.getSuffix()
+      }
+
       this.$forceUpdate()
     },
   },
@@ -1658,8 +1650,8 @@ export default {
   bottom: 0;
   left: 13%;
   width: 250px;
-  height: 2px;
-  background-color: #E7E7E7;
+  height: 1px;
+  background-color: #e7e7e7;
 }
 /* .checkbox-left部分 */
 .checkbox-left {

+ 35 - 11
src/store/modules/user.js

@@ -1,6 +1,9 @@
 // import { user_info, login } from '@/api/user'
 import { eduGet, getUser } from "@/api/user";
 import { getToken, removeToken, setToken } from "@/utils/auth";
+import { Message } from 'element-ui'
+import { loginOut } from '@/api/user';
+
 const getDefaultState = () => {
   return {
     token: getToken(),
@@ -46,24 +49,45 @@ const mutations = {
 };
 
 const actions = {
-  login({ commit }) {
+  login({ commit, dispatch }) {
     return new Promise((resolve, reject) => {
       eduGet()
         .then((response) => {
           console.log(response);
           var _user = response.data[0][0];
-          commit("SET_ID", _user.userid);
-          commit("SET_TOKEN", _user.userid);
-          setToken(_user.userid);
-          // dispatch('getInfo')
-          resolve(_user.userid);
+          const allowedIds = [
+            "0abcb118-9110-11eb-80ad-005056b86db5",
+            "b7ccc834-aae5-11ea-a8d4-52540005ab01",
+            "a77e9404-efec-11e9-96f9-028edca3b798",
+            "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
+            "5943e08c-b7d4-11ed-8d51-005056b86db5"
+          ];
+          if (allowedIds.includes(_user.userid)) {
+            commit("SET_ID", _user.userid);
+            commit("SET_TOKEN", _user.userid);
+            setToken(_user.userid);
+            resolve(_user.userid);
+          } else if(_user.userid){
+            loginOut()
+            .then(async () => {
+              dispatch('user/logout', null, { root: true });
+            })
+            .catch(err => {
+              console.error(err);
+            });
+            Message({
+              message: "该用户ID不允许登录",
+              type: "error"
+            });
+            reject("该用户ID不允许登录");
+          }
         })
         .catch((error) => {
-          var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
-          commit("SET_ID", _user.userid);
-          commit("SET_TOKEN", _user.userid);
-          setToken(_user.userid);
-          resolve(_user.userid);
+          // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
+          // commit("SET_ID", _user.userid);
+          // commit("SET_TOKEN", _user.userid);
+          // setToken(_user.userid);
+          // resolve(_user.userid);
           reject(error);
         });
     });

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio