Newer
Older
import {Component, OnInit, Output, EventEmitter, ViewChild} from '@angular/core';
import {EarlyWarningService} from '../../earlyWarning.service';
import {NzMessageService} from 'ng-zorro-antd';
import {WarningTrackInfoComponent} from '../warning-track-info/warning-track-info.component';
@Component({
selector: 'smart-notation',
templateUrl: './notation.component.html',
styles: []
})
export class NotationComponent implements OnInit {
@ViewChild('smartWarningTrackInfo') smartWarningTrackInfo: WarningTrackInfoComponent;
@Output() done = new EventEmitter();
modal = {
isVisible: false,
title: '',
constructor(private earlySer: EarlyWarningService, private message: NzMessageService,
private $localStorage: LocalStorageService) {
this.remarkPerson = this.$localStorage.retrieve('userInfo').userName;
this.remarkTime = Date.now();
this.modal.isVisible = true;
this.modal.type = 'look';
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
this.getDetail();
}
//详情
getDetail() {
this.earlySer.findWarningMsg(this.msgId).subscribe(
(res) => {
if (res.errCode == 10000) {
this.msgObj = res.data;
}
}
);
}
//确定
handleOk() {
}
//添加批注
saveNotation() {
if (!this.newestRemark) {
this.message.warning('请输入批注');
return;
}
this.modal.isOkLoading = true;
const data = {
newestRemark: this.newestRemark,
id: this.msgId
};
this.earlySer.updateWarningMsg(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.done.emit();
this.message.success('添加批注成功');
this.handleCancel();
}
}
);
}
//取消
handleCancel() {
this.modal.isOkLoading = false;
this.modal.isVisible = false;
this.newestRemark = '';