添加部门树
This commit is contained in:
@@ -78,10 +78,9 @@
|
||||
<el-input v-model="form.email" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="dept.id" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
||||
<treeselect
|
||||
<el-tree-select
|
||||
v-model="form.dept.id"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
:data="deptDatas"
|
||||
style="width: 200px"
|
||||
placeholder="选择部门"
|
||||
/>
|
||||
@@ -365,7 +364,6 @@ export default {
|
||||
getDeptTree() {
|
||||
setTimeout(() => {
|
||||
getDeptTreee().then(res => {
|
||||
debugger
|
||||
this.deptDatas = res.content
|
||||
})
|
||||
}, 100)
|
||||
@@ -374,6 +372,7 @@ export default {
|
||||
console.log('获取部门')
|
||||
getDepts({ is_used: 1 }).then(res => {
|
||||
console.log('获取的部门信息', res)
|
||||
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -402,6 +401,7 @@ export default {
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
debugger
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ is_used: 1, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
|
||||
Reference in New Issue
Block a user