|
|
|
@ -41,24 +41,30 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
allOrList: any |
|
|
|
|
getAllOrganization() { |
|
|
|
|
|
|
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
|
let params = { |
|
|
|
|
OrganizationUnitId: OrganizationUnitId, |
|
|
|
|
IsContainsChildren: "true" |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/services/app/Organization/GetAll', { |
|
|
|
|
this.http.get('/api/services/app/Menu/GetAll', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
|
|
|
|
|
this.totalCount = data.result.totalCount |
|
|
|
|
data.result.items.forEach(element => { |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.displayName |
|
|
|
|
element.title = element.name |
|
|
|
|
element.selectable = false |
|
|
|
|
}); |
|
|
|
|
this.allOrList = data.result.items |
|
|
|
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
|
|
|
|
this.defaultExpandedKeys = [this.nodes[0].id] |
|
|
|
|
this.defaultExpandedKeys = [...this.defaultExpandedKeys] |
|
|
|
|
// console.log(...this.nodes,444);
|
|
|
|
|
// console.log(this.defaultExpandedKeys,45);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -68,7 +74,7 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
defaultExpandedKeys = []; |
|
|
|
|
|
|
|
|
|
nodes: any[] = [] |
|
|
|
|
|
|
|
|
|
datas:any[]=[{id:0,title:"首页",children:[]},{id:1,title:"数字油站",children:[]},{id:2,title:"今日预警",children:[]},{id:3,title:"预警记录",children:[{title:'预警类型统计',isGasStation:true},{title:'卸油统计',isGasStation:true},{title:'证照预警统计',isGasStation:true}]},{id:4,title:"证照管理",children:[{title:'经营类证照',isGasStation:true},{title:'资产类证照',isGasStation:true},{title:'待办',isGasStation:true},{title:'审批记录',isGasStation:true}]}] |
|
|
|
|
|
|
|
|
|
addOr(node?: any) { |
|
|
|
|
console.log(node) |
|
|
|
@ -85,10 +91,10 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
let body = { |
|
|
|
|
parentId: node ? Number(node.key) : null, |
|
|
|
|
// code: instance.validateForm.value.code,
|
|
|
|
|
displayName: instance.validateForm.value.name, |
|
|
|
|
isGasStation: instance.validateForm.value.isGasStation |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
// isGasStation: instance.validateForm.value.isGasStation
|
|
|
|
|
} |
|
|
|
|
this.http.post('/api/services/app/Organization/Create', body).subscribe(data => { |
|
|
|
|
this.http.post('/api/services/app/Menu/Create', body).subscribe(data => { |
|
|
|
|
resolve(data) |
|
|
|
|
this.message.create('success', '创建成功!'); |
|
|
|
|
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { |
|
|
|
@ -112,7 +118,7 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
editOr(node) { |
|
|
|
|
// console.log(node)
|
|
|
|
|
console.log(node) |
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
nzTitle: '编辑组织机构', |
|
|
|
|
nzContent: EditmenuComponent, |
|
|
|
@ -129,10 +135,10 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
id: node.origin.id, |
|
|
|
|
parentId: node.origin.parentId, |
|
|
|
|
// code: instance.validateForm.value.code,
|
|
|
|
|
displayName: instance.validateForm.value.name, |
|
|
|
|
isGasStation: instance.validateForm.value.isGasStation |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
// isGasStation: instance.validateForm.value.isGasStation
|
|
|
|
|
} |
|
|
|
|
this.http.put('/api/services/app/Organization/Update', body).subscribe(data => { |
|
|
|
|
this.http.put('/api/services/app/Menu/Update', body).subscribe(data => { |
|
|
|
|
resolve(data) |
|
|
|
|
this.message.create('success', '编辑成功!'); |
|
|
|
|
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { |
|
|
|
@ -164,7 +170,7 @@ export class MenuComponent implements OnInit {
|
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'danger', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
this.http.delete('/api/services/app/Organization/Delete', { |
|
|
|
|
this.http.delete('/api/services/app/Menu/Delete', { |
|
|
|
|
params: { |
|
|
|
|
Id: item.origin.id |
|
|
|
|
} |
|
|
|
|