用户列表修改

This commit is contained in:
zhangzhiqiang
2022-11-30 18:52:58 +08:00
parent 4004f6d4df
commit df996c5eef
12 changed files with 122 additions and 82 deletions

View File

@@ -2,27 +2,24 @@
<div class="app-container">
<el-row :gutter="20">
<!--侧边部门数据-->
<!-- <el-col :xs="9" :sm="6" :md="5" :lg="5" :xl="4">-->
<!-- <div class="head-container">-->
<!-- <el-input-->
<!-- v-model="deptName"-->
<!-- clearable-->
<!-- size="mini"-->
<!-- placeholder="请输入部门名称"-->
<!-- prefix-icon="el-icon-search"-->
<!-- class="filter-item"-->
<!-- @input="getDeptDatas"-->
<!-- />-->
<!-- </div>-->
<!-- <el-tree-->
<!-- :data="deptDatas"-->
<!-- :load="getDeptDatas"-->
<!-- :props="defaultProps"-->
<!-- :expand-on-click-node="false"-->
<!-- lazy-->
<!-- @node-click="handleNodeClick"-->
<!-- />-->
<!-- </el-col>-->
<el-col :xs="9" :sm="6" :md="5" :lg="5" :xl="4">
<div class="head-container">
<el-input
v-model="deptName"
clearable
size="mini"
placeholder="请输入部门名称"
prefix-icon="el-icon-search"
class="filter-item"
@input="getDeptDatas"
/>
</div>
<el-tree
:data="deptDatas"
:props="defaultProps"
@node-click="handleNodeClick"
/>
</el-col>
<!--用户数据-->
<el-col :xs="15" :sm="18" :md="19" :lg="19" :xl="20">
<!--工具栏-->
@@ -200,7 +197,7 @@
<script>
import crudUser from '@/api/system/user'
import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { getDepts, getDeptSuperior, getDeptTreee } from '@/api/system/dept'
import { getAll, getLevel } from '@/api/system/role'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
@@ -239,7 +236,7 @@ export default {
height: document.documentElement.clientHeight - 180 + 'px;',
deptName: '', depts: [], deptDatas: [], level: 3, roles: [],
roleDatas: [], // 多选时使用
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
defaultProps: { children: 'children', label: 'name' },
permission: {
add: ['admin', 'user:add'],
edit: ['admin', 'user:edit'],
@@ -266,6 +263,9 @@ export default {
'user'
])
},
beforeMount() {
this.getDeptTree()
},
created() {
this.crud.msg.add = '新增成功'
},
@@ -351,7 +351,7 @@ export default {
}
console.log('params', params)
setTimeout(() => {
getDepts(params).then(res => {
getDeptTreee().then(res => {
console.log('res', res)
if (resolve) {
resolve(res.content)
@@ -361,6 +361,15 @@ export default {
})
}, 100)
},
getDeptTree() {
setTimeout(() => {
getDeptTreee().then(res => {
debugger
this.deptDatas = res.content
})
}, 100)
},
getDepts() {
console.log('获取部门')
getDepts({ is_used: 1 }).then(res => {
@@ -409,11 +418,8 @@ export default {
},
// 切换部门
handleNodeClick(data) {
if (data.pid === 0) {
this.query.deptId = null
} else {
this.query.deptId = data.id
}
this.query.deptId = data.dept_id
this.query.needAll = true
this.crud.toQuery()
},
// 改变状态