From 6d2fb7b0e22b24aee719b6caf148a3d15cd72443 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 18 Apr 2022 16:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E7=AD=89?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 1 + src/pages/user/list/index.vue | 62 ++++++++++++++--------------------- src/setting.js | 2 +- src/styles/page/screen.scss | 3 +- 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 499c9fc..2637aed 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -31,6 +31,7 @@ export default { // 用户管理 saveUser: `/users/users/data/user/save`, + getDetailByAccount: `/occupationlab/architecture/getDetailByAccount`, getUserList: `/users/users/data/user/getUserList`, getUserTotalBySchoolId: `/users/users/data/user/getUserTotalBySchoolId`, checkAccount:`/occupationlab/architecture/checkWorkNumOrAccount`, diff --git a/src/pages/user/list/index.vue b/src/pages/user/list/index.vue index be693b1..68a94df 100644 --- a/src/pages/user/list/index.vue +++ b/src/pages/user/list/index.vue @@ -88,8 +88,8 @@ - - + + @@ -109,9 +109,6 @@ - - - @@ -203,12 +200,7 @@ export default { }, rules: { account: [ - { required: true, message: '请输入职工账号', trigger: 'blur' }, - { - pattern: /^[A-Za-z0-9]+$/, - message: '请输入正确的账号', - trigger: 'blur' - } + { required: true, message: '请输入职工账号', trigger: 'blur' } ], userName: [ { required: true, message: '请输入用户姓名', trigger: 'blur' } @@ -250,7 +242,6 @@ export default { workNumberRepeat: false, phoneRepeat: false, emailRepeat: false, - originalAccount: '', originalWorkNumber: '', originalPhone: '', originalEmail: '', @@ -304,10 +295,11 @@ export default { pageSize: this.pageSize, platformId: Setting.platformId, roleId: this.role, - }).then(res => { - this.listData = res.pageList.records - this.total = res.pageList.total - if(!this.listData.length && this.total){ + }).then(({ pageList }) => { + const { records, total } = pageList + this.listData = records + this.total = total + if(!records.length && total){ this.page-- this.getData() } @@ -341,28 +333,24 @@ export default { }).catch(res => {}) }).catch(() => {}) }, - accountChange(){ - if(this.form.account && this.form.account !== this.originalAccount){ - // type: 0:教师端,1:学生端,2:无端 - this.$post(`${this.api.checkAccount}?account=${this.form.account}&type=2&platformId=${Setting.platformId}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { - this.accountRepeat = false - }).catch(res => { - this.accountRepeat = true - }) - }else{ - this.accountRepeat = false - } + // 组合账号 + renderAccount() { + const form = this.form + // 平台id-端id-schoolId-workNumber组成账号 + form.account = `${Setting.platformId}-2-${this.schoolId}-${form.workNumber}` }, workNumberChange(){ - if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){ - this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { - this.workNumberRepeat = false - }).catch(res => { - this.workNumberRepeat = true - }) - }else{ - this.workNumberRepeat = false - } + if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){ + this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { + this.workNumberRepeat = false + this.renderAccount() + }).catch(res => { + this.workNumberRepeat = true + }) + }else{ + this.workNumberRepeat = false + this.renderAccount() + } }, phoneChange(){ if(this.form.phone && this.form.phone !== this.originalPhone){ @@ -390,7 +378,6 @@ export default { this.$refs.form.resetFields() this.form.userId = '' this.form.accountId = '' - this.originalAccount = '' this.originalWorkNumber = '' this.accountRepeat = false this.workNumberRepeat = false @@ -418,7 +405,6 @@ export default { password: '' } // 先保存该用户的账号工号等信息,判重的时候如果判断到修改的字段跟这里保存的值一样,则不调判重的接口 - this.originalAccount = data.account this.originalWorkNumber = data.workNumber this.originalPhone = data.phone this.originalEmail = data.email diff --git a/src/setting.js b/src/setting.js index 5a35237..b55efa9 100644 --- a/src/setting.js +++ b/src/setting.js @@ -25,7 +25,7 @@ const Setting = { * 正式:http://www.dataforward.cn:9000 * */ // apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000', - apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : `${location.origin}:9000`, + apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : `${location.origin}:9000`, // 加密货币接口地址 cryptoBaseURL: `http://159.138.53.111/`, // 接口请求返回错误时,弹窗的持续时间,单位:秒 diff --git a/src/styles/page/screen.scss b/src/styles/page/screen.scss index 5397e9f..62a5247 100644 --- a/src/styles/page/screen.scss +++ b/src/styles/page/screen.scss @@ -3,10 +3,11 @@ } .wrap { width: 100%; - height: auto; + height: 100vh; color:#333; background: url('../../../assets/img/screen/screen1.jpg') no-repeat; background-size: 100% 100%; + overflow: auto; .full { z-index: 10; position: absolute;