import { HttpClient } from '@angular/common/http'; import { Component, OnInit, Input } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { NzMessageService } from 'ng-zorro-antd/message'; @Component({ selector: 'app-get-out-of-line-details', templateUrl: './get-out-of-line-details.component.html', styleUrls: ['./get-out-of-line-details.component.scss'] }) export class GetOutOfLineDetailsComponent implements OnInit { @Input() data: any constructor(private fb: FormBuilder, private http: HttpClient, private message: NzMessageService) { } imgUrl: string vedioUrl: string content details ngOnInit(): void { console.log(this.data) this.details = this.data.desc this.imgUrl = this.data.violateImage this.vedioUrl = this.data.violateVideo this.content = this.data.handleRecord } selectedType: string = 'img' contentType(type) { this.selectedType = type } submit() { let body = { id: this.data.id, handleRecord: this.content } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.message.create('success', '处置成功!'); this.data.handleTime = new Date() this.data.handleRecord = this.content }) } }