用户角色等修复

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; right: 0;
} }
.login{ .login{
z-index: 4;
position: absolute;
top: 48%;
left: 50%;
transform: translate(-50%, -50%);
width: 436px; width: 436px;
margin: 188px auto 150px;
.form{ .form{
padding: 38px 38px 60px; padding: 38px 38px 60px;
border-radius: 6px; border-radius: 6px;

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

@ -409,6 +409,10 @@ export default {
exportDatabase(){ exportDatabase(){
let data = this.listDataAll let data = this.listDataAll
if(this.multipleSelection.length) data = this.multipleSelection 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,{ axios.post(this.api.databaseInfoExport,data,{
headers: { headers: {
token: this.token token: this.token

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

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

Loading…
Cancel
Save