Newer
Older
import {Component, OnInit, ViewChild} from '@angular/core';
import {AdminOfficeModalComponent} from '../modal/admin-office-modal/admin-office-modal.component';
import {PerforManageService} from '../perfor.manage.service';
import {CommonService} from '../../shared/common/common.service';
import {NzMessageService} from 'ng-zorro-antd';
import {DataStorageModalComponent} from '../modal/data-storage-modal/data-storage-modal.component';
@Component({
selector: 'smart-data-storage',
templateUrl: './data-storage.component.html',
styles: []
})
export class DataStorageComponent implements OnInit {
@ViewChild('smartDataStorageModal') smartDataStorageModal: DataStorageModalComponent;
page = {
isLoading: false,
pageNum: 1,
pageCount: 10,
totalNum: null,
dataSet: [],
};
obj = {
projectName: '',
projectYear: ''
};
constructor(private perforSer: PerforManageService, public commonSer: CommonService, public message: NzMessageService) {
}
ngOnInit() {
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
58
59
60
61
62
63
64
65
66
67
68
69
70
}
//获取列表
getList() {
this.page.isLoading = true;
const obj = {
pageCount: this.page.pageCount,
pageNum: this.page.pageNum,
obj: this.obj,
};
this.perforSer.selectBackgroundDataStorage(obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.page.dataSet = res.data.data;
this.page.totalNum = res.data.totalNum;
}
this.page.isLoading = false;
}
);
}
//翻页
change(e) {
if (e > 0) {
this.page.pageNum = e;
this.getList();
}
}
//查询
search() {
this.page.pageNum = 1;
this.getList();
}
//删除
deleteHandle(data) {
const arr = {
};
this.commonSer.confirmThing('删除', '确定删除该资产', () => {
this.perforSer.deleteBackgroundDataStorage(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.getList();
}
}
);
});
}
//打开添加modal
showAddModal() {