|
|
|
@ -7,26 +7,29 @@ import { MyValidators } from '../addcamera/addcamera.component';
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-editcamera', |
|
|
|
|
templateUrl: './editcamera.component.html', |
|
|
|
|
styleUrls: ['./editcamera.component.scss'] |
|
|
|
|
styleUrls: ['./editcamera.component.scss'], |
|
|
|
|
}) |
|
|
|
|
export class EditcameraComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
@Input() data: any |
|
|
|
|
@Input() data: any; |
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } |
|
|
|
|
constructor( |
|
|
|
|
private modal: NzModalRef, |
|
|
|
|
private fb: FormBuilder, |
|
|
|
|
private http: HttpClient |
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
const { namevalidate } = MyValidators; |
|
|
|
|
let datacopy = JSON.parse(JSON.stringify(this.data)) |
|
|
|
|
console.log('编辑数据', datacopy) |
|
|
|
|
let datacopy = JSON.parse(JSON.stringify(this.data)); |
|
|
|
|
console.log('编辑数据', datacopy); |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
name: [datacopy.name, [Validators.required,namevalidate]], |
|
|
|
|
name: [datacopy.name, [Validators.required, namevalidate]], |
|
|
|
|
user: [datacopy.user, [Validators.required]], |
|
|
|
|
decoderType: [datacopy.decoderType, [Validators.required]], |
|
|
|
|
password: [datacopy.password, [Validators.required]], |
|
|
|
|
uri: [datacopy.uri, [Validators.required]], |
|
|
|
|
type: [datacopy.type, [Validators.required]], |
|
|
|
|
order: [datacopy.order, [Validators.required]] |
|
|
|
|
order: [datacopy.order, [Validators.required]], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|