You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1006 B
30 lines
1006 B
3 years ago
|
import { Component, OnInit, Input } from '@angular/core';
|
||
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-editcamera',
|
||
|
templateUrl: './editcamera.component.html',
|
||
|
styleUrls: ['./editcamera.component.scss']
|
||
|
})
|
||
|
export class EditcameraComponent implements OnInit {
|
||
3 years ago
|
|
||
3 years ago
|
@Input() data: any
|
||
|
validateForm!: FormGroup;
|
||
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
|
||
|
|
||
|
ngOnInit(): void {
|
||
|
let datacopy = JSON.parse(JSON.stringify(this.data))
|
||
3 years ago
|
console.log('编辑数据', datacopy)
|
||
3 years ago
|
this.validateForm = this.fb.group({
|
||
|
name: [datacopy.name, [Validators.required]],
|
||
3 years ago
|
user: [datacopy.user, [Validators.required]],
|
||
|
password: [datacopy.password, [Validators.required]],
|
||
|
url: [datacopy.url, [Validators.required]],
|
||
|
type: [datacopy.type, [Validators.required]]
|
||
3 years ago
|
});
|
||
|
}
|
||
|
|
||
|
}
|