|
|
|
@ -66,8 +66,8 @@ export class OrganizationComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
this.allOrList = data.items |
|
|
|
|
this.nodes = [...this.toTree.toTree(data.items)] |
|
|
|
|
this.defaultExpandedKeys = [this.nodes[0].id] |
|
|
|
|
this.defaultExpandedKeys = [...this.defaultExpandedKeys] |
|
|
|
|
this.defaultExpandedKeys.length == 0 ? this.defaultExpandedKeys = [this.nodes[0].id] : this.defaultExpandedKeys = [...this.defaultExpandedKeys] |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ export class OrganizationComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOr(node?: any) { |
|
|
|
|
console.log(node) |
|
|
|
|
// console.log(node.key)
|
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
nzTitle: node ? '新增组织机构' : '新增一级组织机构', |
|
|
|
|
nzContent: AddorComponent, |
|
|
|
@ -92,7 +92,7 @@ export class OrganizationComponent implements OnInit {
|
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let body = { |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
parentId: node ? Number(node.key) : null, |
|
|
|
|
parentId: node ? node.key : null, |
|
|
|
|
isGasStation: instance.validateForm.value.isGasStation |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Organizations', body).subscribe(data => { |
|
|
|
|