Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import {Component, OnInit, EventEmitter, Output} from '@angular/core';
import index from '@angular/cli/lib/cli';
import {OverviewService} from '../../overview.service';
import {NzMessageService} from 'ng-zorro-antd';
import {fakeAsync} from '@angular/core/testing';
@Component({
selector: 'smart-module-config',
templateUrl: './module-config.component.html',
styles: []
})
export class ModuleConfigComponent implements OnInit {
@Output() done = new EventEmitter();
modal = {
isVisible: false,
title: '',
list: []
};
constructor(private overviewSer: OverviewService,
private message: NzMessageService) {
}
ngOnInit() {
}
showModal(title, dataSet) {
this.modal.isVisible = true;
this.modal.title = title;
this.modal.list = dataSet;
}
handleCancel() {
this.modal.isVisible = false;
}
handleOk() {
console.log(this.modal.list);
this.modal.list.forEach((e, index) => {
e.status = e.status == false ? 0 : 1;
e.orders = index;
});
this.overviewSer.updateWorkModule(this.modal.list).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('更新成功');
this.modal.isVisible = false;
this.done.emit();
}
}
);
// this.modal.isVisible = false;
}
}