用户管理等修改

dev_2022-04-07
yujialong 3 years ago
parent 0423f8e589
commit 6d2fb7b0e2
  1. 1
      src/api/index.js
  2. 62
      src/pages/user/list/index.vue
  3. 2
      src/setting.js
  4. 3
      src/styles/page/screen.scss

@ -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`,

@ -88,8 +88,8 @@
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix="" :disabled="isDetail">
<el-form-item prop="account" label="账号">
<el-input v-model="form.account" ref="account" placeholder="请输入账号" @change="accountChange"></el-input>
<el-form-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="用户姓名">
<el-input v-model="form.userName" placeholder="请输入姓名"></el-input>
@ -109,9 +109,6 @@
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱" @change="emailChange"></el-input>
</el-form-item>
<el-form-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
@ -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: 012
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

@ -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/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒

@ -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;

Loading…
Cancel
Save