|
|
@ -1,18 +1,21 @@ |
|
|
|
import { Component, OnInit, Input } from '@angular/core'; |
|
|
|
import { Component, OnInit, Input,ViewChild } from '@angular/core'; |
|
|
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
|
|
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
import { FormBuilder, FormGroup, Validators, } from '@angular/forms'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
|
|
|
|
import { NzTreeComponent } from 'ng-zorro-antd/tree'; |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-addrole', |
|
|
|
selector: 'app-addrole', |
|
|
|
templateUrl: './addrole.component.html', |
|
|
|
templateUrl: './addrole.component.html', |
|
|
|
styleUrls: ['./addrole.component.scss'] |
|
|
|
styleUrls: ['./addrole.component.scss'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class AddroleComponent implements OnInit { |
|
|
|
export class AddroleComponent implements OnInit { |
|
|
|
|
|
|
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; |
|
|
|
|
|
|
|
@Input() data?: any; |
|
|
|
|
|
|
|
@Input() nodes?: any; |
|
|
|
@Input() title?: string; |
|
|
|
@Input() title?: string; |
|
|
|
@Input() subtitle?: string; |
|
|
|
@Input() subtitle?: string; |
|
|
|
@Input() nodes?: any; |
|
|
|
|
|
|
|
validateForm!: FormGroup; |
|
|
|
validateForm!: FormGroup; |
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } |
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } |
|
|
|
|
|
|
|
|
|
|
@ -23,10 +26,10 @@ export class AddroleComponent implements OnInit { |
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
name: [null, [Validators.required]], |
|
|
|
name: [null, [Validators.required]], |
|
|
|
power: [null, [Validators.required]], |
|
|
|
power: [null, [Validators.required]], |
|
|
|
// menus: [null]
|
|
|
|
menus: [null] |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
totalCount |
|
|
|
totalCount |
|
|
|
getAllMenus() { |
|
|
|
getAllMenus() { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|