|
|
|
@ -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 { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
|
import { FormBuilder, FormGroup, Validators, } from '@angular/forms'; |
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
import { TreeService } from 'src/app/service/tree.service'; |
|
|
|
|
import { NzTreeComponent } from 'ng-zorro-antd/tree'; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-addrole', |
|
|
|
|
templateUrl: './addrole.component.html', |
|
|
|
|
styleUrls: ['./addrole.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class AddroleComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; |
|
|
|
|
@Input() data?: any; |
|
|
|
|
@Input() nodes?: any; |
|
|
|
|
@Input() title?: string; |
|
|
|
|
@Input() subtitle?: string; |
|
|
|
|
@Input() nodes?: any; |
|
|
|
|
|
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
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({ |
|
|
|
|
name: [null, [Validators.required]], |
|
|
|
|
power: [null, [Validators.required]], |
|
|
|
|
// menus: [null]
|
|
|
|
|
menus: [null] |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
totalCount |
|
|
|
|
getAllMenus() { |
|
|
|
|
let params = { |
|
|
|
|