# Conflicts:
#	nladmin-ui/src/views/system/user/index.vue
This commit is contained in:
ludj
2022-11-30 19:19:05 +08:00
12 changed files with 104 additions and 64 deletions

View File

@@ -16,10 +16,7 @@
</div>
<el-tree
:data="deptDatas"
:load="getDeptDatas"
:props="defaultProps"
:expand-on-click-node="false"
lazy
@node-click="handleNodeClick"
/>
</el-col>
@@ -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()
},
// 改变状态