Newer
Older
import {pageSize} from '../../../app.constants';
import {NzMessageService} from 'ng-zorro-antd';
import {SelectGroupComponent} from '../../../modal/select-group/select-group.component';
import {CommonService} from '../../../shared/common/common.service';
import {Location} from '@angular/common';
import {AssetsComponent} from '../../modal/assets/assets.component';
selector: 'smart-assets-detail',
templateUrl: './assets-detail.component.html',
styles: []
@ViewChild('smartSelectGroup') smartSelectGroup: SelectGroupComponent;
@ViewChild('smartAssets') smartAssets: AssetsComponent;
constructor(private routerInfo: ActivatedRoute, private workSer: WorkService, private commonSer: CommonService,
private message: NzMessageService, private router: Router, private localSer: Location) {
this.routerInfo.queryParams.subscribe(
(res) => {
this.invertoryId = res.invertoryId;
}
);
}
ngOnInit() {
this.getDetail();
this.getEventList();
}
//资产详情
getDetail() {
getEventList() {
this.loading = true;
const data = {
'pageCount': this.pageCount,
'pageNum': this.pageNum,
'inventoryId': this.invertoryId
};
this.workSer.find(data).subscribe(
(res) => {
this.thingList = res.data.data;
this.totalNum = res.data.totalNum;
this.loading = false;
}
);
change(e) {
if (e > 0) {
this.pageNum = e;
this.getEventList();
}
showEditModal() {
this.smartAssets.showEditModal('编辑资产', this.invertoryId);
setLink(e) {
const data = {
hostid: e[0],
id: this.invertoryId
};
this.workSer.updateHostid(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('设置关联主机成功');
this.getDetail();
}
}
);
queryParams: {
hostId: hostid,
type: 0,
}
});
}