用户角色等修复

dev_2022-04-07
yujialong 3 years ago
parent 80f209bb1a
commit 5c405f5fec
  1. 6
      src/pages/account/login/index.vue
  2. 11
      src/pages/role/list/index.vue
  3. 4
      src/pages/stat/list/index.vue
  4. 35
      src/pages/user/list/index.vue
  5. 2
      src/plugins/requests/index.js

@ -239,8 +239,12 @@ export default {
right: 0;
}
.login{
z-index: 4;
position: absolute;
top: 48%;
left: 50%;
transform: translate(-50%, -50%);
width: 436px;
margin: 188px auto 150px;
.form{
padding: 38px 38px 60px;
border-radius: 6px;

@ -95,7 +95,8 @@ export default {
roleVisible: false,
searchTimer: null,
permissions: [],
checkedIds: []
checkedIds: [],
submiting: false
};
},
computed: {
@ -196,10 +197,11 @@ export default {
this.roleVisible = true
},
confirm() {
if (this.submiting) return false
if(!this.form.roleName) return util.warningMsg('请填写角色名称')
if(!this.form.remark) return util.warningMsg('请填写角色描述')
// if(!this.$refs.per.getCheckedKeys().length) return util.warningMsg('')
this.submiting = true
let data = {
id: this.form.id,
roleName: this.form.roleName,
@ -211,7 +213,10 @@ export default {
util.successMsg(this.form.id ? '修改成功' : '新增成功')
this.getData()
this.roleVisible = false
}).catch(res => {})
this.submiting = false
}).catch(res => {
this.submiting = false
})
},
handleDelete(row) {
// ,,

@ -409,6 +409,10 @@ export default {
exportDatabase(){
let data = this.listDataAll
if(this.multipleSelection.length) data = this.multipleSelection
const date = (this.date && this.date.length) ? this.date.join(' - ') : ''
data.map(e => {
e.time = date
})
axios.post(this.api.databaseInfoExport,data,{
headers: {
token: this.token

@ -1,9 +1,9 @@
<template>
<div>
<div class="page">
<h6 class="l-title">用户列表</h6>
<div class="page" style="margin-bottom: 20px">
<h6 class="l-title">筛选</h6>
<div class="page-content">
<div class="tool">
<div class="tool" style="margin-bottom: 0">
<ul class="filter">
<li>
<label>创建时间</label>
@ -33,8 +33,11 @@
</ul>
<div></div>
</div>
<div class="tool">
</div>
</div>
<div class="page">
<div class="page-content">
<div class="tool" style="margin-bottom: 20px">
<ul class="filter">
<li style="margin-bottom: 0">
<label>搜索</label>
@ -47,6 +50,7 @@
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column>
@ -80,6 +84,7 @@
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
</div>
</div>
<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">
@ -133,8 +138,6 @@
</span>
</el-dialog>
</div>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
@ -250,7 +253,8 @@ export default {
originalAccount: '',
originalWorkNumber: '',
originalPhone: '',
originalEmail: ''
originalEmail: '',
submiting: false
};
},
computed: {
@ -431,10 +435,12 @@ export default {
confirm(){
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
if(this.accountRepeat) return util.errorMsg('该账号已存在!')
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!')
if(this.phoneRepeat) return util.errorMsg('该手机号已存在!')
if(this.emailRepeat) return util.errorMsg('该邮箱已存在!')
this.submiting = true
let data = this.form
// ,schoolId
data.schoolId = data.schoolId ? data.schoolId : this.schoolId
@ -447,13 +453,19 @@ export default {
this.userVisible = false
util.successMsg('编辑成功')
this.getData()
}).catch(res => {})
this.submiting = false
}).catch(res => {
this.submiting = false
})
}else{
this.$post(this.api.saveUser,data).then(res => {
this.userVisible = false
util.successMsg('添加成功')
this.getData()
}).catch(res => {})
this.submiting = false
}).catch(res => {
this.submiting = false
})
}
}
})
@ -584,9 +596,6 @@ export default {
.l-title{
margin-bottom: 24px;
}
.page .page-content .tool{
margin-bottom: 30px;
}
.filter{
flex-wrap: wrap;
li{

@ -28,7 +28,7 @@ function checkDisabled () {
}).then(res => {
console.log(11, res.data)
if (res.data) {
util.errorMsg('当前账号无权限,请重新登录!')
util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)

Loading…
Cancel
Save